diff --git a/src/dashboard.py b/src/dashboard.py index b2bfb75..e690f8c 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -2819,25 +2819,102 @@ import requests def getIPAddressGeolocation(ipAddress): try: + print("Requesting: " + ipAddress) r = requests.get(f"http://ip-api.com/json/{ipAddress}?field=city") return r.json() except Exception as e: return None +# This will be a modified version of icmplib.traceroute for socket +@socketio.on('traceroute') +def SocketIO_Traceroute(json): + data = dict(json) + if 'ipAddress' in data.keys(): + from icmplib.utils import is_hostname, is_ipv6_address, is_ipv4_address, resolve, unique_identifier + from icmplib.models import ICMPRequest, Hop + from icmplib.sockets import ICMPv6Socket, ICMPv4Socket + from icmplib.exceptions import TimeExceeded, ICMPLibError + address = data.get('ipAddress') + + try: + if is_hostname(address): + address = resolve(address)[0] + if is_ipv6_address(address): + _Socket = ICMPv6Socket + else: + _Socket = ICMPv4Socket + except Exception as e: + emit('tracerouteResponse', ResponseObjectSocket(False, str(e))) + return + id = unique_identifier() + ttl = 1 + host_reached = False + hops = [] + max_hops = 30 + timeout = 2 + with _Socket() as sock: + while not host_reached and ttl <= max_hops: + reply = None + packets_sent = 0 + rtts = [] + for sequence in range(2): + request = ICMPRequest(destination=address, id=id, sequence=sequence, ttl=ttl) + try: + sock.send(request) + packets_sent += 1 + reply = sock.receive(request, timeout) + rtt = (reply.time - request.time) * 1000 + rtts.append(rtt) + reply.raise_for_status() + host_reached = True + except TimeExceeded: + time.sleep(0.05) + except ICMPLibError: + break + if reply: + hop = Hop(address=reply.source, packets_sent=packets_sent, rtts=rtts, distance=ttl) + hops.append(hop) + result = { + "hop": hop.distance, + "ip": hop.address, + "avg_rtt": hop.avg_rtt, + "min_rtt": hop.min_rtt, + "max_rtt": hop.max_rtt, + "geo": getIPAddressGeolocation(hop.address) + } + + else: + result = { + "hop": ttl, + "ip": "*", + "avg_rtt": "*", + "min_rtt": "*", + "max_rtt": "*", + "geo": None + } + emit('tracerouteResponse', ResponseObjectSocket(True, data=result)) + ttl += 1 + emit('tracerouteResponseEnd') + + else: + emit('tracerouteResponse', ResponseObjectSocket(False, "Please provide IP Address/Hostname")) + + @socketio.on("ping") def SocketIO_Ping(json): data = dict(json) geo = {} - if 'ipAddress' in data.keys() and 'count' in data.keys() and len(data['ipAddress']) > 0 and data['count'] > 0: ip = data['ipAddress'] count = data['count'] for i in range(count): print(ip, count) - result = ping(ip, count=1, source=None) + try: + result = ping(ip, count=1, source=None) + except Exception as e: + emit('pingResponse', ResponseObjectSocket(False, str(e))) if result.address not in geo.keys(): geo[result.address] = getIPAddressGeolocation(result.address) - data = { "address": result.address, "is_alive": result.is_alive, @@ -2849,10 +2926,9 @@ def SocketIO_Ping(json): "package_loss": result.packet_loss, "geo": geo[result.address] } - emit('pingResponse', ResponseObjectSocket(True, data=data)) time.sleep(1) - + emit('pingResponseEnd') else: emit('pingResponse', ResponseObjectSocket(False, "Please provide IP Address and Ping Count")) diff --git a/src/static/app/dist/assets/configuration-DVJcktkN.js b/src/static/app/dist/assets/configuration-DGaUoiAC.js similarity index 86% rename from src/static/app/dist/assets/configuration-DVJcktkN.js rename to src/static/app/dist/assets/configuration-DGaUoiAC.js index b4d5911..3bc4a97 100644 --- a/src/static/app/dist/assets/configuration-DVJcktkN.js +++ b/src/static/app/dist/assets/configuration-DGaUoiAC.js @@ -1 +1 @@ -import{_ as r,c as i,d as o,w as e,j as l,a as t,T as _,i as a,l as d,S as u}from"./index-7qLsecvh.js";const m={name:"configuration"},p={class:"mt-md-5 mt-3 text-body"};function f(x,h,k,w,$,v){const n=l("RouterView");return t(),i("div",p,[o(n,null,{default:e(({Component:s,route:c})=>[o(_,{name:"fade2",mode:"out-in"},{default:e(()=>[(t(),a(u,null,{default:e(()=>[(t(),a(d(s),{key:c.path}))]),_:2},1024))]),_:2},1024)]),_:1})])}const B=r(m,[["render",f]]);export{B as default}; +import{_ as r,c as i,d as o,w as e,j as l,a as t,T as _,i as a,l as d,S as u}from"./index-CgM9eUIs.js";const m={name:"configuration"},p={class:"mt-md-5 mt-3 text-body"};function f(x,h,k,w,$,v){const n=l("RouterView");return t(),i("div",p,[o(n,null,{default:e(({Component:s,route:c})=>[o(_,{name:"fade2",mode:"out-in"},{default:e(()=>[(t(),a(u,null,{default:e(()=>[(t(),a(d(s),{key:c.path}))]),_:2},1024))]),_:2},1024)]),_:1})])}const B=r(m,[["render",f]]);export{B as default}; diff --git a/src/static/app/dist/assets/configurationList-DXmytjuc.js b/src/static/app/dist/assets/configurationList-Bu1TwT78.js similarity index 98% rename from src/static/app/dist/assets/configurationList-DXmytjuc.js rename to src/static/app/dist/assets/configurationList-Bu1TwT78.js index e6a4364..598c5fc 100644 --- a/src/static/app/dist/assets/configurationList-DXmytjuc.js +++ b/src/static/app/dist/assets/configurationList-Bu1TwT78.js @@ -1 +1 @@ -import{_ as D,D as M,g as I,a as i,c as n,b as t,d as r,w as S,n as m,t as u,f as v,i as _,e as y,m as U,v as V,u as B,j as p,r as O,p as K,T as G,q as L,o as R,s as W,F as w,h as k,W as q,G as $,k as F,x as z}from"./index-7qLsecvh.js";import{L as x}from"./localeText-BguG5zGd.js";import{_ as j}from"./protocolBadge-CVzzEU4-.js";import{C as J}from"./storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-0Ox3ogTv.js";const N={name:"configurationCard",components:{ProtocolBadge:j,LocaleText:x},props:{c:{Name:String,Status:Boolean,PublicKey:String,PrivateKey:String},delay:String,display:String},data(){return{configurationToggling:!1}},setup(){return{dashboardConfigurationStore:M()}},methods:{toggle(){this.configurationToggling=!0,I("/api/toggleWireguardConfiguration/",{configurationName:this.c.Name},e=>{e.status?this.dashboardConfigurationStore.newMessage("Server",`${this.c.Name} ${e.data?"is on":"is off"}`):this.dashboardConfigurationStore.newMessage("Server",e.message,"danger"),this.c.Status=e.data,this.configurationToggling=!1})}}},T=()=>{B(e=>({d75b06ae:e.delay}))},P=N.setup;N.setup=P?(e,s)=>(T(),P(e,s)):T;const E={class:"card conf_card rounded-3 shadow text-decoration-none"},H={class:"mb-0"},Y={class:"card-title mb-0 d-flex align-items-center gap-2"},A={class:"card-footer d-flex gap-2 flex-column"},Q={class:"row"},X={class:"d-flex gap-2 align-items-center"},Z={class:"text-muted"},tt={class:"mb-0 d-block d-lg-inline-block"},et={style:{"line-break":"anywhere"}},st={class:"form-check form-switch ms-auto"},ot=["for"],it={key:4,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},nt=["disabled","id"];function at(e,s,o,f,a,g){const c=p("ProtocolBadge"),l=p("RouterLink"),d=p("LocaleText");return i(),n("div",{class:m(["col-12",{"col-lg-6 col-xl-4":this.display==="Grid"}])},[t("div",E,[r(l,{to:"/configuration/"+o.c.Name+"/peers",class:"card-body d-flex align-items-center gap-3 flex-wrap text-decoration-none"},{default:S(()=>[t("h6",H,[t("span",{class:m(["dot",{active:o.c.Status}])},null,2)]),t("h6",Y,[t("samp",null,u(o.c.Name),1),t("small",null,[r(c,{protocol:o.c.Protocol,mini:!0},null,8,["protocol"])])]),s[2]||(s[2]=t("h6",{class:"mb-0 ms-auto"},[t("i",{class:"bi bi-chevron-right"})],-1))]),_:1},8,["to"]),t("div",A,[t("div",Q,[t("small",{class:m(["col-6",{"col-md-3":this.display==="List"}])},[s[3]||(s[3]=t("i",{class:"bi bi-arrow-down-up me-2"},null,-1)),v(u(o.c.DataUsage.Total>0?o.c.DataUsage.Total.toFixed(4):0)+" GB ",1)],2),t("small",{class:m(["text-primary-emphasis col-6",{"col-md-3":this.display==="List"}])},[s[4]||(s[4]=t("i",{class:"bi bi-arrow-down me-2"},null,-1)),v(u(o.c.DataUsage.Receive>0?o.c.DataUsage.Receive.toFixed(4):0)+" GB ",1)],2),t("small",{class:m(["text-success-emphasis col-6",{"col-md-3":this.display==="List"}])},[s[5]||(s[5]=t("i",{class:"bi bi-arrow-up me-2"},null,-1)),v(u(o.c.DataUsage.Sent>0?o.c.DataUsage.Sent.toFixed(4):0)+" GB ",1)],2),t("small",{class:m(["col-6",{"col-md-3 text-md-end ":this.display==="List"}])},[t("span",{class:m(["dot me-2",{active:o.c.ConnectedPeers>0}])},null,2),v(" "+u(o.c.ConnectedPeers)+" / "+u(o.c.TotalPeers)+" ",1),r(d,{t:"Peers"})],2)]),t("div",{class:m(["d-flex gap-2",[this.display==="Grid"?"flex-column":"gap-lg-3 flex-column flex-lg-row"]])},[t("div",X,[t("small",Z,[t("strong",null,[r(d,{t:"Public Key"})])]),t("small",tt,[t("samp",et,u(o.c.PublicKey),1)])]),t("div",st,[t("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+o.c.PrivateKey},[!o.c.Status&&this.configurationToggling?(i(),_(d,{key:0,t:"Turning Off..."})):o.c.Status&&this.configurationToggling?(i(),_(d,{key:1,t:"Turning On..."})):o.c.Status&&!this.configurationToggling?(i(),_(d,{key:2,t:"On"})):!o.c.Status&&!this.configurationToggling?(i(),_(d,{key:3,t:"Off"})):y("",!0),this.configurationToggling?(i(),n("span",it)):y("",!0)],8,ot),U(t("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+o.c.PrivateKey,onChange:s[0]||(s[0]=C=>this.toggle()),"onUpdate:modelValue":s[1]||(s[1]=C=>o.c.Status=C)},null,40,nt),[[V,o.c.Status]])])],2)])])],2)}const rt=D(N,[["render",at],["__scopeId","data-v-6451623a"]]),lt={class:"text-muted me-2"},ct={class:"fw-bold"},dt={__name:"storageMount",props:{mount:Object,align:Boolean,square:Boolean},setup(e){B(a=>({"38705f32":f.value}));const s=e,o=O(!1),f=K(()=>s.square?"40px":"25px");return(a,g)=>(i(),n("div",{class:"flex-grow-1 square rounded-3 border position-relative",onMouseenter:g[0]||(g[0]=c=>o.value=!0),onMouseleave:g[1]||(g[1]=c=>o.value=!1),style:L({"background-color":`rgb(25 135 84 / ${e.mount.percent}%)`})},[r(G,{name:"zoomReversed"},{default:S(()=>[o.value?(i(),n("div",{key:0,style:{"white-space":"nowrap"},class:m(["floatingLabel z-3 border position-absolute d-block p-1 px-2 bg-body text-body rounded-3 border shadow d-flex",[e.align?"end-0":"start-0"]])},[t("small",lt,[t("samp",null,u(e.mount.mountPoint),1)]),t("small",ct,u(e.mount.percent)+"% ",1)],2)):y("",!0)]),_:1})],36))}},ut=D(dt,[["__scopeId","data-v-a382214a"]]),mt={class:"row text-body g-3 mb-5"},gt={class:"col-md-6 col-sm-12 col-xl-3"},ht={class:"d-flex align-items-center"},ft={class:"text-muted"},_t={class:"ms-auto"},pt={key:0},yt={key:1,class:"spinner-border spinner-border-sm"},bt={class:"progress",role:"progressbar",style:{height:"6px"}},St={class:"d-flex mt-2 gap-1"},vt={class:"col-md-6 col-sm-12 col-xl-3"},xt={class:"d-flex align-items-center"},wt={class:"text-muted"},kt={class:"ms-auto"},Ct={key:0},Lt={key:1,class:"spinner-border spinner-border-sm"},Dt={class:"progress",role:"progressbar",style:{height:"6px"}},$t={class:"d-flex mt-2 gap-1"},Nt={class:"col-md-6 col-sm-12 col-xl-3"},Tt={class:"d-flex align-items-center"},Pt={class:"text-muted"},Mt={class:"ms-auto"},It={key:0},Ut={key:1,class:"spinner-border spinner-border-sm"},Bt={class:"progress",role:"progressbar",style:{height:"6px"}},Kt={class:"col-md-6 col-sm-12 col-xl-3"},Gt={class:"d-flex align-items-center"},Vt={class:"text-muted"},Ot={class:"ms-auto"},Rt={key:0},Wt={key:1,class:"spinner-border spinner-border-sm"},qt={__name:"systemStatusWidget",setup(e){const s=M();let o=null;R(()=>{f(),o=setInterval(()=>{f()},5e3)}),W(()=>{clearInterval(o)});const f=()=>{I("/api/systemStatus",{},g=>{s.SystemStatus=g.data})},a=K(()=>s.SystemStatus);return(g,c)=>(i(),n("div",mt,[t("div",gt,[t("div",ht,[t("h6",ft,[c[0]||(c[0]=t("i",{class:"bi bi-cpu-fill me-2"},null,-1)),r(x,{t:"CPU"})]),t("h6",_t,[a.value?(i(),n("span",pt,u(a.value.CPU.cpu_percent)+"% ",1)):(i(),n("span",yt))])]),t("div",bt,[t("div",{class:"progress-bar",style:L({width:`${a.value?.CPU.cpu_percent}%`})},null,4)]),t("div",St,[(i(!0),n(w,null,k(a.value?.CPU.cpu_percent_per_cpu,(l,d)=>(i(),_(J,{key:d,align:d+1>Math.round(a.value?.CPU.cpu_percent_per_cpu.length/2),core_number:d,percentage:l},null,8,["align","core_number","percentage"]))),128))])]),t("div",vt,[t("div",xt,[t("h6",wt,[c[1]||(c[1]=t("i",{class:"bi bi-device-ssd-fill me-2"},null,-1)),r(x,{t:"Storage"})]),t("h6",kt,[a.value?(i(),n("span",Ct,u(a.value?.Disks.find(l=>l.mountPoint==="/").percent)+"% ",1)):(i(),n("span",Lt))])]),t("div",Dt,[t("div",{class:"progress-bar bg-success",style:L({width:`${a.value?.Disks.find(l=>l.mountPoint==="/").percent}%`})},null,4)]),t("div",$t,[a.value?(i(!0),n(w,{key:0},k(a.value?.Disks,(l,d)=>(i(),_(ut,{key:l.mountPoint,align:d+1>Math.round(a.value?.Disks.length/2),mount:l},null,8,["align","mount"]))),128)):y("",!0)])]),t("div",Nt,[t("div",Tt,[t("h6",Pt,[c[2]||(c[2]=t("i",{class:"bi bi-memory me-2"},null,-1)),r(x,{t:"Memory"})]),t("h6",Mt,[a.value?(i(),n("span",It,u(a.value?.Memory.VirtualMemory.percent)+"% ",1)):(i(),n("span",Ut))])]),t("div",Bt,[t("div",{class:"progress-bar bg-info",style:L({width:`${a.value?.Memory.VirtualMemory.percent}%`})},null,4)])]),t("div",Kt,[t("div",Gt,[t("h6",Vt,[c[3]||(c[3]=t("i",{class:"bi bi-memory me-2"},null,-1)),r(x,{t:"Swap Memory"})]),t("h6",Ot,[a.value?(i(),n("span",Rt,u(a.value?.Memory.SwapMemory.percent)+"% ",1)):(i(),n("span",Wt))])]),c[4]||(c[4]=t("div",{class:"progress",role:"progressbar",style:{height:"6px"}},[t("div",{class:"progress-bar bg-warning",style:{width:"$ data?.Memory.SwapMemory.percent}%"}})],-1))])]))}},Ft=D(qt,[["__scopeId","data-v-c7f6d1a1"]]),zt={name:"configurationList",components:{SystemStatus:Ft,LocaleText:x,ConfigurationCard:rt},async setup(){return{wireguardConfigurationsStore:q()}},data(){return{configurationLoaded:!1,sort:{Name:$("Name"),Status:$("Status"),"DataUsage.Total":$("Total Usage")},currentSort:{key:"Name",order:"asc"},currentDisplay:"List",searchKey:""}},async mounted(){window.localStorage.getItem("ConfigurationListSort")?this.currentSort=JSON.parse(window.localStorage.getItem("ConfigurationListSort")):window.localStorage.setItem("ConfigurationListSort",JSON.stringify(this.currentSort)),window.localStorage.getItem("ConfigurationListDisplay")?this.currentDisplay=window.localStorage.getItem("ConfigurationListDisplay"):window.localStorage.setItem("ConfigurationListDisplay",this.currentDisplay),await this.wireguardConfigurationsStore.getConfigurations(),this.configurationLoaded=!0,this.wireguardConfigurationsStore.ConfigurationListInterval=setInterval(()=>{this.wireguardConfigurationsStore.getConfigurations()},1e4)},beforeUnmount(){clearInterval(this.wireguardConfigurationsStore.ConfigurationListInterval)},computed:{configurations(){return[...this.wireguardConfigurationsStore.Configurations].filter(e=>e.Name.toLowerCase().includes(this.searchKey)||e.PublicKey.includes(this.searchKey)||!this.searchKey).sort((e,s)=>this.currentSort.order==="desc"?this.dotNotation(e,this.currentSort.key)this.dotNotation(s,this.currentSort.key)?-1:0:this.dotNotation(e,this.currentSort.key)>this.dotNotation(s,this.currentSort.key)?1:this.dotNotation(e,this.currentSort.key)f&&f[a],e);return typeof o=="string"?o.toLowerCase():o},updateSort(e){this.currentSort.key===e?this.currentSort.order==="asc"?this.currentSort.order="desc":this.currentSort.order="asc":this.currentSort.key=e,window.localStorage.setItem("ConfigurationListSort",JSON.stringify(this.currentSort))},updateDisplay(e){this.currentDisplay!==e&&(this.currentDisplay=e,window.localStorage.setItem("ConfigurationListDisplay",this.currentDisplay))}}},jt={class:"mt-md-5 mt-3"},Jt={class:"container-fluid"},Et={class:"d-flex mb-4 configurationListTitle align-items-md-center gap-2 flex-column flex-md-row"},Ht={class:"text-body d-flex mb-0"},Yt={key:0,class:"text-body filter mb-3 d-flex gap-2 flex-column flex-md-row"},At={class:"d-flex align-items-center gap-3 align-items-center mb-3 mb-md-0"},Qt={class:"text-muted"},Xt={class:"d-flex ms-auto ms-lg-0"},Zt=["onClick"],te={class:"align-items-center gap-3 align-items-center mb-3 mb-md-0 d-none d-lg-flex"},ee={class:"text-muted"},se={class:"d-flex ms-auto ms-lg-0"},oe=["onClick"],ie={class:"d-flex align-items-center ms-md-auto"},ne={class:"row g-3 mb-2"},ae={class:"text-muted col-12",key:"noConfiguration"};function re(e,s,o,f,a,g){const c=p("SystemStatus"),l=p("LocaleText"),d=p("RouterLink"),C=p("ConfigurationCard");return i(),n("div",jt,[t("div",Jt,[r(c),t("div",Et,[t("h2",Ht,[r(l,{t:"WireGuard Configurations"})]),r(d,{to:"/new_configuration",class:"ms-md-auto py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle"},{default:S(()=>[s[1]||(s[1]=t("i",{class:"bi bi-plus-circle me-2"},null,-1)),r(l,{t:"Configuration"})]),_:1}),r(d,{to:"/restore_configuration",class:"py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle"},{default:S(()=>[s[2]||(s[2]=t("i",{class:"bi bi-clock-history me-2"},null,-1)),r(l,{t:"Restore"})]),_:1})]),r(G,{name:"fade"},{default:S(()=>[this.configurationLoaded?(i(),n("div",Yt,[t("div",At,[t("small",Qt,[r(l,{t:"Sort By"})]),t("div",Xt,[(i(!0),n(w,null,k(this.sort,(h,b)=>(i(),n("a",{role:"button",onClick:le=>g.updateSort(b),class:m([{"bg-primary-subtle text-primary-emphasis":this.currentSort.key===b},"px-2 py-1 rounded-3"])},[t("small",null,[this.currentSort.key===b?(i(),n("i",{key:0,class:m(["bi me-2",[this.currentSort.order==="asc"?"bi-sort-up":"bi-sort-down"]])},null,2)):y("",!0),v(u(h),1)])],10,Zt))),256))])]),t("div",te,[t("small",ee,[r(l,{t:"Display as"})]),t("div",se,[(i(),n(w,null,k([{name:"List",key:"list"},{name:"Grid",key:"grid"}],h=>t("a",{role:"button",onClick:b=>g.updateDisplay(h.name),class:m([{"bg-primary-subtle text-primary-emphasis":this.currentDisplay===h.name},"px-2 py-1 rounded-3"])},[t("small",null,[t("i",{class:m(["bi me-2","bi-"+h.key])},null,2),v(" "+u(h.name),1)])],10,oe)),64))])]),t("div",ie,[s[3]||(s[3]=t("label",{for:"configurationSearch",class:"text-muted"},[t("i",{class:"bi bi-search me-2"})],-1)),U(t("input",{class:"form-control form-control-sm rounded-3","onUpdate:modelValue":s[0]||(s[0]=h=>this.searchKey=h),id:"configurationSearch"},null,512),[[z,this.searchKey]])])])):y("",!0)]),_:1}),t("div",ne,[r(F,{name:"fade"},{default:S(()=>[this.configurationLoaded&&this.wireguardConfigurationsStore.Configurations.length===0?(i(),n("p",ae,[r(l,{t:"You don't have any WireGuard configurations yet. Please check the configuration folder or change it in Settings. By default the folder is /etc/wireguard."})])):this.configurationLoaded?(i(!0),n(w,{key:1},k(g.configurations,(h,b)=>(i(),_(C,{display:this.currentDisplay,delay:b*.03+"s",key:h.Name,c:h},null,8,["display","delay","c"]))),128)):y("",!0)]),_:1})])])])}const ge=D(zt,[["render",re],["__scopeId","data-v-0ac2bdcc"]]);export{ge as default}; +import{_ as D,D as M,g as I,a as i,c as n,b as t,d as r,w as S,n as m,t as u,f as v,i as _,e as y,m as U,v as V,u as B,j as p,r as O,p as K,T as G,q as L,o as R,s as W,F as w,h as k,W as q,G as $,k as F,x as z}from"./index-CgM9eUIs.js";import{L as x}from"./localeText-Dh33930I.js";import{_ as j}from"./protocolBadge-DeLW9wVX.js";import{C as J}from"./storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-D3--h2ZI.js";const N={name:"configurationCard",components:{ProtocolBadge:j,LocaleText:x},props:{c:{Name:String,Status:Boolean,PublicKey:String,PrivateKey:String},delay:String,display:String},data(){return{configurationToggling:!1}},setup(){return{dashboardConfigurationStore:M()}},methods:{toggle(){this.configurationToggling=!0,I("/api/toggleWireguardConfiguration/",{configurationName:this.c.Name},e=>{e.status?this.dashboardConfigurationStore.newMessage("Server",`${this.c.Name} ${e.data?"is on":"is off"}`):this.dashboardConfigurationStore.newMessage("Server",e.message,"danger"),this.c.Status=e.data,this.configurationToggling=!1})}}},T=()=>{B(e=>({d75b06ae:e.delay}))},P=N.setup;N.setup=P?(e,s)=>(T(),P(e,s)):T;const E={class:"card conf_card rounded-3 shadow text-decoration-none"},H={class:"mb-0"},Y={class:"card-title mb-0 d-flex align-items-center gap-2"},A={class:"card-footer d-flex gap-2 flex-column"},Q={class:"row"},X={class:"d-flex gap-2 align-items-center"},Z={class:"text-muted"},tt={class:"mb-0 d-block d-lg-inline-block"},et={style:{"line-break":"anywhere"}},st={class:"form-check form-switch ms-auto"},ot=["for"],it={key:4,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},nt=["disabled","id"];function at(e,s,o,f,a,g){const c=p("ProtocolBadge"),l=p("RouterLink"),d=p("LocaleText");return i(),n("div",{class:m(["col-12",{"col-lg-6 col-xl-4":this.display==="Grid"}])},[t("div",E,[r(l,{to:"/configuration/"+o.c.Name+"/peers",class:"card-body d-flex align-items-center gap-3 flex-wrap text-decoration-none"},{default:S(()=>[t("h6",H,[t("span",{class:m(["dot",{active:o.c.Status}])},null,2)]),t("h6",Y,[t("samp",null,u(o.c.Name),1),t("small",null,[r(c,{protocol:o.c.Protocol,mini:!0},null,8,["protocol"])])]),s[2]||(s[2]=t("h6",{class:"mb-0 ms-auto"},[t("i",{class:"bi bi-chevron-right"})],-1))]),_:1},8,["to"]),t("div",A,[t("div",Q,[t("small",{class:m(["col-6",{"col-md-3":this.display==="List"}])},[s[3]||(s[3]=t("i",{class:"bi bi-arrow-down-up me-2"},null,-1)),v(u(o.c.DataUsage.Total>0?o.c.DataUsage.Total.toFixed(4):0)+" GB ",1)],2),t("small",{class:m(["text-primary-emphasis col-6",{"col-md-3":this.display==="List"}])},[s[4]||(s[4]=t("i",{class:"bi bi-arrow-down me-2"},null,-1)),v(u(o.c.DataUsage.Receive>0?o.c.DataUsage.Receive.toFixed(4):0)+" GB ",1)],2),t("small",{class:m(["text-success-emphasis col-6",{"col-md-3":this.display==="List"}])},[s[5]||(s[5]=t("i",{class:"bi bi-arrow-up me-2"},null,-1)),v(u(o.c.DataUsage.Sent>0?o.c.DataUsage.Sent.toFixed(4):0)+" GB ",1)],2),t("small",{class:m(["col-6",{"col-md-3 text-md-end ":this.display==="List"}])},[t("span",{class:m(["dot me-2",{active:o.c.ConnectedPeers>0}])},null,2),v(" "+u(o.c.ConnectedPeers)+" / "+u(o.c.TotalPeers)+" ",1),r(d,{t:"Peers"})],2)]),t("div",{class:m(["d-flex gap-2",[this.display==="Grid"?"flex-column":"gap-lg-3 flex-column flex-lg-row"]])},[t("div",X,[t("small",Z,[t("strong",null,[r(d,{t:"Public Key"})])]),t("small",tt,[t("samp",et,u(o.c.PublicKey),1)])]),t("div",st,[t("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+o.c.PrivateKey},[!o.c.Status&&this.configurationToggling?(i(),_(d,{key:0,t:"Turning Off..."})):o.c.Status&&this.configurationToggling?(i(),_(d,{key:1,t:"Turning On..."})):o.c.Status&&!this.configurationToggling?(i(),_(d,{key:2,t:"On"})):!o.c.Status&&!this.configurationToggling?(i(),_(d,{key:3,t:"Off"})):y("",!0),this.configurationToggling?(i(),n("span",it)):y("",!0)],8,ot),U(t("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+o.c.PrivateKey,onChange:s[0]||(s[0]=C=>this.toggle()),"onUpdate:modelValue":s[1]||(s[1]=C=>o.c.Status=C)},null,40,nt),[[V,o.c.Status]])])],2)])])],2)}const rt=D(N,[["render",at],["__scopeId","data-v-6451623a"]]),lt={class:"text-muted me-2"},ct={class:"fw-bold"},dt={__name:"storageMount",props:{mount:Object,align:Boolean,square:Boolean},setup(e){B(a=>({"38705f32":f.value}));const s=e,o=O(!1),f=K(()=>s.square?"40px":"25px");return(a,g)=>(i(),n("div",{class:"flex-grow-1 square rounded-3 border position-relative",onMouseenter:g[0]||(g[0]=c=>o.value=!0),onMouseleave:g[1]||(g[1]=c=>o.value=!1),style:L({"background-color":`rgb(25 135 84 / ${e.mount.percent}%)`})},[r(G,{name:"zoomReversed"},{default:S(()=>[o.value?(i(),n("div",{key:0,style:{"white-space":"nowrap"},class:m(["floatingLabel z-3 border position-absolute d-block p-1 px-2 bg-body text-body rounded-3 border shadow d-flex",[e.align?"end-0":"start-0"]])},[t("small",lt,[t("samp",null,u(e.mount.mountPoint),1)]),t("small",ct,u(e.mount.percent)+"% ",1)],2)):y("",!0)]),_:1})],36))}},ut=D(dt,[["__scopeId","data-v-a382214a"]]),mt={class:"row text-body g-3 mb-5"},gt={class:"col-md-6 col-sm-12 col-xl-3"},ht={class:"d-flex align-items-center"},ft={class:"text-muted"},_t={class:"ms-auto"},pt={key:0},yt={key:1,class:"spinner-border spinner-border-sm"},bt={class:"progress",role:"progressbar",style:{height:"6px"}},St={class:"d-flex mt-2 gap-1"},vt={class:"col-md-6 col-sm-12 col-xl-3"},xt={class:"d-flex align-items-center"},wt={class:"text-muted"},kt={class:"ms-auto"},Ct={key:0},Lt={key:1,class:"spinner-border spinner-border-sm"},Dt={class:"progress",role:"progressbar",style:{height:"6px"}},$t={class:"d-flex mt-2 gap-1"},Nt={class:"col-md-6 col-sm-12 col-xl-3"},Tt={class:"d-flex align-items-center"},Pt={class:"text-muted"},Mt={class:"ms-auto"},It={key:0},Ut={key:1,class:"spinner-border spinner-border-sm"},Bt={class:"progress",role:"progressbar",style:{height:"6px"}},Kt={class:"col-md-6 col-sm-12 col-xl-3"},Gt={class:"d-flex align-items-center"},Vt={class:"text-muted"},Ot={class:"ms-auto"},Rt={key:0},Wt={key:1,class:"spinner-border spinner-border-sm"},qt={__name:"systemStatusWidget",setup(e){const s=M();let o=null;R(()=>{f(),o=setInterval(()=>{f()},5e3)}),W(()=>{clearInterval(o)});const f=()=>{I("/api/systemStatus",{},g=>{s.SystemStatus=g.data})},a=K(()=>s.SystemStatus);return(g,c)=>(i(),n("div",mt,[t("div",gt,[t("div",ht,[t("h6",ft,[c[0]||(c[0]=t("i",{class:"bi bi-cpu-fill me-2"},null,-1)),r(x,{t:"CPU"})]),t("h6",_t,[a.value?(i(),n("span",pt,u(a.value.CPU.cpu_percent)+"% ",1)):(i(),n("span",yt))])]),t("div",bt,[t("div",{class:"progress-bar",style:L({width:`${a.value?.CPU.cpu_percent}%`})},null,4)]),t("div",St,[(i(!0),n(w,null,k(a.value?.CPU.cpu_percent_per_cpu,(l,d)=>(i(),_(J,{key:d,align:d+1>Math.round(a.value?.CPU.cpu_percent_per_cpu.length/2),core_number:d,percentage:l},null,8,["align","core_number","percentage"]))),128))])]),t("div",vt,[t("div",xt,[t("h6",wt,[c[1]||(c[1]=t("i",{class:"bi bi-device-ssd-fill me-2"},null,-1)),r(x,{t:"Storage"})]),t("h6",kt,[a.value?(i(),n("span",Ct,u(a.value?.Disks.find(l=>l.mountPoint==="/").percent)+"% ",1)):(i(),n("span",Lt))])]),t("div",Dt,[t("div",{class:"progress-bar bg-success",style:L({width:`${a.value?.Disks.find(l=>l.mountPoint==="/").percent}%`})},null,4)]),t("div",$t,[a.value?(i(!0),n(w,{key:0},k(a.value?.Disks,(l,d)=>(i(),_(ut,{key:l.mountPoint,align:d+1>Math.round(a.value?.Disks.length/2),mount:l},null,8,["align","mount"]))),128)):y("",!0)])]),t("div",Nt,[t("div",Tt,[t("h6",Pt,[c[2]||(c[2]=t("i",{class:"bi bi-memory me-2"},null,-1)),r(x,{t:"Memory"})]),t("h6",Mt,[a.value?(i(),n("span",It,u(a.value?.Memory.VirtualMemory.percent)+"% ",1)):(i(),n("span",Ut))])]),t("div",Bt,[t("div",{class:"progress-bar bg-info",style:L({width:`${a.value?.Memory.VirtualMemory.percent}%`})},null,4)])]),t("div",Kt,[t("div",Gt,[t("h6",Vt,[c[3]||(c[3]=t("i",{class:"bi bi-memory me-2"},null,-1)),r(x,{t:"Swap Memory"})]),t("h6",Ot,[a.value?(i(),n("span",Rt,u(a.value?.Memory.SwapMemory.percent)+"% ",1)):(i(),n("span",Wt))])]),c[4]||(c[4]=t("div",{class:"progress",role:"progressbar",style:{height:"6px"}},[t("div",{class:"progress-bar bg-warning",style:{width:"$ data?.Memory.SwapMemory.percent}%"}})],-1))])]))}},Ft=D(qt,[["__scopeId","data-v-c7f6d1a1"]]),zt={name:"configurationList",components:{SystemStatus:Ft,LocaleText:x,ConfigurationCard:rt},async setup(){return{wireguardConfigurationsStore:q()}},data(){return{configurationLoaded:!1,sort:{Name:$("Name"),Status:$("Status"),"DataUsage.Total":$("Total Usage")},currentSort:{key:"Name",order:"asc"},currentDisplay:"List",searchKey:""}},async mounted(){window.localStorage.getItem("ConfigurationListSort")?this.currentSort=JSON.parse(window.localStorage.getItem("ConfigurationListSort")):window.localStorage.setItem("ConfigurationListSort",JSON.stringify(this.currentSort)),window.localStorage.getItem("ConfigurationListDisplay")?this.currentDisplay=window.localStorage.getItem("ConfigurationListDisplay"):window.localStorage.setItem("ConfigurationListDisplay",this.currentDisplay),await this.wireguardConfigurationsStore.getConfigurations(),this.configurationLoaded=!0,this.wireguardConfigurationsStore.ConfigurationListInterval=setInterval(()=>{this.wireguardConfigurationsStore.getConfigurations()},1e4)},beforeUnmount(){clearInterval(this.wireguardConfigurationsStore.ConfigurationListInterval)},computed:{configurations(){return[...this.wireguardConfigurationsStore.Configurations].filter(e=>e.Name.toLowerCase().includes(this.searchKey)||e.PublicKey.includes(this.searchKey)||!this.searchKey).sort((e,s)=>this.currentSort.order==="desc"?this.dotNotation(e,this.currentSort.key)this.dotNotation(s,this.currentSort.key)?-1:0:this.dotNotation(e,this.currentSort.key)>this.dotNotation(s,this.currentSort.key)?1:this.dotNotation(e,this.currentSort.key)f&&f[a],e);return typeof o=="string"?o.toLowerCase():o},updateSort(e){this.currentSort.key===e?this.currentSort.order==="asc"?this.currentSort.order="desc":this.currentSort.order="asc":this.currentSort.key=e,window.localStorage.setItem("ConfigurationListSort",JSON.stringify(this.currentSort))},updateDisplay(e){this.currentDisplay!==e&&(this.currentDisplay=e,window.localStorage.setItem("ConfigurationListDisplay",this.currentDisplay))}}},jt={class:"mt-md-5 mt-3"},Jt={class:"container-fluid"},Et={class:"d-flex mb-4 configurationListTitle align-items-md-center gap-2 flex-column flex-md-row"},Ht={class:"text-body d-flex mb-0"},Yt={key:0,class:"text-body filter mb-3 d-flex gap-2 flex-column flex-md-row"},At={class:"d-flex align-items-center gap-3 align-items-center mb-3 mb-md-0"},Qt={class:"text-muted"},Xt={class:"d-flex ms-auto ms-lg-0"},Zt=["onClick"],te={class:"align-items-center gap-3 align-items-center mb-3 mb-md-0 d-none d-lg-flex"},ee={class:"text-muted"},se={class:"d-flex ms-auto ms-lg-0"},oe=["onClick"],ie={class:"d-flex align-items-center ms-md-auto"},ne={class:"row g-3 mb-2"},ae={class:"text-muted col-12",key:"noConfiguration"};function re(e,s,o,f,a,g){const c=p("SystemStatus"),l=p("LocaleText"),d=p("RouterLink"),C=p("ConfigurationCard");return i(),n("div",jt,[t("div",Jt,[r(c),t("div",Et,[t("h2",Ht,[r(l,{t:"WireGuard Configurations"})]),r(d,{to:"/new_configuration",class:"ms-md-auto py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle"},{default:S(()=>[s[1]||(s[1]=t("i",{class:"bi bi-plus-circle me-2"},null,-1)),r(l,{t:"Configuration"})]),_:1}),r(d,{to:"/restore_configuration",class:"py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle"},{default:S(()=>[s[2]||(s[2]=t("i",{class:"bi bi-clock-history me-2"},null,-1)),r(l,{t:"Restore"})]),_:1})]),r(G,{name:"fade"},{default:S(()=>[this.configurationLoaded?(i(),n("div",Yt,[t("div",At,[t("small",Qt,[r(l,{t:"Sort By"})]),t("div",Xt,[(i(!0),n(w,null,k(this.sort,(h,b)=>(i(),n("a",{role:"button",onClick:le=>g.updateSort(b),class:m([{"bg-primary-subtle text-primary-emphasis":this.currentSort.key===b},"px-2 py-1 rounded-3"])},[t("small",null,[this.currentSort.key===b?(i(),n("i",{key:0,class:m(["bi me-2",[this.currentSort.order==="asc"?"bi-sort-up":"bi-sort-down"]])},null,2)):y("",!0),v(u(h),1)])],10,Zt))),256))])]),t("div",te,[t("small",ee,[r(l,{t:"Display as"})]),t("div",se,[(i(),n(w,null,k([{name:"List",key:"list"},{name:"Grid",key:"grid"}],h=>t("a",{role:"button",onClick:b=>g.updateDisplay(h.name),class:m([{"bg-primary-subtle text-primary-emphasis":this.currentDisplay===h.name},"px-2 py-1 rounded-3"])},[t("small",null,[t("i",{class:m(["bi me-2","bi-"+h.key])},null,2),v(" "+u(h.name),1)])],10,oe)),64))])]),t("div",ie,[s[3]||(s[3]=t("label",{for:"configurationSearch",class:"text-muted"},[t("i",{class:"bi bi-search me-2"})],-1)),U(t("input",{class:"form-control form-control-sm rounded-3","onUpdate:modelValue":s[0]||(s[0]=h=>this.searchKey=h),id:"configurationSearch"},null,512),[[z,this.searchKey]])])])):y("",!0)]),_:1}),t("div",ne,[r(F,{name:"fade"},{default:S(()=>[this.configurationLoaded&&this.wireguardConfigurationsStore.Configurations.length===0?(i(),n("p",ae,[r(l,{t:"You don't have any WireGuard configurations yet. Please check the configuration folder or change it in Settings. By default the folder is /etc/wireguard."})])):this.configurationLoaded?(i(!0),n(w,{key:1},k(g.configurations,(h,b)=>(i(),_(C,{display:this.currentDisplay,delay:b*.03+"s",key:h.Name,c:h},null,8,["display","delay","c"]))),128)):y("",!0)]),_:1})])])])}const ge=D(zt,[["render",re],["__scopeId","data-v-0ac2bdcc"]]);export{ge as default}; diff --git a/src/static/app/dist/assets/dayjs.min-C341O-eN.js b/src/static/app/dist/assets/dayjs.min-B2wceQaW.js similarity index 99% rename from src/static/app/dist/assets/dayjs.min-C341O-eN.js rename to src/static/app/dist/assets/dayjs.min-B2wceQaW.js index ce9bafe..282323b 100644 --- a/src/static/app/dist/assets/dayjs.min-C341O-eN.js +++ b/src/static/app/dist/assets/dayjs.min-B2wceQaW.js @@ -1 +1 @@ -import{a0 as Q,a1 as K}from"./index-7qLsecvh.js";var E={exports:{}};(function(V,X){(function(W,k){V.exports=k()})(Q,function(){var W=1e3,k=6e4,N=36e5,A="millisecond",S="second",w="minute",O="hour",M="day",T="week",m="month",U="quarter",v="year",_="date",J="Invalid Date",q=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,B=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,G={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},I=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},P={s:I,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+I(r,2,"0")+":"+I(e,2,"0")},m:function s(n,t){if(n.date()1)return s(u[0])}else{var o=n.name;D[o]=n,e=o}return!r&&e&&(x=e),e||!r&&x},f=function(s,n){if(F(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new C(t)},a=P;a.l=j,a.i=F,a.w=function(s,n){return f(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var C=function(){function s(t){this.$L=j(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[Z]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,i=r.utc;if(e===null)return new Date(NaN);if(a.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var u=e.match(q);if(u){var o=u[2]-1||0,c=(u[7]||"0").substring(0,3);return i?new Date(Date.UTC(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)):new Date(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return a},n.isValid=function(){return this.$d.toString()!==J},n.isSame=function(t,r){var e=f(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return f(t)=n?s:""+Array(n+1-r.length).join(t)+s},P={s:I,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+I(r,2,"0")+":"+I(e,2,"0")},m:function s(n,t){if(n.date()1)return s(u[0])}else{var o=n.name;D[o]=n,e=o}return!r&&e&&(x=e),e||!r&&x},f=function(s,n){if(F(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new C(t)},a=P;a.l=j,a.i=F,a.w=function(s,n){return f(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var C=function(){function s(t){this.$L=j(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[Z]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,i=r.utc;if(e===null)return new Date(NaN);if(a.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var u=e.match(q);if(u){var o=u[2]-1||0,c=(u[7]||"0").substring(0,3);return i?new Date(Date.UTC(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)):new Date(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return a},n.isValid=function(){return this.$d.toString()!==J},n.isSame=function(t,r){var e=f(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return f(t){clearInterval(u.Peers.RefreshInterval),h.value=!0,W("/api/deleteWireguardConfiguration",{Name:p},_=>{_.status?(g.push("/"),u.newMessage("Server","Configuration deleted","success")):h.value=!1})},b=x(!0),y=x([]),w=()=>{b.value=!0,M("/api/getWireguardConfigurationBackup",{configurationName:p},_=>{y.value=_.data,b.value=!1})};j(()=>{w()});const k=r;return(_,d)=>(c(),v("div",oe,[e("div",re,[e("div",de,[e("div",ue,[e("div",ce,[e("h5",fe,[i(l,{t:"Are you sure to delete this configuration?"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:d[0]||(d[0]=s=>k("close"))})]),e("div",ge,[e("p",me,[i(l,{t:"Once you deleted this configuration:"})]),e("ul",null,[e("li",null,[i(l,{t:"All connected peers will get disconnected"})]),e("li",null,[i(l,{t:"Both configuration file (.conf) and database table related to this configuration will get deleted"})])]),e("div",{class:$(["alert",[b.value?"alert-secondary":y.value.length>0?"alert-success":"alert-danger"]])},[b.value?(c(),v("div",be,[d[5]||(d[5]=e("i",{class:"bi bi-search me-2"},null,-1)),i(l,{t:"Checking backups..."})])):y.value.length>0?(c(),v("div",ve,[d[6]||(d[6]=e("i",{class:"bi bi-check-circle-fill me-2"},null,-1)),i(l,{t:"This configuration have "+y.value.length+" backups"},null,8,["t"])])):(c(),v("div",pe,[d[9]||(d[9]=e("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),i(l,{t:"This configuration have no backup"}),e("a",{role:"button",onClick:d[1]||(d[1]=s=>k("backup")),class:"ms-auto btn btn-sm btn-primary rounded-3"},[d[7]||(d[7]=e("i",{class:"bi bi-clock-history me-2"},null,-1)),i(l,{t:"Backup"})]),e("a",{role:"button",onClick:d[2]||(d[2]=s=>w()),class:"btn btn-sm btn-primary rounded-3"},d[8]||(d[8]=[e("i",{class:"bi bi-arrow-clockwise"},null,-1)]))]))],2),d[11]||(d[11]=e("hr",null,null,-1)),e("p",null,[i(l,{t:"If you're sure, please type in the configuration name below and click Delete"})]),B(e("input",{class:"form-control rounded-3 mb-3",placeholder:K(p),"onUpdate:modelValue":d[3]||(d[3]=s=>n.value=s),type:"text"},null,8,he),[[R,n.value]]),e("button",{class:"btn btn-danger w-100",onClick:d[4]||(d[4]=s=>f()),disabled:n.value!==K(p)||h.value},[d[10]||(d[10]=e("i",{class:"bi bi-trash-fill me-2 rounded-3"},null,-1)),h.value?(c(),N(l,{key:1,t:"Deleting..."})):(c(),N(l,{key:0,t:"Delete"}))],8,ye)])])])])]))}},we={class:"card my-0 rounded-3"},ke={class:"card-body position-relative"},Ce={key:0,class:"position-absolute w-100 h-100 confirmationContainer start-0 top-0 rounded-3 d-flex p-2"},_e={class:"m-auto"},Se={class:"d-flex gap-2 align-items-center justify-content-center"},Ne=["disabled"],$e=["disabled"],Be={key:0,class:"position-absolute w-100 h-100 confirmationContainer start-0 top-0 rounded-3 d-flex p-2"},Pe={class:"m-auto"},Re={class:"d-flex gap-2 align-items-center justify-content-center"},De=["disabled"],We=["disabled"],Le={class:"d-flex gap-3"},Ve={class:"d-flex flex-column"},He={class:"text-muted"},Me={class:"d-flex flex-column"},ze={class:"text-muted"},Ie={class:"d-flex gap-2 align-items-center ms-auto"},Ke={class:"card rounded-3"},Te={key:0,class:"card-body"},Fe=["value"],Oe={class:"d-flex"},Ue={__name:"backup",props:["b","delay"],emits:["refresh","refreshPeersList"],setup(o,{emit:r}){Q(d=>({a60ade86:k.value}));const t=o,p=x(!1),n=x(!1),g=O(),u=r,h=z(),f=x(!1),b=()=>{f.value=!0,W("/api/deleteWireguardConfigurationBackup",{configurationName:g.params.id,backupFileName:t.b.filename},d=>{f.value=!1,d.status?(u("refresh"),h.newMessage("Server","Backup deleted","success")):h.newMessage("Server","Backup failed to delete","danger")})},y=()=>{f.value=!0,W("/api/restoreWireguardConfigurationBackup",{configurationName:g.params.id,backupFileName:t.b.filename},d=>{f.value=!1,n.value=!1,d.status?(u("refreshPeersList"),h.newMessage("Server","Backup restored with "+t.b.filename,"success")):h.newMessage("Server","Backup failed to restore","danger")})},w=()=>{M("/api/downloadWireguardConfigurationBackup",{configurationName:g.params.id,backupFileName:t.b.filename},d=>{d.status&&window.open(`/fileDownload?file=${d.data}`,"_blank")})},k=X(()=>t.delay+"s"),_=x(!1);return(d,s)=>(c(),v("div",we,[e("div",ke,[i(Y,{name:"zoomReversed"},{default:T(()=>[p.value?(c(),v("div",Ce,[e("div",_e,[e("h5",null,[i(l,{t:"Are you sure to delete this backup?"})]),e("div",Se,[e("button",{class:"btn btn-danger rounded-3",disabled:f.value,onClick:s[0]||(s[0]=C=>b())},[i(l,{t:"Yes"})],8,Ne),e("button",{onClick:s[1]||(s[1]=C=>p.value=!1),disabled:f.value,class:"btn bg-secondary-subtle text-secondary-emphasis border-secondary-subtle rounded-3"},[i(l,{t:"No"})],8,$e)])])])):S("",!0)]),_:1}),i(Y,{name:"zoomReversed"},{default:T(()=>[n.value?(c(),v("div",Be,[e("div",Pe,[e("h5",null,[i(l,{t:"Are you sure to restore this backup?"})]),e("div",Re,[e("button",{disabled:f.value,onClick:s[2]||(s[2]=C=>y()),class:"btn btn-success rounded-3"},[i(l,{t:"Yes"})],8,De),e("button",{onClick:s[3]||(s[3]=C=>n.value=!1),disabled:f.value,class:"btn bg-secondary-subtle text-secondary-emphasis border-secondary-subtle rounded-3"},[i(l,{t:"No"})],8,We)])])])):S("",!0)]),_:1}),e("div",Le,[e("div",Ve,[e("small",He,[i(l,{t:"Backup"})]),e("samp",null,D(o.b.filename),1)]),e("div",Me,[e("small",ze,[i(l,{t:"Backup Date"})]),V(" "+D(K(le)(o.b.backupDate,"YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss")),1)]),e("div",Ie,[e("button",{onClick:s[4]||(s[4]=C=>w()),class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3 btn-sm"},s[8]||(s[8]=[e("i",{class:"bi bi-download"},null,-1)])),e("button",{onClick:s[5]||(s[5]=C=>n.value=!0),class:"btn bg-warning-subtle text-warning-emphasis border-warning-subtle rounded-3 btn-sm"},s[9]||(s[9]=[e("i",{class:"bi bi-clock-history"},null,-1)])),e("button",{onClick:s[6]||(s[6]=C=>p.value=!0),class:"btn bg-danger-subtle text-danger-emphasis border-danger-subtle rounded-3 btn-sm"},s[10]||(s[10]=[e("i",{class:"bi bi-trash-fill"},null,-1)]))])]),s[14]||(s[14]=e("hr",null,null,-1)),e("div",Ke,[e("a",{role:"button",class:$(["card-header d-flex text-decoration-none align-items-center",{"border-bottom-0":!_.value}]),style:{cursor:"pointer"},onClick:s[7]||(s[7]=C=>_.value=!_.value)},[e("small",null,[s[11]||(s[11]=V(".conf ")),i(l,{t:"File"})]),s[12]||(s[12]=e("i",{class:"bi bi-chevron-down ms-auto"},null,-1))],2),_.value?(c(),v("div",Te,[e("textarea",{class:"form-control rounded-3",value:o.b.content,disabled:"",style:{height:"300px","font-family":"var(--bs-font-monospace),sans-serif !important"}},null,8,Fe)])):S("",!0)]),s[15]||(s[15]=e("hr",null,null,-1)),e("div",Oe,[e("span",null,[s[13]||(s[13]=e("i",{class:"bi bi-database me-1"},null,-1)),i(l,{t:"Database File"})]),e("i",{class:$(["bi ms-auto",[o.b.database?"text-success bi-check-circle-fill":"text-danger bi-x-circle-fill"]])},null,2)])])]))}},Ae=I(Ue,[["__scopeId","data-v-93ce03f2"]]),Je={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref:"editConfigurationContainer"},je={class:"d-flex h-100 w-100"},Ye={class:"modal-dialog-centered dashboardModal w-100 h-100 overflow-x-scroll flex-column gap-3 mx-3"},Ee={class:"my-5 d-flex gap-3 flex-column position-relative"},Ge={class:"title"},qe={class:"d-flex mb-3"},Ze={class:"mb-0"},Qe={class:"position-relative d-flex flex-column gap-3"},Xe={class:"text-center title",key:"spinner"},et={class:"card my-0 rounded-3",key:"noBackups"},tt={class:"card-body text-center text-muted"},st={__name:"configurationBackupRestore",emits:["close","refreshPeersList"],setup(o,{emit:r}){const t=O(),p=x([]),n=x(!0),g=r;j(()=>{u()});const u=()=>{n.value=!0,M("/api/getWireguardConfigurationBackup",{configurationName:t.params.id},f=>{p.value=f.data,n.value=!1})},h=()=>{M("/api/createWireguardConfigurationBackup",{configurationName:t.params.id},f=>{p.value=f.data,n.value=!1})};return(f,b)=>(c(),v("div",Je,[e("div",je,[e("div",Ye,[e("div",Ee,[e("div",Ge,[e("div",qe,[e("h4",Ze,[i(l,{t:"Backup & Restore"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:b[0]||(b[0]=y=>f.$emit("close"))})]),e("button",{onClick:b[1]||(b[1]=y=>h()),class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3 w-100"},[b[4]||(b[4]=e("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),i(l,{t:"Create Backup"})])]),e("div",Qe,[i(G,{name:"list1"},{default:T(()=>[n.value&&p.value.length===0?(c(),v("div",Xe,b[5]||(b[5]=[e("div",{class:"spinner-border"},null,-1)]))):!n.value&&p.value.length===0?(c(),v("div",et,[e("div",tt,[b[6]||(b[6]=e("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),i(l,{t:"No backup yet, click the button above to create backup."})])])):S("",!0),(c(!0),v(H,null,F(p.value,y=>(c(),N(Ae,{onRefresh:b[2]||(b[2]=w=>u()),onRefreshPeersList:b[3]||(b[3]=w=>g("refreshPeersList")),b:y,key:y.filename},null,8,["b"]))),128))]),_:1})])])])])],512))}},nt=I(st,[["__scopeId","data-v-1f718118"]]),at={class:"card rounded-3 flex-grow-1 bg-danger-subtle border-danger-subtle border shadow"},it={class:"card-body"},lt={class:"d-flex align-items-center gap-3 inputGroup"},ot=["value"],rt={class:"mb-0"},dt={class:"d-flex mt-3"},ut=["disabled"],ct={__name:"updateConfigurationName",props:{configurationName:String},emits:["close"],setup(o,{emit:r}){const t=o,p=r,n=J({data:"",valid:!1}),g=q();j(()=>{Z(()=>n.data,y=>{n.valid=/^[a-zA-Z0-9_=+.-]{1,15}$/.test(y)&&y.length>0&&!g.Configurations.find(w=>w.Name===y)})});const u=z(),h=x(!1),f=E(),b=async()=>{n.data&&(h.value=!0,clearInterval(u.Peers.RefreshInterval),await W("/api/renameWireguardConfiguration",{Name:t.configurationName,NewConfigurationName:n.data},async y=>{y.status?(await g.getConfigurations(),u.newMessage("Server","Configuration renamed","success"),f.push(`/configuration/${n.data}/peers`)):(u.newMessage("Server",y.message,"danger"),h.value=!1)}))};return(y,w)=>(c(),v("div",at,[e("div",it,[e("p",null,[i(l,{t:"To update this configuration's name, WGDashboard will execute the following operations:"})]),e("ol",null,[e("li",null,[i(l,{t:"Duplicate current configuration's database table and .conf file with the new name"})]),e("li",null,[i(l,{t:"Delete current configuration's database table and .conf file"})])]),e("div",lt,[e("input",{class:"form-control form-control-sm rounded-3",value:o.configurationName,disabled:""},null,8,ot),w[3]||(w[3]=e("h3",{class:"mb-0"},[e("i",{class:"bi bi-arrow-right"})],-1)),B(e("input",{class:$(["form-control form-control-sm rounded-3",[n.data?n.valid?"is-valid":"is-invalid":""]]),id:"newConfigurationName","onUpdate:modelValue":w[0]||(w[0]=k=>n.data=k)},null,2),[[R,n.data]])]),e("div",{class:$(["invalid-feedback",{"d-block":!n.valid&&n.data}])},[i(l,{t:"Configuration name is invalid. Possible reasons:"}),e("ul",rt,[e("li",null,[i(l,{t:"Configuration name already exist."})]),e("li",null,[i(l,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])],2),e("div",dt,[e("button",{onClick:w[1]||(w[1]=k=>p("close")),class:"btn btn-sm bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3"},[i(l,{t:"Cancel"})]),e("button",{onClick:w[2]||(w[2]=k=>b()),disabled:!n.data||h.value,class:"btn btn-sm btn-danger rounded-3 ms-auto"},[i(l,{t:"Save"})],8,ut)])])]))}},ft=I(ct,[["__scopeId","data-v-4be4f48a"]]),gt={name:"Dropdown",props:{width:{type:String,default:"80px"},height:{type:String,default:"auto"},title:{type:String,default:""},disabled:{type:Boolean,default:!1},defaultDisplay:{type:Boolean,default:!1}}},mt={class:"title"};function bt(o,r,t,p,n,g){return c(),v("div",{class:$(["dropdown",{disabled:t.disabled}]),onClick:r[0]||(r[0]=(...u)=>o.toggleDropdown&&o.toggleDropdown(...u)),onFocusout:r[1]||(r[1]=(...u)=>o.hideDropdown&&o.hideDropdown(...u)),tabindex:"0"},[e("div",mt,[e("div",null,D(t.title),1)])],34)}const vt=I(gt,[["render",bt]]),pt={components:{Dropdown:vt},name:"CodeEditor",props:{lineNums:{type:Boolean,default:!1},modelValue:{type:String},value:{type:String},theme:{type:String,default:"github-dark"},tabSpaces:{type:Number,default:2},wrap:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},header:{type:Boolean,default:!0},width:{type:String,default:"540px"},height:{type:String,default:"auto"},maxWidth:{type:String},minWidth:{type:String},maxHeight:{type:String},minHeight:{type:String},borderRadius:{type:String,default:"12px"},languages:{type:Array,default:function(){return[["javascript","JS"]]}},langListWidth:{type:String,default:"110px"},langListHeight:{type:String,default:"auto"},langListDisplay:{type:Boolean,default:!1},displayLanguage:{type:Boolean,default:!0},zIndex:{type:String,default:"0"},fontSize:{type:String,default:"17px"},padding:{type:String,default:"20px"}},directives:{highlight:{mounted(o,r){o.textContent=r.value},updated(o,r){o.scrolling?o.scrolling=!1:o.textContent=r.value}}},data(){return{scrollBarWidth:0,scrollBarHeight:0,top:0,left:0,languageClass:"hljs language-"+this.languages[0][0],languageTitle:this.languages[0][1]?this.languages[0][1]:this.languages[0][0],content:this.value,cursorPosition:0,insertTab:!1,lineNum:0,lineNumsWidth:0,scrolling:!1,textareaHeight:0,showLineNums:this.wrap?!1:this.lineNums}},computed:{tabWidth(){let o="";for(let r=0;r{clearInterval(u.Peers.RefreshInterval),h.value=!0,W("/api/deleteWireguardConfiguration",{Name:p},_=>{_.status?(g.push("/"),u.newMessage("Server","Configuration deleted","success")):h.value=!1})},b=x(!0),y=x([]),w=()=>{b.value=!0,M("/api/getWireguardConfigurationBackup",{configurationName:p},_=>{y.value=_.data,b.value=!1})};j(()=>{w()});const k=r;return(_,d)=>(c(),v("div",oe,[e("div",re,[e("div",de,[e("div",ue,[e("div",ce,[e("h5",fe,[i(l,{t:"Are you sure to delete this configuration?"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:d[0]||(d[0]=s=>k("close"))})]),e("div",ge,[e("p",me,[i(l,{t:"Once you deleted this configuration:"})]),e("ul",null,[e("li",null,[i(l,{t:"All connected peers will get disconnected"})]),e("li",null,[i(l,{t:"Both configuration file (.conf) and database table related to this configuration will get deleted"})])]),e("div",{class:$(["alert",[b.value?"alert-secondary":y.value.length>0?"alert-success":"alert-danger"]])},[b.value?(c(),v("div",be,[d[5]||(d[5]=e("i",{class:"bi bi-search me-2"},null,-1)),i(l,{t:"Checking backups..."})])):y.value.length>0?(c(),v("div",ve,[d[6]||(d[6]=e("i",{class:"bi bi-check-circle-fill me-2"},null,-1)),i(l,{t:"This configuration have "+y.value.length+" backups"},null,8,["t"])])):(c(),v("div",pe,[d[9]||(d[9]=e("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),i(l,{t:"This configuration have no backup"}),e("a",{role:"button",onClick:d[1]||(d[1]=s=>k("backup")),class:"ms-auto btn btn-sm btn-primary rounded-3"},[d[7]||(d[7]=e("i",{class:"bi bi-clock-history me-2"},null,-1)),i(l,{t:"Backup"})]),e("a",{role:"button",onClick:d[2]||(d[2]=s=>w()),class:"btn btn-sm btn-primary rounded-3"},d[8]||(d[8]=[e("i",{class:"bi bi-arrow-clockwise"},null,-1)]))]))],2),d[11]||(d[11]=e("hr",null,null,-1)),e("p",null,[i(l,{t:"If you're sure, please type in the configuration name below and click Delete"})]),B(e("input",{class:"form-control rounded-3 mb-3",placeholder:K(p),"onUpdate:modelValue":d[3]||(d[3]=s=>n.value=s),type:"text"},null,8,he),[[R,n.value]]),e("button",{class:"btn btn-danger w-100",onClick:d[4]||(d[4]=s=>f()),disabled:n.value!==K(p)||h.value},[d[10]||(d[10]=e("i",{class:"bi bi-trash-fill me-2 rounded-3"},null,-1)),h.value?(c(),N(l,{key:1,t:"Deleting..."})):(c(),N(l,{key:0,t:"Delete"}))],8,ye)])])])])]))}},we={class:"card my-0 rounded-3"},ke={class:"card-body position-relative"},Ce={key:0,class:"position-absolute w-100 h-100 confirmationContainer start-0 top-0 rounded-3 d-flex p-2"},_e={class:"m-auto"},Se={class:"d-flex gap-2 align-items-center justify-content-center"},Ne=["disabled"],$e=["disabled"],Be={key:0,class:"position-absolute w-100 h-100 confirmationContainer start-0 top-0 rounded-3 d-flex p-2"},Pe={class:"m-auto"},Re={class:"d-flex gap-2 align-items-center justify-content-center"},De=["disabled"],We=["disabled"],Le={class:"d-flex gap-3"},Ve={class:"d-flex flex-column"},He={class:"text-muted"},Me={class:"d-flex flex-column"},ze={class:"text-muted"},Ie={class:"d-flex gap-2 align-items-center ms-auto"},Ke={class:"card rounded-3"},Te={key:0,class:"card-body"},Fe=["value"],Oe={class:"d-flex"},Ue={__name:"backup",props:["b","delay"],emits:["refresh","refreshPeersList"],setup(o,{emit:r}){Q(d=>({a60ade86:k.value}));const t=o,p=x(!1),n=x(!1),g=O(),u=r,h=z(),f=x(!1),b=()=>{f.value=!0,W("/api/deleteWireguardConfigurationBackup",{configurationName:g.params.id,backupFileName:t.b.filename},d=>{f.value=!1,d.status?(u("refresh"),h.newMessage("Server","Backup deleted","success")):h.newMessage("Server","Backup failed to delete","danger")})},y=()=>{f.value=!0,W("/api/restoreWireguardConfigurationBackup",{configurationName:g.params.id,backupFileName:t.b.filename},d=>{f.value=!1,n.value=!1,d.status?(u("refreshPeersList"),h.newMessage("Server","Backup restored with "+t.b.filename,"success")):h.newMessage("Server","Backup failed to restore","danger")})},w=()=>{M("/api/downloadWireguardConfigurationBackup",{configurationName:g.params.id,backupFileName:t.b.filename},d=>{d.status&&window.open(`/fileDownload?file=${d.data}`,"_blank")})},k=X(()=>t.delay+"s"),_=x(!1);return(d,s)=>(c(),v("div",we,[e("div",ke,[i(Y,{name:"zoomReversed"},{default:T(()=>[p.value?(c(),v("div",Ce,[e("div",_e,[e("h5",null,[i(l,{t:"Are you sure to delete this backup?"})]),e("div",Se,[e("button",{class:"btn btn-danger rounded-3",disabled:f.value,onClick:s[0]||(s[0]=C=>b())},[i(l,{t:"Yes"})],8,Ne),e("button",{onClick:s[1]||(s[1]=C=>p.value=!1),disabled:f.value,class:"btn bg-secondary-subtle text-secondary-emphasis border-secondary-subtle rounded-3"},[i(l,{t:"No"})],8,$e)])])])):S("",!0)]),_:1}),i(Y,{name:"zoomReversed"},{default:T(()=>[n.value?(c(),v("div",Be,[e("div",Pe,[e("h5",null,[i(l,{t:"Are you sure to restore this backup?"})]),e("div",Re,[e("button",{disabled:f.value,onClick:s[2]||(s[2]=C=>y()),class:"btn btn-success rounded-3"},[i(l,{t:"Yes"})],8,De),e("button",{onClick:s[3]||(s[3]=C=>n.value=!1),disabled:f.value,class:"btn bg-secondary-subtle text-secondary-emphasis border-secondary-subtle rounded-3"},[i(l,{t:"No"})],8,We)])])])):S("",!0)]),_:1}),e("div",Le,[e("div",Ve,[e("small",He,[i(l,{t:"Backup"})]),e("samp",null,D(o.b.filename),1)]),e("div",Me,[e("small",ze,[i(l,{t:"Backup Date"})]),V(" "+D(K(le)(o.b.backupDate,"YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss")),1)]),e("div",Ie,[e("button",{onClick:s[4]||(s[4]=C=>w()),class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3 btn-sm"},s[8]||(s[8]=[e("i",{class:"bi bi-download"},null,-1)])),e("button",{onClick:s[5]||(s[5]=C=>n.value=!0),class:"btn bg-warning-subtle text-warning-emphasis border-warning-subtle rounded-3 btn-sm"},s[9]||(s[9]=[e("i",{class:"bi bi-clock-history"},null,-1)])),e("button",{onClick:s[6]||(s[6]=C=>p.value=!0),class:"btn bg-danger-subtle text-danger-emphasis border-danger-subtle rounded-3 btn-sm"},s[10]||(s[10]=[e("i",{class:"bi bi-trash-fill"},null,-1)]))])]),s[14]||(s[14]=e("hr",null,null,-1)),e("div",Ke,[e("a",{role:"button",class:$(["card-header d-flex text-decoration-none align-items-center",{"border-bottom-0":!_.value}]),style:{cursor:"pointer"},onClick:s[7]||(s[7]=C=>_.value=!_.value)},[e("small",null,[s[11]||(s[11]=V(".conf ")),i(l,{t:"File"})]),s[12]||(s[12]=e("i",{class:"bi bi-chevron-down ms-auto"},null,-1))],2),_.value?(c(),v("div",Te,[e("textarea",{class:"form-control rounded-3",value:o.b.content,disabled:"",style:{height:"300px","font-family":"var(--bs-font-monospace),sans-serif !important"}},null,8,Fe)])):S("",!0)]),s[15]||(s[15]=e("hr",null,null,-1)),e("div",Oe,[e("span",null,[s[13]||(s[13]=e("i",{class:"bi bi-database me-1"},null,-1)),i(l,{t:"Database File"})]),e("i",{class:$(["bi ms-auto",[o.b.database?"text-success bi-check-circle-fill":"text-danger bi-x-circle-fill"]])},null,2)])])]))}},Ae=I(Ue,[["__scopeId","data-v-93ce03f2"]]),Je={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref:"editConfigurationContainer"},je={class:"d-flex h-100 w-100"},Ye={class:"modal-dialog-centered dashboardModal w-100 h-100 overflow-x-scroll flex-column gap-3 mx-3"},Ee={class:"my-5 d-flex gap-3 flex-column position-relative"},Ge={class:"title"},qe={class:"d-flex mb-3"},Ze={class:"mb-0"},Qe={class:"position-relative d-flex flex-column gap-3"},Xe={class:"text-center title",key:"spinner"},et={class:"card my-0 rounded-3",key:"noBackups"},tt={class:"card-body text-center text-muted"},st={__name:"configurationBackupRestore",emits:["close","refreshPeersList"],setup(o,{emit:r}){const t=O(),p=x([]),n=x(!0),g=r;j(()=>{u()});const u=()=>{n.value=!0,M("/api/getWireguardConfigurationBackup",{configurationName:t.params.id},f=>{p.value=f.data,n.value=!1})},h=()=>{M("/api/createWireguardConfigurationBackup",{configurationName:t.params.id},f=>{p.value=f.data,n.value=!1})};return(f,b)=>(c(),v("div",Je,[e("div",je,[e("div",Ye,[e("div",Ee,[e("div",Ge,[e("div",qe,[e("h4",Ze,[i(l,{t:"Backup & Restore"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:b[0]||(b[0]=y=>f.$emit("close"))})]),e("button",{onClick:b[1]||(b[1]=y=>h()),class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3 w-100"},[b[4]||(b[4]=e("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),i(l,{t:"Create Backup"})])]),e("div",Qe,[i(G,{name:"list1"},{default:T(()=>[n.value&&p.value.length===0?(c(),v("div",Xe,b[5]||(b[5]=[e("div",{class:"spinner-border"},null,-1)]))):!n.value&&p.value.length===0?(c(),v("div",et,[e("div",tt,[b[6]||(b[6]=e("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),i(l,{t:"No backup yet, click the button above to create backup."})])])):S("",!0),(c(!0),v(H,null,F(p.value,y=>(c(),N(Ae,{onRefresh:b[2]||(b[2]=w=>u()),onRefreshPeersList:b[3]||(b[3]=w=>g("refreshPeersList")),b:y,key:y.filename},null,8,["b"]))),128))]),_:1})])])])])],512))}},nt=I(st,[["__scopeId","data-v-1f718118"]]),at={class:"card rounded-3 flex-grow-1 bg-danger-subtle border-danger-subtle border shadow"},it={class:"card-body"},lt={class:"d-flex align-items-center gap-3 inputGroup"},ot=["value"],rt={class:"mb-0"},dt={class:"d-flex mt-3"},ut=["disabled"],ct={__name:"updateConfigurationName",props:{configurationName:String},emits:["close"],setup(o,{emit:r}){const t=o,p=r,n=J({data:"",valid:!1}),g=q();j(()=>{Z(()=>n.data,y=>{n.valid=/^[a-zA-Z0-9_=+.-]{1,15}$/.test(y)&&y.length>0&&!g.Configurations.find(w=>w.Name===y)})});const u=z(),h=x(!1),f=E(),b=async()=>{n.data&&(h.value=!0,clearInterval(u.Peers.RefreshInterval),await W("/api/renameWireguardConfiguration",{Name:t.configurationName,NewConfigurationName:n.data},async y=>{y.status?(await g.getConfigurations(),u.newMessage("Server","Configuration renamed","success"),f.push(`/configuration/${n.data}/peers`)):(u.newMessage("Server",y.message,"danger"),h.value=!1)}))};return(y,w)=>(c(),v("div",at,[e("div",it,[e("p",null,[i(l,{t:"To update this configuration's name, WGDashboard will execute the following operations:"})]),e("ol",null,[e("li",null,[i(l,{t:"Duplicate current configuration's database table and .conf file with the new name"})]),e("li",null,[i(l,{t:"Delete current configuration's database table and .conf file"})])]),e("div",lt,[e("input",{class:"form-control form-control-sm rounded-3",value:o.configurationName,disabled:""},null,8,ot),w[3]||(w[3]=e("h3",{class:"mb-0"},[e("i",{class:"bi bi-arrow-right"})],-1)),B(e("input",{class:$(["form-control form-control-sm rounded-3",[n.data?n.valid?"is-valid":"is-invalid":""]]),id:"newConfigurationName","onUpdate:modelValue":w[0]||(w[0]=k=>n.data=k)},null,2),[[R,n.data]])]),e("div",{class:$(["invalid-feedback",{"d-block":!n.valid&&n.data}])},[i(l,{t:"Configuration name is invalid. Possible reasons:"}),e("ul",rt,[e("li",null,[i(l,{t:"Configuration name already exist."})]),e("li",null,[i(l,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])],2),e("div",dt,[e("button",{onClick:w[1]||(w[1]=k=>p("close")),class:"btn btn-sm bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3"},[i(l,{t:"Cancel"})]),e("button",{onClick:w[2]||(w[2]=k=>b()),disabled:!n.data||h.value,class:"btn btn-sm btn-danger rounded-3 ms-auto"},[i(l,{t:"Save"})],8,ut)])])]))}},ft=I(ct,[["__scopeId","data-v-4be4f48a"]]),gt={name:"Dropdown",props:{width:{type:String,default:"80px"},height:{type:String,default:"auto"},title:{type:String,default:""},disabled:{type:Boolean,default:!1},defaultDisplay:{type:Boolean,default:!1}}},mt={class:"title"};function bt(o,r,t,p,n,g){return c(),v("div",{class:$(["dropdown",{disabled:t.disabled}]),onClick:r[0]||(r[0]=(...u)=>o.toggleDropdown&&o.toggleDropdown(...u)),onFocusout:r[1]||(r[1]=(...u)=>o.hideDropdown&&o.hideDropdown(...u)),tabindex:"0"},[e("div",mt,[e("div",null,D(t.title),1)])],34)}const vt=I(gt,[["render",bt]]),pt={components:{Dropdown:vt},name:"CodeEditor",props:{lineNums:{type:Boolean,default:!1},modelValue:{type:String},value:{type:String},theme:{type:String,default:"github-dark"},tabSpaces:{type:Number,default:2},wrap:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},header:{type:Boolean,default:!0},width:{type:String,default:"540px"},height:{type:String,default:"auto"},maxWidth:{type:String},minWidth:{type:String},maxHeight:{type:String},minHeight:{type:String},borderRadius:{type:String,default:"12px"},languages:{type:Array,default:function(){return[["javascript","JS"]]}},langListWidth:{type:String,default:"110px"},langListHeight:{type:String,default:"auto"},langListDisplay:{type:Boolean,default:!1},displayLanguage:{type:Boolean,default:!0},zIndex:{type:String,default:"0"},fontSize:{type:String,default:"17px"},padding:{type:String,default:"20px"}},directives:{highlight:{mounted(o,r){o.textContent=r.value},updated(o,r){o.scrolling?o.scrolling=!1:o.textContent=r.value}}},data(){return{scrollBarWidth:0,scrollBarHeight:0,top:0,left:0,languageClass:"hljs language-"+this.languages[0][0],languageTitle:this.languages[0][1]?this.languages[0][1]:this.languages[0][0],content:this.value,cursorPosition:0,insertTab:!1,lineNum:0,lineNumsWidth:0,scrolling:!1,textareaHeight:0,showLineNums:this.wrap?!1:this.lineNums}},computed:{tabWidth(){let o="";for(let r=0;r{this.scrollBarWidth=t[0].target.offsetWidth-t[0].target.clientWidth,this.scrollBarHeight=t[0].target.offsetHeight-t[0].target.clientHeight,this.textareaHeight=t[0].target.offsetHeight}).observe(this.$refs.textarea);const r=new ResizeObserver(t=>{this.lineNumsWidth=t[0].target.offsetWidth});this.$refs.lineNums&&r.observe(this.$refs.lineNums)},copy(){document.execCommand("copy")?(this.$refs.textarea.select(),document.execCommand("copy"),window.getSelection().removeAllRanges()):navigator.clipboard.writeText(this.$refs.textarea.value)},getLineNum(){const o=this.$refs.textarea.value;let r=0,t=o.indexOf(` `);for(;t!==-1;)r++,t=o.indexOf(` diff --git a/src/static/app/dist/assets/index-CiNFG1Ys.js b/src/static/app/dist/assets/index-CZvzYF4i.js similarity index 97% rename from src/static/app/dist/assets/index-CiNFG1Ys.js rename to src/static/app/dist/assets/index-CZvzYF4i.js index f7de2ff..43bb172 100644 --- a/src/static/app/dist/assets/index-CiNFG1Ys.js +++ b/src/static/app/dist/assets/index-CZvzYF4i.js @@ -1 +1 @@ -import{r as C,o as D,a as o,c as d,b as e,d as s,e as b,f as m,t as p,_ as k,W as L,D as y,g as H,G as N,w as l,F as $,h as w,n as S,i as g,T as M,j as _,k as T,l as G,S as A}from"./index-7qLsecvh.js";import{L as v}from"./localeText-BguG5zGd.js";import{M as V}from"./message-B3dKoq3S.js";import"./dayjs.min-C341O-eN.js";const W={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},U={class:"container d-flex h-100 w-100"},z={class:"m-auto modal-dialog-centered dashboardModal"},B={class:"card rounded-3 shadow flex-grow-1"},O={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},R={class:"mb-0"},j={class:"card-body px-4 pb-4 d-flex flex-column gap-2"},F={class:"card text-decoration-none",target:"_blank",role:"button",href:"https://discord.gg/72TwzjeuWm"},q={class:"card-body d-flex gap-4 align-items-center"},I={class:"d-flex align-items-center"},E={class:"badge rounded-pill text-bg-primary ms-2"},J={key:0,class:"spinner-border spinner-border-sm",style:{width:"0.7rem",height:"0.7rem"}},P={key:1},K={class:"text-muted"},Q={class:"card text-decoration-none",href:"https://donaldzou.github.io/WGDashboard-Documentation/",target:"_blank"},X={class:"card-body d-flex gap-4 align-items-center"},Y={class:"mb-0"},Z={class:"text-muted"},ee={__name:"helpModal",setup(i){const t=C(!0),h=C(void 0);return D(()=>{t.value=!0,fetch("https://discord.com/api/guilds/1276818723637956628/widget.json").then(c=>c.json()).then(c=>{h.value=c,t.value=!1}).catch(()=>{t.value=!1})}),(c,a)=>(o(),d("div",W,[e("div",U,[e("div",z,[e("div",B,[e("div",O,[e("h4",R,[s(v,{t:"Help"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:a[0]||(a[0]=f=>c.$emit("close"))})]),e("div",j,[e("a",F,[e("div",q,[a[3]||(a[3]=e("h1",{class:"mb-0"},[e("i",{class:"bi bi-discord"})],-1)),e("div",null,[e("div",I,[a[2]||(a[2]=e("h5",{class:"mb-0"}," Discord Server ",-1)),e("span",E,[t.value?(o(),d("span",J)):b("",!0),h.value!==void 0&&!t.value?(o(),d("span",P,[a[1]||(a[1]=e("i",{class:"bi bi-person-fill me-2"},null,-1)),m(p(h.value.presence_count)+" Online ",1)])):b("",!0)])]),e("small",K,[s(v,{t:"Join our Discord server for quick help or chat about WGDashboard!"})])])])]),e("a",Q,[e("div",X,[a[4]||(a[4]=e("h1",{class:"mb-0"},[e("i",{class:"bi bi-hash"})],-1)),e("div",null,[e("h5",Y,[s(v,{t:"Official Documentation"})]),e("small",Z,[s(v,{t:"Official documentation contains User Guides and more..."})])])])])])])])])]))}},te={name:"navbar",components:{HelpModal:ee,LocaleText:v},setup(){const i=L(),t=y();return{wireguardConfigurationsStore:i,dashboardConfigurationStore:t}},data(){return{updateAvailable:!1,updateMessage:"Checking for update...",updateUrl:"",openHelpModal:!1}},computed:{getActiveCrossServer(){if(this.dashboardConfigurationStore.ActiveServerConfiguration)return new URL(this.dashboardConfigurationStore.CrossServerConfiguration.ServerList[this.dashboardConfigurationStore.ActiveServerConfiguration].host)}},mounted(){H("/api/getDashboardUpdate",{},i=>{i.status?(i.data&&(this.updateAvailable=!0,this.updateUrl=i.data),this.updateMessage=i.message):(this.updateMessage=N("Failed to check available update"),console.log(`Failed to get update: ${i.message}`))})}},se=["data-bs-theme"],oe={id:"sidebarMenu",class:"bg-body-tertiary sidebar border h-100 rounded-3 shadow overflow-y-scroll"},ae={class:"sidebar-sticky"},ne={class:"text-white text-center m-0 py-3 mb-2 btn-brand"},ie={key:0,class:"ms-auto"},re={class:"nav flex-column px-2 gap-1"},le={class:"nav-item"},de={class:"nav-item"},ce={class:"nav-item"},ue={class:"sidebar-heading px-3 mt-3 mb-1 text-muted text-center"},me={class:"nav flex-column px-2 gap-1"},_e={class:"nav-item"},he={class:"sidebar-heading px-3 mt-3 mb-1 text-muted text-center"},fe={class:"nav flex-column px-2 gap-1"},pe={class:"nav-item"},ve={class:"nav-item"},ge={class:"nav-item"},be={class:"nav flex-column px-2 mb-3"},xe={class:"nav-item"},Ce={class:"nav-item",style:{"font-size":"0.8rem"}},Se=["href"],ke={class:"nav-link text-muted rounded-3"},ye={key:1,class:"nav-link text-muted rounded-3"};function $e(i,t,h,c,a,f){const n=_("LocaleText"),u=_("RouterLink"),x=_("HelpModal");return o(),d("div",{class:S(["col-md-3 col-lg-2 d-md-block p-2 navbar-container",{active:this.dashboardConfigurationStore.ShowNavBar}]),"data-bs-theme":c.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[e("nav",oe,[e("div",ae,[e("div",ne,[t[4]||(t[4]=e("h5",{class:"mb-0"}," WGDashboard ",-1)),f.getActiveCrossServer!==void 0?(o(),d("small",ie,[t[3]||(t[3]=e("i",{class:"bi bi-hdd-rack-fill me-2"},null,-1)),m(p(f.getActiveCrossServer.host),1)])):b("",!0)]),e("ul",re,[e("li",le,[s(u,{class:"nav-link rounded-3",to:"/","exact-active-class":"active"},{default:l(()=>[t[5]||(t[5]=e("i",{class:"bi bi-house me-2"},null,-1)),s(n,{t:"Home"})]),_:1})]),e("li",de,[s(u,{class:"nav-link rounded-3",to:"/settings","exact-active-class":"active"},{default:l(()=>[t[6]||(t[6]=e("i",{class:"bi bi-gear me-2"},null,-1)),s(n,{t:"Settings"})]),_:1})]),e("li",ce,[e("a",{class:"nav-link rounded-3",role:"button",onClick:t[0]||(t[0]=r=>a.openHelpModal=!0)},[t[7]||(t[7]=e("i",{class:"bi bi-question-circle me-2"},null,-1)),s(n,{t:"Help"})])])]),t[10]||(t[10]=e("hr",{class:"text-body my-2"},null,-1)),e("h6",ue,[s(n,{t:"WireGuard Configurations"})]),e("ul",me,[(o(!0),d($,null,w(this.wireguardConfigurationsStore.Configurations,r=>(o(),d("li",_e,[s(u,{to:"/configuration/"+r.Name+"/peers",class:"nav-link nav-conf-link rounded-3","active-class":"active"},{default:l(()=>[e("span",{class:S(["dot me-2",{active:r.Status}])},null,2),m(" "+p(r.Name),1)]),_:2},1032,["to"])]))),256))]),t[11]||(t[11]=e("hr",{class:"text-body my-2"},null,-1)),e("h6",he,[s(n,{t:"Tools"})]),e("ul",fe,[e("li",pe,[s(u,{to:"/system_status",class:"nav-link rounded-3","active-class":"active"},{default:l(()=>[s(n,{t:"System Status"})]),_:1})]),e("li",ve,[s(u,{to:"/ping",class:"nav-link rounded-3","active-class":"active"},{default:l(()=>[s(n,{t:"Ping"})]),_:1})]),e("li",ge,[s(u,{to:"/traceroute",class:"nav-link rounded-3","active-class":"active"},{default:l(()=>[s(n,{t:"Traceroute"})]),_:1})])]),t[12]||(t[12]=e("hr",{class:"text-body my-2"},null,-1)),e("ul",be,[e("li",xe,[e("a",{class:"nav-link text-danger rounded-3",onClick:t[1]||(t[1]=r=>this.dashboardConfigurationStore.signOut()),role:"button",style:{"font-weight":"bold"}},[t[8]||(t[8]=e("i",{class:"bi bi-box-arrow-left me-2"},null,-1)),s(n,{t:"Sign Out"})])]),e("li",Ce,[this.updateAvailable?(o(),d("a",{key:0,href:this.updateUrl,class:"text-decoration-none rounded-3",target:"_blank"},[e("small",ke,[s(n,{t:this.updateMessage},null,8,["t"]),t[9]||(t[9]=m(" (")),s(n,{t:"Current Version:"}),m(" "+p(c.dashboardConfigurationStore.Configuration.Server.version)+") ",1)])],8,Se)):(o(),d("small",ye,[s(n,{t:this.updateMessage},null,8,["t"]),m(" ("+p(c.dashboardConfigurationStore.Configuration.Server.version)+") ",1)]))])])])]),s(M,{name:"zoom"},{default:l(()=>[this.openHelpModal?(o(),g(x,{key:0,onClose:t[2]||(t[2]=r=>{a.openHelpModal=!1})})):b("",!0)]),_:1})],10,se)}const we=k(te,[["render",$e],["__scopeId","data-v-637e1869"]]),Me={name:"index",components:{Message:V,Navbar:we},async setup(){return{dashboardConfigurationStore:y()}},computed:{getMessages(){return this.dashboardConfigurationStore.Messages.filter(i=>i.show)}}},De=["data-bs-theme"],Le={class:"row h-100"},He={class:"col-md-9 col-lg-10 overflow-y-scroll mb-0 pt-2"},Ne={class:"messageCentre text-body position-absolute d-flex"};function Te(i,t,h,c,a,f){const n=_("Navbar"),u=_("RouterView"),x=_("Message");return o(),d("div",{class:"container-fluid flex-grow-1 main","data-bs-theme":this.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[e("div",Le,[s(n),e("main",He,[(o(),g(A,null,{default:l(()=>[s(u,null,{default:l(({Component:r})=>[s(M,{name:"fade2",mode:"out-in",appear:""},{default:l(()=>[(o(),g(G(r)))]),_:2},1024)]),_:1})]),_:1})),e("div",Ne,[s(T,{name:"message",tag:"div",class:"position-relative flex-sm-grow-0 flex-grow-1 d-flex align-items-end ms-sm-auto flex-column gap-2"},{default:l(()=>[(o(!0),d($,null,w(f.getMessages.slice().reverse(),r=>(o(),g(x,{message:r,key:r.id},null,8,["message"]))),128))]),_:1})])])])],8,De)}const Ue=k(Me,[["render",Te],["__scopeId","data-v-2b7e9ff4"]]);export{Ue as default}; +import{r as C,o as D,a as o,c as d,b as e,d as s,e as b,f as m,t as p,_ as k,W as L,D as y,g as H,G as N,w as l,F as $,h as w,n as S,i as g,T as M,j as _,k as T,l as G,S as A}from"./index-CgM9eUIs.js";import{L as v}from"./localeText-Dh33930I.js";import{M as V}from"./message-C8I98_6p.js";import"./dayjs.min-B2wceQaW.js";const W={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},U={class:"container d-flex h-100 w-100"},z={class:"m-auto modal-dialog-centered dashboardModal"},B={class:"card rounded-3 shadow flex-grow-1"},O={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},R={class:"mb-0"},j={class:"card-body px-4 pb-4 d-flex flex-column gap-2"},F={class:"card text-decoration-none",target:"_blank",role:"button",href:"https://discord.gg/72TwzjeuWm"},q={class:"card-body d-flex gap-4 align-items-center"},I={class:"d-flex align-items-center"},E={class:"badge rounded-pill text-bg-primary ms-2"},J={key:0,class:"spinner-border spinner-border-sm",style:{width:"0.7rem",height:"0.7rem"}},P={key:1},K={class:"text-muted"},Q={class:"card text-decoration-none",href:"https://donaldzou.github.io/WGDashboard-Documentation/",target:"_blank"},X={class:"card-body d-flex gap-4 align-items-center"},Y={class:"mb-0"},Z={class:"text-muted"},ee={__name:"helpModal",setup(i){const t=C(!0),h=C(void 0);return D(()=>{t.value=!0,fetch("https://discord.com/api/guilds/1276818723637956628/widget.json").then(c=>c.json()).then(c=>{h.value=c,t.value=!1}).catch(()=>{t.value=!1})}),(c,a)=>(o(),d("div",W,[e("div",U,[e("div",z,[e("div",B,[e("div",O,[e("h4",R,[s(v,{t:"Help"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:a[0]||(a[0]=f=>c.$emit("close"))})]),e("div",j,[e("a",F,[e("div",q,[a[3]||(a[3]=e("h1",{class:"mb-0"},[e("i",{class:"bi bi-discord"})],-1)),e("div",null,[e("div",I,[a[2]||(a[2]=e("h5",{class:"mb-0"}," Discord Server ",-1)),e("span",E,[t.value?(o(),d("span",J)):b("",!0),h.value!==void 0&&!t.value?(o(),d("span",P,[a[1]||(a[1]=e("i",{class:"bi bi-person-fill me-2"},null,-1)),m(p(h.value.presence_count)+" Online ",1)])):b("",!0)])]),e("small",K,[s(v,{t:"Join our Discord server for quick help or chat about WGDashboard!"})])])])]),e("a",Q,[e("div",X,[a[4]||(a[4]=e("h1",{class:"mb-0"},[e("i",{class:"bi bi-hash"})],-1)),e("div",null,[e("h5",Y,[s(v,{t:"Official Documentation"})]),e("small",Z,[s(v,{t:"Official documentation contains User Guides and more..."})])])])])])])])])]))}},te={name:"navbar",components:{HelpModal:ee,LocaleText:v},setup(){const i=L(),t=y();return{wireguardConfigurationsStore:i,dashboardConfigurationStore:t}},data(){return{updateAvailable:!1,updateMessage:"Checking for update...",updateUrl:"",openHelpModal:!1}},computed:{getActiveCrossServer(){if(this.dashboardConfigurationStore.ActiveServerConfiguration)return new URL(this.dashboardConfigurationStore.CrossServerConfiguration.ServerList[this.dashboardConfigurationStore.ActiveServerConfiguration].host)}},mounted(){H("/api/getDashboardUpdate",{},i=>{i.status?(i.data&&(this.updateAvailable=!0,this.updateUrl=i.data),this.updateMessage=i.message):(this.updateMessage=N("Failed to check available update"),console.log(`Failed to get update: ${i.message}`))})}},se=["data-bs-theme"],oe={id:"sidebarMenu",class:"bg-body-tertiary sidebar border h-100 rounded-3 shadow overflow-y-scroll"},ae={class:"sidebar-sticky"},ne={class:"text-white text-center m-0 py-3 mb-2 btn-brand"},ie={key:0,class:"ms-auto"},re={class:"nav flex-column px-2 gap-1"},le={class:"nav-item"},de={class:"nav-item"},ce={class:"nav-item"},ue={class:"sidebar-heading px-3 mt-3 mb-1 text-muted text-center"},me={class:"nav flex-column px-2 gap-1"},_e={class:"nav-item"},he={class:"sidebar-heading px-3 mt-3 mb-1 text-muted text-center"},fe={class:"nav flex-column px-2 gap-1"},pe={class:"nav-item"},ve={class:"nav-item"},ge={class:"nav-item"},be={class:"nav flex-column px-2 mb-3"},xe={class:"nav-item"},Ce={class:"nav-item",style:{"font-size":"0.8rem"}},Se=["href"],ke={class:"nav-link text-muted rounded-3"},ye={key:1,class:"nav-link text-muted rounded-3"};function $e(i,t,h,c,a,f){const n=_("LocaleText"),u=_("RouterLink"),x=_("HelpModal");return o(),d("div",{class:S(["col-md-3 col-lg-2 d-md-block p-2 navbar-container",{active:this.dashboardConfigurationStore.ShowNavBar}]),"data-bs-theme":c.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[e("nav",oe,[e("div",ae,[e("div",ne,[t[4]||(t[4]=e("h5",{class:"mb-0"}," WGDashboard ",-1)),f.getActiveCrossServer!==void 0?(o(),d("small",ie,[t[3]||(t[3]=e("i",{class:"bi bi-hdd-rack-fill me-2"},null,-1)),m(p(f.getActiveCrossServer.host),1)])):b("",!0)]),e("ul",re,[e("li",le,[s(u,{class:"nav-link rounded-3",to:"/","exact-active-class":"active"},{default:l(()=>[t[5]||(t[5]=e("i",{class:"bi bi-house me-2"},null,-1)),s(n,{t:"Home"})]),_:1})]),e("li",de,[s(u,{class:"nav-link rounded-3",to:"/settings","exact-active-class":"active"},{default:l(()=>[t[6]||(t[6]=e("i",{class:"bi bi-gear me-2"},null,-1)),s(n,{t:"Settings"})]),_:1})]),e("li",ce,[e("a",{class:"nav-link rounded-3",role:"button",onClick:t[0]||(t[0]=r=>a.openHelpModal=!0)},[t[7]||(t[7]=e("i",{class:"bi bi-question-circle me-2"},null,-1)),s(n,{t:"Help"})])])]),t[10]||(t[10]=e("hr",{class:"text-body my-2"},null,-1)),e("h6",ue,[s(n,{t:"WireGuard Configurations"})]),e("ul",me,[(o(!0),d($,null,w(this.wireguardConfigurationsStore.Configurations,r=>(o(),d("li",_e,[s(u,{to:"/configuration/"+r.Name+"/peers",class:"nav-link nav-conf-link rounded-3","active-class":"active"},{default:l(()=>[e("span",{class:S(["dot me-2",{active:r.Status}])},null,2),m(" "+p(r.Name),1)]),_:2},1032,["to"])]))),256))]),t[11]||(t[11]=e("hr",{class:"text-body my-2"},null,-1)),e("h6",he,[s(n,{t:"Tools"})]),e("ul",fe,[e("li",pe,[s(u,{to:"/system_status",class:"nav-link rounded-3","active-class":"active"},{default:l(()=>[s(n,{t:"System Status"})]),_:1})]),e("li",ve,[s(u,{to:"/ping",class:"nav-link rounded-3","active-class":"active"},{default:l(()=>[s(n,{t:"Ping"})]),_:1})]),e("li",ge,[s(u,{to:"/traceroute",class:"nav-link rounded-3","active-class":"active"},{default:l(()=>[s(n,{t:"Traceroute"})]),_:1})])]),t[12]||(t[12]=e("hr",{class:"text-body my-2"},null,-1)),e("ul",be,[e("li",xe,[e("a",{class:"nav-link text-danger rounded-3",onClick:t[1]||(t[1]=r=>this.dashboardConfigurationStore.signOut()),role:"button",style:{"font-weight":"bold"}},[t[8]||(t[8]=e("i",{class:"bi bi-box-arrow-left me-2"},null,-1)),s(n,{t:"Sign Out"})])]),e("li",Ce,[this.updateAvailable?(o(),d("a",{key:0,href:this.updateUrl,class:"text-decoration-none rounded-3",target:"_blank"},[e("small",ke,[s(n,{t:this.updateMessage},null,8,["t"]),t[9]||(t[9]=m(" (")),s(n,{t:"Current Version:"}),m(" "+p(c.dashboardConfigurationStore.Configuration.Server.version)+") ",1)])],8,Se)):(o(),d("small",ye,[s(n,{t:this.updateMessage},null,8,["t"]),m(" ("+p(c.dashboardConfigurationStore.Configuration.Server.version)+") ",1)]))])])])]),s(M,{name:"zoom"},{default:l(()=>[this.openHelpModal?(o(),g(x,{key:0,onClose:t[2]||(t[2]=r=>{a.openHelpModal=!1})})):b("",!0)]),_:1})],10,se)}const we=k(te,[["render",$e],["__scopeId","data-v-637e1869"]]),Me={name:"index",components:{Message:V,Navbar:we},async setup(){return{dashboardConfigurationStore:y()}},computed:{getMessages(){return this.dashboardConfigurationStore.Messages.filter(i=>i.show)}}},De=["data-bs-theme"],Le={class:"row h-100"},He={class:"col-md-9 col-lg-10 overflow-y-scroll mb-0 pt-2"},Ne={class:"messageCentre text-body position-absolute d-flex"};function Te(i,t,h,c,a,f){const n=_("Navbar"),u=_("RouterView"),x=_("Message");return o(),d("div",{class:"container-fluid flex-grow-1 main","data-bs-theme":this.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[e("div",Le,[s(n),e("main",He,[(o(),g(A,null,{default:l(()=>[s(u,null,{default:l(({Component:r})=>[s(M,{name:"fade2",mode:"out-in",appear:""},{default:l(()=>[(o(),g(G(r)))]),_:2},1024)]),_:1})]),_:1})),e("div",Ne,[s(T,{name:"message",tag:"div",class:"position-relative flex-sm-grow-0 flex-grow-1 d-flex align-items-end ms-sm-auto flex-column gap-2"},{default:l(()=>[(o(!0),d($,null,w(f.getMessages.slice().reverse(),r=>(o(),g(x,{message:r,key:r.id},null,8,["message"]))),128))]),_:1})])])])],8,De)}const Ue=k(Me,[["render",Te],["__scopeId","data-v-2b7e9ff4"]]);export{Ue as default}; diff --git a/src/static/app/dist/assets/index-7qLsecvh.js b/src/static/app/dist/assets/index-CgM9eUIs.js similarity index 98% rename from src/static/app/dist/assets/index-7qLsecvh.js rename to src/static/app/dist/assets/index-CgM9eUIs.js index 5250219..1583f68 100644 --- a/src/static/app/dist/assets/index-7qLsecvh.js +++ b/src/static/app/dist/assets/index-CgM9eUIs.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CiNFG1Ys.js","assets/localeText-BguG5zGd.js","assets/message-B3dKoq3S.js","assets/dayjs.min-C341O-eN.js","assets/message-BaDb-qC9.css","assets/index-DvdCiRjM.css","assets/configurationList-DXmytjuc.js","assets/protocolBadge-CVzzEU4-.js","assets/storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-0Ox3ogTv.js","assets/storageMount-Dupif2Js.css","assets/configurationList-CUOCKhlF.css","assets/settings-iVnO1xa4.js","assets/vue-datepicker-v4St2bKM.js","assets/settings-H5PFVa1m.css","assets/ping-Dr8Ebh5i.js","assets/osmap-CVrWGfN8.js","assets/osmap-CoctJCk_.css","assets/ping-3hO-rXXY.css","assets/traceroute-Dc3TIsZW.js","assets/traceroute-DH1nb6XH.css","assets/newConfiguration-CgJ2tQN8.js","assets/index-L60y6kc9.js","assets/newConfiguration-DFJqg-M7.css","assets/restoreConfiguration-BKQ8n4I1.js","assets/restoreConfiguration-VgIx_N7z.css","assets/systemStatus-BekSpxIb.js","assets/index-CfW94M3m.js","assets/systemStatus-B37ThmTH.css","assets/peerList-BRtqzCMG.js","assets/peerList-DGF__TiG.css","assets/signin-BapBm19L.js","assets/signin-CHulm0U0.css","assets/setup-YDQRO7o1.js","assets/totp-BVPXbklw.js","assets/browser-CjSdxGTc.js","assets/share-C08DucO0.js","assets/share-B4McccvP.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CZvzYF4i.js","assets/localeText-Dh33930I.js","assets/message-C8I98_6p.js","assets/dayjs.min-B2wceQaW.js","assets/message-BaDb-qC9.css","assets/index-DvdCiRjM.css","assets/configurationList-Bu1TwT78.js","assets/protocolBadge-DeLW9wVX.js","assets/storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-D3--h2ZI.js","assets/storageMount-Dupif2Js.css","assets/configurationList-CUOCKhlF.css","assets/settings-DCAbH1gn.js","assets/vue-datepicker-D7WdryeM.js","assets/settings-H5PFVa1m.css","assets/ping-DCNhLaR7.js","assets/osmapSocket-CJmzPMGM.js","assets/osmapSocket-Di31nNcN.css","assets/ping-BGGYdR4a.css","assets/traceroute-CLD_BSNv.js","assets/traceroute-UMAnhO0_.css","assets/newConfiguration-CWJn2EUf.js","assets/index-L60y6kc9.js","assets/newConfiguration-DFJqg-M7.css","assets/restoreConfiguration-DAp7sHOi.js","assets/restoreConfiguration-VgIx_N7z.css","assets/systemStatus-CmPtdgK9.js","assets/index-z-53TFlU.js","assets/systemStatus-B37ThmTH.css","assets/peerList-M29SPoZn.js","assets/peerList-DGF__TiG.css","assets/signin-Ce-ypchd.js","assets/signin-CHulm0U0.css","assets/setup-DY8wemWQ.js","assets/totp-Dj5ZBaPC.js","assets/browser-CjSdxGTc.js","assets/share-BLXg8Dsp.js","assets/share-B4McccvP.css"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();var vg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Eg(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}),n}var yg={exports:{}},qe="top",nt="bottom",st="right",ze="left",Kr="auto",ds=[qe,nt,st,ze],On="start",ts="end",pc="clippingParents",fo="viewport",Wn="popper",gc="reference",Bi=ds.reduce(function(e,t){return e.concat([t+"-"+On,t+"-"+ts])},[]),ho=[].concat(ds,[Kr]).reduce(function(e,t){return e.concat([t,t+"-"+On,t+"-"+ts])},[]),mc="beforeRead",_c="read",vc="afterRead",Ec="beforeMain",yc="main",bc="afterMain",Ac="beforeWrite",Tc="write",wc="afterWrite",Cc=[mc,_c,vc,Ec,yc,bc,Ac,Tc,wc];function Nt(e){return e?(e.nodeName||"").toLowerCase():null}function rt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function xn(e){var t=rt(e).Element;return e instanceof t||e instanceof Element}function ct(e){var t=rt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function po(e){if(typeof ShadowRoot>"u")return!1;var t=rt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function bg(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var s=t.styles[n]||{},r=t.attributes[n]||{},o=t.elements[n];!ct(o)||!Nt(o)||(Object.assign(o.style,s),Object.keys(r).forEach(function(a){var l=r[a];l===!1?o.removeAttribute(a):o.setAttribute(a,l===!0?"":l)}))})}function Ag(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(s){var r=t.elements[s],o=t.attributes[s]||{},a=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:n[s]),l=a.reduce(function(c,d){return c[d]="",c},{});!ct(r)||!Nt(r)||(Object.assign(r.style,l),Object.keys(o).forEach(function(c){r.removeAttribute(c)}))})}}const go={name:"applyStyles",enabled:!0,phase:"write",fn:bg,effect:Ag,requires:["computeStyles"]};function Ot(e){return e.split("-")[0]}var Tn=Math.max,Dr=Math.min,ns=Math.round;function ji(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Sc(){return!/^((?!chrome|android).)*safari/i.test(ji())}function ss(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var s=e.getBoundingClientRect(),r=1,o=1;t&&ct(e)&&(r=e.offsetWidth>0&&ns(s.width)/e.offsetWidth||1,o=e.offsetHeight>0&&ns(s.height)/e.offsetHeight||1);var a=xn(e)?rt(e):window,l=a.visualViewport,c=!Sc()&&n,d=(s.left+(c&&l?l.offsetLeft:0))/r,f=(s.top+(c&&l?l.offsetTop:0))/o,h=s.width/r,p=s.height/o;return{width:h,height:p,top:f,right:d+h,bottom:f+p,left:d,x:d,y:f}}function mo(e){var t=ss(e),n=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:s}}function Oc(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&po(n)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Bt(e){return rt(e).getComputedStyle(e)}function Tg(e){return["table","td","th"].indexOf(Nt(e))>=0}function on(e){return((xn(e)?e.ownerDocument:e.document)||window.document).documentElement}function Wr(e){return Nt(e)==="html"?e:e.assignedSlot||e.parentNode||(po(e)?e.host:null)||on(e)}function Ua(e){return!ct(e)||Bt(e).position==="fixed"?null:e.offsetParent}function wg(e){var t=/firefox/i.test(ji()),n=/Trident/i.test(ji());if(n&&ct(e)){var s=Bt(e);if(s.position==="fixed")return null}var r=Wr(e);for(po(r)&&(r=r.host);ct(r)&&["html","body"].indexOf(Nt(r))<0;){var o=Bt(r);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return r;r=r.parentNode}return null}function Gs(e){for(var t=rt(e),n=Ua(e);n&&Tg(n)&&Bt(n).position==="static";)n=Ua(n);return n&&(Nt(n)==="html"||Nt(n)==="body"&&Bt(n).position==="static")?t:n||wg(e)||t}function _o(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function xs(e,t,n){return Tn(e,Dr(t,n))}function Cg(e,t,n){var s=xs(e,t,n);return s>n?n:s}function xc(){return{top:0,right:0,bottom:0,left:0}}function Nc(e){return Object.assign({},xc(),e)}function $c(e,t){return t.reduce(function(n,s){return n[s]=e,n},{})}var Sg=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Nc(typeof t!="number"?t:$c(t,ds))};function Og(e){var t,n=e.state,s=e.name,r=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Ot(n.placement),c=_o(l),d=[ze,st].indexOf(l)>=0,f=d?"height":"width";if(!(!o||!a)){var h=Sg(r.padding,n),p=mo(o),E=c==="y"?qe:ze,x=c==="y"?nt:st,C=n.rects.reference[f]+n.rects.reference[c]-a[c]-n.rects.popper[f],D=a[c]-n.rects.reference[c],P=Gs(o),V=P?c==="y"?P.clientHeight||0:P.clientWidth||0:0,k=C/2-D/2,M=h[E],b=V-p[f]-h[x],y=V/2-p[f]/2+k,S=xs(M,y,b),T=c;n.modifiersData[s]=(t={},t[T]=S,t.centerOffset=S-y,t)}}function xg(e){var t=e.state,n=e.options,s=n.element,r=s===void 0?"[data-popper-arrow]":s;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||Oc(t.elements.popper,r)&&(t.elements.arrow=r))}const Dc={name:"arrow",enabled:!0,phase:"main",fn:Og,effect:xg,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function rs(e){return e.split("-")[1]}var Ng={top:"auto",right:"auto",bottom:"auto",left:"auto"};function $g(e,t){var n=e.x,s=e.y,r=t.devicePixelRatio||1;return{x:ns(n*r)/r||0,y:ns(s*r)/r||0}}function Ya(e){var t,n=e.popper,s=e.popperRect,r=e.placement,o=e.variation,a=e.offsets,l=e.position,c=e.gpuAcceleration,d=e.adaptive,f=e.roundOffsets,h=e.isFixed,p=a.x,E=p===void 0?0:p,x=a.y,C=x===void 0?0:x,D=typeof f=="function"?f({x:E,y:C}):{x:E,y:C};E=D.x,C=D.y;var P=a.hasOwnProperty("x"),V=a.hasOwnProperty("y"),k=ze,M=qe,b=window;if(d){var y=Gs(n),S="clientHeight",T="clientWidth";if(y===rt(n)&&(y=on(n),Bt(y).position!=="static"&&l==="absolute"&&(S="scrollHeight",T="scrollWidth")),y=y,r===qe||(r===ze||r===st)&&o===ts){M=nt;var A=h&&y===b&&b.visualViewport?b.visualViewport.height:y[S];C-=A-s.height,C*=c?1:-1}if(r===ze||(r===qe||r===nt)&&o===ts){k=st;var w=h&&y===b&&b.visualViewport?b.visualViewport.width:y[T];E-=w-s.width,E*=c?1:-1}}var j=Object.assign({position:l},d&&Ng),B=f===!0?$g({x:E,y:C},rt(n)):{x:E,y:C};if(E=B.x,C=B.y,c){var Q;return Object.assign({},j,(Q={},Q[M]=V?"0":"",Q[k]=P?"0":"",Q.transform=(b.devicePixelRatio||1)<=1?"translate("+E+"px, "+C+"px)":"translate3d("+E+"px, "+C+"px, 0)",Q))}return Object.assign({},j,(t={},t[M]=V?C+"px":"",t[k]=P?E+"px":"",t.transform="",t))}function Dg(e){var t=e.state,n=e.options,s=n.gpuAcceleration,r=s===void 0?!0:s,o=n.adaptive,a=o===void 0?!0:o,l=n.roundOffsets,c=l===void 0?!0:l,d={placement:Ot(t.placement),variation:rs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ya(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ya(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const vo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Dg,data:{}};var dr={passive:!0};function Lg(e){var t=e.state,n=e.instance,s=e.options,r=s.scroll,o=r===void 0?!0:r,a=s.resize,l=a===void 0?!0:a,c=rt(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,dr)}),l&&c.addEventListener("resize",n.update,dr),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,dr)}),l&&c.removeEventListener("resize",n.update,dr)}}const Eo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Lg,data:{}};var Rg={left:"right",right:"left",bottom:"top",top:"bottom"};function wr(e){return e.replace(/left|right|bottom|top/g,function(t){return Rg[t]})}var Ig={start:"end",end:"start"};function Ga(e){return e.replace(/start|end/g,function(t){return Ig[t]})}function yo(e){var t=rt(e),n=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:n,scrollTop:s}}function bo(e){return ss(on(e)).left+yo(e).scrollLeft}function Pg(e,t){var n=rt(e),s=on(e),r=n.visualViewport,o=s.clientWidth,a=s.clientHeight,l=0,c=0;if(r){o=r.width,a=r.height;var d=Sc();(d||!d&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}return{width:o,height:a,x:l+bo(e),y:c}}function Mg(e){var t,n=on(e),s=yo(e),r=(t=e.ownerDocument)==null?void 0:t.body,o=Tn(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Tn(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-s.scrollLeft+bo(e),c=-s.scrollTop;return Bt(r||n).direction==="rtl"&&(l+=Tn(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:l,y:c}}function Ao(e){var t=Bt(e),n=t.overflow,s=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+s)}function Lc(e){return["html","body","#document"].indexOf(Nt(e))>=0?e.ownerDocument.body:ct(e)&&Ao(e)?e:Lc(Wr(e))}function Ns(e,t){var n;t===void 0&&(t=[]);var s=Lc(e),r=s===((n=e.ownerDocument)==null?void 0:n.body),o=rt(s),a=r?[o].concat(o.visualViewport||[],Ao(s)?s:[]):s,l=t.concat(a);return r?l:l.concat(Ns(Wr(a)))}function Ki(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function kg(e,t){var n=ss(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function qa(e,t,n){return t===fo?Ki(Pg(e,n)):xn(t)?kg(t,n):Ki(Mg(on(e)))}function Vg(e){var t=Ns(Wr(e)),n=["absolute","fixed"].indexOf(Bt(e).position)>=0,s=n&&ct(e)?Gs(e):e;return xn(s)?t.filter(function(r){return xn(r)&&Oc(r,s)&&Nt(r)!=="body"}):[]}function Fg(e,t,n,s){var r=t==="clippingParents"?Vg(e):[].concat(t),o=[].concat(r,[n]),a=o[0],l=o.reduce(function(c,d){var f=qa(e,d,s);return c.top=Tn(f.top,c.top),c.right=Dr(f.right,c.right),c.bottom=Dr(f.bottom,c.bottom),c.left=Tn(f.left,c.left),c},qa(e,a,s));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Rc(e){var t=e.reference,n=e.element,s=e.placement,r=s?Ot(s):null,o=s?rs(s):null,a=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(r){case qe:c={x:a,y:t.y-n.height};break;case nt:c={x:a,y:t.y+t.height};break;case st:c={x:t.x+t.width,y:l};break;case ze:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var d=r?_o(r):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case On:c[d]=c[d]-(t[f]/2-n[f]/2);break;case ts:c[d]=c[d]+(t[f]/2-n[f]/2);break}}return c}function is(e,t){t===void 0&&(t={});var n=t,s=n.placement,r=s===void 0?e.placement:s,o=n.strategy,a=o===void 0?e.strategy:o,l=n.boundary,c=l===void 0?pc:l,d=n.rootBoundary,f=d===void 0?fo:d,h=n.elementContext,p=h===void 0?Wn:h,E=n.altBoundary,x=E===void 0?!1:E,C=n.padding,D=C===void 0?0:C,P=Nc(typeof D!="number"?D:$c(D,ds)),V=p===Wn?gc:Wn,k=e.rects.popper,M=e.elements[x?V:p],b=Fg(xn(M)?M:M.contextElement||on(e.elements.popper),c,f,a),y=ss(e.elements.reference),S=Rc({reference:y,element:k,strategy:"absolute",placement:r}),T=Ki(Object.assign({},k,S)),A=p===Wn?T:y,w={top:b.top-A.top+P.top,bottom:A.bottom-b.bottom+P.bottom,left:b.left-A.left+P.left,right:A.right-b.right+P.right},j=e.modifiersData.offset;if(p===Wn&&j){var B=j[r];Object.keys(w).forEach(function(Q){var oe=[st,nt].indexOf(Q)>=0?1:-1,he=[qe,nt].indexOf(Q)>=0?"y":"x";w[Q]+=B[he]*oe})}return w}function Hg(e,t){t===void 0&&(t={});var n=t,s=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?ho:c,f=rs(s),h=f?l?Bi:Bi.filter(function(x){return rs(x)===f}):ds,p=h.filter(function(x){return d.indexOf(x)>=0});p.length===0&&(p=h);var E=p.reduce(function(x,C){return x[C]=is(e,{placement:C,boundary:r,rootBoundary:o,padding:a})[Ot(C)],x},{});return Object.keys(E).sort(function(x,C){return E[x]-E[C]})}function Bg(e){if(Ot(e)===Kr)return[];var t=wr(e);return[Ga(e),t,Ga(t)]}function jg(e){var t=e.state,n=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var r=n.mainAxis,o=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!0:a,c=n.fallbackPlacements,d=n.padding,f=n.boundary,h=n.rootBoundary,p=n.altBoundary,E=n.flipVariations,x=E===void 0?!0:E,C=n.allowedAutoPlacements,D=t.options.placement,P=Ot(D),V=P===D,k=c||(V||!x?[wr(D)]:Bg(D)),M=[D].concat(k).reduce(function(Be,Pe){return Be.concat(Ot(Pe)===Kr?Hg(t,{placement:Pe,boundary:f,rootBoundary:h,padding:d,flipVariations:x,allowedAutoPlacements:C}):Pe)},[]),b=t.rects.reference,y=t.rects.popper,S=new Map,T=!0,A=M[0],w=0;w=0,he=oe?"width":"height",te=is(t,{placement:j,boundary:f,rootBoundary:h,altBoundary:p,padding:d}),Z=oe?Q?st:ze:Q?nt:qe;b[he]>y[he]&&(Z=wr(Z));var ce=wr(Z),Ce=[];if(o&&Ce.push(te[B]<=0),l&&Ce.push(te[Z]<=0,te[ce]<=0),Ce.every(function(Be){return Be})){A=j,T=!1;break}S.set(j,Ce)}if(T)for(var He=x?3:1,De=function(Pe){var we=M.find(function(R){var q=S.get(R);if(q)return q.slice(0,Pe).every(function(z){return z})});if(we)return A=we,"break"},Ae=He;Ae>0;Ae--){var et=De(Ae);if(et==="break")break}t.placement!==A&&(t.modifiersData[s]._skip=!0,t.placement=A,t.reset=!0)}}const Ic={name:"flip",enabled:!0,phase:"main",fn:jg,requiresIfExists:["offset"],data:{_skip:!1}};function za(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Xa(e){return[qe,st,nt,ze].some(function(t){return e[t]>=0})}function Kg(e){var t=e.state,n=e.name,s=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,a=is(t,{elementContext:"reference"}),l=is(t,{altBoundary:!0}),c=za(a,s),d=za(l,r,o),f=Xa(c),h=Xa(d);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}const Pc={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kg};function Wg(e,t,n){var s=Ot(e),r=[ze,qe].indexOf(s)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],l=o[1];return a=a||0,l=(l||0)*r,[ze,st].indexOf(s)>=0?{x:l,y:a}:{x:a,y:l}}function Ug(e){var t=e.state,n=e.options,s=e.name,r=n.offset,o=r===void 0?[0,0]:r,a=ho.reduce(function(f,h){return f[h]=Wg(h,t.rects,o),f},{}),l=a[t.placement],c=l.x,d=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=d),t.modifiersData[s]=a}const Mc={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ug};function Yg(e){var t=e.state,n=e.name;t.modifiersData[n]=Rc({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const To={name:"popperOffsets",enabled:!0,phase:"read",fn:Yg,data:{}};function Gg(e){return e==="x"?"y":"x"}function qg(e){var t=e.state,n=e.options,s=e.name,r=n.mainAxis,o=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!1:a,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.padding,p=n.tether,E=p===void 0?!0:p,x=n.tetherOffset,C=x===void 0?0:x,D=is(t,{boundary:c,rootBoundary:d,padding:h,altBoundary:f}),P=Ot(t.placement),V=rs(t.placement),k=!V,M=_o(P),b=Gg(M),y=t.modifiersData.popperOffsets,S=t.rects.reference,T=t.rects.popper,A=typeof C=="function"?C(Object.assign({},t.rects,{placement:t.placement})):C,w=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(y){if(o){var Q,oe=M==="y"?qe:ze,he=M==="y"?nt:st,te=M==="y"?"height":"width",Z=y[M],ce=Z+D[oe],Ce=Z-D[he],He=E?-T[te]/2:0,De=V===On?S[te]:T[te],Ae=V===On?-T[te]:-S[te],et=t.elements.arrow,Be=E&&et?mo(et):{width:0,height:0},Pe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:xc(),we=Pe[oe],R=Pe[he],q=xs(0,S[te],Be[te]),z=k?S[te]/2-He-q-we-w.mainAxis:De-q-we-w.mainAxis,J=k?-S[te]/2+He+q+R+w.mainAxis:Ae+q+R+w.mainAxis,$=t.elements.arrow&&Gs(t.elements.arrow),ge=$?M==="y"?$.clientTop||0:$.clientLeft||0:0,g=(Q=j?.[M])!=null?Q:0,_=Z+z-g-ge,O=Z+J-g,H=xs(E?Dr(ce,_):ce,Z,E?Tn(Ce,O):Ce);y[M]=H,B[M]=H-Z}if(l){var L,F=M==="x"?qe:ze,G=M==="x"?nt:st,N=y[b],W=b==="y"?"height":"width",K=N+D[F],se=N-D[G],X=[qe,ze].indexOf(P)!==-1,ee=(L=j?.[b])!=null?L:0,re=X?K:N-S[W]-T[W]-ee+w.altAxis,ae=X?N+S[W]+T[W]-ee-w.altAxis:se,de=E&&X?Cg(re,N,ae):xs(E?re:K,N,E?ae:se);y[b]=de,B[b]=de-N}t.modifiersData[s]=B}}const kc={name:"preventOverflow",enabled:!0,phase:"main",fn:qg,requiresIfExists:["offset"]};function zg(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Xg(e){return e===rt(e)||!ct(e)?yo(e):zg(e)}function Qg(e){var t=e.getBoundingClientRect(),n=ns(t.width)/e.offsetWidth||1,s=ns(t.height)/e.offsetHeight||1;return n!==1||s!==1}function Jg(e,t,n){n===void 0&&(n=!1);var s=ct(t),r=ct(t)&&Qg(t),o=on(t),a=ss(e,r,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!n)&&((Nt(t)!=="body"||Ao(o))&&(l=Xg(t)),ct(t)?(c=ss(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=bo(o))),{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function Zg(e){var t=new Map,n=new Set,s=[];e.forEach(function(o){t.set(o.name,o)});function r(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var c=t.get(l);c&&r(c)}}),s.push(o)}return e.forEach(function(o){n.has(o.name)||r(o)}),s}function em(e){var t=Zg(e);return Cc.reduce(function(n,s){return n.concat(t.filter(function(r){return r.phase===s}))},[])}function tm(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function nm(e){var t=e.reduce(function(n,s){var r=n[s.name];return n[s.name]=r?Object.assign({},r,s,{options:Object.assign({},r.options,s.options),data:Object.assign({},r.data,s.data)}):s,n},{});return Object.keys(t).map(function(n){return t[n]})}var Qa={placement:"bottom",modifiers:[],strategy:"absolute"};function Ja(){for(var e=arguments.length,t=new Array(e),n=0;ne&&e.exact?hy:new RegExp(`(?:${en(e)}${mt}${en(e)})|(?:${en(e)}${li}${en(e)})`,"g");ci.v4=e=>e&&e.exact?py:new RegExp(`${en(e)}${mt}${en(e)}`,"g");ci.v6=e=>e&&e.exact?gy:new RegExp(`${en(e)}${li}${en(e)}`,"g");const If={exact:!1},Pf=`${ci.v4().source}\\/(3[0-2]|[12]?[0-9])`,Mf=`${ci.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`,my=new RegExp(`^${Pf}$`),_y=new RegExp(`^${Mf}$`),vy=({exact:e}=If)=>e?my:new RegExp(Pf,"g"),Ey=({exact:e}=If)=>e?_y:new RegExp(Mf,"g"),kf=vy({exact:!0}),Vf=Ey({exact:!0}),na=e=>kf.test(e)?4:Vf.test(e)?6:0;na.v4=e=>kf.test(e);na.v6=e=>Vf.test(e);const kt=e=>{const t=un();if(t.Locale===null)return e;const s=Object.keys(t.Locale).filter(r=>e.match(new RegExp("^"+r+"$","gi"))!==null);return s.length===0||s.length>1||t.Locale[s[0]].length===0?e:e.replace(new RegExp(s[0],"gi"),t.Locale[s[0]])},yy=yf("WireguardConfigurationsStore",{state:()=>({Configurations:void 0,searchString:"",ConfigurationListInterval:void 0,PeerScheduleJobs:{dropdowns:{Field:[{display:kt("Total Received"),value:"total_receive",unit:"GB",type:"number"},{display:kt("Total Sent"),value:"total_sent",unit:"GB",type:"number"},{display:kt("Total Usage"),value:"total_data",unit:"GB",type:"number"},{display:kt("Date"),value:"date",type:"date"}],Operator:[{display:kt("larger than"),value:"lgt"}],Action:[{display:kt("Restrict Peer"),value:"restrict"},{display:kt("Delete Peer"),value:"delete"}]}}}),actions:{async getConfigurations(){await jr("/api/getWireguardConfigurations",{},e=>{e.status&&(this.Configurations=e.data)})},regexCheckIP(e){return/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/.test(e)},checkCIDR(e){return na(e)!==0},checkWGKeyLength(e){return/^[A-Za-z0-9+/]{43}=?=?$/.test(e)}}}),by=async()=>{let e=!1;return await jr("/api/validateAuthentication",{},t=>{e=t.status}),e},ms=ly({history:FE(),scrollBehavior(){document.querySelector("main")!==null&&document.querySelector("main").scrollTo({top:0})},routes:[{name:"Index",path:"/",component:()=>Qe(()=>import("./index-CiNFG1Ys.js"),__vite__mapDeps([0,1,2,3,4,5])),meta:{requiresAuth:!0},children:[{name:"Configuration List",path:"",component:()=>Qe(()=>import("./configurationList-DXmytjuc.js"),__vite__mapDeps([6,1,7,8,9,10])),meta:{title:"WireGuard Configurations"}},{name:"Settings",path:"/settings",component:()=>Qe(()=>import("./settings-iVnO1xa4.js"),__vite__mapDeps([11,1,3,12,13])),meta:{title:"Settings"}},{path:"/ping",name:"Ping",component:()=>Qe(()=>import("./ping-Dr8Ebh5i.js"),__vite__mapDeps([14,1,15,16,17]))},{path:"/traceroute",name:"Traceroute",component:()=>Qe(()=>import("./traceroute-Dc3TIsZW.js"),__vite__mapDeps([18,15,16,1,19]))},{name:"New Configuration",path:"/new_configuration",component:()=>Qe(()=>import("./newConfiguration-CgJ2tQN8.js"),__vite__mapDeps([20,21,1,22])),meta:{title:"New Configuration"}},{name:"Restore Configuration",path:"/restore_configuration",component:()=>Qe(()=>import("./restoreConfiguration-BKQ8n4I1.js"),__vite__mapDeps([23,1,3,7,21,24])),meta:{title:"Restore Configuration"}},{name:"System Status",path:"/system_status",component:()=>Qe(()=>import("./systemStatus-BekSpxIb.js"),__vite__mapDeps([25,1,8,9,26,3,27])),meta:{title:"System Status"}},{name:"Configuration",path:"/configuration/:id",component:()=>Qe(()=>import("./configuration-DVJcktkN.js"),[]),meta:{title:"Configuration"},children:[{name:"Peers List",path:"peers",component:()=>Qe(()=>import("./peerList-BRtqzCMG.js"),__vite__mapDeps([28,7,1,26,3,29]))}]}]},{path:"/signin",component:()=>Qe(()=>import("./signin-BapBm19L.js"),__vite__mapDeps([30,2,1,3,4,31])),meta:{title:"Sign In",hideTopNav:!0}},{path:"/welcome",component:()=>Qe(()=>import("./setup-YDQRO7o1.js"),__vite__mapDeps([32,1])),meta:{requiresAuth:!0,title:"Welcome to WGDashboard",hideTopNav:!0}},{path:"/2FASetup",component:()=>Qe(()=>import("./totp-BVPXbklw.js"),__vite__mapDeps([33,34,1])),meta:{requiresAuth:!0,title:"Multi-Factor Authentication Setup",hideTopNav:!0}},{path:"/share",component:()=>Qe(()=>import("./share-C08DucO0.js"),__vite__mapDeps([35,34,1,36])),meta:{title:"Share",hideTopNav:!0}}]});ms.beforeEach(async(e,t,n)=>{const s=yy(),r=un();e.meta.title?e.params.id?document.title=e.params.id+" | WGDashboard":document.title=e.meta.title+" | WGDashboard":document.title="WGDashboard",r.ShowNavBar=!1,document.querySelector(".loadingBar").classList.remove("loadingDone"),document.querySelector(".loadingBar").classList.add("loading"),e.meta.requiresAuth?r.getActiveCrossServer()?(await r.getConfiguration(),!s.Configurations&&e.name!=="Configuration List"&&await s.getConfigurations(),n()):await by()?(await r.getConfiguration(),!s.Configurations&&e.name!=="Configuration List"&&await s.getConfigurations(),r.Redirect=void 0,n()):(r.Redirect=e,n("/signin"),r.newMessage("WGDashboard","Sign in session ended, please sign in again","warning")):n()});ms.afterEach(()=>{document.querySelector(".loadingBar").classList.remove("loading"),document.querySelector(".loadingBar").classList.add("loadingDone")});const Ff=()=>{let e={"content-type":"application/json"};const n=un().getActiveCrossServer();return n&&(e["wg-dashboard-apikey"]=n.apiKey),e},Hf=e=>{const n=un().getActiveCrossServer();return n?`${n.host}${e}`:`${window.location.protocol}//${(window.location.host+window.location.pathname+e).replace(/\/\//g,"/")}`},jr=async(e,t=void 0,n=void 0)=>{const s=new URLSearchParams(t);await fetch(`${Hf(e)}?${s.toString()}`,{headers:Ff()}).then(r=>{const o=un();if(r.ok)return r.json();if(r.status!==200)throw r.status===401&&o.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(r.statusText)}).then(r=>n?n(r):void 0).catch(r=>{console.log("Error:",r),ms.push({path:"/signin"})})},gb=async(e,t,n)=>{await fetch(`${Hf(e)}`,{headers:Ff(),method:"POST",body:JSON.stringify(t)}).then(s=>{const r=un();if(s.ok)return s.json();if(s.status!==200)throw s.status===401&&r.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(s.statusText)}).then(s=>n?n(s):void 0).catch(s=>{console.log("Error:",s),ms.push({path:"/signin"})})};let Tr;const Ay=new Uint8Array(16);function Ty(){if(!Tr&&(Tr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Tr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Tr(Ay)}const Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function wy(e,t=0){return Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]}const Cy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),dc={randomUUID:Cy};function hc(e,t,n){if(dc.randomUUID&&!t&&!e)return dc.randomUUID();e=e||{};const s=e.random||(e.rng||Ty)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,wy(s)}const un=yf("DashboardConfigurationStore",{state:()=>({Redirect:void 0,Configuration:void 0,Messages:[],Peers:{Selecting:!1,RefreshInterval:void 0},CrossServerConfiguration:{Enable:!1,ServerList:{}},SystemStatus:void 0,ActiveServerConfiguration:void 0,IsElectronApp:!1,ShowNavBar:!1,Locale:void 0}),actions:{initCrossServerConfiguration(){const e=localStorage.getItem("CrossServerConfiguration");localStorage.getItem("ActiveCrossServerConfiguration")!==null&&(this.ActiveServerConfiguration=localStorage.getItem("ActiveCrossServerConfiguration")),e===null?window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration)):this.CrossServerConfiguration=JSON.parse(e)},syncCrossServerConfiguration(){window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration))},addCrossServerConfiguration(){this.CrossServerConfiguration.ServerList[hc().toString()]={host:"",apiKey:"",active:!1}},deleteCrossServerConfiguration(e){delete this.CrossServerConfiguration.ServerList[e]},getActiveCrossServer(){const e=localStorage.getItem("ActiveCrossServerConfiguration");if(e!==null)return this.CrossServerConfiguration.ServerList[e]},setActiveCrossServer(e){this.ActiveServerConfiguration=e,localStorage.setItem("ActiveCrossServerConfiguration",e)},removeActiveCrossServer(){this.ActiveServerConfiguration=void 0,localStorage.removeItem("ActiveCrossServerConfiguration")},async getConfiguration(){await jr("/api/getDashboardConfiguration",{},e=>{e.status&&(this.Configuration=e.data)})},async signOut(){await jr("/api/signout",{},()=>{this.removeActiveCrossServer(),document.cookie="",this.$router.go("/signin")})},newMessage(e,t,n){this.Messages.push({id:hc(),from:kt(e),content:kt(t),type:n,show:!0})},applyLocale(e){if(this.Locale===null)return e;const n=Object.keys(this.Locale).filter(s=>e.match(new RegExp("^"+s+"$","g"))!==null);return console.log(n),n.length===0||n.length>1?e:this.Locale[n[0]]}}});/*! SPDX-License-Identifier: GPL-2.0 +`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),hy=new RegExp(`(?:^${mt}$)|(?:^${li}$)`),py=new RegExp(`^${mt}$`),gy=new RegExp(`^${li}$`),ci=e=>e&&e.exact?hy:new RegExp(`(?:${en(e)}${mt}${en(e)})|(?:${en(e)}${li}${en(e)})`,"g");ci.v4=e=>e&&e.exact?py:new RegExp(`${en(e)}${mt}${en(e)}`,"g");ci.v6=e=>e&&e.exact?gy:new RegExp(`${en(e)}${li}${en(e)}`,"g");const If={exact:!1},Pf=`${ci.v4().source}\\/(3[0-2]|[12]?[0-9])`,Mf=`${ci.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`,my=new RegExp(`^${Pf}$`),_y=new RegExp(`^${Mf}$`),vy=({exact:e}=If)=>e?my:new RegExp(Pf,"g"),Ey=({exact:e}=If)=>e?_y:new RegExp(Mf,"g"),kf=vy({exact:!0}),Vf=Ey({exact:!0}),na=e=>kf.test(e)?4:Vf.test(e)?6:0;na.v4=e=>kf.test(e);na.v6=e=>Vf.test(e);const kt=e=>{const t=un();if(t.Locale===null)return e;const s=Object.keys(t.Locale).filter(r=>e.match(new RegExp("^"+r+"$","gi"))!==null);return s.length===0||s.length>1||t.Locale[s[0]].length===0?e:e.replace(new RegExp(s[0],"gi"),t.Locale[s[0]])},yy=yf("WireguardConfigurationsStore",{state:()=>({Configurations:void 0,searchString:"",ConfigurationListInterval:void 0,PeerScheduleJobs:{dropdowns:{Field:[{display:kt("Total Received"),value:"total_receive",unit:"GB",type:"number"},{display:kt("Total Sent"),value:"total_sent",unit:"GB",type:"number"},{display:kt("Total Usage"),value:"total_data",unit:"GB",type:"number"},{display:kt("Date"),value:"date",type:"date"}],Operator:[{display:kt("larger than"),value:"lgt"}],Action:[{display:kt("Restrict Peer"),value:"restrict"},{display:kt("Delete Peer"),value:"delete"}]}}}),actions:{async getConfigurations(){await jr("/api/getWireguardConfigurations",{},e=>{e.status&&(this.Configurations=e.data)})},regexCheckIP(e){return/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/.test(e)},checkCIDR(e){return na(e)!==0},checkWGKeyLength(e){return/^[A-Za-z0-9+/]{43}=?=?$/.test(e)}}}),by=async()=>{let e=!1;return await jr("/api/validateAuthentication",{},t=>{e=t.status}),e},ms=ly({history:FE(),scrollBehavior(){document.querySelector("main")!==null&&document.querySelector("main").scrollTo({top:0})},routes:[{name:"Index",path:"/",component:()=>Qe(()=>import("./index-CZvzYF4i.js"),__vite__mapDeps([0,1,2,3,4,5])),meta:{requiresAuth:!0},children:[{name:"Configuration List",path:"",component:()=>Qe(()=>import("./configurationList-Bu1TwT78.js"),__vite__mapDeps([6,1,7,8,9,10])),meta:{title:"WireGuard Configurations"}},{name:"Settings",path:"/settings",component:()=>Qe(()=>import("./settings-DCAbH1gn.js"),__vite__mapDeps([11,1,3,12,13])),meta:{title:"Settings"}},{path:"/ping",name:"Ping",component:()=>Qe(()=>import("./ping-DCNhLaR7.js"),__vite__mapDeps([14,1,15,16,17]))},{path:"/traceroute",name:"Traceroute",component:()=>Qe(()=>import("./traceroute-CLD_BSNv.js"),__vite__mapDeps([18,15,1,16,19]))},{name:"New Configuration",path:"/new_configuration",component:()=>Qe(()=>import("./newConfiguration-CWJn2EUf.js"),__vite__mapDeps([20,21,1,22])),meta:{title:"New Configuration"}},{name:"Restore Configuration",path:"/restore_configuration",component:()=>Qe(()=>import("./restoreConfiguration-DAp7sHOi.js"),__vite__mapDeps([23,1,3,7,21,24])),meta:{title:"Restore Configuration"}},{name:"System Status",path:"/system_status",component:()=>Qe(()=>import("./systemStatus-CmPtdgK9.js"),__vite__mapDeps([25,1,8,9,26,3,27])),meta:{title:"System Status"}},{name:"Configuration",path:"/configuration/:id",component:()=>Qe(()=>import("./configuration-DGaUoiAC.js"),[]),meta:{title:"Configuration"},children:[{name:"Peers List",path:"peers",component:()=>Qe(()=>import("./peerList-M29SPoZn.js"),__vite__mapDeps([28,7,1,26,3,29]))}]}]},{path:"/signin",component:()=>Qe(()=>import("./signin-Ce-ypchd.js"),__vite__mapDeps([30,2,1,3,4,31])),meta:{title:"Sign In",hideTopNav:!0}},{path:"/welcome",component:()=>Qe(()=>import("./setup-DY8wemWQ.js"),__vite__mapDeps([32,1])),meta:{requiresAuth:!0,title:"Welcome to WGDashboard",hideTopNav:!0}},{path:"/2FASetup",component:()=>Qe(()=>import("./totp-Dj5ZBaPC.js"),__vite__mapDeps([33,34,1])),meta:{requiresAuth:!0,title:"Multi-Factor Authentication Setup",hideTopNav:!0}},{path:"/share",component:()=>Qe(()=>import("./share-BLXg8Dsp.js"),__vite__mapDeps([35,34,1,36])),meta:{title:"Share",hideTopNav:!0}}]});ms.beforeEach(async(e,t,n)=>{const s=yy(),r=un();e.meta.title?e.params.id?document.title=e.params.id+" | WGDashboard":document.title=e.meta.title+" | WGDashboard":document.title="WGDashboard",r.ShowNavBar=!1,document.querySelector(".loadingBar").classList.remove("loadingDone"),document.querySelector(".loadingBar").classList.add("loading"),e.meta.requiresAuth?r.getActiveCrossServer()?(await r.getConfiguration(),!s.Configurations&&e.name!=="Configuration List"&&await s.getConfigurations(),n()):await by()?(await r.getConfiguration(),!s.Configurations&&e.name!=="Configuration List"&&await s.getConfigurations(),r.Redirect=void 0,n()):(r.Redirect=e,n("/signin"),r.newMessage("WGDashboard","Sign in session ended, please sign in again","warning")):n()});ms.afterEach(()=>{document.querySelector(".loadingBar").classList.remove("loading"),document.querySelector(".loadingBar").classList.add("loadingDone")});const Ff=()=>{let e={"content-type":"application/json"};const n=un().getActiveCrossServer();return n&&(e["wg-dashboard-apikey"]=n.apiKey),e},Hf=e=>{const n=un().getActiveCrossServer();return n?`${n.host}${e}`:`${window.location.protocol}//${(window.location.host+window.location.pathname+e).replace(/\/\//g,"/")}`},jr=async(e,t=void 0,n=void 0)=>{const s=new URLSearchParams(t);await fetch(`${Hf(e)}?${s.toString()}`,{headers:Ff()}).then(r=>{const o=un();if(r.ok)return r.json();if(r.status!==200)throw r.status===401&&o.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(r.statusText)}).then(r=>n?n(r):void 0).catch(r=>{console.log("Error:",r),ms.push({path:"/signin"})})},gb=async(e,t,n)=>{await fetch(`${Hf(e)}`,{headers:Ff(),method:"POST",body:JSON.stringify(t)}).then(s=>{const r=un();if(s.ok)return s.json();if(s.status!==200)throw s.status===401&&r.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(s.statusText)}).then(s=>n?n(s):void 0).catch(s=>{console.log("Error:",s),ms.push({path:"/signin"})})};let Tr;const Ay=new Uint8Array(16);function Ty(){if(!Tr&&(Tr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Tr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Tr(Ay)}const Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function wy(e,t=0){return Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]}const Cy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),dc={randomUUID:Cy};function hc(e,t,n){if(dc.randomUUID&&!t&&!e)return dc.randomUUID();e=e||{};const s=e.random||(e.rng||Ty)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,wy(s)}const un=yf("DashboardConfigurationStore",{state:()=>({Redirect:void 0,Configuration:void 0,Messages:[],Peers:{Selecting:!1,RefreshInterval:void 0},CrossServerConfiguration:{Enable:!1,ServerList:{}},SystemStatus:void 0,ActiveServerConfiguration:void 0,IsElectronApp:!1,ShowNavBar:!1,Locale:void 0}),actions:{initCrossServerConfiguration(){const e=localStorage.getItem("CrossServerConfiguration");localStorage.getItem("ActiveCrossServerConfiguration")!==null&&(this.ActiveServerConfiguration=localStorage.getItem("ActiveCrossServerConfiguration")),e===null?window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration)):this.CrossServerConfiguration=JSON.parse(e)},syncCrossServerConfiguration(){window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration))},addCrossServerConfiguration(){this.CrossServerConfiguration.ServerList[hc().toString()]={host:"",apiKey:"",active:!1}},deleteCrossServerConfiguration(e){delete this.CrossServerConfiguration.ServerList[e]},getActiveCrossServer(){const e=localStorage.getItem("ActiveCrossServerConfiguration");if(e!==null)return this.CrossServerConfiguration.ServerList[e]},setActiveCrossServer(e){this.ActiveServerConfiguration=e,localStorage.setItem("ActiveCrossServerConfiguration",e)},removeActiveCrossServer(){this.ActiveServerConfiguration=void 0,localStorage.removeItem("ActiveCrossServerConfiguration")},async getConfiguration(){await jr("/api/getDashboardConfiguration",{},e=>{e.status&&(this.Configuration=e.data)})},async signOut(){await jr("/api/signout",{},()=>{this.removeActiveCrossServer(),document.cookie="",this.$router.go("/signin")})},newMessage(e,t,n){this.Messages.push({id:hc(),from:kt(e),content:kt(t),type:n,show:!0})},applyLocale(e){if(this.Locale===null)return e;const n=Object.keys(this.Locale).filter(s=>e.match(new RegExp("^"+s+"$","g"))!==null);return console.log(n),n.length===0||n.length>1?e:this.Locale[n[0]]}}});/*! SPDX-License-Identifier: GPL-2.0 * * Copyright (C) 2015-2020 Jason A. Donenfeld . All Rights Reserved. - */(function(){function e(b){var y=new Float64Array(16);if(b)for(var S=0;S>16&1),T[w-1]&=65535;T[15]=A[15]-32767-(T[14]>>16&1),S=T[15]>>16&1,T[14]&=65535,s(A,T,1-S)}for(var w=0;w<16;++w)b[2*w]=A[w]&255,b[2*w+1]=A[w]>>8}function n(b){for(var y=0;y<16;++y)b[(y+1)%16]+=(y<15?1:38)*Math.floor(b[y]/65536),b[y]&=65535}function s(b,y,S){for(var T,A=~(S-1),w=0;w<16;++w)T=A&(b[w]^y[w]),b[w]^=T,y[w]^=T}function r(b,y,S){for(var T=0;T<16;++T)b[T]=y[T]+S[T]|0}function o(b,y,S){for(var T=0;T<16;++T)b[T]=y[T]-S[T]|0}function a(b,y,S){for(var T=new Float64Array(31),A=0;A<16;++A)for(var w=0;w<16;++w)T[A+w]+=y[A]*S[w];for(var A=0;A<15;++A)T[A]+=38*T[A+16];for(var A=0;A<16;++A)b[A]=T[A];n(b),n(b)}function l(b,y){for(var S=e(),T=0;T<16;++T)S[T]=y[T];for(var T=253;T>=0;--T)a(S,S,S),T!==2&&T!==4&&a(S,S,y);for(var T=0;T<16;++T)b[T]=S[T]}function c(b){b[31]=b[31]&127|64,b[0]&=248}function d(b){for(var y,S=new Uint8Array(32),T=e([1]),A=e([9]),w=e(),j=e([1]),B=e(),Q=e(),oe=e([56129,1]),he=e([9]),te=0;te<32;++te)S[te]=b[te];c(S);for(var te=254;te>=0;--te)y=S[te>>>3]>>>(te&7)&1,s(T,A,y),s(w,j,y),r(B,T,w),o(T,T,w),r(w,A,j),o(A,A,j),a(j,B,B),a(Q,T,T),a(T,w,T),a(w,A,B),r(B,T,w),o(T,T,w),a(A,T,T),o(w,j,Q),a(T,w,oe),r(T,T,j),a(w,w,T),a(T,j,Q),a(j,A,he),a(A,B,B),s(T,A,y),s(w,j,y);return l(w,w),a(T,T,w),t(S,T),S}function f(){var b=new Uint8Array(32);return window.crypto.getRandomValues(b),b}function h(){var b=f();return c(b),b}function p(b,y){for(var S=Uint8Array.from([y[0]>>2&63,(y[0]<<4|y[1]>>4)&63,(y[1]<<2|y[2]>>6)&63,y[2]&63]),T=0;T<4;++T)b[T]=S[T]+65+(25-S[T]>>8&6)-(51-S[T]>>8&75)-(61-S[T]>>8&15)+(62-S[T]>>8&3)}function E(b){var y,S=new Uint8Array(44);for(y=0;y<32/3;++y)p(S.subarray(y*4),b.subarray(y*3));return p(S.subarray(y*4),Uint8Array.from([b[y*3+0],b[y*3+1],0])),S[43]=61,String.fromCharCode.apply(null,S)}function x(b){let y=window.atob(b),S=y.length,T=new Uint8Array(S);for(let w=0;w>>8&255,y>>>16&255,y>>>24&255)}function D(b,y){b.push(y&255,y>>>8&255)}function P(b,y){for(var S=0;S>>1:y>>>1;k.table[S]=y}}for(var A=-1,w=0;w>>8^k.table[(A^b[w])&255];return(A^-1)>>>0}function M(b){for(var y=[],S=[],T=0,A=0;A{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Oy={key:0,class:"navbar bg-dark sticky-top","data-bs-theme":"dark"},xy={class:"container-fluid d-flex text-body align-items-center"},Ny={key:0,class:"bi bi-list"},$y={key:1,class:"bi bi-x-lg"},Dy={__name:"App",setup(e){const t=un();t.initCrossServerConfiguration(),window.IS_WGDASHBOARD_DESKTOP&&(t.IsElectronApp=!0,t.CrossServerConfiguration.Enable=!0),Zn(t.CrossServerConfiguration,()=>{t.syncCrossServerConfiguration()},{deep:!0});const n=uy();return(s,r)=>{const o=v_("RouterLink");return Ct(),br(Ve,null,[r[2]||(r[2]=qn("div",{style:{"z-index":"9999",height:"5px"},class:"position-absolute loadingBar top-0 start-0"},null,-1)),vt(n).meta.hideTopNav?ov("",!0):(Ct(),br("nav",Oy,[qn("div",xy,[ye(o,{to:"/",class:"navbar-brand mb-0 h1"},{default:Yn(()=>r[1]||(r[1]=[qn("img",{src:aE,alt:"WGDashboard Logo",style:{width:"32px"}},null,-1)])),_:1}),qn("a",{role:"button",class:"navbarBtn text-body",onClick:r[0]||(r[0]=a=>vt(t).ShowNavBar=!vt(t).ShowNavBar),style:{"line-height":"0","font-size":"2rem"}},[ye(Cl,{name:"fade2",mode:"out-in"},{default:Yn(()=>[vt(t).ShowNavBar?(Ct(),br("i",$y)):(Ct(),br("i",Ny))]),_:1})])])])),(Ct(),Ws(X_,null,{default:Yn(()=>[ye(vt(Rf),null,{default:Yn(({Component:a})=>[ye(Cl,{name:"app",mode:"out-in",type:"transition",appear:""},{default:Yn(()=>[(Ct(),Ws(E_(a)))]),_:2},1024)]),_:1})]),_:1}))],64)}}},Ly=Sy(Dy,[["__scopeId","data-v-7966f302"]]);let uo;await fetch("/api/locale").then(e=>e.json()).then(e=>uo=e.data).catch(()=>{uo=null});const sa=Qv(Ly);sa.use(ms);const Bf=tE();Bf.use(({store:e})=>{e.$router=Zr(ms)});sa.use(Bf);const Ry=un();Ry.Locale=uo;sa.mount("#app");export{ub as $,vt as A,Uv as B,ob as C,un as D,Zn as E,Ve as F,kt as G,db as H,zs as I,pb as J,uy as K,qc as L,Tm as M,Zy as N,Qe as O,Bo as P,fu as Q,Zo as R,X_ as S,Cl as T,mv as U,Wo as V,yy as W,fe as X,ei as Y,ko as Z,Sy as _,Ct as a,vg as a0,Gy as a1,Jy as a2,eb as a3,fb as a4,Wv as a5,rb as a6,zy as a7,nb as a8,sb as a9,qy as aa,rv as ab,av as ac,Te as ad,Qy as ae,hb as af,ib as ag,d_ as ah,ab as ai,qn as b,br as c,ye as d,ov as e,iv as f,jr as g,tb as h,Ws as i,v_ as j,cb as k,E_ as l,Xy as m,Xr as n,Ko as o,lt as p,zr as q,Cn as r,Du as s,Am as t,lb as u,Kv as v,Yn as w,Bl as x,hc as y,gb as z}; + */(function(){function e(b){var y=new Float64Array(16);if(b)for(var S=0;S>16&1),T[w-1]&=65535;T[15]=A[15]-32767-(T[14]>>16&1),S=T[15]>>16&1,T[14]&=65535,s(A,T,1-S)}for(var w=0;w<16;++w)b[2*w]=A[w]&255,b[2*w+1]=A[w]>>8}function n(b){for(var y=0;y<16;++y)b[(y+1)%16]+=(y<15?1:38)*Math.floor(b[y]/65536),b[y]&=65535}function s(b,y,S){for(var T,A=~(S-1),w=0;w<16;++w)T=A&(b[w]^y[w]),b[w]^=T,y[w]^=T}function r(b,y,S){for(var T=0;T<16;++T)b[T]=y[T]+S[T]|0}function o(b,y,S){for(var T=0;T<16;++T)b[T]=y[T]-S[T]|0}function a(b,y,S){for(var T=new Float64Array(31),A=0;A<16;++A)for(var w=0;w<16;++w)T[A+w]+=y[A]*S[w];for(var A=0;A<15;++A)T[A]+=38*T[A+16];for(var A=0;A<16;++A)b[A]=T[A];n(b),n(b)}function l(b,y){for(var S=e(),T=0;T<16;++T)S[T]=y[T];for(var T=253;T>=0;--T)a(S,S,S),T!==2&&T!==4&&a(S,S,y);for(var T=0;T<16;++T)b[T]=S[T]}function c(b){b[31]=b[31]&127|64,b[0]&=248}function d(b){for(var y,S=new Uint8Array(32),T=e([1]),A=e([9]),w=e(),j=e([1]),B=e(),Q=e(),oe=e([56129,1]),he=e([9]),te=0;te<32;++te)S[te]=b[te];c(S);for(var te=254;te>=0;--te)y=S[te>>>3]>>>(te&7)&1,s(T,A,y),s(w,j,y),r(B,T,w),o(T,T,w),r(w,A,j),o(A,A,j),a(j,B,B),a(Q,T,T),a(T,w,T),a(w,A,B),r(B,T,w),o(T,T,w),a(A,T,T),o(w,j,Q),a(T,w,oe),r(T,T,j),a(w,w,T),a(T,j,Q),a(j,A,he),a(A,B,B),s(T,A,y),s(w,j,y);return l(w,w),a(T,T,w),t(S,T),S}function f(){var b=new Uint8Array(32);return window.crypto.getRandomValues(b),b}function h(){var b=f();return c(b),b}function p(b,y){for(var S=Uint8Array.from([y[0]>>2&63,(y[0]<<4|y[1]>>4)&63,(y[1]<<2|y[2]>>6)&63,y[2]&63]),T=0;T<4;++T)b[T]=S[T]+65+(25-S[T]>>8&6)-(51-S[T]>>8&75)-(61-S[T]>>8&15)+(62-S[T]>>8&3)}function E(b){var y,S=new Uint8Array(44);for(y=0;y<32/3;++y)p(S.subarray(y*4),b.subarray(y*3));return p(S.subarray(y*4),Uint8Array.from([b[y*3+0],b[y*3+1],0])),S[43]=61,String.fromCharCode.apply(null,S)}function x(b){let y=window.atob(b),S=y.length,T=new Uint8Array(S);for(let w=0;w>>8&255,y>>>16&255,y>>>24&255)}function D(b,y){b.push(y&255,y>>>8&255)}function P(b,y){for(var S=0;S>>1:y>>>1;k.table[S]=y}}for(var A=-1,w=0;w>>8^k.table[(A^b[w])&255];return(A^-1)>>>0}function M(b){for(var y=[],S=[],T=0,A=0;A{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Oy={key:0,class:"navbar bg-dark sticky-top","data-bs-theme":"dark"},xy={class:"container-fluid d-flex text-body align-items-center"},Ny={key:0,class:"bi bi-list"},$y={key:1,class:"bi bi-x-lg"},Dy={__name:"App",setup(e){const t=un();t.initCrossServerConfiguration(),window.IS_WGDASHBOARD_DESKTOP&&(t.IsElectronApp=!0,t.CrossServerConfiguration.Enable=!0),Zn(t.CrossServerConfiguration,()=>{t.syncCrossServerConfiguration()},{deep:!0});const n=uy();return(s,r)=>{const o=v_("RouterLink");return Ct(),br(Ve,null,[r[2]||(r[2]=qn("div",{style:{"z-index":"9999",height:"5px"},class:"position-absolute loadingBar top-0 start-0"},null,-1)),vt(n).meta.hideTopNav?ov("",!0):(Ct(),br("nav",Oy,[qn("div",xy,[ye(o,{to:"/",class:"navbar-brand mb-0 h1"},{default:Yn(()=>r[1]||(r[1]=[qn("img",{src:aE,alt:"WGDashboard Logo",style:{width:"32px"}},null,-1)])),_:1}),qn("a",{role:"button",class:"navbarBtn text-body",onClick:r[0]||(r[0]=a=>vt(t).ShowNavBar=!vt(t).ShowNavBar),style:{"line-height":"0","font-size":"2rem"}},[ye(Cl,{name:"fade2",mode:"out-in"},{default:Yn(()=>[vt(t).ShowNavBar?(Ct(),br("i",$y)):(Ct(),br("i",Ny))]),_:1})])])])),(Ct(),Ws(X_,null,{default:Yn(()=>[ye(vt(Rf),null,{default:Yn(({Component:a})=>[ye(Cl,{name:"app",mode:"out-in",type:"transition",appear:""},{default:Yn(()=>[(Ct(),Ws(E_(a)))]),_:2},1024)]),_:1})]),_:1}))],64)}}},Ly=Sy(Dy,[["__scopeId","data-v-7966f302"]]);let uo;await fetch("/api/locale").then(e=>e.json()).then(e=>uo=e.data).catch(()=>{uo=null});const sa=Qv(Ly);sa.use(ms);const Bf=tE();Bf.use(({store:e})=>{e.$router=Zr(ms)});sa.use(Bf);const Ry=un();Ry.Locale=uo;sa.mount("#app");export{ub as $,vt as A,Uv as B,db as C,un as D,ob as E,Ve as F,kt as G,Zn as H,zs as I,pb as J,uy as K,qc as L,Tm as M,Zy as N,Qe as O,Bo as P,fu as Q,Zo as R,X_ as S,Cl as T,mv as U,Wo as V,yy as W,fe as X,ei as Y,ko as Z,Sy as _,Ct as a,vg as a0,Gy as a1,Jy as a2,eb as a3,fb as a4,Wv as a5,rb as a6,zy as a7,nb as a8,sb as a9,qy as aa,rv as ab,av as ac,Te as ad,Qy as ae,hb as af,ib as ag,d_ as ah,ab as ai,qn as b,br as c,ye as d,ov as e,iv as f,jr as g,tb as h,Ws as i,v_ as j,cb as k,E_ as l,Xy as m,Xr as n,Ko as o,lt as p,zr as q,Cn as r,Du as s,Am as t,lb as u,Kv as v,Yn as w,Bl as x,hc as y,gb as z}; diff --git a/src/static/app/dist/assets/index-CfW94M3m.js b/src/static/app/dist/assets/index-z-53TFlU.js similarity index 99% rename from src/static/app/dist/assets/index-CfW94M3m.js rename to src/static/app/dist/assets/index-z-53TFlU.js index d61590a..00467ad 100644 --- a/src/static/app/dist/assets/index-CfW94M3m.js +++ b/src/static/app/dist/assets/index-z-53TFlU.js @@ -1,4 +1,4 @@ -import{P as Ws,Q as Vs,R as Ue,U as Hn,r as Wn,o as Vn,V as Nn,E as jn,X as Xe,Y as $n,Z as Ns}from"./index-7qLsecvh.js";/*! +import{P as Ws,Q as Vs,R as Ue,U as Hn,r as Wn,o as Vn,V as Nn,H as jn,X as Xe,Y as $n,Z as Ns}from"./index-CgM9eUIs.js";/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela diff --git a/src/static/app/dist/assets/localeText-BguG5zGd.js b/src/static/app/dist/assets/localeText-Dh33930I.js similarity index 76% rename from src/static/app/dist/assets/localeText-BguG5zGd.js rename to src/static/app/dist/assets/localeText-Dh33930I.js index 3aca0ca..d8154b4 100644 --- a/src/static/app/dist/assets/localeText-BguG5zGd.js +++ b/src/static/app/dist/assets/localeText-Dh33930I.js @@ -1 +1 @@ -import{_ as e,G as t,a as o,c as a,t as c}from"./index-7qLsecvh.js";const s={name:"localeText",props:{t:""},computed:{getLocaleText(){return t(this.t)}}};function n(r,p,l,_,i,x){return o(),a("span",null,c(this.getLocaleText),1)}const u=e(s,[["render",n]]);export{u as L}; +import{_ as e,G as t,a as o,c as a,t as c}from"./index-CgM9eUIs.js";const s={name:"localeText",props:{t:""},computed:{getLocaleText(){return t(this.t)}}};function n(r,p,l,_,i,x){return o(),a("span",null,c(this.getLocaleText),1)}const u=e(s,[["render",n]]);export{u as L}; diff --git a/src/static/app/dist/assets/message-B3dKoq3S.js b/src/static/app/dist/assets/message-C8I98_6p.js similarity index 84% rename from src/static/app/dist/assets/message-B3dKoq3S.js rename to src/static/app/dist/assets/message-C8I98_6p.js index 5536d85..1fd2df0 100644 --- a/src/static/app/dist/assets/message-B3dKoq3S.js +++ b/src/static/app/dist/assets/message-C8I98_6p.js @@ -1 +1 @@ -import{L as l}from"./localeText-BguG5zGd.js";import{d as c}from"./dayjs.min-C341O-eN.js";import{_ as h,a as o,c as a,b as e,d as i,w as u,f as p,t as n,T as g,n as f,j as _}from"./index-7qLsecvh.js";const x={name:"message",methods:{dayjs:c,hide(){this.ct(),this.message.show=!1},show(){this.timeout=setTimeout(()=>{this.message.show=!1},5e3)},ct(){clearTimeout(this.timeout)}},components:{LocaleText:l},props:{message:Object},mounted(){this.show()},data(){return{dismiss:!1,timeout:null}}},v=["id"],b={key:0,class:"d-flex"},w={class:"fw-bold d-block",style:{"text-transform":"uppercase"}},y={class:"ms-auto"},T={key:1},k={class:"card-body d-flex align-items-center gap-3"};function M(j,s,C,L,t,m){const d=_("LocaleText");return o(),a("div",{onMouseenter:s[1]||(s[1]=r=>{t.dismiss=!0,this.ct()}),onMouseleave:s[2]||(s[2]=r=>{t.dismiss=!1,this.show()}),class:"card shadow rounded-3 position-relative message ms-auto",id:this.message.id},[e("div",{class:f([{"text-bg-danger":this.message.type==="danger","text-bg-success":this.message.type==="success","text-bg-warning":this.message.type==="warning"},"card-header pos"])},[i(g,{name:"zoom",mode:"out-in"},{default:u(()=>[t.dismiss?(o(),a("div",T,[e("small",{onClick:s[0]||(s[0]=r=>m.hide()),class:"d-block mx-auto w-100 text-center",style:{cursor:"pointer"}},[s[3]||(s[3]=e("i",{class:"bi bi-x-lg me-2"},null,-1)),i(d,{t:"Dismiss"})])])):(o(),a("div",b,[e("small",w,[i(d,{t:"FROM "}),p(" "+n(this.message.from),1)]),e("small",y,n(m.dayjs().format("hh:mm A")),1)]))]),_:1})],2),e("div",k,[e("div",null,n(this.message.content),1)])],40,v)}const z=h(x,[["render",M],["__scopeId","data-v-94c76b54"]]);export{z as M}; +import{L as l}from"./localeText-Dh33930I.js";import{d as c}from"./dayjs.min-B2wceQaW.js";import{_ as h,a as o,c as a,b as e,d as i,w as u,f as p,t as n,T as g,n as f,j as _}from"./index-CgM9eUIs.js";const x={name:"message",methods:{dayjs:c,hide(){this.ct(),this.message.show=!1},show(){this.timeout=setTimeout(()=>{this.message.show=!1},5e3)},ct(){clearTimeout(this.timeout)}},components:{LocaleText:l},props:{message:Object},mounted(){this.show()},data(){return{dismiss:!1,timeout:null}}},v=["id"],b={key:0,class:"d-flex"},w={class:"fw-bold d-block",style:{"text-transform":"uppercase"}},y={class:"ms-auto"},T={key:1},k={class:"card-body d-flex align-items-center gap-3"};function M(j,s,C,L,t,m){const d=_("LocaleText");return o(),a("div",{onMouseenter:s[1]||(s[1]=r=>{t.dismiss=!0,this.ct()}),onMouseleave:s[2]||(s[2]=r=>{t.dismiss=!1,this.show()}),class:"card shadow rounded-3 position-relative message ms-auto",id:this.message.id},[e("div",{class:f([{"text-bg-danger":this.message.type==="danger","text-bg-success":this.message.type==="success","text-bg-warning":this.message.type==="warning"},"card-header pos"])},[i(g,{name:"zoom",mode:"out-in"},{default:u(()=>[t.dismiss?(o(),a("div",T,[e("small",{onClick:s[0]||(s[0]=r=>m.hide()),class:"d-block mx-auto w-100 text-center",style:{cursor:"pointer"}},[s[3]||(s[3]=e("i",{class:"bi bi-x-lg me-2"},null,-1)),i(d,{t:"Dismiss"})])])):(o(),a("div",b,[e("small",w,[i(d,{t:"FROM "}),p(" "+n(this.message.from),1)]),e("small",y,n(m.dayjs().format("hh:mm A")),1)]))]),_:1})],2),e("div",k,[e("div",null,n(this.message.content),1)])],40,v)}const z=h(x,[["render",M],["__scopeId","data-v-94c76b54"]]);export{z as M}; diff --git a/src/static/app/dist/assets/newConfiguration-CgJ2tQN8.js b/src/static/app/dist/assets/newConfiguration-CWJn2EUf.js similarity index 99% rename from src/static/app/dist/assets/newConfiguration-CgJ2tQN8.js rename to src/static/app/dist/assets/newConfiguration-CWJn2EUf.js index a218fbf..b1be035 100644 --- a/src/static/app/dist/assets/newConfiguration-CgJ2tQN8.js +++ b/src/static/app/dist/assets/newConfiguration-CWJn2EUf.js @@ -1,3 +1,3 @@ -import{p as P}from"./index-L60y6kc9.js";import{_ as x,W as L,r as S,g as k,D as K,z as A,c as l,b as t,d as a,w as U,n as v,e as b,m as p,x as h,t as g,f as w,F as y,h as _,j as C,a as d}from"./index-7qLsecvh.js";import{L as I}from"./localeText-BguG5zGd.js";const N=s=>{const e=s.split(` +import{p as P}from"./index-L60y6kc9.js";import{_ as x,W as L,r as S,g as k,D as K,z as A,c as l,b as t,d as a,w as U,n as v,e as b,m as p,x as h,t as g,f as w,F as y,h as _,j as C,a as d}from"./index-CgM9eUIs.js";import{L as I}from"./localeText-Dh33930I.js";const N=s=>{const e=s.split(` `),i={};for(let c of e){if(c==="[Peer]")break;if(c.length>0){let n=c.replace(" = ","=");n.indexOf("=")>-1&&(n=[n.slice(0,n.indexOf("=")),n.slice(n.indexOf("=")+1)],n[0]==="ListenPort"?i[n[0]]=parseInt(n[1]):i[n[0]]=n[1])}}return i},O=s=>{const e=s.split(` `),i=[];let c=-1;const n=e.indexOf("[Peer]");if(n===-1)return!1;for(let u=n;u-1&&(f=[f.slice(0,f.indexOf("=")),f.slice(f.indexOf("=")+1)],i[c][f[0]]=f[1])}return i},q={name:"newConfiguration",components:{LocaleText:I},async setup(){const s=L(),e=S([]);await k("/api/protocolsEnabled",{},c=>{e.value=c.data});const i=K();return{store:s,protocols:e,dashboardStore:i}},data(){return{newConfiguration:{ConfigurationName:"",Address:"",ListenPort:"",PrivateKey:"",PublicKey:"",PresharedKey:"",PreUp:"",PreDown:"",PostUp:"",PostDown:"",Protocol:"wg",Jc:5,Jmin:49,Jmax:998,S1:17,S2:110,H1:0,H2:0,H3:0,H4:0},numberOfAvailableIPs:"0",error:!1,errorMessage:"",success:!1,loading:!1,parseInterfaceResult:void 0,parsePeersResult:void 0}},created(){this.wireguardGenerateKeypair();let s=[];for(;[...new Set(s)].length!==4;)s=[this.rand(1,2**31-1),this.rand(1,2**31-1),this.rand(1,2**31-1),this.rand(1,2**31-1)];this.newConfiguration.H1=s[0],this.newConfiguration.H2=s[1],this.newConfiguration.H3=s[2],this.newConfiguration.H4=s[3]},methods:{rand(s,e){return Math.floor(Math.random()*(e-s)+s)},wireguardGenerateKeypair(){const s=window.wireguard.generateKeypair();this.newConfiguration.PrivateKey=s.privateKey,this.newConfiguration.PublicKey=s.publicKey,this.newConfiguration.PresharedKey=s.presharedKey},async saveNewConfiguration(){this.goodToSubmit&&(this.loading=!0,await A("/api/addWireguardConfiguration",this.newConfiguration,async s=>{s.status?(this.success=!0,await this.store.getConfigurations(),this.$router.push(`/configuration/${this.newConfiguration.ConfigurationName}/peers`)):(this.error=!0,this.errorMessage=s.message,document.querySelector(`#${s.data}`).classList.remove("is-valid"),document.querySelector(`#${s.data}`).classList.add("is-invalid"),this.loading=!1)}))},openFileUpload(){document.querySelector("#fileUpload").click()},readFile(s){const e=s.target.files[0];if(!e)return!1;const i=new FileReader;i.onload=c=>{this.parseInterfaceResult=N(c.target.result),this.parsePeersResult=O(c.target.result);let n=0;if(this.parseInterfaceResult){this.newConfiguration.ConfigurationName=e.name.replace(".conf","");for(let u of Object.keys(this.parseInterfaceResult))Object.keys(this.newConfiguration).includes(u)&&(this.newConfiguration[u]=this.parseInterfaceResult[u],n+=1)}n>0?this.dashboardStore.newMessage("WGDashboard",`Parse successful! Updated ${n} field(s)`,"success"):this.dashboardStore.newMessage("WGDashboard","Parse failed","danger")},i.readAsText(e)}},computed:{goodToSubmit(){let s=["ConfigurationName","Address","ListenPort","PrivateKey"],e=[...document.querySelectorAll("input[required]")];return s.find(i=>this.newConfiguration[i].length===0)===void 0&&e.find(i=>i.classList.contains("is-invalid"))===void 0}},watch:{"newConfiguration.Address"(s){let e=document.querySelector("#Address");e.classList.remove("is-invalid","is-valid");try{if(s.trim().split("/").filter(n=>n.length>0).length!==2)throw Error();let i=P(s),c=i.end-i.start;this.numberOfAvailableIPs=c.toLocaleString(),e.classList.add("is-valid")}catch{this.numberOfAvailableIPs="0",e.classList.add("is-invalid")}},"newConfiguration.ListenPort"(s){let e=document.querySelector("#ListenPort");e.classList.remove("is-invalid","is-valid"),s<0||s>65353||!Number.isInteger(s)?e.classList.add("is-invalid"):e.classList.add("is-valid")},"newConfiguration.ConfigurationName"(s){let e=document.querySelector("#ConfigurationName");e.classList.remove("is-invalid","is-valid"),!/^[a-zA-Z0-9_=+.-]{1,15}$/.test(s)||s.length===0||this.store.Configurations.find(i=>i.Name===s)?e.classList.add("is-invalid"):e.classList.add("is-valid")},"newConfiguration.PrivateKey"(s){let e=document.querySelector("#PrivateKey");e.classList.remove("is-invalid","is-valid");try{wireguard.generatePublicKey(s),e.classList.add("is-valid")}catch{e.classList.add("is-invalid")}}},mounted(){document.querySelector("#fileUpload").addEventListener("change",this.readFile,!1)}},D={class:"mt-md-5 mt-3 text-body"},R={class:"container mb-4"},H={class:"mb-4 d-flex align-items-center gap-4 align-items-center"},$={class:"mb-0"},M={class:"d-flex gap-2 ms-auto"},F={class:"card rounded-3 shadow"},G={class:"card-header"},T={class:"card-body d-flex gap-2 protocolBtnGroup"},V={key:0,class:"bi bi-check-circle-fill me-2"},B={key:1,class:"bi bi-circle me-2"},W={key:0,class:"bi bi-check-circle-fill me-2"},J={key:1,class:"bi bi-circle me-2"},z={class:"card rounded-3 shadow"},E={class:"card-header"},j={class:"card-body"},Z=["disabled"],Q={class:"invalid-feedback"},X={key:0},Y={key:1},ee={class:"mb-0"},te={class:"card rounded-3 shadow"},se={class:"card-header"},ie={class:"card-body",style:{"font-family":"var(--bs-font-monospace)"}},oe={class:"mb-2"},ne={class:"text-muted fw-bold mb-1"},ae={class:"input-group"},re=["disabled"],le={class:"text-muted fw-bold mb-1"},de={class:"card rounded-3 shadow"},ce={class:"card-header"},ue={class:"card-body"},fe=["disabled"],pe={class:"invalid-feedback"},he={key:0},ge={key:1},me={class:"card rounded-3 shadow"},be={class:"card-header d-flex align-items-center"},ve={class:"badge rounded-pill text-bg-success ms-auto"},we={class:"card-body"},ye=["disabled"],_e={class:"invalid-feedback"},Ce={key:0},Pe={key:1},xe={class:"accordion",id:"newConfigurationOptionalAccordion"},Le={class:"accordion-item"},Se={class:"accordion-header"},ke={class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#newConfigurationOptionalAccordionCollapse"},Ke={id:"newConfigurationOptionalAccordionCollapse",class:"accordion-collapse collapse","data-bs-parent":"#newConfigurationOptionalAccordion"},Ae={class:"accordion-body d-flex flex-column gap-3"},Ue={class:"card rounded-3"},Ie={class:"card-header"},Ne={class:"card-body"},Oe=["id","onUpdate:modelValue"],qe={class:"card rounded-3"},De={class:"card-header"},Re={class:"card-body"},He=["id","onUpdate:modelValue"],$e=["disabled"],Me={key:0,class:"d-flex w-100"},Fe={key:1,class:"d-flex w-100"},Ge={key:2,class:"d-flex w-100 align-items-center"};function Te(s,e,i,c,n,u){const f=C("RouterLink"),r=C("LocaleText");return d(),l("div",D,[t("div",R,[t("div",H,[a(f,{to:"/",class:"btn btn-dark btn-brand p-2 shadow",style:{"border-radius":"100%"}},{default:U(()=>e[10]||(e[10]=[t("h2",{class:"mb-0",style:{"line-height":"0"}},[t("i",{class:"bi bi-arrow-left-circle"})],-1)])),_:1}),t("h2",$,[a(r,{t:"New Configuration"})]),t("div",M,[t("button",{class:"titleBtn py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:e[0]||(e[0]=o=>u.openFileUpload()),type:"button","aria-expanded":"false"},[e[11]||(e[11]=t("i",{class:"bi bi-upload me-2"},null,-1)),a(r,{t:"Open File"})]),e[12]||(e[12]=t("input",{type:"file",id:"fileUpload",multiple:"",class:"d-none",accept:"text/plain"},null,-1))])]),t("form",{class:"text-body d-flex flex-column gap-3",onSubmit:e[9]||(e[9]=o=>{o.preventDefault(),this.saveNewConfiguration()})},[t("div",F,[t("div",G,[a(r,{t:"Protocol"})]),t("div",T,[this.protocols.includes("wg")?(d(),l("a",{key:0,onClick:e[1]||(e[1]=o=>this.newConfiguration.Protocol="wg"),class:v([{"opacity-50":this.newConfiguration.Protocol!=="wg"},"btn btn-primary wireguardBg border-0"]),style:{"flex-basis":"100%"}},[this.newConfiguration.Protocol==="wg"?(d(),l("i",V)):(d(),l("i",B)),e[13]||(e[13]=t("strong",null," WireGuard ",-1))],2)):b("",!0),this.protocols.includes("awg")?(d(),l("a",{key:1,onClick:e[2]||(e[2]=o=>this.newConfiguration.Protocol="awg"),class:v([{"opacity-50":this.newConfiguration.Protocol!=="awg"},"btn btn-primary amneziawgBg border-0"]),style:{"flex-basis":"100%"}},[this.newConfiguration.Protocol==="awg"?(d(),l("i",W)):(d(),l("i",J)),e[14]||(e[14]=t("strong",null," AmneziaWG ",-1))],2)):b("",!0)])]),t("div",z,[t("div",E,[a(r,{t:"Configuration Name"})]),t("div",j,[p(t("input",{type:"text",class:"form-control",placeholder:"ex. wg1",id:"ConfigurationName","onUpdate:modelValue":e[3]||(e[3]=o=>this.newConfiguration.ConfigurationName=o),disabled:this.loading,required:""},null,8,Z),[[h,this.newConfiguration.ConfigurationName]]),t("div",Q,[this.error?(d(),l("div",X,g(this.errorMessage),1)):(d(),l("div",Y,[a(r,{t:"Configuration name is invalid. Possible reasons:"}),t("ul",ee,[t("li",null,[a(r,{t:"Configuration name already exist."})]),t("li",null,[a(r,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])]))])])]),t("div",te,[t("div",se,[a(r,{t:"Private Key"}),e[15]||(e[15]=w(" & ")),a(r,{t:"Public Key"})]),t("div",ie,[t("div",oe,[t("label",ne,[t("small",null,[a(r,{t:"Private Key"})])]),t("div",ae,[p(t("input",{type:"text",class:"form-control",id:"PrivateKey",required:"",disabled:this.loading,"onUpdate:modelValue":e[4]||(e[4]=o=>this.newConfiguration.PrivateKey=o)},null,8,re),[[h,this.newConfiguration.PrivateKey]]),t("button",{class:"btn btn-outline-primary",type:"button",title:"Regenerate Private Key",onClick:e[5]||(e[5]=o=>u.wireguardGenerateKeypair())},e[16]||(e[16]=[t("i",{class:"bi bi-arrow-repeat"},null,-1)]))])]),t("div",null,[t("label",le,[t("small",null,[a(r,{t:"Public Key"})])]),p(t("input",{type:"text",class:"form-control",id:"PublicKey","onUpdate:modelValue":e[6]||(e[6]=o=>this.newConfiguration.PublicKey=o),disabled:""},null,512),[[h,this.newConfiguration.PublicKey]])])])]),t("div",de,[t("div",ce,[a(r,{t:"Listen Port"})]),t("div",ue,[p(t("input",{type:"number",class:"form-control",placeholder:"0-65353",id:"ListenPort",min:"1",max:"65353","onUpdate:modelValue":e[7]||(e[7]=o=>this.newConfiguration.ListenPort=o),disabled:this.loading,required:""},null,8,fe),[[h,this.newConfiguration.ListenPort]]),t("div",pe,[this.error?(d(),l("div",he,g(this.errorMessage),1)):(d(),l("div",ge,[a(r,{t:"Invalid port"})]))])])]),t("div",me,[t("div",be,[a(r,{t:"IP Address/CIDR"}),t("span",ve,g(n.numberOfAvailableIPs)+" Available IPs",1)]),t("div",we,[p(t("input",{type:"text",class:"form-control",placeholder:"Ex: 10.0.0.1/24",id:"Address","onUpdate:modelValue":e[8]||(e[8]=o=>this.newConfiguration.Address=o),disabled:this.loading,required:""},null,8,ye),[[h,this.newConfiguration.Address]]),t("div",_e,[this.error?(d(),l("div",Ce,g(this.errorMessage),1)):(d(),l("div",Pe," IP Address/CIDR is invalid "))])])]),e[21]||(e[21]=t("hr",null,null,-1)),t("div",xe,[t("div",Le,[t("h2",Se,[t("button",ke,[a(r,{t:"Optional Settings"})])]),t("div",Ke,[t("div",Ae,[(d(),l(y,null,_(["PreUp","PreDown","PostUp","PostDown"],o=>t("div",Ue,[t("div",Ie,g(o),1),t("div",Ne,[p(t("input",{type:"text",class:"form-control font-monospace",id:o,"onUpdate:modelValue":m=>this.newConfiguration[o]=m},null,8,Oe),[[h,this.newConfiguration[o]]])])])),64)),this.newConfiguration.Protocol==="awg"?(d(),l(y,{key:0},_(["Jc","Jmin","Jmax","S1","S2","H1","H2","H3","H4"],o=>t("div",qe,[t("div",De,g(o),1),t("div",Re,[p(t("input",{type:"text",class:"form-control font-monospace",id:o,"onUpdate:modelValue":m=>this.newConfiguration[o]=m},null,8,He),[[h,this.newConfiguration[o]]])])])),64)):b("",!0)])])])]),t("button",{class:"btn btn-dark btn-brand rounded-3 px-3 py-2 shadow ms-auto",disabled:!this.goodToSubmit||this.loading||this.success},[this.success?(d(),l("span",Me,[a(r,{t:"Success"}),e[17]||(e[17]=w("! ")),e[18]||(e[18]=t("i",{class:"bi bi-check-circle-fill ms-2"},null,-1))])):this.loading?(d(),l("span",Ge,[a(r,{t:"Saving..."}),e[20]||(e[20]=t("span",{class:"ms-2 spinner-border spinner-border-sm",role:"status"},null,-1))])):(d(),l("span",Fe,[e[19]||(e[19]=t("i",{class:"bi bi-save-fill me-2"},null,-1)),a(r,{t:"Save"})]))],8,$e)],32)])])}const Je=x(q,[["render",Te],["__scopeId","data-v-141f725f"]]);export{Je as default}; diff --git a/src/static/app/dist/assets/osmap-CVrWGfN8.js b/src/static/app/dist/assets/osmap-CVrWGfN8.js deleted file mode 100644 index f890c3f..0000000 --- a/src/static/app/dist/assets/osmap-CVrWGfN8.js +++ /dev/null @@ -1,10 +0,0 @@ -import{_ as el,D as il,a as nl,c as sl,e as rl}from"./index-7qLsecvh.js";class fe{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const di={PROPERTYCHANGE:"propertychange"};class Wn{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function ol(n,t,e){let i,s;e=e||ae;let r=0,o=n.length,a=!1;for(;r>1),s=+e(n[i],t),s<0?r=i+1:(o=i,a=!s);return a?r:~r}function ae(n,t){return n>t?1:n0?s-1:s}return i-1}if(e>0){for(let s=1;s0||o===0)})}function Wi(){return!0}function Zn(){return!1}function fi(){}function No(n){let t,e,i;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==i||!Ae(s,e))&&(i=this,e=s,t=n.apply(this,arguments)),t}}function hl(n){function t(){let e;try{e=n()}catch(i){return Promise.reject(i)}return e instanceof Promise?e:Promise.resolve(e)}return t()}function nn(n){for(const t in n)delete n[t]}function gi(n){let t;for(t in n)return!1;return!t}class Kn extends Wn{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),s=i[t]||(i[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,s=this.listeners_&&this.listeners_[i];if(!s)return;const r=e?new fe(t):t;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let c=0,h=s.length;c0:!1}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const s=i.indexOf(e);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[s]=fi,++this.pendingRemovals_[t]):(i.splice(s,1),i.length===0&&delete this.listeners_[t]))}}const z={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function V(n,t,e,i,s){if(s){const o=e;e=function(){n.removeEventListener(t,e),o.apply(i??this,arguments)}}else i&&i!==n&&(e=e.bind(i));const r={target:n,type:t,listener:e};return n.addEventListener(t,e),r}function vn(n,t,e,i){return V(n,t,e,i,!0)}function tt(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),nn(n))}class sn extends Kn{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(z.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,s=new Array(i);for(let r=0;r0;)this.pop()}extend(t){for(let e=0,i=t.length;ethis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new gn(wt.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,s=e.length;i=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new gn(wt.REMOVE,e,t)),e}setAt(t,e){const i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new gn(wt.REMOVE,s,t)),this.dispatchEvent(new gn(wt.ADD,e,t))}updateLength_(){this.set(Nr.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,s=this.array_.length;i1?(e=s,i=r):l>0&&(e+=o*l,i+=a*l)}return hi(n,t,e,i)}function hi(n,t,e,i){const s=e-n,r=i-t;return s*s+r*r}function fl(n){const t=n.length;for(let i=0;ir&&(r=l,s=a)}if(r===0)return null;const o=n[s];n[s]=n[i],n[i]=o;for(let a=i+1;a=0;i--){e[i]=n[i][t]/n[i][i];for(let s=i-1;s>=0;s--)n[s][t]-=n[s][i]*e[i]}return e}function In(n){return n*Math.PI/180}function ci(n,t){const e=n%t;return e*t<0?e+t:e}function St(n,t,e){return n+e*(t-n)}function Vs(n,t){const e=Math.pow(10,t);return Math.round(n*e)/e}function _n(n,t){return Math.floor(Vs(n,t))}function mn(n,t){return Math.ceil(Vs(n,t))}class Go extends $t{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[J.OPACITY]=t.opacity!==void 0?t.opacity:1,j(typeof e[J.OPACITY]=="number","Layer opacity must be a number"),e[J.VISIBLE]=t.visible!==void 0?t.visible:!0,e[J.Z_INDEX]=t.zIndex,e[J.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[J.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[J.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[J.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},i=this.getZIndex();return e.opacity=st(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return U()}getLayerStatesArray(t){return U()}getExtent(){return this.get(J.EXTENT)}getMaxResolution(){return this.get(J.MAX_RESOLUTION)}getMinResolution(){return this.get(J.MIN_RESOLUTION)}getMinZoom(){return this.get(J.MIN_ZOOM)}getMaxZoom(){return this.get(J.MAX_ZOOM)}getOpacity(){return this.get(J.OPACITY)}getSourceState(){return U()}getVisible(){return this.get(J.VISIBLE)}getZIndex(){return this.get(J.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(J.EXTENT,t)}setMaxResolution(t){this.set(J.MAX_RESOLUTION,t)}setMinResolution(t){this.set(J.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(J.MAX_ZOOM,t)}setMinZoom(t){this.set(J.MIN_ZOOM,t)}setOpacity(t){j(typeof t=="number","Layer opacity must be a number"),this.set(J.OPACITY,t)}setVisible(t){this.set(J.VISIBLE,t)}setZIndex(t){this.set(J.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Ot={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},mt={ANIMATING:0,INTERACTING:1},Nt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},gl=42,Us=256,js={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class zo{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||js[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const rn=6378137,oi=Math.PI*rn,_l=[-oi,-oi,oi,oi],ml=[-180,-85,180,85],pn=rn*Math.log(Math.tan(Math.PI/2));class je extends zo{constructor(t){super({code:t,units:"m",extent:_l,global:!0,worldExtent:ml,getPointResolution:function(e,i){return e/Math.cosh(i[1]/rn)}})}}const Gr=[new je("EPSG:3857"),new je("EPSG:102100"),new je("EPSG:102113"),new je("EPSG:900913"),new je("http://www.opengis.net/def/crs/EPSG/0/3857"),new je("http://www.opengis.net/gml/srs/epsg.xml#3857")];function pl(n,t,e,i){const s=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(s));for(let r=0;rpn?o=pn:o<-pn&&(o=-pn),t[r+1]=o}return t}function yl(n,t,e,i){const s=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(s));for(let r=0;rs&&(l=l|ht.RIGHT),ar&&(l=l|ht.ABOVE),l===ht.UNKNOWN&&(l=ht.INTERSECTING),l}function Ft(){return[1/0,1/0,-1/0,-1/0]}function Se(n,t,e,i,s){return s?(s[0]=n,s[1]=t,s[2]=e,s[3]=i,s):[n,t,e,i]}function Bn(n){return Se(1/0,1/0,-1/0,-1/0,n)}function Yo(n,t){const e=n[0],i=n[1];return Se(e,i,e,i,t)}function $s(n,t,e,i,s){const r=Bn(s);return Zo(r,n,t,e,i)}function Yi(n,t){return n[0]==t[0]&&n[2]==t[2]&&n[1]==t[1]&&n[3]==t[3]}function Tl(n,t){return t[0]n[2]&&(n[2]=t[2]),t[1]n[3]&&(n[3]=t[3]),n}function zi(n,t){t[0]n[2]&&(n[2]=t[0]),t[1]n[3]&&(n[3]=t[1])}function Zo(n,t,e,i,s){for(;et[0]?i[0]=n[0]:i[0]=t[0],n[1]>t[1]?i[1]=n[1]:i[1]=t[1],n[2]=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function Hn(n){return n[2]=o&&_<=l),!i&&r&ht.RIGHT&&!(s&ht.RIGHT)&&(m=f-(d-l)*g,i=m>=a&&m<=c),!i&&r&ht.BELOW&&!(s&ht.BELOW)&&(_=d-(f-a)/g,i=_>=o&&_<=l),!i&&r&ht.LEFT&&!(s&ht.LEFT)&&(m=f-(d-o)*g,i=m>=a&&m<=c)}return i}function Bo(n,t){const e=t.getExtent(),i=Xe(n);if(t.canWrapX()&&(i[0]=e[2])){const s=q(e),o=Math.floor((i[0]-e[0])/s)*s;n[0]-=o,n[2]-=o}return n}function Js(n,t,e){if(t.canWrapX()){const i=t.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[i[0],n[1],i[2],n[3]]];Bo(n,t);const s=q(i);if(q(n)>s&&!e)return[[i[0],n[1],i[2],n[3]]];if(n[0]i[2])return[[n[0],n[1],i[2],n[3]],[i[0],n[1],n[2]-s,n[3]]]}return[n]}function Ml(n,t){return n[0]+=+t[0],n[1]+=+t[1],n}function Ln(n,t){let e=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=t[i]){e=!1;break}return e}function Qs(n,t){const e=Math.cos(t),i=Math.sin(t),s=n[0]*e-n[1]*i,r=n[1]*e+n[0]*i;return n[0]=s,n[1]=r,n}function bl(n,t){return n[0]*=t,n[1]*=t,n}function Vo(n,t){if(t.canWrapX()){const e=q(t.getExtent()),i=Dl(n,t,e);i&&(n[0]-=i*e)}return n}function Dl(n,t,e){const i=t.getExtent();let s=0;return t.canWrapX()&&(n[0]i[2])&&(e=e||q(i),s=Math.floor((n[0]-i[0])/e)),s}const Pl=63710088e-1;function Yr(n,t,e){e=e||Pl;const i=In(n[1]),s=In(t[1]),r=(s-i)/2,o=In(t[0]-n[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(s);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function Uo(...n){console.warn(...n)}let Os=!0;function jo(n){Os=!1}function tr(n,t){if(t!==void 0){for(let e=0,i=n.length;e=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Os=!1,Uo("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function $o(n,t){return n}function Te(n,t){return n}function Nl(){Kr(Gr),Kr(Xr),kl(Xr,Gr,pl,yl)}Nl();function Br(n,t,e){return function(i,s,r,o,a){if(!i)return;if(!s&&!t)return i;const l=t?0:r[0]*s,c=t?0:r[1]*s,h=a?a[0]:0,u=a?a[1]:0;let d=n[0]+l/2+h,f=n[2]-l/2+h,g=n[1]+c/2+u,_=n[3]-c/2+u;d>f&&(d=(f+d)/2,f=d),g>_&&(g=(_+g)/2,_=g);let m=st(i[0],d,f),p=st(i[1],g,_);if(o&&e&&s){const y=30*s;m+=-y*Math.log(1+Math.max(0,d-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-f)/y),p+=-y*Math.log(1+Math.max(0,g-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-_)/y)}return[m,p]}}function Gl(n){return n}function nr(n,t,e,i){const s=q(t)/e[0],r=pt(t)/e[1];return i?Math.min(n,Math.max(s,r)):Math.min(n,Math.min(s,r))}function sr(n,t,e){let i=Math.min(n,t);const s=50;return i*=Math.log(1+s*Math.max(0,n/t-1))/s+1,e&&(i=Math.max(i,e),i/=Math.log(1+s*Math.max(0,e/n-1))/s+1),st(i,e/2,t*2)}function zl(n,t,e,i){return t=t!==void 0?t:!0,function(s,r,o,a){if(s!==void 0){const l=n[0],c=n[n.length-1],h=e?nr(l,e,o,i):l;if(a)return t?sr(s,h,c):st(s,c,h);const u=Math.min(h,s),d=Math.floor(Bs(n,u,r));return n[d]>h&&dMath.round(e*jr[i])/jr[i]).join(", ")+")"}function ve(n,t,e,i,s,r,o){r=r||[],o=o||2;let a=0;for(let l=t;l{if(!i)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(i),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return U()}closestPointXY(t,e,i,s){return U()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return U()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Bn(e),this.extentRevision_=this.getRevision()}return Ll(this.extent_,t)}rotate(t,e){U()}scale(t,e,i){U()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return U()}getType(){return U()}applyTransform(t){U()}intersectsExtent(t){return U()}translate(t,e){U()}transform(t,e){const i=kt(t),s=i.getUnits()=="tile-pixels"?function(r,o,a){const l=i.getExtent(),c=i.getWorldExtent(),h=pt(c)/pt(l);return de(Hr,c[0],c[3],h,-h,0,0,0),ve(r,0,r.length,a,Hr,o),An(i,e)(r,o,a)}:An(i,e);return this.applyTransform(s),this}}class qn extends ql{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return $s(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return U()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length1)u=e;else if(d>0){for(let f=0;fs&&(s=c),r=a,o=l}return s}function Ql(n,t,e,i,s){for(let r=0,o=e.length;r0;){const u=c.pop(),d=c.pop();let f=0;const g=n[d],_=n[d+1],m=n[u],p=n[u+1];for(let y=d+i;yf&&(h=y,f=w)}f>s&&(l[(h-t)/i]=1,d+i0&&_>f)&&(g<0&&m0&&m>g)){c=u,h=d;continue}r[o++]=c,r[o++]=h,a=c,l=h,c=u,h=d}return r[o++]=c,r[o++]=h,o}function ea(n,t,e,i,s,r,o,a){for(let l=0,c=e.length;lr&&(c-a)*(r-l)-(s-a)*(h-l)>0&&o++:h<=r&&(c-a)*(r-l)-(s-a)*(h-l)<0&&o--,a=c,l=h}return o!==0}function na(n,t,e,i,s,r){if(e.length===0||!Ne(n,t,e[0],i,s,r))return!1;for(let o=1,a=e.length;op&&(c=(h+u)/2,na(n,t,e,i,c,g)&&(m=c,p=y)),h=u}return isNaN(m)&&(m=s[r]),o?(o.push(m,g,p),o):[m,g,p]}function ah(n,t,e,i,s){let r=[];for(let o=0,a=e.length;o=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:sa(n,t,e,i,function(o,a){return Al(s,o,a)}):!1}function ra(n,t,e,i,s){return!!(cr(n,t,e,i,s)||Ne(n,t,e,i,s[0],s[1])||Ne(n,t,e,i,s[0],s[3])||Ne(n,t,e,i,s[2],s[1])||Ne(n,t,e,i,s[2],s[3]))}function lh(n,t,e,i,s){if(!ra(n,t,e[0],i,s))return!1;if(e.length===1)return!0;for(let r=1,o=e.length;r0}function ch(n,t,e,i,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let s=0;for(;s0}getInteracting(){return this.hints_[mt.INTERACTING]>0}cancelAnimations(){this.setHint(mt.ANIMATING,-this.hints_[mt.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e=0;--i){const s=this.animations_[i];let r=!0;for(let o=0,a=s.length;o0?c/l.duration:1;h>=1?(l.complete=!0,h=1):r=!1;const u=l.easing(h);if(l.sourceCenter){const d=l.sourceCenter[0],f=l.sourceCenter[1],g=l.targetCenter[0],_=l.targetCenter[1];this.nextCenter_=l.targetCenter;const m=d+u*(g-d),p=f+u*(_-f);this.targetCenter_=[m,p]}if(l.sourceResolution&&l.targetResolution){const d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const f=this.getViewportSize_(this.getRotation()),g=this.constraints_.resolution(d,0,f,!0);this.targetCenter_=this.calculateCenterZoom(g,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=u===1?ci(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const f=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(f,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(r){this.animations_[i]=null,this.setHint(mt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&yn(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const s=this.getCenterInternal();return s!==void 0&&(i=[s[0]-e[0],s[1]-e[1]],Qs(i,t-this.getRotation()),Ml(i,e)),i}calculateCenterZoom(t,e){let i;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=e[0]-t*(e[0]-s[0])/r,a=e[1]-t*(e[1]-s[1])/r;i=[o,a]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],s=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(s*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&Fs(t,this.getProjection())}getCenterInternal(){return this.get(Nt.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return $o(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();j(e,"The view center is not defined");const i=this.getResolution();j(i!==void 0,"The view resolution is not defined");const s=this.getRotation();return j(s!==void 0,"The view rotation is not defined"),Ps(e,i,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Nt.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(Te(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=q(t)/e[0],s=pt(t)/e[1];return Math.max(i,s)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,s=Math.log(e/i)/Math.log(t);return function(r){return e/Math.pow(t,r*s)}}getRotation(){return this.get(Nt.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(i/s)/e;return function(o){return Math.log(i/o)/e/r}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=gs(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,i)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,i,s;if(this.resolutions_){const r=Bs(this.resolutions_,t,1);e=r,i=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=i/this.resolutions_[r+1]}else i=this.maxResolution_,s=this.zoomFactor_;return e+Math.log(i/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const e=st(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,st(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(j(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){j(!Hn(t),"Cannot fit empty extent provided as `geometry`");const s=Te(t,this.getProjection());i=to(s)}else if(t.getType()==="Circle"){const s=Te(t.getExtent(),this.getProjection());i=to(s),i.rotate(this.getRotation(),Xe(s))}else i=t;this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),s=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,c=-1/0,h=-1/0;for(let u=0,d=r.length;u{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof Vt?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let s;e.layerStatesArray?s=e.layerStatesArray.find(o=>o.layer===this):s=this.getLayerState();const r=this.getExtent();return dr(s,e.viewState)&&(!r||Tt(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];const i=t instanceof Vt?t.getViewStateAndExtent():t;let s=e(i);return Array.isArray(s)||(s=[s]),s}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(J.MAP,t)}getMapInternal(){return this.get(J.MAP)}setMap(t){this.mapPrecomposeKey_&&(tt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(tt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=V(t,Ot.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=V(this,z.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,i=this.getLayerState(!1);j(!e.some(s=>s.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(i)}setSource(t){this.set(J.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function dr(n,t){if(!n.visible)return!1;const e=t.resolution;if(e=n.maxResolution)return!1;const i=t.zoom;return i>n.minZoom&&i<=n.maxZoom}function oa(n,t,e=0,i=n.length-1,s=mh){for(;i>e;){if(i-e>600){const l=i-e+1,c=t-e+1,h=Math.log(l),u=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(e,Math.floor(t-c*u/l+d)),g=Math.min(i,Math.floor(t+(l-c)*u/l+d));oa(n,t,f,g,s)}const r=n[t];let o=e,a=i;for(Ai(n,e,t),s(n[i],r)>0&&Ai(n,e,i);o0;)a--}s(n[e],r)===0?Ai(n,e,a):(a++,Ai(n,a,i)),a<=t&&(e=a+1),t<=a&&(i=a-1)}}function Ai(n,t,e){const i=n[t];n[t]=n[e],n[e]=i}function mh(n,t){return nt?1:0}let aa=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!xn(t,e))return i;const s=this.toBBox,r=[];for(;e;){for(let o=0;o=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)}_split(t,e){const i=t[e],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);const o=this._chooseSplitIndex(i,r,s),a=ii(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,He(i,this.toBBox),He(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=ii([t,e]),this.data.height=t.height+1,this.data.leaf=!1,He(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let s,r=1/0,o=1/0;for(let a=e;a<=i-e;a++){const l=Pi(t,0,a,this.toBBox),c=Pi(t,a,i,this.toBBox),h=wh(l,c),u=_s(l)+_s(c);h=e;c--){const h=t.children[c];Oi(a,t.leaf?r(h):h),l+=En(a)}return l}_adjustParentBBoxes(t,e,i){for(let s=i;s>=0;s--)Oi(e[s],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)t[e].children.length===0?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():He(t[e],this.toBBox)}};function ph(n,t,e){if(!e)return t.indexOf(n);for(let i=0;i=n.minX&&t.maxY>=n.minY}function ii(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function eo(n,t,e,i,s){const r=[t,e];for(;r.length;){if(e=r.pop(),t=r.pop(),e-t<=i)continue;const o=t+Math.ceil((e-t)/i/2)*i;oa(n,o,t,e,s),r.push(t,o,o,e)}}const Y={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function io(n){return n[0]>0&&n[1]>0}function Ch(n,t,e){return e===void 0&&(e=[0,0]),e[0]=n[0]*t+.5|0,e[1]=n[1]*t+.5|0,e}function vt(n,t){return Array.isArray(n)?n:(t===void 0?t=[n,n]:(t[0]=n,t[1]=n),t)}class Qn{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=vt(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Qn({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return U()}getImage(t){return U()}getHitDetectionImage(){return U()}getPixelRatio(t){return 1}getImageState(){return U()}getImageSize(){return U()}getOrigin(){return U()}getSize(){return U()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=vt(t)}listenImageChange(t){U()}load(){U()}unlistenImageChange(t){U()}ready(){return Promise.resolve()}}const Ui={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var ft={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};ft.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}};ft.max=ft.whitepoint[2].D65;ft.rgb=function(n,t){t=t||ft.whitepoint[2].E;var e=n[0]/t[0],i=n[1]/t[1],s=n[2]/t[2],r,o,a;return r=e*3.240969941904521+i*-1.537383177570093+s*-.498610760293,o=e*-.96924363628087+i*1.87596750150772+s*.041555057407175,a=e*.055630079696993+i*-.20397695888897+s*1.056971514242878,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[r*255,o*255,a*255]};Ui.xyz=function(n,t){var e=n[0]/255,i=n[1]/255,s=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=e*.41239079926595+i*.35758433938387+s*.18048078840183,o=e*.21263900587151+i*.71516867876775+s*.072192315360733,a=e*.019330818715591+i*.11919477979462+s*.95053215224966;return t=t||ft.whitepoint[2].E,[r*t[0],o*t[1],a*t[2]]};const fr={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(n,t,e){var i,s,r,o,a,l,c,h,u,d,f,g,_;if(r=n[0],o=n[1],a=n[2],r===0)return[0,0,0];var m=.0011070564598794539;return t=t||"D65",e=e||2,u=ft.whitepoint[e][t][0],d=ft.whitepoint[e][t][1],f=ft.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),i=o/(13*r)+g||0,s=a/(13*r)+_||0,c=r>8?d*Math.pow((r+16)/116,3):d*r*m,l=c*9*i/(4*s)||0,h=c*(12-3*i-20*s)/(4*s)||0,[l,c,h]}};ft.luv=function(n,t,e){var i,s,r,o,a,l,c,h,u,d,f,g,_,m=.008856451679035631,p=903.2962962962961;t=t||"D65",e=e||2,u=ft.whitepoint[e][t][0],d=ft.whitepoint[e][t][1],f=ft.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),l=n[0],c=n[1],h=n[2],i=4*l/(l+15*c+3*h)||0,s=9*c/(l+15*c+3*h)||0;var y=c/d;return r=y<=m?p*y:116*Math.pow(y,1/3)-16,o=13*r*(i-g),a=13*r*(s-_),[r,o,a]};var la={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(n){var t=n[0],e=n[1],i=n[2],s,r,o;return o=i/360*2*Math.PI,s=e*Math.cos(o),r=e*Math.sin(o),[t,s,r]},xyz:function(n){return fr.xyz(la.luv(n))}};fr.lchuv=function(n){var t=n[0],e=n[1],i=n[2],s=Math.sqrt(e*e+i*i),r=Math.atan2(i,e),o=r*360/2/Math.PI;return o<0&&(o+=360),[t,s,o]};ft.lchuv=function(n){return fr.lchuv(ft.luv(n))};const no={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var so={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Rh(n){var t,e=[],i=1,s;if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(n=String(n).toLowerCase(),no[n])e=no[n].slice(),s="rgb";else if(n==="transparent")i=0,s="rgb",e=[0,0,0];else if(n[0]==="#"){var r=n.slice(1),o=r.length,a=o<=4;i=1,a?(e=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],o===4&&(i=parseInt(r[3]+r[3],16)/255)):(e=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],o===8&&(i=parseInt(r[6]+r[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),s="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(n)){var l=t[1];s=l.replace(/a$/,"");var c=s==="cmyk"?4:s==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),s==="color"&&(s=e.shift()),e=e.map(function(h,u){if(h[h.length-1]==="%")return h=parseFloat(h)/100,u===3?h:s==="rgb"?h*255:s[0]==="h"||s[0]==="l"&&!u?h*100:s==="lab"?h*125:s==="lch"?u<2?h*150:h*360:s[0]==="o"&&!u?h:s==="oklab"?h*.4:s==="oklch"?u<2?h*.4:h*360:h;if(s[u]==="h"||u===2&&s[s.length-1]==="h"){if(so[h]!==void 0)return so[h];if(h.endsWith("deg"))return parseFloat(h);if(h.endsWith("turn"))return parseFloat(h)*360;if(h.endsWith("grad"))return parseFloat(h)*360/400;if(h.endsWith("rad"))return parseFloat(h)*180/Math.PI}return h==="none"?0:parseFloat(h)}),i=e.length>c?e.pop():1}else/[0-9](?:\s|\/|,)/.test(n)&&(e=n.match(/([0-9]+)/g).map(function(h){return parseFloat(h)}),s=n.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:s,values:e,alpha:i}}const ps={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(n){var t=n[0]/360,e=n[1]/100,i=n[2]/100,s,r,o,a,l,c=0;if(e===0)return l=i*255,[l,l,l];for(r=i<.5?i*(1+e):i+e-i*e,s=2*i-r,a=[0,0,0];c<3;)o=t+1/3*-(c-1),o<0?o++:o>1&&o--,l=6*o<1?s+(r-s)*6*o:2*o<1?r:3*o<2?s+(r-s)*(2/3-o)*6:s,a[c++]=l*255;return a}};Ui.hsl=function(n){var t=n[0]/255,e=n[1]/255,i=n[2]/255,s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a,l,c;return r===s?a=0:t===r?a=(e-i)/o:e===r?a=2+(i-t)/o:i===r&&(a=4+(t-e)/o),a=Math.min(a*60,360),a<0&&(a+=360),c=(s+r)/2,r===s?l=0:c<=.5?l=o/(r+s):l=o/(2-r-s),[a,l*100,c*100]};function Th(n){Array.isArray(n)&&n.raw&&(n=String.raw(...arguments)),n instanceof Number&&(n=+n);var t,e=Rh(n);if(!e.space)return[];const i=e.space[0]==="h"?ps.min:Ui.min,s=e.space[0]==="h"?ps.max:Ui.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],i[0]),s[0]),t[1]=Math.min(Math.max(e.values[1],i[1]),s[1]),t[2]=Math.min(Math.max(e.values[2],i[2]),s[2]),e.space[0]==="h"&&(t=ps.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}const gr=[NaN,NaN,NaN,0];function Ih(n){return typeof n=="string"?n:mr(n)}const vh=1024,Mi={};let ys=0;function Sh(n){if(n.length===4)return n;const t=n.slice();return t[3]=1,t}function ro(n){const t=ft.lchuv(Ui.xyz(n));return t[3]=n[3],t}function Lh(n){const t=ft.rgb(la.xyz(n));return t[3]=n[3],t}function _r(n){if(n==="none")return gr;if(Mi.hasOwnProperty(n))return Mi[n];if(ys>=vh){let e=0;for(const i in Mi)e++&3||(delete Mi[i],--ys)}const t=Th(n);if(t.length!==4)throw new Error('failed to parse "'+n+'" as color');for(const e of t)if(isNaN(e))throw new Error('failed to parse "'+n+'" as color');return ha(t),Mi[n]=t,++ys,t}function ji(n){return Array.isArray(n)?n:_r(n)}function ha(n){return n[0]=st(n[0]+.5|0,0,255),n[1]=st(n[1]+.5|0,0,255),n[2]=st(n[2]+.5|0,0,255),n[3]=st(n[3],0,1),n}function mr(n){let t=n[0];t!=(t|0)&&(t=t+.5|0);let e=n[1];e!=(e|0)&&(e=e+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const s=n[3]===void 0?1:Math.round(n[3]*1e3)/1e3;return"rgba("+t+","+e+","+i+","+s+")"}const Le=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Ah=Le.includes("firefox"),Mh=Le.includes("safari")&&!Le.includes("chrom");Mh&&(Le.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Le));const bh=Le.includes("webkit")&&!Le.includes("edge"),ca=Le.includes("macintosh"),ua=typeof devicePixelRatio<"u"?devicePixelRatio:1,da=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,fa=typeof Image<"u"&&Image.prototype.decode,ga=function(){let n=!1;try{const t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return n}();function rt(n,t,e,i){let s;return e&&e.length?s=e.shift():da?s=new OffscreenCanvas(n||300,t||300):s=document.createElement("canvas"),n&&(s.width=n),t&&(s.height=t),s.getContext("2d",i)}let Es;function bn(){return Es||(Es=rt(1,1)),Es}function mi(n){const t=n.canvas;t.width=1,t.height=1,n.clearRect(0,0,1,1)}function oo(n,t){const e=t.parentNode;e&&e.replaceChild(n,t)}function Dh(n){for(;n.lastChild;)n.lastChild.remove()}function Ph(n,t){const e=n.childNodes;for(let i=0;;++i){const s=e[i],r=t[i];if(!s&&!r)break;if(s!==r){if(!s){n.appendChild(r);continue}if(!r){n.removeChild(s),--i;continue}n.insertBefore(r,s)}}}function Oh(n,t,e){const i=n;let s=!0,r=!1,o=!1;const a=[vn(i,z.LOAD,function(){o=!0,r||t()})];return i.src&&fa?(r=!0,i.decode().then(function(){s&&t()}).catch(function(l){s&&(o?t():e())})):a.push(vn(i,z.ERROR,e)),function(){s=!1,a.forEach(tt)}}function Fh(n,t){return new Promise((e,i)=>{function s(){o(),e(n)}function r(){o(),i(new Error("Image load error"))}function o(){n.removeEventListener("load",s),n.removeEventListener("error",r)}n.addEventListener("load",s),n.addEventListener("error",r)})}function kh(n,t){return t&&(n.src=t),n.src&&fa?new Promise((e,i)=>n.decode().then(()=>e(n)).catch(s=>n.complete&&n.width?e(n):i(s))):Fh(n)}class Nh{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];!(t++&3)&&!i.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,i){const s=xs(t,e,i);return s in this.cache_?this.cache_[s]:null}getPattern(t,e,i){const s=xs(t,e,i);return s in this.patternCache_?this.patternCache_[s]:null}set(t,e,i,s,r){const o=xs(t,e,i),a=o in this.cache_;this.cache_[o]=s,r&&(s.getImageState()===Y.IDLE&&s.load(),s.getImageState()===Y.LOADING?s.ready().then(()=>{this.patternCache_[o]=bn().createPattern(s.getImage(1),"repeat")}):this.patternCache_[o]=bn().createPattern(s.getImage(1),"repeat")),a||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function xs(n,t,e){const i=e?ji(e):"null";return t+":"+n+":"+i}const Ht=new Nh;let bi=null;class Gh extends Kn{constructor(t,e,i,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=r,this.imageState_=s===void 0?Y.IDLE:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===Y.LOADED){bi||(bi=rt(1,1,void 0,{willReadFrequently:!0})),bi.drawImage(this.image_,0,0);try{bi.getImageData(0,0,1,1),this.tainted_=!1}catch{bi=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(z.CHANGE)}handleImageError_(){this.imageState_=Y.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Y.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=rt(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Y.IDLE){this.image_||this.initializeImage_(),this.imageState_=Y.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&kh(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==Y.LOADED)return;const e=this.image_,i=rt(Math.ceil(e.width*t),Math.ceil(e.height*t)),s=i.canvas;i.scale(t,t),i.drawImage(e,0,0),i.globalCompositeOperation="multiply",i.fillStyle=Ih(this.color_),i.fillRect(0,0,s.width/t,s.height/t),i.globalCompositeOperation="destination-in",i.drawImage(e,0,0),this.canvas_[t]=s}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===Y.LOADED||this.imageState_===Y.ERROR)t();else{const e=()=>{(this.imageState_===Y.LOADED||this.imageState_===Y.ERROR)&&(this.removeEventListener(z.CHANGE,e),t())};this.addEventListener(z.CHANGE,e)}})),this.ready_}}function pr(n,t,e,i,s,r){let o=t===void 0?void 0:Ht.get(t,e,s);return o||(o=new Gh(n,n&&"src"in n?n.src||void 0:t,e,i,s),Ht.set(t,e,s,o,r)),r&&o&&!Ht.getPattern(t,e,s)&&Ht.set(t,e,s,o,r),o}function qt(n){return n?Array.isArray(n)?mr(n):typeof n=="object"&&"src"in n?zh(n):n:null}function zh(n){if(!n.offset||!n.size)return Ht.getPattern(n.src,"anonymous",n.color);const t=n.src+":"+n.offset,e=Ht.getPattern(t,void 0,n.color);if(e)return e;const i=Ht.get(n.src,"anonymous",null);if(i.getImageState()!==Y.LOADED)return null;const s=rt(n.size[0],n.size[1]);return s.drawImage(i.getImage(1),n.offset[0],n.offset[1],n.size[0],n.size[1],0,0,n.size[0],n.size[1]),pr(s.canvas,t,void 0,Y.LOADED,n.color,!0),Ht.getPattern(t,void 0,n.color)}const wn="ol-hidden",ts="ol-unselectable",yr="ol-control",ao="ol-collapsed",Xh=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),lo=["style","variant","weight","size","lineHeight","family"],_a=function(n){const t=n.match(Xh);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,s=lo.length;iMath.max(s,Pn(n,r)),0);return e[t]=i,i}function Zh(n,t){const e=[],i=[],s=[];let r=0,o=0,a=0,l=0;for(let c=0,h=t.length;c<=h;c+=2){const u=t[c];if(u===` -`||c===h){r=Math.max(r,o),s.push(o),o=0,a+=l,l=0;continue}const d=t[c+1]||n.font,f=Pn(d,u);e.push(f),o+=f;const g=Yh(d);i.push(g),l=Math.max(l,g)}return{width:r,height:a,widths:e,heights:i,lineWidths:s}}function Kh(n,t,e,i,s,r,o,a,l,c,h){n.save(),e!==1&&(n.globalAlpha===void 0?n.globalAlpha=u=>u.globalAlpha*=e:n.globalAlpha*=e),t&&n.transform.apply(n,t),i.contextInstructions?(n.translate(l,c),n.scale(h[0],h[1]),Bh(i,n)):h[0]<0||h[1]<0?(n.translate(l,c),n.scale(h[0],h[1]),n.drawImage(i,s,r,o,a,0,0,o,a)):n.drawImage(i,s,r,o,a,l,c,o*h[0],a*h[1]),n.restore()}function Bh(n,t){const e=n.contextInstructions;for(let i=0,s=e.length;ithis.imageState_=Y.LOADED),this.render()}clone(){const t=this.getScale(),e=new es({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const i=this.renderOptions_,s=rt(i.size*t,i.size*t);this.draw_(i,s,t),e=s.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let s=this.radius,r=this.radius2_===void 0?s:this.radius2_;if(s{this.patternImage_=null}),e.getImageState()===Y.IDLE&&e.load(),e.getImageState()===Y.LOADING&&(this.patternImage_=e)}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}class Ei{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new Ei({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}class ce{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=co,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new ce({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=co,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function Vh(n){let t;if(typeof n=="function")t=n;else{let e;Array.isArray(n)?e=n:(j(typeof n.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[n]),t=function(){return e}}return t}let ws=null;function ya(n,t){if(!ws){const e=new wi({color:"rgba(255,255,255,0.4)"}),i=new Ei({color:"#3399CC",width:1.25});ws=[new ce({image:new on({fill:e,stroke:i,radius:5}),fill:e,stroke:i})]}return ws}function co(n){return n.getGeometry()}function uo(n,t,e,i){return e!==void 0&&i!==void 0?[e/n,i/t]:e!==void 0?e/n:i!==void 0?i/t:1}class is extends Qn{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,i=t.rotation!==void 0?t.rotation:0,s=t.scale!==void 0?t.scale:1,r=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:i,scale:s,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const o=t.img!==void 0?t.img:null;let a=t.src;j(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||$(o)),j(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),j(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(t.src!==void 0?l=Y.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?Y.LOADED:Y.IDLE:l=Y.LOADING:l=Y.LOADED),this.color_=t.color!==void 0?ji(t.color):null,this.iconImage_=pr(o,a,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,this.initialOptions_,t.width!==void 0||t.height!==void 0){let c,h;if(t.size)[c,h]=t.size;else{const u=this.getImage(1);if(u.width&&u.height)c=u.width,h=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const f=this.iconImage_.getSize();this.setScale(uo(f[0],f[1],t.width,t.height))};this.listenImageChange(d);return}}c!==void 0&&this.setScale(uo(c,h,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new is({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const s=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!s)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=s[0]),this.anchorYUnits_=="fraction"&&(t[1]*=s[1])}if(this.anchorOrigin_!="top-left"){if(!s)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+s[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+s[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=i[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==Y.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==Y.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(z.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(z.CHANGE,t)}ready(){return this.iconImage_.ready()}}const Uh="#333";class Er{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=vt(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new wi({color:Uh}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Er({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=vt(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}let Ze=0;const Et=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},$h={[C.Get]:N(W(1,1/0),fo),[C.Var]:N(W(1,1),Jh),[C.Has]:N(W(1,1/0),fo),[C.Id]:N(Qh,qe),[C.Concat]:N(W(2,1/0),H(Rt)),[C.GeometryType]:N(tc,qe),[C.LineMetric]:N(qe),[C.Resolution]:N(qe),[C.Zoom]:N(qe),[C.Time]:N(qe),[C.Any]:N(W(2,1/0),H(Et)),[C.All]:N(W(2,1/0),H(Et)),[C.Not]:N(W(1,1),H(Et)),[C.Equal]:N(W(2,2),H(Cn)),[C.NotEqual]:N(W(2,2),H(Cn)),[C.GreaterThan]:N(W(2,2),H(B)),[C.GreaterThanOrEqualTo]:N(W(2,2),H(B)),[C.LessThan]:N(W(2,2),H(B)),[C.LessThanOrEqualTo]:N(W(2,2),H(B)),[C.Multiply]:N(W(2,1/0),go),[C.Coalesce]:N(W(2,1/0),go),[C.Divide]:N(W(2,2),H(B)),[C.Add]:N(W(2,1/0),H(B)),[C.Subtract]:N(W(2,2),H(B)),[C.Clamp]:N(W(3,3),H(B)),[C.Mod]:N(W(2,2),H(B)),[C.Pow]:N(W(2,2),H(B)),[C.Abs]:N(W(1,1),H(B)),[C.Floor]:N(W(1,1),H(B)),[C.Ceil]:N(W(1,1),H(B)),[C.Round]:N(W(1,1),H(B)),[C.Sin]:N(W(1,1),H(B)),[C.Cos]:N(W(1,1),H(B)),[C.Atan]:N(W(1,2),H(B)),[C.Sqrt]:N(W(1,1),H(B)),[C.Match]:N(W(4,1/0),_o,ic),[C.Between]:N(W(3,3),H(B)),[C.Interpolate]:N(W(6,1/0),_o,nc),[C.Case]:N(W(3,1/0),ec,sc),[C.In]:N(W(2,2),rc),[C.Number]:N(W(1,1/0),H(Cn)),[C.String]:N(W(1,1/0),H(Cn)),[C.Array]:N(W(1,1/0),H(B)),[C.Color]:N(W(1,4),H(B)),[C.Band]:N(W(1,3),H(B)),[C.Palette]:N(W(2,2),oc),[C.ToString]:N(W(1,1),H(Et|B|Rt|zt))};function fo(n,t,e){const i=n.length-1,s=new Array(i);for(let r=0;rt){const a=t===1/0?`${n} or more`:`${n} to ${t}`;throw new Error(`expected ${a} arguments for ${r}, got ${o}`)}}}function go(n,t,e){const i=n.length-1,s=new Array(i);for(let r=0;ri.featureId;case C.GeometryType:return i=>i.geometryType;case C.Concat:{const i=n.args.map(s=>Yt(s));return s=>"".concat(...i.map(r=>r(s).toString()))}case C.Resolution:return i=>i.resolution;case C.Any:case C.All:case C.Between:case C.In:case C.Not:return uc(n);case C.Equal:case C.NotEqual:case C.LessThan:case C.LessThanOrEqualTo:case C.GreaterThan:case C.GreaterThanOrEqualTo:return cc(n);case C.Multiply:case C.Divide:case C.Add:case C.Subtract:case C.Clamp:case C.Mod:case C.Pow:case C.Abs:case C.Floor:case C.Ceil:case C.Round:case C.Sin:case C.Cos:case C.Atan:case C.Sqrt:return dc(n);case C.Case:return fc(n);case C.Match:return gc(n);case C.Interpolate:return _c(n);case C.ToString:return mc(n);default:throw new Error(`Unsupported operator ${e}`)}}function lc(n,t){const e=n.operator,i=n.args.length,s=new Array(i);for(let r=0;r{for(let o=0;o{for(let o=0;o{const r=n.args;let o=s.properties[i];for(let a=1,l=r.length;as.variables[i];case C.Has:return s=>{const r=n.args;if(!(i in s.properties))return!1;let o=s.properties[i];for(let a=1,l=r.length;ai(r)===s(r);case C.NotEqual:return r=>i(r)!==s(r);case C.LessThan:return r=>i(r)i(r)<=s(r);case C.GreaterThan:return r=>i(r)>s(r);case C.GreaterThanOrEqualTo:return r=>i(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${e}`)}}function uc(n,t){const e=n.operator,i=n.args.length,s=new Array(i);for(let r=0;r{for(let o=0;o{for(let o=0;o{const o=s[0](r),a=s[1](r),l=s[2](r);return o>=a&&o<=l};case C.In:return r=>{const o=s[0](r);for(let a=1;a!s[0](r);default:throw new Error(`Unsupported logical operator ${e}`)}}function dc(n,t){const e=n.operator,i=n.args.length,s=new Array(i);for(let r=0;r{let o=1;for(let a=0;as[0](r)/s[1](r);case C.Add:return r=>{let o=0;for(let a=0;as[0](r)-s[1](r);case C.Clamp:return r=>{const o=s[0](r),a=s[1](r);if(ol?l:o};case C.Mod:return r=>s[0](r)%s[1](r);case C.Pow:return r=>Math.pow(s[0](r),s[1](r));case C.Abs:return r=>Math.abs(s[0](r));case C.Floor:return r=>Math.floor(s[0](r));case C.Ceil:return r=>Math.ceil(s[0](r));case C.Round:return r=>Math.round(s[0](r));case C.Sin:return r=>Math.sin(s[0](r));case C.Cos:return r=>Math.cos(s[0](r));case C.Atan:return i===2?r=>Math.atan2(s[0](r),s[1](r)):r=>Math.atan(s[0](r));case C.Sqrt:return r=>Math.sqrt(s[0](r));default:throw new Error(`Unsupported numeric operator ${e}`)}}function fc(n,t){const e=n.args.length,i=new Array(e);for(let s=0;s{for(let r=0;r{const r=i[0](s);for(let o=1;o{const r=i[0](s),o=i[1](s);let a,l;for(let c=2;c=o)return c===2?u:d?pc(r,o,a,l,h,u):Gi(r,o,a,l,h,u);a=h,l=u}return l}}function mc(n,t){const e=n.operator,i=n.args.length,s=new Array(i);for(let r=0;r{const o=s[0](r);return n.args[0].type===zt?mr(o):o.toString()};default:throw new Error(`Unsupported convert operator ${e}`)}}function Gi(n,t,e,i,s,r){const o=s-e;if(o===0)return i;const a=t-e,l=n===1?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1);return i+l*(r-i)}function pc(n,t,e,i,s,r){if(s-e===0)return i;const a=ro(i),l=ro(r);let c=l[2]-a[2];c>180?c-=360:c<-180&&(c+=360);const h=[Gi(n,t,e,a[0],s,l[0]),Gi(n,t,e,a[1],s,l[1]),a[2]+Gi(n,t,e,0,s,c),Gi(n,t,e,i[3],s,r[3])];return ha(Lh(h))}function yc(n){return!0}function Ec(n){const t=Ea(),e=xc(n,t),i=wa();return function(s,r){if(i.properties=s.getPropertiesInternal(),i.resolution=r,t.featureId){const o=s.getId();o!==void 0?i.featureId=o:i.featureId=null}return t.geometryType&&(i.geometryType=xa(s.getGeometry())),e(i)}}function mo(n){const t=Ea(),e=n.length,i=new Array(e);for(let o=0;onull;i=wr(n,t+"fill-color",e)}if(!i)return null;const s=new wi;return function(r){const o=i(r);return o===gr?null:(s.setColor(o),s)}}function tn(n,t,e){const i=It(n,t+"stroke-width",e),s=wr(n,t+"stroke-color",e);if(!i&&!s)return null;const r=oe(n,t+"stroke-line-cap",e),o=oe(n,t+"stroke-line-join",e),a=Ca(n,t+"stroke-line-dash",e),l=It(n,t+"stroke-line-dash-offset",e),c=It(n,t+"stroke-miter-limit",e),h=new Ei;return function(u){if(s){const d=s(u);if(d===gr)return null;h.setColor(d)}if(i&&h.setWidth(i(u)),r){const d=r(u);if(d!=="butt"&&d!=="round"&&d!=="square")throw new Error("Expected butt, round, or square line cap");h.setLineCap(d)}if(o){const d=o(u);if(d!=="bevel"&&d!=="round"&&d!=="miter")throw new Error("Expected bevel, round, or miter line join");h.setLineJoin(d)}return a&&h.setLineDash(a(u)),l&&h.setLineDashOffset(l(u)),c&&h.setMiterLimit(c(u)),h}}function wc(n,t){const e="text-",i=oe(n,e+"value",t);if(!i)return null;const s=Qi(n,e,t),r=Qi(n,e+"background-",t),o=tn(n,e,t),a=tn(n,e+"background-",t),l=oe(n,e+"font",t),c=It(n,e+"max-angle",t),h=It(n,e+"offset-x",t),u=It(n,e+"offset-y",t),d=en(n,e+"overflow",t),f=oe(n,e+"placement",t),g=It(n,e+"repeat",t),_=ns(n,e+"scale",t),m=en(n,e+"rotate-with-view",t),p=It(n,e+"rotation",t),y=oe(n,e+"align",t),x=oe(n,e+"justify",t),E=oe(n,e+"baseline",t),w=Ca(n,e+"padding",t),v=ss(n,e+"declutter-mode"),T=new Er({declutterMode:v});return function(R){if(T.setText(i(R)),s&&T.setFill(s(R)),r&&T.setBackgroundFill(r(R)),o&&T.setStroke(o(R)),a&&T.setBackgroundStroke(a(R)),l&&T.setFont(l(R)),c&&T.setMaxAngle(c(R)),h&&T.setOffsetX(h(R)),u&&T.setOffsetY(u(R)),d&&T.setOverflow(d(R)),f){const I=f(R);if(I!=="point"&&I!=="line")throw new Error("Expected point or line for text-placement");T.setPlacement(I)}if(g&&T.setRepeat(g(R)),_&&T.setScale(_(R)),m&&T.setRotateWithView(m(R)),p&&T.setRotation(p(R)),y){const I=y(R);if(I!=="left"&&I!=="center"&&I!=="right"&&I!=="end"&&I!=="start")throw new Error("Expected left, right, center, start, or end for text-align");T.setTextAlign(I)}if(x){const I=x(R);if(I!=="left"&&I!=="right"&&I!=="center")throw new Error("Expected left, right, or center for text-justify");T.setJustify(I)}if(E){const I=E(R);if(I!=="bottom"&&I!=="top"&&I!=="middle"&&I!=="alphabetic"&&I!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");T.setTextBaseline(I)}return w&&T.setPadding(w(R)),T}}function Cc(n,t){return"icon-src"in n?Rc(n,t):"shape-points"in n?Tc(n,t):"circle-radius"in n?Ic(n,t):null}function Rc(n,t){const e="icon-",i=e+"src",s=Ra(n[i],i),r=On(n,e+"anchor",t),o=ns(n,e+"scale",t),a=It(n,e+"opacity",t),l=On(n,e+"displacement",t),c=It(n,e+"rotation",t),h=en(n,e+"rotate-with-view",t),u=yo(n,e+"anchor-origin"),d=Eo(n,e+"anchor-x-units"),f=Eo(n,e+"anchor-y-units"),g=Mc(n,e+"color"),_=Lc(n,e+"cross-origin"),m=Ac(n,e+"offset"),p=yo(n,e+"offset-origin"),y=Fn(n,e+"width"),x=Fn(n,e+"height"),E=Sc(n,e+"size"),w=ss(n,e+"declutter-mode"),v=new is({src:s,anchorOrigin:u,anchorXUnits:d,anchorYUnits:f,color:g,crossOrigin:_,offset:m,offsetOrigin:p,height:x,width:y,size:E,declutterMode:w});return function(T){return a&&v.setOpacity(a(T)),l&&v.setDisplacement(l(T)),c&&v.setRotation(c(T)),h&&v.setRotateWithView(h(T)),o&&v.setScale(o(T)),r&&v.setAnchor(r(T)),v}}function Tc(n,t){const e="shape-",i=e+"points",s=e+"radius",r=zs(n[i],i),o=zs(n[s],s),a=Qi(n,e,t),l=tn(n,e,t),c=ns(n,e+"scale",t),h=On(n,e+"displacement",t),u=It(n,e+"rotation",t),d=en(n,e+"rotate-with-view",t),f=Fn(n,e+"radius2"),g=Fn(n,e+"angle"),_=ss(n,e+"declutter-mode"),m=new es({points:r,radius:o,radius2:f,angle:g,declutterMode:_});return function(p){return a&&m.setFill(a(p)),l&&m.setStroke(l(p)),h&&m.setDisplacement(h(p)),u&&m.setRotation(u(p)),d&&m.setRotateWithView(d(p)),c&&m.setScale(c(p)),m}}function Ic(n,t){const e="circle-",i=Qi(n,e,t),s=tn(n,e,t),r=It(n,e+"radius",t),o=ns(n,e+"scale",t),a=On(n,e+"displacement",t),l=It(n,e+"rotation",t),c=en(n,e+"rotate-with-view",t),h=ss(n,e+"declutter-mode"),u=new on({radius:5,declutterMode:h});return function(d){return r&&u.setRadius(r(d)),i&&u.setFill(i(d)),s&&u.setStroke(s(d)),a&&u.setDisplacement(a(d)),l&&u.setRotation(l(d)),c&&u.setRotateWithView(c(d)),o&&u.setScale(o(d)),u}}function It(n,t,e){if(!(t in n))return;const i=ge(n[t],B,e);return function(s){return zs(i(s),t)}}function oe(n,t,e){if(!(t in n))return null;const i=ge(n[t],Rt,e);return function(s){return Ra(i(s),t)}}function vc(n,t,e){const i=oe(n,t+"pattern-src",e),s=po(n,t+"pattern-offset",e),r=po(n,t+"pattern-size",e),o=wr(n,t+"color",e);return function(a){return{src:i(a),offset:s&&s(a),size:r&&r(a),color:o&&o(a)}}}function en(n,t,e){if(!(t in n))return null;const i=ge(n[t],Et,e);return function(s){const r=i(s);if(typeof r!="boolean")throw new Error(`Expected a boolean for ${t}`);return r}}function wr(n,t,e){if(!(t in n))return null;const i=ge(n[t],zt,e);return function(s){return Ta(i(s),t)}}function Ca(n,t,e){if(!(t in n))return null;const i=ge(n[t],We,e);return function(s){return an(i(s),t)}}function On(n,t,e){if(!(t in n))return null;const i=ge(n[t],We,e);return function(s){const r=an(i(s),t);if(r.length!==2)throw new Error(`Expected two numbers for ${t}`);return r}}function po(n,t,e){if(!(t in n))return null;const i=ge(n[t],We,e);return function(s){return Ia(i(s),t)}}function ns(n,t,e){if(!(t in n))return null;const i=ge(n[t],We|B,e);return function(s){return bc(i(s),t)}}function Fn(n,t){const e=n[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function Sc(n,t){const e=n[t];if(e!==void 0){if(typeof e=="number")return vt(e);if(!Array.isArray(e))throw new Error(`Expected a number or size array for ${t}`);if(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return e}}function Lc(n,t){const e=n[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function yo(n,t){const e=n[t];if(e!==void 0){if(e!=="bottom-left"&&e!=="bottom-right"&&e!=="top-left"&&e!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return e}}function Eo(n,t){const e=n[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function Ac(n,t){const e=n[t];if(e!==void 0)return an(e,t)}function ss(n,t){const e=n[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);if(e!=="declutter"&&e!=="obstacle"&&e!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return e}}function Mc(n,t){const e=n[t];if(e!==void 0)return Ta(e,t)}function an(n,t){if(!Array.isArray(n))throw new Error(`Expected an array for ${t}`);const e=n.length;for(let i=0;i4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function Ia(n,t){const e=an(n,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}function bc(n,t){return typeof n=="number"?n:Ia(n,t)}const xo={RENDER_ORDER:"renderOrder"};class va extends Jn{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(xo.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const i=this.getDeclutter();i in t.declutter||(t.declutter[i]=new aa(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(xo.RENDER_ORDER,t)}setStyle(t){this.style_=t===void 0?ya:t;const e=Dc(t);this.styleFunction_=t===null?void 0:Vh(e),this.changed()}}function Dc(n){if(n===void 0)return ya;if(!n)return null;if(typeof n=="function"||n instanceof ce)return n;if(!Array.isArray(n))return mo([n]);if(n.length===0)return[];const t=n.length,e=n[0];if(e instanceof ce){const s=new Array(t);for(let r=0;r=0;--w){const v=_[w],T=v.layer;if(T.hasRenderer()&&dr(v,h)&&a.call(l,T)){const R=T.getRenderer(),I=T.getSource();if(R&&I){const G=I.getWrapX()?f:t,D=u.bind(null,v.managed);y[0]=G[0]+g[E][0],y[1]=G[1]+g[E][1],c=R.forEachFeatureAtCoordinate(y,e,i,D,p)}if(c)return c}}if(p.length===0)return;const x=1/p.length;return p.forEach((E,w)=>E.distanceSq+=w*x),p.sort((E,w)=>E.distanceSq-w.distanceSq),p.some(E=>c=E.callback(E.feature,E.layer,E.geometry)),c}hasFeatureAtCoordinate(t,e,i,s,r,o){return this.forEachFeatureAtCoordinate(t,e,i,s,Wi,this,r,o)!==void 0}getMap(){return this.map_}renderFrame(t){U()}scheduleExpireIconCache(t){Ht.canExpireCache()&&t.postRenderFunctions.push(Oc)}}function Oc(n,t){Ht.expire()}class Sa extends fe{constructor(t,e,i,s){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=s}}class Fc extends Pc{constructor(t){super(t),this.fontChangeListenerKey_=V(re,di.PROPERTYCHANGE,t.redrawText,t),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=ts+" ol-layers";const i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const i=this.getMap();if(i.hasListener(t)){const s=new Sa(t,void 0,e);i.dispatchEvent(s)}}disposeInternal(){tt(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(Ot.PRECOMPOSE,t);const e=t.layerStatesArray.sort((a,l)=>a.zIndex-l.zIndex);e.some(a=>a.layer instanceof va&&a.layer.getDeclutter())&&(t.declutter={});const s=t.viewState;this.children_.length=0;const r=[];let o=null;for(let a=0,l=e.length;a=0;--i){const s=e[i],r=s.layer;r.getDeclutter()&&r.renderDeclutter(t,s)}e.forEach(i=>i.layer.renderDeferred(t))}}}class Re extends fe{constructor(t,e){super(t),this.layer=e}}const Cs={LAYERS:"layers"};class Ci extends Go{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Cs.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new jt(i.slice(),{unique:!0}):j(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new jt(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(tt),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(V(t,wt.ADD,this.handleLayersAdd_,this),V(t,wt.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(tt);nn(this.listenerKeys_);const e=t.getArray();for(let i=0,s=e.length;i{this.clickTimeoutId_=void 0;const i=new we(nt.SINGLECLICK,this.map_,t);this.dispatchEvent(i)},250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==nt.POINTERUP||e.type==nt.POINTERCANCEL){delete this.trackedTouches_[i];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==e.target){delete this.trackedTouches_[s];break}}else(e.type==nt.POINTERDOWN||e.type==nt.POINTERMOVE)&&(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new we(nt.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(tt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);const e=new we(nt.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(V(i,nt.POINTERMOVE,this.handlePointerMove_,this),V(i,nt.POINTERUP,this.handlePointerUp_,this),V(this.element_,nt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(V(this.element_.getRootNode(),nt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new we(nt.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new we(nt.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(tt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(z.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(tt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(tt),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Ce={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},_t={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},kn=1/0;class Nc{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,nn(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,i=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const s=this.keyFunction_(i);return delete this.queuedElements_[s],i}enqueue(t){j(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=kn?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,i=this.priorities_,s=e.length,r=e[t],o=i[t],a=t;for(;t>1;){const l=this.getLeftChildIndex_(t),c=this.getRightChildIndex_(t),h=ct;){const a=this.getParentIndex_(e);if(s[a]>o)i[e]=i[a],s[e]=s[a],e=a;else break}i[e]=r,s[e]=o}reprioritize(){const t=this.priorityFunction_,e=this.elements_,i=this.priorities_;let s=0;const r=e.length;let o,a,l;for(a=0;a0;){const s=this.dequeue()[0],r=s.getKey();s.getState()===M.IDLE&&!(r in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++i,s.load())}}}function zc(n,t,e,i,s){if(!n||!(e in n.wantedTiles)||!n.wantedTiles[e][t.getKey()])return kn;const r=n.viewState.center,o=i[0]-r[0],a=i[1]-r[1];return 65536*Math.log(s)+Math.sqrt(o*o+a*a)/s}class Cr extends $t{constructor(t){super();const e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let e=0,i=this.listenerKeys.length;es.getAttributions(t)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(s=>i.add(s)):i.add(this.attributions_)),!this.overrideCollapsible_){const s=!e.some(r=>r.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(s)}return Array.from(i)}async updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=await Promise.all(this.collectSourceAttributions_(t).map(s=>hl(()=>s))),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Ae(e,this.renderedAttributions_)){Dh(this.ulElement_);for(let s=0,r=e.length;s0&&i%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:xi}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const i=e.viewState.rotation;if(i!=this.rotation_){const s="rotate("+i+"rad)";if(this.autoHide_){const r=this.element.classList.contains(wn);!r&&i===0?this.element.classList.add(wn):r&&i!==0&&this.element.classList.remove(wn)}this.label_.style.transform=s}this.rotation_=i}}class Yc extends Cr{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",i=t.delta!==void 0?t.delta:1,s=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",r=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",o=t.zoomInLabel!==void 0?t.zoomInLabel:"+",a=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",l=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",c=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=s,h.setAttribute("type","button"),h.title=l,h.appendChild(typeof o=="string"?document.createTextNode(o):o),h.addEventListener(z.CLICK,this.handleClick_.bind(this,i),!1);const u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=c,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(z.CLICK,this.handleClick_.bind(this,-i),!1);const d=e+" "+ts+" "+yr,f=this.element;f.className=d,f.appendChild(h),f.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const i=this.getMap().getView();if(!i)return;const s=i.getZoom();if(s!==void 0){const r=i.getConstrainedZoom(s+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:r,duration:this.duration_,easing:xi})):i.setZoom(r)}}}function Zc(n){n=n||{};const t=new jt;return(n.zoom!==void 0?n.zoom:!0)&&t.push(new Yc(n.zoomOptions)),(n.rotate!==void 0?n.rotate:!0)&&t.push(new Wc(n.rotateOptions)),(n.attribution!==void 0?n.attribution:!0)&&t.push(new Xc(n.attributionOptions)),t}const wo={ACTIVE:"active"};class ln extends $t{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(wo.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(wo.ACTIVE,t)}setMap(t){this.map_=t}}function Kc(n,t,e){const i=n.getCenterInternal();if(i){const s=[i[0]+t[0],i[1]+t[1]];n.animateInternal({duration:e!==void 0?e:250,easing:Kl,center:n.getConstrainedCenter(s)})}}function Rr(n,t,e,i){const s=n.getZoom();if(s===void 0)return;const r=n.getConstrainedZoom(s+t),o=n.getResolutionForZoom(r);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:e,duration:i!==void 0?i:250,easing:xi})}class Bc extends ln{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==nt.DBLCLICK){const i=t.originalEvent,s=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=s.getView();Rr(a,o,r,this.duration_),i.preventDefault(),e=!0}return!e}}class hn extends ln{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==nt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==nt.POINTERUP){const i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==nt.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==nt.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function Tr(n){const t=n.length;let e=0,i=0;for(let s=0;s0&&this.condition_(t)){const i=t.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class Qc extends hn{constructor(t){t=t||{},super({stopDown:Zn}),this.condition_=t.condition?t.condition:Vc,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!Rs(t))return;const e=t.map,i=e.getView();if(i.getConstraints().rotation===rr)return;const s=e.getSize(),r=t.pixel,o=Math.atan2(s[1]/2-r[1],r[0]-s[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(t){return Rs(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return Rs(t)&&Aa(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class tu extends Wn{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,i="px",s=this.element_.style;s.left=Math.min(t[0],e[0])+i,s.top=Math.min(t[1],e[1])+i,s.width=Math.abs(e[0]-t[0])+i,s.height=Math.abs(e[1]-t[1])+i}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,s=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new Vi([s])}getGeometry(){return this.geometry_}}const $e={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Di extends fe{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}class eu extends hn{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new tu(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??Aa,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){const s=i[0]-e[0],r=i[1]-e[1];return s*s+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Di($e.BOXDRAG,t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Di(e?$e.BOXEND:$e.BOXCANCEL,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Di($e.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Di($e.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Di($e.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}}class iu extends eu{constructor(t){t=t||{};const e=t.condition?t.condition:qc;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){const i=this.getMap().getView();let s=this.getGeometry();if(this.out_){const r=i.rotatedExtentForGeometry(s),o=i.getResolutionForExtentInternal(r),a=i.getResolution()/o;s=s.clone(),s.scale(a*a)}i.fitInternal(s,{duration:this.duration_,easing:xi})}}const Oe={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class nu extends ln{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return Ma(e)&&ba(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==z.KEYDOWN){const i=t.originalEvent,s=i.key;if(this.condition_(t)&&(s==Oe.DOWN||s==Oe.LEFT||s==Oe.RIGHT||s==Oe.UP)){const o=t.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,c=0;s==Oe.DOWN?c=-a:s==Oe.LEFT?l=-a:s==Oe.RIGHT?l=a:c=a;const h=[l,c];Qs(h,o.getRotation()),Kc(o,h,this.duration_),i.preventDefault(),e=!0}}return!e}}class su extends ln{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!Hc(e)&&ba(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==z.KEYDOWN||t.type==z.KEYPRESS){const i=t.originalEvent,s=i.key;if(this.condition_(t)&&(s==="+"||s==="-")){const r=t.map,o=s==="+"?this.delta_:-this.delta_,a=r.getView();Rr(a,o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}}class ru{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[i+2]>t;)i-=3;const s=this.points_[e+2]-this.points_[i+2];if(s<1e3/60)return!1;const r=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/s,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}class ou extends ln{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const e=t.condition?t.condition:jc;this.condition_=t.onFocusOnly?Ws(La,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t)||t.type!==z.WHEEL)return!0;const i=t.map,s=t.originalEvent;s.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel);let r;if(t.type==z.WHEEL&&(r=s.deltaY,Ah&&s.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(r/=ua),s.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=40)),r===0)return!1;this.lastDelta_=r;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?"trackpad":"wheel");const a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-r/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=r;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-st(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Rr(e,i,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}class au extends hn{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=Zn),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0;const i=this.targetPointers[0],s=this.targetPointers[1],r=Math.atan2(s.clientY-i.clientY,s.clientX-i.clientX);if(this.lastAngle_!==void 0){const l=r-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=l}this.lastAngle_=r;const o=t.map,a=o.getView();a.getConstraints().rotation!==rr&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(Tr(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}class lu extends hn{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=Zn),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const i=this.targetPointers[0],s=this.targetPointers[1],r=i.clientX-s.clientX,o=i.clientY-s.clientY,a=Math.sqrt(r*r+o*o);this.lastDistance_!==void 0&&(e=this.lastDistance_/a),this.lastDistance_=a;const l=t.map,c=l.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(Tr(this.targetPointers))),l.render(),c.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const i=t.map.getView(),s=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,s),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}function hu(n){n=n||{};const t=new jt,e=new ru(-.005,.05,100);return(n.altShiftDragRotate!==void 0?n.altShiftDragRotate:!0)&&t.push(new Qc),(n.doubleClickZoom!==void 0?n.doubleClickZoom:!0)&&t.push(new Bc({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan!==void 0?n.dragPan:!0)&&t.push(new Jc({onFocusOnly:n.onFocusOnly,kinetic:e})),(n.pinchRotate!==void 0?n.pinchRotate:!0)&&t.push(new au),(n.pinchZoom!==void 0?n.pinchZoom:!0)&&t.push(new lu({duration:n.zoomDuration})),(n.keyboard!==void 0?n.keyboard:!0)&&(t.push(new nu),t.push(new su({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom!==void 0?n.mouseWheelZoom:!0)&&t.push(new ou({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom!==void 0?n.shiftDragZoom:!0)&&t.push(new iu({duration:n.zoomDuration})),t}function Da(n){if(n instanceof Jn){n.setMapInternal(null);return}n instanceof Ci&&n.getLayers().forEach(Da)}function Pa(n,t){if(n instanceof Jn){n.setMapInternal(t);return}if(n instanceof Ci){const e=n.getLayers().getArray();for(let i=0,s=e.length;ithis.updateSize()),this.controls=e.controls||Zc(),this.interactions=e.interactions||hu({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Gc(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(_t.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(_t.VIEW,this.handleViewChanged_),this.addChangeListener(_t.SIZE,this.handleSizeChanged_),this.addChangeListener(_t.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const i=this;t.view&&!(t.view instanceof Vt)&&t.view.then(function(s){i.setView(new Vt(s))}),this.controls.addEventListener(wt.ADD,s=>{s.element.setMap(this)}),this.controls.addEventListener(wt.REMOVE,s=>{s.element.setMap(null)}),this.interactions.addEventListener(wt.ADD,s=>{s.element.setMap(this)}),this.interactions.addEventListener(wt.REMOVE,s=>{s.element.setMap(null)}),this.overlays_.addEventListener(wt.ADD,s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener(wt.REMOVE,s=>{const r=s.element.getId();r!==void 0&&delete this.overlayIdIndex_[r.toString()],s.element.setMap(null)}),this.controls.forEach(s=>{s.setMap(this)}),this.interactions.forEach(s=>{s.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){Pa(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;const s=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};const r=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:Wi,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,r,a,e,null,o,null)}getFeaturesAtPixel(t,e){const i=[];return this.forEachFeatureAtPixel(t,function(s){i.push(s)},e),i}getAllLayers(){const t=[];function e(i){i.forEach(function(s){s instanceof Ci?e(s.getLayers()):t.push(s)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const s=e.layerFilter!==void 0?e.layerFilter:Wi,r=e.hitTolerance!==void 0?e.hitTolerance:0,o=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,r,o,s,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const i=this.viewport_.getBoundingClientRect(),s=this.getSize(),r=i.width/s[0],o=i.height/s[1],a="changedTouches"in t?t.changedTouches[0]:t;return[(a.clientX-i.left)/r,(a.clientY-i.top)/o]}getTarget(){return this.get(_t.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return Fs(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?dt(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(_t.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof jt){e.setLayers(t);return}const i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e=0;r--){const o=s[r];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let s=this.maxTilesLoading_,r=s;if(t){const o=t.viewHints;if(o[mt.ANIMATING]||o[mt.INTERACTING]){const a=Date.now()-t.time>8;s=a?0:8,r=a?0:2}}e.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new Re("removelayer",e)),this.set(_t.LAYERGROUP,t)}setSize(t){this.set(_t.SIZE,t)}setTarget(t){this.set(_t.TARGET,t)}setView(t){if(!t||t instanceof Vt){this.set(_t.VIEW,t);return}this.set(_t.VIEW,new Vt);const e=this;t.then(function(i){e.setView(new Vt(i))})}updateSize(){const t=this.getTargetElement();let e;if(t){const s=getComputedStyle(t),r=t.offsetWidth-parseFloat(s.borderLeftWidth)-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)-parseFloat(s.borderRightWidth),o=t.offsetHeight-parseFloat(s.borderTopWidth)-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)-parseFloat(s.borderBottomWidth);!isNaN(r)&&!isNaN(o)&&(e=[Math.max(0,r),Math.max(0,o)],!io(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&Uo("No map visible because the map container's width or height are 0."))}const i=this.getSize();e&&(!i||!Ae(e,i))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}}function uu(n){let t=null;n.keyboardEventTarget!==void 0&&(t=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);const e={},i=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new Ci({layers:n.layers});e[_t.LAYERGROUP]=i,e[_t.TARGET]=n.target,e[_t.VIEW]=n.view instanceof Vt?n.view:new Vt;let s;n.controls!==void 0&&(Array.isArray(n.controls)?s=new jt(n.controls.slice()):(j(typeof n.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),s=n.controls));let r;n.interactions!==void 0&&(Array.isArray(n.interactions)?r=new jt(n.interactions.slice()):(j(typeof n.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),r=n.interactions));let o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new jt(n.overlays.slice()):(j(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new jt,{controls:s,interactions:r,keyboardEventTarget:t,overlays:o,values:e}}class Ir extends Kn{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(z.CHANGE)}release(){this.state===M.ERROR&&this.setState(M.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==M.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){U()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(!i)i=e,this.transitionStarts_[t]=i;else if(i===-1)return 1;const s=e-i+1e3/60;return s>=this.transition_?1:Jo(s/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}class Oa extends Ir{constructor(t,e,i,s,r,o){super(t,e,o),this.crossOrigin_=s,this.src_=i,this.key=i,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=M.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=M.ERROR,this.unlistenImage_(),this.image_=du(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=M.LOADED:this.state=M.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==M.ERROR&&(this.state=M.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==M.IDLE&&(this.state=M.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Oh(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function du(){const n=rt(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}const Fa=.5,fu=10,Co=.25;class ka{constructor(t,e,i,s,r,o){this.sourceProj_=t,this.targetProj_=e;let a={};const l=An(this.targetProj_,this.sourceProj_);this.transformInv_=function(y){const x=y[0]+"/"+y[1];return a[x]||(a[x]=l(y)),a[x]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&q(s)>=q(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?q(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?q(this.targetProj_.getExtent()):null;const c=Ye(i),h=jn(i),u=Un(i),d=Vn(i),f=this.transformInv_(c),g=this.transformInv_(h),_=this.transformInv_(u),m=this.transformInv_(d),p=fu+(o?Math.max(0,Math.ceil(Math.log2(Zi(i)/(o*o*256*256)))):0);if(this.addQuad_(c,h,u,d,f,g,_,m,p),this.wrapsXInSource_){let y=1/0;this.triangles_.forEach(function(x,E,w){y=Math.min(y,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach(x=>{if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-y>this.sourceWorldWidth_/2){const E=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];E[0][0]-y>this.sourceWorldWidth_/2&&(E[0][0]-=this.sourceWorldWidth_),E[1][0]-y>this.sourceWorldWidth_/2&&(E[1][0]-=this.sourceWorldWidth_),E[2][0]-y>this.sourceWorldWidth_/2&&(E[2][0]-=this.sourceWorldWidth_);const w=Math.min(E[0][0],E[1][0],E[2][0]);Math.max(E[0][0],E[1][0],E[2][0])-w.5&&u<1;let g=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const m=Wr([t,e,i,s]);g=q(m)/this.targetWorldWidth_>Co||g}!f&&this.sourceProj_.isGlobal()&&u&&(g=u>Co||g)}if(!g&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!Tt(h,this.maxSourceExtent_))return;let _=0;if(!g&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)g=!0;else if(_=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),_!=1&&_!=2&&_!=4&&_!=8)return}if(c>0){if(!g){const m=[(t[0]+i[0])/2,(t[1]+i[1])/2],p=this.transformInv_(m);let y;f?y=(ci(r[0],d)+ci(a[0],d))/2-ci(p[0],d):y=(r[0]+a[0])/2-p[0];const x=(r[1]+a[1])/2-p[1];g=y*y+x*x>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){const m=[(e[0]+i[0])/2,(e[1]+i[1])/2],p=this.transformInv_(m),y=[(s[0]+t[0])/2,(s[1]+t[1])/2],x=this.transformInv_(y);this.addQuad_(t,e,m,y,r,o,p,x,c-1),this.addQuad_(y,m,i,s,x,p,a,l,c-1)}else{const m=[(t[0]+e[0])/2,(t[1]+e[1])/2],p=this.transformInv_(m),y=[(i[0]+s[0])/2,(i[1]+s[1])/2],x=this.transformInv_(y);this.addQuad_(t,m,y,s,r,p,x,l,c-1),this.addQuad_(m,e,i,y,p,o,a,x,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}_&11||this.addTriangle_(t,i,s,r,a,l),_&14||this.addTriangle_(t,i,e,r,a,o),_&&(_&13||this.addTriangle_(e,s,t,o,l,r),_&7||this.addTriangle_(e,s,i,o,l,a))}calculateSourceExtent(){const t=Ft();return this.triangles_.forEach(function(e,i,s){const r=e.source;zi(t,r[0]),zi(t,r[1]),zi(t,r[2])}),t}getTriangles(){return this.triangles_}}let Ts;const ue=[];function Ro(n,t,e,i,s){n.beginPath(),n.moveTo(0,0),n.lineTo(t,e),n.lineTo(i,s),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(t,i)+1,Math.max(e,s)),n.restore()}function Is(n,t){return Math.abs(n[t*4]-210)>2||Math.abs(n[t*4+3]-.75*255)>2}function gu(){if(Ts===void 0){const n=rt(6,6,ue);n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",Ro(n,4,5,4,0),Ro(n,4,5,0,5);const t=n.getImageData(0,0,3,3).data;Ts=Is(t,0)||Is(t,4)||Is(t,8),mi(n),ue.push(n.canvas)}return Ts}function To(n,t,e,i){const s=qo(e,t,n);let r=Zr(t,i,e);const o=t.getMetersPerUnit();o!==void 0&&(r*=o);const a=n.getMetersPerUnit();a!==void 0&&(r/=a);const l=n.getExtent();if(!l||_i(l,s)){const c=Zr(n,r,s)/r;isFinite(c)&&c>0&&(r/=c)}return r}function Na(n,t,e,i){const s=Xe(e);let r=To(n,t,s,i);return(!isFinite(r)||r<=0)&&Ko(e,function(o){return r=To(n,t,o,i),isFinite(r)&&r>0}),r}function Ga(n,t,e,i,s,r,o,a,l,c,h,u,d,f){const g=rt(Math.round(e*n),Math.round(e*t),ue);if(u||(g.imageSmoothingEnabled=!1),l.length===0)return g.canvas;g.scale(e,e);function _(w){return Math.round(w*e)/e}g.globalCompositeOperation="lighter";const m=Ft();l.forEach(function(w,v,T){Tl(m,w.extent)});let p;const y=e/i,x=(u?1:1+Math.pow(2,-24))/y;if(!d||l.length!==1||c!==0){if(p=rt(Math.round(q(m)*y),Math.round(pt(m)*y),ue),u||(p.imageSmoothingEnabled=!1),s&&f){const w=(s[0]-m[0])*y,v=-(s[3]-m[3])*y,T=q(s)*y,R=pt(s)*y;p.rect(w,v,T,R),p.clip()}l.forEach(function(w,v,T){if(w.image.width>0&&w.image.height>0){if(w.clipExtent){p.save();const b=(w.clipExtent[0]-m[0])*y,O=-(w.clipExtent[3]-m[3])*y,A=q(w.clipExtent)*y,F=pt(w.clipExtent)*y;p.rect(u?b:Math.round(b),u?O:Math.round(O),u?A:Math.round(b+A)-Math.round(b),u?F:Math.round(O+F)-Math.round(O)),p.clip()}const R=(w.extent[0]-m[0])*y,I=-(w.extent[3]-m[3])*y,G=q(w.extent)*y,D=pt(w.extent)*y;p.drawImage(w.image,c,c,w.image.width-2*c,w.image.height-2*c,u?R:Math.round(R),u?I:Math.round(I),u?G:Math.round(R+G)-Math.round(R),u?D:Math.round(I+D)-Math.round(I)),w.clipExtent&&p.restore()}})}const E=Ye(o);return a.getTriangles().forEach(function(w,v,T){const R=w.source,I=w.target;let G=R[0][0],D=R[0][1],b=R[1][0],O=R[1][1],A=R[2][0],F=R[2][1];const L=_((I[0][0]-E[0])/r),Z=_(-(I[0][1]-E[1])/r),K=_((I[1][0]-E[0])/r),et=_(-(I[1][1]-E[1])/r),k=_((I[2][0]-E[0])/r),X=_(-(I[2][1]-E[1])/r),Q=G,ct=D;G=0,D=0,b-=Q,O-=ct,A-=Q,F-=ct;const S=[[b,O,0,0,K-L],[A,F,0,0,k-L],[0,0,b,O,et-Z],[0,0,A,F,X-Z]],xt=fl(S);if(!xt)return;if(g.save(),g.beginPath(),gu()||!u){g.moveTo(K,et);const at=4,Zt=L-K,Jt=Z-et;for(let Lt=0;Lt{const G=e.getTileRangeForExtentAndZ(I,this.sourceZ_);for(let D=G.minX;D<=G.maxX;D++)for(let b=G.minY;b<=G.maxY;b++){const O=c(this.sourceZ_,D,b,a);if(O){const A=T*v;this.sourceTiles_.push({tile:O,offset:A})}}++T}),this.sourceTiles_.length===0&&(this.state=M.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{const i=e.tile;if(i&&i.getState()==M.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);s[0]+=e.offset,s[2]+=e.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=e.offset,r[2]+=e.offset),t.push({extent:s,clipExtent:r,image:i.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=M.ERROR;else{const e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),s=typeof i=="number"?i:i[0],r=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Ga(s,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=M.LOADED}this.changed()}load(){if(this.state==M.IDLE){this.state=M.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{const i=e.getState();if(i==M.IDLE||i==M.LOADING){t++;const s=V(e,z.CHANGE,r=>{const o=e.getState();(o==M.LOADED||o==M.ERROR||o==M.EMPTY)&&(tt(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},i,s){e.getState()==M.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(tt),this.sourcesListenerKeys_=null}release(){this.canvas_&&(mi(this.canvas_.getContext("2d")),ue.push(this.canvas_),this.canvas_=null),super.release()}}const vs={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class za extends $t{constructor(t){super(),this.projection=kt(t.projection),this.attributions_=Io(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(i,s){e.viewResolver=i,e.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=Io(t),this.changed()}setState(t){this.state_=t,this.changed()}}function Io(n){return n?typeof n=="function"?n:(Array.isArray(n)||(n=[n]),t=>n):null}class vr{constructor(t,e,i,s){this.minX=t,this.maxX=e,this.minY=i,this.maxY=s}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function Je(n,t,e,i,s){return s!==void 0?(s.minX=n,s.maxX=t,s.minY=e,s.maxY=i,s):new vr(n,t,e,i)}function Nn(n,t,e,i){return i!==void 0?(i[0]=n,i[1]=t,i[2]=e,i):[n,t,e]}function _u(n,t,e){return n+"/"+t+"/"+e}function mu(n){return pu(n[0],n[1],n[2])}function pu(n,t,e){return(t<e||e>t.getMaxZoom())return!1;const r=t.getFullTileRange(e);return r?r.containsXY(i,s):!0}const Qe=[0,0,0],pe=5;class Xa{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,j(ll(this.resolutions_,(s,r)=>r-s),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let s=0,r=this.resolutions_.length-1;s{const o=new vr(Math.min(0,s[0]),Math.max(s[0]-1,-1),Math.min(0,s[1]),Math.max(s[1]-1,-1));if(i){const a=this.getTileRangeForExtentAndZ(i,r);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){const s=this.getTileRangeForExtentAndZ(t,e);for(let r=s.minX,o=s.maxX;r<=o;++r)for(let a=s.minY,l=s.maxY;a<=l;++a)i([e,r,a])}forEachTileCoordParentTileRange(t,e,i,s){let r,o,a,l=null,c=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,s);c>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),r=Je(o,o,a,a,i)):r=this.getTileRangeForExtentAndZ(l,c,i),e(c,r))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]this.maxZoom||e0?i:Math.max(r/e[0],s/e[1]);const o=t+1,a=new Array(o);for(let l=0;lthis.getTileInternal(f,g,_,m,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=l,d}getTileInternal(t,e,i,s,r){const o=this.getKey();return this.createTile_(t,e,i,s,r,o)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){const i=kt(t);if(i){const s=$(i);s in this.tileGridForProjection||(this.tileGridForProjection[s]=e)}}}function Fu(n,t){n.getImage().src=t}class ku extends Ou{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",i=t.tileGrid!==void 0?t.tileGrid:wu({extent:Sr(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}const Nu='© OpenStreetMap contributors.';class Gu extends ku{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[Nu];const i=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",s=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:s,wrapX:t.wrapX,zDirection:t.zDirection})}}const Rn={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class zu extends Jn{constructor(t){t=t||{};const e=Object.assign({},t),i=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Rn.PRELOAD)}setPreload(t){this.set(Rn.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(Rn.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(Rn.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}const Xu=5;class Wu extends sn{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=Xu}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return U()}getData(t){return null}prepareFrame(t){return U()}renderFrame(t,e){return U()}forEachFeatureAtCoordinate(t,e,i,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===Y.LOADED||e.getState()===Y.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=Y.LOADED&&e!=Y.ERROR&&t.addEventListener(z.CHANGE,this.boundHandleImageChange_),e==Y.IDLE&&(t.load(),e=t.getState()),e==Y.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}class Za{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(bn(),{get:(t,e)=>{if(typeof bn()[e]=="function")return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,i)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,i),!0)})}pushMethodArgs_=(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this);pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let i=0,s=e.length;i0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();){const e=this.pop();e instanceof Wn&&e.dispose()}}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const i=this.entries_[t];return j(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){const e=this.entries_[t];return j(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.key_;return t}getValues(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){j(!(t in this.entries_),"Tried to set a value for a key that is used already");const i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}}class ju extends Zs{constructor(t){super({tileCoord:t.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:t.interpolate,transition:t.transition}),this.pixelRatio_=t.pixelRatio,this.gutter_=t.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=t.sourceTileGrid,this.targetTileGrid_=t.targetTileGrid,this.wrappedTileCoord_=t.wrappedTileCoord||t.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const e=t.sourceProj,i=e.getExtent(),s=t.sourceTileGrid.getExtent();this.clipExtent_=e.canWrapX()?s?Xt(i,s):i:s;const r=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),o=this.targetTileGrid_.getExtent();let a=this.sourceTileGrid_.getExtent();const l=o?Xt(r,o):r;if(Zi(l)===0){this.state=M.EMPTY;return}i&&(a?a=Xt(a,i):a=i);const c=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),h=t.targetProj,u=Na(e,h,l,c);if(!isFinite(u)||u<=0){this.state=M.EMPTY;return}const d=t.errorThreshold!==void 0?t.errorThreshold:Fa;if(this.triangulation_=new ka(e,h,l,a,u*d,c),this.triangulation_.getTriangles().length===0){this.state=M.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(u);let f=this.triangulation_.calculateSourceExtent();if(a&&(e.canWrapX()?(f[1]=st(f[1],a[1],a[3]),f[3]=st(f[3],a[1],a[3])):f=Xt(f,a)),!Zi(f))this.state=M.EMPTY;else{let g=0,_=0;e.canWrapX()&&(g=q(i),_=Math.floor((f[0]-i[0])/g)),Js(f.slice(),e,!0).forEach(p=>{const y=this.sourceTileGrid_.getTileRangeForExtentAndZ(p,this.sourceZ_),x=t.getTileFunction;for(let E=y.minX;E<=y.maxX;E++)for(let w=y.minY;w<=y.maxY;w++){const v=x(this.sourceZ_,E,w,this.pixelRatio_);if(v){const T=_*g;this.sourceTiles_.push({tile:v,offset:T})}}++_}),this.sourceTiles_.length===0&&(this.state=M.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const t=[];let e=!1;if(this.sourceTiles_.forEach(g=>{const _=g.tile;if(!_||_.getState()!==M.LOADED)return;const m=_.getSize(),p=this.gutter_;let y;const x=Zu(_.getData());x?y=x:(e=!0,y=Bu(Gn(_.getData())));const E=[m[0]+2*p,m[1]+2*p],w=y instanceof Float32Array,v=E[0]*E[1],T=w?Float32Array:Uint8ClampedArray,R=new T(y.buffer),I=T.BYTES_PER_ELEMENT,G=I*R.length/v,D=R.byteLength/E[1],b=Math.floor(D/I/E[0]),O=v*b;let A=R;if(R.length!==O){A=new T(O);let Z=0,K=0;const et=E[0]*b;for(let k=0;k=0;--g){const _=[];for(let w=0,v=t.length;w{const i=e.getState();if(i!==M.IDLE&&i!==M.LOADING)return;t++;const s=V(e,z.CHANGE,()=>{const r=e.getState();(r==M.LOADED||r==M.ERROR||r==M.EMPTY)&&(tt(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e}){e.getState()==M.IDLE&&e.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(tt),this.sourcesListenerKeys_=null}}function Ss(n,t,e,i){return`${n},${_u(t,e,i)}`}function Ls(n,t,e){if(!(e in n))return n[e]=new Set([t]),!0;const i=n[e],s=i.has(t);return s||i.add(t),!s}function Hu(n,t,e){const i=n[e];return i?i.delete(t):!1}function So(n,t){const e=n.layerStatesArray[n.layerIndex];e.extent&&(t=Xt(t,Te(e.extent,n.viewState.projection)));const i=e.layer.getRenderSource();if(!i.getWrapX()){const s=i.getTileGridForProjection(n.viewState.projection).getExtent();s&&(t=Xt(t,s))}return t}class qu extends Ka{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=Ft(),this.tempTileRange_=new vr(0,0,0,0),this.tempTileCoord_=Nn(0,0,0);const i=e.cacheSize!==void 0?e.cacheSize:512;this.tileCache_=new Uu(i),this.renderedProjection_=void 0,this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,i,s){const r=this.tileCache_,a=this.getLayer().getSource(),l=Ss(a.getKey(),t,e,i);let c;if(r.containsKey(l))c=r.get(l);else{if(c=a.getTile(t,e,i,s.pixelRatio,s.viewState.projection),!c)return null;r.set(l,c)}return c}getTile(t,e,i,s){const r=this.getOrCreateTile(t,e,i,s);return r||null}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),s=dt(e.pixelToCoordinateTransform,t.slice()),r=i.getExtent();if(r&&!_i(r,s))return null;const o=e.viewState,a=i.getRenderSource(),l=a.getTileGridForProjection(o.projection),c=a.getTilePixelRatio(e.pixelRatio);for(let h=l.getZForResolution(o.resolution);h>=l.getMinZoom();--h){const u=l.getTileCoordForCoordAndZ(s,h),d=this.getTile(h,u[1],u[2],e);if(!d||d.getState()!==M.LOADED)continue;const f=l.getOrigin(h),g=vt(l.getTileSize(h)),_=l.getResolution(h);let m;if(d instanceof Oa||d instanceof Ys)m=d.getImage();else if(d instanceof Zs){if(m=Gn(d.getData()),!m)continue}else continue;const p=Math.floor(c*((s[0]-f[0])/_-u[1]*g[0])),y=Math.floor(c*((f[1]-s[1])/_-u[2]*g[1])),x=Math.round(c*a.getGutterForProjection(o.projection));return this.getImageData(m,p+x,y+x)}return null}prepareFrame(t){this.renderedProjection_?t.viewState.projection!==this.renderedProjection_&&(this.tileCache_.clear(),this.renderedProjection_=t.viewState.projection):this.renderedProjection_=t.viewState.projection;const e=this.getLayer().getSource();if(!e)return!1;const i=e.getRevision();return this.renderedRevision_?this.renderedRevision_!==i&&(this.renderedRevision_=i,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedRevision_=i,!0}enqueueTiles(t,e,i,s,r){const o=t.viewState,a=this.getLayer(),l=a.getRenderSource(),c=l.getTileGridForProjection(o.projection),h=$(l);h in t.wantedTiles||(t.wantedTiles[h]={});const u=t.wantedTiles[h],d=a.getMapInternal(),f=Math.max(i-r,c.getMinZoom(),c.getZForResolution(Math.min(a.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):c.getResolution(0)),l.zDirection));for(let g=i;g>=f;--g){const _=c.getTileRangeForExtentAndZ(e,g,this.tempTileRange_),m=c.getResolution(g);for(let p=_.minX;p<=_.maxX;++p)for(let y=_.minY;y<=_.maxY;++y){const x=this.getTile(g,p,y,t);if(!x||!Ls(s,x,g))continue;const w=x.getKey();if(u[w]=!0,x.getState()===M.IDLE&&!t.tileQueue.isKeyQueued(w)){const v=Nn(g,p,y,this.tempTileCoord_);t.tileQueue.enqueue([x,h,c.getTileCoordCenter(v),m])}}}}findStaleTile_(t,e){const i=this.tileCache_,s=t[0],r=t[1],o=t[2],a=this.getStaleKeys();for(let l=0;l0&&setTimeout(()=>{this.enqueueTiles(t,G,f-1,R,I-1)},0),!(f in R))return this.container;const D=$(this),b=t.time;for(const k of R[f]){const X=k.getState();if((k instanceof Ys||k instanceof ju)&&X===M.EMPTY)continue;const Q=k.tileCoord;if(X===M.LOADED&&k.getAlpha(D,b)===1){k.endTransition(D);continue}if(this.renderComplete=!1,this.findStaleTile_(Q,R)){Hu(R,k,f),t.animate=!0;continue}if(this.findAltTiles_(d,Q,f+1,R))continue;const xt=d.getMinZoom();for(let ut=f-1;ut>=xt&&!this.findAltTiles_(d,Q,ut,R);--ut);}const O=g/o*l/p,A=this.getRenderContext(t);de(this.tempTransform,y/2,x/2,O,O,0,-y/2,-x/2),i.extent&&this.clipUnrotated(A,t,E),h.getInterpolate()||(A.imageSmoothingEnabled=!1),this.preRender(A,t);const F=Object.keys(R).map(Number);F.sort(ae);let L;const Z=[],K=[];for(let k=F.length-1;k>=0;--k){const X=F[k],Q=h.getTilePixelSize(X,l,r),S=d.getResolution(X)/g,xt=Q[0]*S*O,ut=Q[1]*S*O,at=d.getTileCoordForCoordAndZ(Ye(T),X),Zt=d.getTileCoordExtent(at),Jt=dt(this.tempTransform,[p*(Zt[0]-T[0])/g,p*(T[3]-Zt[3])/g]),Lt=p*h.getGutterForProjection(r);for(const _e of R[X]){if(_e.getState()!==M.LOADED)continue;const Ri=_e.tileCoord,un=at[1]-Ri[1],rs=Math.round(Jt[0]-(un-1)*xt),Ti=at[2]-Ri[2],Me=Math.round(Jt[1]-(Ti-1)*ut),At=Math.round(Jt[0]-un*xt),Kt=Math.round(Jt[1]-Ti*ut),Ke=rs-At,Be=Me-Kt,Ii=F.length===1;let be=!1;L=[At,Kt,At+Ke,Kt,At+Ke,Kt+Be,At,Kt+Be];for(let Ve=0,Ue=Z.length;Ve{const Q=$(h),ct=X.wantedTiles[Q],S=ct?Object.keys(ct).length:0;this.updateCacheSize(S),this.tileCache_.expireCache()};return t.postRenderFunctions.push(et),this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,t*2)}drawTile(t,e,i,s,r,o,a,l){let c;if(t instanceof Zs){if(c=Gn(t.getData()),!c)throw new Error("Rendering array data is not yet supported")}else c=this.getTileImage(t);if(!c)return;const h=this.getRenderContext(e),u=$(this),d=e.layerStatesArray[e.layerIndex],f=d.opacity*(l?t.getAlpha(u,e.time):1),g=f!==h.globalAlpha;g&&(h.save(),h.globalAlpha=f),h.drawImage(c,a,a,c.width-2*a,c.height-2*a,i,s,r,o),g&&h.restore(),f!==d.opacity?e.animate=!0:l&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,i){const s=$(e);s in t||(t[s]={}),t[s][i.getKey()]=!0}}class $u extends zu{constructor(t){super(t)}createRenderer(){return new qu(this,{cacheSize:this.getCacheSize()})}}class Xi extends $t{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new Xi(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(tt(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=V(t,z.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?Ju(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function Ju(n){if(typeof n=="function")return n;let t;return Array.isArray(n)?t=n:(j(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[n]),function(){return t}}function Ks(n,t,e,i,s,r,o){let a,l;const c=(e-t)/i;if(c===1)a=t;else if(c===2)a=t,l=s;else if(c!==0){let h=n[t],u=n[t+1],d=0;const f=[0];for(let m=t+i;m1?o:2,r=r||new Array(o);for(let h=0;h>1;sl&&(this.instructions.push([P.CUSTOM,l,h,t,i,ke,r]),this.hitDetectionInstructions.push([P.CUSTOM,l,h,t,s||i,ke,r]));break;case"Point":c=t.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),h=this.coordinates.length,this.instructions.push([P.CUSTOM,l,h,t,i,void 0,r]),this.hitDetectionInstructions.push([P.CUSTOM,l,h,t,s||i,void 0,r]);break}this.endGeometry(e)}beginGeometry(t,e,i){this.beginGeometryInstruction1_=[P.BEGIN_GEOMETRY,e,0,t,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[P.BEGIN_GEOMETRY,e,0,t,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const i=t.length;let s,r,o=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[P.SET_FILL_STYLE,e];return typeof e!="string"&&i.push(t.fillPatternScale),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[P.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,s=t.lineCap,r=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,l=t.lineWidth,c=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=s||r!=t.currentLineDash&&!Ae(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=c)&&(i!==void 0&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=s,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=l,t.currentMiterLimit=c)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[P.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Xo(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;Hs(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class td extends cn{constructor(t,e,i,s){super(t,e,i,s),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,i){if(!this.image_||this.maxExtent&&!_i(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,i);const s=t.getFlatCoordinates(),r=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(s,r);this.instructions.push([P.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([P.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,i){if(!this.image_)return;this.beginGeometry(t,e,i);const s=t.getFlatCoordinates(),r=[];for(let l=0,c=s.length;l=n){const g=(n-a+f)/f,_=St(c,u,g),m=St(h,d,g);l.push(_,m),r.push(l),l=[_,m],a==n&&(o+=s),a=0}else if(a0&&r.push(l),r}function nd(n,t,e,i,s){let r=e,o=e,a=0,l=0,c=e,h,u,d,f,g,_,m,p,y,x;for(u=e;un&&(l>a&&(a=l,r=c,o=u),l=0,c=u-s)),d=f,m=y,p=x),g=E,_=w}return l+=f,l>a?[c,u]:[r,o]}const Xn={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class sd extends cn{constructor(t,e,i,s){super(t,e,i,s),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[Ct]={fillStyle:Ct},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,i){const s=this.textFillState_,r=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!s&&!r)return;const a=this.coordinates;let l=a.length;const c=t.getType();let h=null,u=t.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!Tt(this.maxExtent,t.getExtent()))return;let d;if(h=t.getFlatCoordinates(),c=="LineString")d=[h.length];else if(c=="MultiLineString")d=t.getEnds();else if(c=="Polygon")d=t.getEnds().slice(0,1);else if(c=="MultiPolygon"){const m=t.getEndss();d=[];for(let p=0,y=m.length;p{const w=a[(y+E)*2]===h[E*u]&&a[(y+E)*2+1]===h[E*u+1];return w||--y,w})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&this.updateFillStyle(this.state,this.createFill),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e,i);let g=o.padding;if(g!=Ge&&(o.scale[0]<0||o.scale[1]<0)){let y=o.padding[0],x=o.padding[1],E=o.padding[2],w=o.padding[3];o.scale[0]<0&&(x=-x,w=-w),o.scale[1]<0&&(y=-y,E=-E),g=[y,x,E,w]}const _=this.pixelRatio;this.instructions.push([P.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,g==Ge?Ge:g.map(function(y){return y*_}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const m=1/_,p=this.state.fillStyle;o.backgroundFill&&(this.state.fillStyle=Ct,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([P.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,this.declutterMode_,this.declutterImageWithText_,g,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Ct:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),o.backgroundFill&&(this.state.fillStyle=p,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||$i,justify:e.justify,textBaseline:e.textBaseline||Dn,scale:e.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(t,e){const i=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,c=Xn[s.textBaseline],h=this.textOffsetY_*l,u=this.text_,d=i?i.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([P.DRAW_CHARS,t,e,c,s.overflow,a,s.maxAngle,l,h,r,d*l,u,o,1,this.declutterMode_]),this.hitDetectionInstructions.push([P.DRAW_CHARS,t,e,c,s.overflow,a&&Ct,s.maxAngle,l,h,r,d*l,u,o,1/l,this.declutterMode_])}setTextStyle(t,e){let i,s,r;if(!t)this.text_="";else{const o=t.getFill();o?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=qt(o.getColor()||Ct)):(s=null,this.textFillState_=s);const a=t.getStroke();if(!a)r=null,this.textStrokeState_=r;else{r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const g=a.getLineDash(),_=a.getLineDashOffset(),m=a.getWidth(),p=a.getMiterLimit();r.lineCap=a.getLineCap()||pi,r.lineDash=g?g.slice():le,r.lineDashOffset=_===void 0?he:_,r.lineJoin=a.getLineJoin()||yi,r.lineWidth=m===void 0?Ji:m,r.miterLimit=p===void 0?Hi:p,r.strokeStyle=qt(a.getColor()||qi)}i=this.textState_;const l=t.getFont()||ma;Wh(l);const c=t.getScaleArray();i.overflow=t.getOverflow(),i.font=l,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||Dn,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Ge,i.scale=c===void 0?[1,1]:c;const h=t.getOffsetX(),u=t.getOffsetY(),d=t.getRotateWithView(),f=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=h===void 0?0:h,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textRotation_=f===void 0?0:f,this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:$(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=s&&s.fillStyle?typeof s.fillStyle=="string"?s.fillStyle:"|"+$(s.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const rd={Circle:Ao,Default:cn,Image:td,LineString:ed,Polygon:Ao,Text:sd};class od{constructor(t,e,i,s){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=s,this.resolution_=i,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const i=this.buildersByZIndex_[e];for(const s in i){const r=i[s].finish();t[e][s]=r}}return t}getBuilder(t,e){const i=t!==void 0?t.toString():"0";let s=this.buildersByZIndex_[i];s===void 0&&(s={},this.buildersByZIndex_[i]=s);let r=s[e];if(r===void 0){const o=rd[e];r=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[e]=r}return r}}function ad(n,t,e,i,s,r,o,a,l,c,h,u){let d=n[t],f=n[t+1],g=0,_=0,m=0,p=0;function y(){g=d,_=f,t+=i,d=n[t],f=n[t+1],p+=m,m=Math.sqrt((d-g)*(d-g)+(f-_)*(f-_))}do y();while(tL[2]}else D=E>I;const b=Math.PI,O=[],A=v+i===t;t=v,m=0,p=T,d=n[t],f=n[t+1];let F;if(A){y(),F=Math.atan2(f-_,d-g),D&&(F+=F>0?-b:b);const L=(I+E)/2,Z=(G+w)/2;return O[0]=[L,Z,(R-r)/2,F,s],O}s=s.replace(/\n/g," ");for(let L=0,Z=s.length;L0?-b:b),F!==void 0){let S=K-F;if(S+=S>b?-2*b:S<-b?2*b:0,Math.abs(S)>o)return null}F=K;const et=L;let k=0;for(;L0&&n.push(` -`,""),n.push(t,""),n}class hd{constructor(t,e,i,s,r){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=Wt(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new Za:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,i,s){const r=t+e+i+s;if(this.labels_[r])return this.labels_[r];const o=s?this.strokeStates[s]:null,a=i?this.fillStates[i]:null,l=this.textStates[e],c=this.pixelRatio,h=[l.scale[0]*c,l.scale[1]*c],u=l.justify?Xn[l.justify]:As(Array.isArray(t)?t[0]:t,l.textAlign||$i),d=s&&o.lineWidth?o.lineWidth:0,f=Array.isArray(t)?t:String(t).split(` -`).reduce(ld,[]),{width:g,height:_,widths:m,heights:p,lineWidths:y}=Zh(l,f),x=g+d,E=[],w=(x+2)*h[0],v=(_+d)*h[1],T={width:w<0?Math.floor(w):Math.ceil(w),height:v<0?Math.floor(v):Math.ceil(v),contextInstructions:E};(h[0]!=1||h[1]!=1)&&E.push("scale",h),s&&(E.push("strokeStyle",o.strokeStyle),E.push("lineWidth",d),E.push("lineCap",o.lineCap),E.push("lineJoin",o.lineJoin),E.push("miterLimit",o.miterLimit),E.push("setLineDash",[o.lineDash]),E.push("lineDashOffset",o.lineDashOffset)),i&&E.push("fillStyle",a.fillStyle),E.push("textBaseline","middle"),E.push("textAlign","center");const R=.5-u;let I=u*x+R*d;const G=[],D=[];let b=0,O=0,A=0,F=0,L;for(let Z=0,K=f.length;Zt?t-c:r,E=o+h>e?e-h:o,w=g[3]+x*d[0]+g[1],v=g[0]+E*d[1]+g[2],T=p-g[3],R=y-g[0];(_||u!==0)&&(ye[0]=T,Ee[0]=T,ye[1]=R,ie[1]=R,ie[0]=T+w,ne[0]=ie[0],ne[1]=R+v,Ee[1]=ne[1]);let I;return u!==0?(I=de(Wt(),i,s,1,1,u,-i,-s),dt(I,ye),dt(I,ie),dt(I,ne),dt(I,Ee),Se(Math.min(ye[0],ie[0],ne[0],Ee[0]),Math.min(ye[1],ie[1],ne[1],Ee[1]),Math.max(ye[0],ie[0],ne[0],Ee[0]),Math.max(ye[1],ie[1],ne[1],Ee[1]),ei)):Se(Math.min(T,T+w),Math.min(R,R+v),Math.max(T,T+w),Math.max(R,R+v),ei),f&&(p=Math.round(p),y=Math.round(y)),{drawImageX:p,drawImageY:y,drawImageW:x,drawImageH:E,originX:c,originY:h,declutterBox:{minX:ei[0],minY:ei[1],maxX:ei[2],maxY:ei[3],value:m},canvasTransform:I,scale:d}}replayImageOrLabel_(t,e,i,s,r,o,a){const l=!!(o||a),c=s.declutterBox,h=a?a[2]*s.scale[0]/2:0;return c.minX-h<=e[0]&&c.maxX+h>=0&&c.minY-h<=e[1]&&c.maxY+h>=0&&(l&&this.replayTextBackground_(t,ye,ie,ne,Ee,o,a),Kh(t,s.canvasTransform,r,i,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const i=dt(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;t.save(),t.translate(i[0]%s,i[1]%s),e!==1&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,s){const r=this.textStates[e],o=this.createLabel(t,e,s,i),a=this.strokeStates[i],l=this.pixelRatio,c=As(Array.isArray(t)?t[0]:t,r.textAlign||$i),h=Xn[r.textBaseline||Dn],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*r.scale[0],f=c*d+2*(.5-c)*u,g=h*o.height/l+2*(.5-h)*u;return{label:o,anchorX:f,anchorY:g}}execute_(t,e,i,s,r,o,a,l){const c=this.zIndexContext_;let h;this.pixelCoordinates_&&Ae(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=ve(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Bl(this.renderedTransform_,i));let u=0;const d=s.length;let f=0,g,_,m,p,y,x,E,w,v,T,R,I,G,D=0,b=0,O=null,A=null;const F=this.coordinateCache_,L=this.viewRotation_,Z=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,K={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:L},et=this.instructions!=s||this.overlaps?0:200;let k,X,Q,ct;for(;uet&&(this.fill_(t),D=0),b>et&&(t.stroke(),b=0),!D&&!b&&(t.beginPath(),y=NaN,x=NaN),++u;break;case P.CIRCLE:f=S[1];const ut=h[f],at=h[f+1],Zt=h[f+2],Jt=h[f+3],Lt=Zt-ut,_e=Jt-at,Ri=Math.sqrt(Lt*Lt+_e*_e);t.moveTo(ut+Ri,at),t.arc(ut,at,Ri,0,2*Math.PI,!0),++u;break;case P.CLOSE_PATH:t.closePath(),++u;break;case P.CUSTOM:f=S[1],g=S[2];const un=S[3],rs=S[4],Ti=S[5];K.geometry=un,K.feature=k,u in F||(F[u]=[]);const Me=F[u];Ti?Ti(h,f,g,2,Me):(Me[0]=h[f],Me[1]=h[f+1],Me.length=2),c&&(c.zIndex=S[6]),rs(Me,K),++u;break;case P.DRAW_IMAGE:f=S[1],g=S[2],v=S[3],_=S[4],m=S[5];let At=S[6];const Kt=S[7],Ke=S[8],Be=S[9],Ii=S[10];let be=S[11];const Ve=S[12];let Ue=S[13];p=S[14]||"declutter";const lt=S[15];if(!v&&S.length>=20){T=S[19],R=S[20],I=S[21],G=S[22];const Mt=this.drawLabelWithPointPlacement_(T,R,I,G);v=Mt.label,S[3]=v;const De=S[23];_=(Mt.anchorX-De)*this.pixelRatio,S[4]=_;const bt=S[24];m=(Mt.anchorY-bt)*this.pixelRatio,S[5]=m,At=v.height,S[6]=At,Ue=v.width,S[13]=Ue}let os;S.length>25&&(os=S[25]);let as,dn,fn;S.length>17?(as=S[16],dn=S[17],fn=S[18]):(as=Ge,dn=!1,fn=!1),Ii&&Z?be+=L:!Ii&&!Z&&(be-=L);let $a=0;for(;f!Ua.includes(n));class ud{constructor(t,e,i,s,r,o,a){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Wt(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,a)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t,e){for(const i in t){let s=this.executorsByZIndex_[i];s===void 0&&(s={},this.executorsByZIndex_[i]=s);const r=t[i];for(const o in r){const a=r[o];s[o]=new hd(this.resolution_,this.pixelRatio_,this.overlaps_,a,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let s=0,r=t.length;s0){if(!o||T==="none"||f!=="Image"&&f!=="Text"||o.includes(w)){const D=(d[I]-3)/4,b=s-D%a,O=s-(D/a|0),A=r(w,v,b*b+O*O);if(A)return A}h.clearRect(0,0,a,a);break}}const _=Object.keys(this.executorsByZIndex_).map(Number);_.sort(ae);let m,p,y,x,E;for(m=_.length-1;m>=0;--m){const w=_[m].toString();for(y=this.executorsByZIndex_[w],p=li.length-1;p>=0;--p)if(f=li[p],x=y[f],x!==void 0&&(E=x.executeHitDetection(h,l,i,g,u),E))return E}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],s=e[1],r=e[2],o=e[3],a=[i,s,i,o,r,o,r,s];return ve(a,0,8,2,t,a),a}isEmpty(){return gi(this.executorsByZIndex_)}execute(t,e,i,s,r,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(ae),o=o||li;const c=li.length;let h,u,d,f,g;for(a&&l.reverse(),h=0,u=l.length;hp.execute(w,e,i,s,r,a)),E&&x.restore(),y){y.offset();const w=l[h]*c+d;this.deferredZIndexContexts_[w]||(this.deferredZIndexContexts_[w]=[]),this.deferredZIndexContexts_[w].push(y)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(ae);for(let i=0,s=e.length;i{r.draw(this.renderedContext_),r.clear()}),t[e[i]].length=0}}const Ms={};function dd(n){if(Ms[n]!==void 0)return Ms[n];const t=n*2+1,e=n*n,i=new Array(e+1);for(let r=0;r<=n;++r)for(let o=0;o<=n;++o){const a=r*r+o*o;if(a>e)break;let l=i[a];l||(l=[],i[a]=l),l.push(((n+r)*t+(n+o))*4+3),r>0&&l.push(((n-r)*t+(n+o))*4+3),o>0&&(l.push(((n+r)*t+(n-o))*4+3),r>0&&l.push(((n-r)*t+(n-o))*4+3))}const s=[];for(let r=0,o=i.length;ru*this.pixelRatio_),lineDashOffset:(o||he)*this.pixelRatio_,lineJoin:a!==void 0?a:yi,lineWidth:(l!==void 0?l:Ji)*this.pixelRatio_,miterLimit:c!==void 0?c:Hi,strokeStyle:qt(i||qi)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const i=t.getPixelRatio(this.pixelRatio_),s=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*i,this.imageAnchorY_=s[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const f=e.getColor();this.textFillState_={fillStyle:qt(f||Ct)}}const i=t.getStroke();if(!i)this.textStrokeState_=null;else{const f=i.getColor(),g=i.getLineCap(),_=i.getLineDash(),m=i.getLineDashOffset(),p=i.getLineJoin(),y=i.getWidth(),x=i.getMiterLimit();this.textStrokeState_={lineCap:g!==void 0?g:pi,lineDash:_||le,lineDashOffset:m||he,lineJoin:p!==void 0?p:yi,lineWidth:y!==void 0?y:Ji,miterLimit:x!==void 0?x:Hi,strokeStyle:qt(f||qi)}}const s=t.getFont(),r=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),l=t.getRotation(),c=t.getScaleArray(),h=t.getText(),u=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:s!==void 0?s:ma,textAlign:u!==void 0?u:$i,textBaseline:d!==void 0?d:Dn},this.text_=h!==void 0?Array.isArray(h)?h.reduce((f,g,_)=>f+=_%2?" ":g,""):h:"",this.textOffsetX_=r!==void 0?this.pixelRatio_*r:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}}const Ut=.5;function gd(n,t,e,i,s,r,o,a,l){const c=s,h=n[0]*Ut,u=n[1]*Ut,d=rt(h,u);d.imageSmoothingEnabled=!1;const f=d.canvas,g=new fd(d,Ut,s,null,o,a,null),_=e.length,m=Math.floor((256*256*256-1)/_),p={};for(let x=1;x<=_;++x){const E=e[x-1],w=E.getStyleFunction()||i;if(!w)continue;let v=w(E,r);if(!v)continue;Array.isArray(v)||(v=[v]);const R=(x*m).toString(16).padStart(7,"#00000");for(let I=0,G=v.length;I0;return u&&Promise.all(l).then(()=>s(null)),Ed(n,t,e,i,r,o,a),u}function Ed(n,t,e,i,s,r,o){const a=e.getGeometryFunction()(t);if(!a)return;const l=a.simplifyTransformed(i,s);if(e.getRenderer())qa(n,l,e,t,o);else{const h=ja[l.getType()];h(n,l,e,t,o,r)}}function qa(n,t,e,i,s){if(t.getType()=="GeometryCollection"){const o=t.getGeometries();for(let a=0,l=o.length;a{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=this.frameState.size.slice(),s=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,c=this.getLayer(),h=[],u=i[0]*Ut,d=i[1]*Ut;h.push(this.getRenderTransform(s,r,o,Ut,u,d,0).slice());const f=c.getSource(),g=a.getExtent();if(f.getWrapX()&&a.canWrapX()&&!ai(g,l)){let _=l[0];const m=q(g);let p=0,y;for(;_g[2];)++p,y=m*p,h.push(this.getRenderTransform(s,r,o,Ut,u,d,y).slice()),_-=m}this.hitDetectionImageData_=gd(i,h,this.renderedFeatures_,c.getStyleFunction(),l,r,o,Do(r,this.renderedPixelRatio_))}e(_d(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,s,r){if(!this.replayGroup_)return;const o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),c={},h=function(g,_,m){const p=$(g),y=c[p];if(y){if(y!==!0&&mu=g.forEachFeatureAtCoordinate(t,o,a,i,h,f&&e.declutter[f]?e.declutter[f].all().map(_=>_.value):null)),u}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const s=t.viewHints[mt.ANIMATING],r=t.viewHints[mt.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&s||!a&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=t.extent,c=t.viewState,h=c.projection,u=c.resolution,d=t.pixelRatio,f=e.getRevision(),g=e.getRenderBuffer();let _=e.getRenderOrder();_===void 0&&(_=pd);const m=c.center.slice(),p=Hs(l,g*u),y=p.slice(),x=[p.slice()],E=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!ai(E,t.extent)){const A=q(E),F=Math.max(q(p)/2,A);p[0]=E[0]-F,p[2]=E[2]+F,Vo(m,h);const L=Bo(x[0],h);L[0]E[0]&&L[2]>E[2]&&x.push([L[0]-A,L[1],L[2]-A,L[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==_&&this.renderedFrameDeclutter_===!!t.declutter&&ai(this.wrappedRenderedExtent_,p))return Ae(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const w=new od(Ha(u,d),p,u,d);let v;for(let A=0,F=x.length;A{let L;const Z=A.getStyleFunction()||e.getStyleFunction();if(Z&&(L=Z(A,u)),L){const K=this.renderFeature(A,T,L,w,v,this.getLayer().getDeclutter(),F);R=R&&!K}},G=$o(p),D=i.getFeaturesInExtent(G);_&&D.sort(_);for(let A=0,F=D.length;A{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":i.length=$n(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),s=[i.length];break;case"MultiLineString":s=[],i.length=nh(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,s);break;case"Polygon":s=[],i.length=ea(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,s);break}return s&&(this.simplifiedGeometry_=new Gt(this.type_,i,s,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}Gt.prototype.getFlatCoordinates=Gt.prototype.getOrientedFlatCoordinates;const Pt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function Md(n,t){return[[-1/0,-1/0,1/0,1/0]]}let bd=!1;function Dd(n,t,e,i,s,r,o){const a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(e,i,s):n,!0),t.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=bd,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const c=t.getType();try{let h;c=="text"||c=="json"?h=a.responseText:c=="xml"?h=a.responseXML||a.responseText:c=="arraybuffer"&&(h=a.response),h?r(t.readFeatures(h,{extent:e,featureProjection:s}),t.readProjection(h)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function ko(n,t){return function(e,i,s,r,o){const a=this;Dd(n,t,e,i,s,function(l,c){a.addFeatures(l),r!==void 0&&r(l)},o||fi)}}class xe extends fe{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class Pd extends za{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=fi,this.format_=t.format||null,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(j(this.format_,"`format` must be set when `url` is set"),this.loader_=ko(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:Md;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new Oo:null,this.loadedExtentsRtree_=new Oo,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,s;Array.isArray(t.features)?s=t.features:t.features&&(i=t.features,s=i.getArray()),!e&&i===void 0&&(i=new jt(s)),s!==void 0&&this.addFeaturesInternal(s),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=$(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const s=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new xe(Pt.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof Gt||(this.featureChangeKeys_[t]=[V(e,z.CHANGE,this.handleFeatureChange_,this),V(e,di.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(e.getId()!==void 0){const s=String(e.getId());if(!(s in this.idIndex_))this.idIndex_[s]=e;else if(e instanceof Gt){const r=this.idIndex_[s];r instanceof Gt?Array.isArray(r)?r.push(e):this.idIndex_[s]=[r,e]:i=!1}else i=!1}return i&&(j(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],s=[];for(let r=0,o=t.length;r{e||(e=!0,this.addFeature(i.element),e=!1)}),t.addEventListener(wt.REMOVE,i=>{e||(e=!0,this.removeFeature(i.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(tt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=s=>{this.removeFeatureInternal(s)};this.featuresRtree_.forEach(i);for(const s in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[s])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new xe(Pt.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(s){const r=s.getGeometry();if(r instanceof Gt||r.intersectsCoordinate(t))return e(s)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(i){const s=i.getGeometry();if(s instanceof Gt||s.intersectsExtent(t)){const r=e(i);if(r)return r}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),gi(this.nullGeometryFeatures_)||Yn(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){e.push(i)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const s=Js(t,e);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],s=t[1];let r=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return e=e||Wi,this.featuresRtree_.forEachInExtent(l,function(c){if(e(c)){const h=c.getGeometry(),u=a;if(a=h instanceof Gt?0:h.closestPointXY(i,s,o,a),a{--this.loadingExtentsCount_,this.dispatchEvent(new xe(Pt.FEATURESLOADEND,void 0,h))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new xe(Pt.FEATURESLOADERROR))}),s.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let i;e.forEachInExtent(t,function(s){if(Yi(s.extent,t))return i=s,!0}),i&&e.remove(i)}removeFeatures(t){let e=!1;for(let i=0,s=t.length;it.geo&&t.geo.lat&&t.geo.lon);return n?[n.geo.lon,n.geo.lat]:[0,0]}return[this.d.geo.lon,this.d.geo.lat]}},async mounted(){await fetch("https://tile.openstreetmap.org/",{signal:AbortSignal.timeout(1500)}).then(n=>{const t=new cu({target:"map",layers:[new $u({source:new Gu})],view:new Vt({center:us(this.getLastLonLat()),zoom:this.type==="traceroute"?3:10})}),e=[],i=new Pd;if(this.type==="traceroute")this.d.forEach(a=>{if(a.geo&&a.geo.lat&&a.geo.lon){const l=us([a.geo.lon,a.geo.lat]);e.push(l);const c=this.getLastLonLat(),h=new Xi({geometry:new Bi(l),last:a.geo.lon===c[0]&&a.geo.lat===c[1]});i.addFeature(h)}});else{const a=us([this.d.geo.lon,this.d.geo.lat]);e.push(a);const l=new Xi({geometry:new Bi(a)});i.addFeature(l)}const s=new zn(e),r=new Xi({geometry:s});console.log(s),i.addFeature(r);const o=new Ld({source:i,style:function(a){if(a.getGeometry().getType()==="Point")return new ce({image:new on({radius:10,fill:new wi({color:a.get("last")?"#dc3545":"#0d6efd"}),stroke:new Ei({color:"white",width:5})})});if(a.getGeometry().getType()==="LineString")return new ce({stroke:new Ei({color:"#0d6efd",width:2})})}});t.addLayer(o),this.store.Configuration.Server.dashboard_theme==="dark"&&t.on("postcompose",()=>{document.querySelector("#map").style.filter="grayscale(80%) invert(100%)"})}).catch(n=>{this.osmAvailable=!1})}},Fd={key:0,id:"map",class:"w-100 rounded-3"};function kd(n,t,e,i,s,r){return this.osmAvailable?(nl(),sl("div",Fd)):rl("",!0)}const zd=el(Od,[["render",kd]]);export{on as C,wi as F,zn as L,cu as M,Gu as O,Bi as P,ce as S,$u as T,Vt as V,Ld as a,Ei as b,Pd as c,Xi as d,zd as e,us as f}; diff --git a/src/static/app/dist/assets/osmapSocket-CJmzPMGM.js b/src/static/app/dist/assets/osmapSocket-CJmzPMGM.js new file mode 100644 index 0000000..0468877 --- /dev/null +++ b/src/static/app/dist/assets/osmapSocket-CJmzPMGM.js @@ -0,0 +1,10 @@ +import{_ as va,D as Ta,a as Js,c as Qs,e as lh,r as po,E as hh,o as ch,H as uh,b as yo,d as dh}from"./index-CgM9eUIs.js";import{L as fh}from"./localeText-Dh33930I.js";class Ee{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const Ci={PROPERTYCHANGE:"propertychange"};class ns{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function gh(n,t,e){let i,s;e=e||ge;let r=0,o=n.length,a=!1;for(;r>1),s=+e(n[i],t),s<0?r=i+1:(o=i,a=!s);return a?r:~r}function ge(n,t){return n>t?1:n0?s-1:s}return i-1}if(e>0){for(let s=1;s0||o===0)})}function tn(){return!0}function rs(){return!1}function Ri(){}function Sa(n){let t,e,i;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==i||!Ne(s,e))&&(i=this,e=s,t=n.apply(this,arguments)),t}}function ph(n){function t(){let e;try{e=n()}catch(i){return Promise.reject(i)}return e instanceof Promise?e:Promise.resolve(e)}return t()}function mn(n){for(const t in n)delete n[t]}function vi(n){let t;for(t in n)return!1;return!t}class os extends ns{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),s=i[t]||(i[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,s=this.listeners_&&this.listeners_[i];if(!s)return;const r=e?new Ee(t):t;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let c=0,h=s.length;c0:!1}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const s=i.indexOf(e);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[s]=Ri,++this.pendingRemovals_[t]):(i.splice(s,1),i.length===0&&delete this.listeners_[t]))}}const z={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function Z(n,t,e,i,s){if(s){const o=e;e=function(){n.removeEventListener(t,e),o.apply(i??this,arguments)}}else i&&i!==n&&(e=e.bind(i));const r={target:n,type:t,listener:e};return n.addEventListener(t,e),r}function Yn(n,t,e,i){return Z(n,t,e,i,!0)}function et(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),mn(n))}class pn extends os{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(z.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,s=new Array(i);for(let r=0;r0;)this.pop()}extend(t){for(let e=0,i=t.length;ethis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Sn(Rt.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,s=e.length;i=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Sn(Rt.REMOVE,e,t)),e}setAt(t,e){const i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Sn(Rt.REMOVE,s,t)),this.dispatchEvent(new Sn(Rt.ADD,e,t))}updateLength_(){this.set(xo.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,s=this.array_.length;i1?(e=s,i=r):l>0&&(e+=o*l,i+=a*l)}return Ei(n,t,e,i)}function Ei(n,t,e,i){const s=e-n,r=i-t;return s*s+r*r}function wh(n){const t=n.length;for(let i=0;ir&&(r=l,s=a)}if(r===0)return null;const o=n[s];n[s]=n[i],n[i]=o;for(let a=i+1;a=0;i--){e[i]=n[i][t]/n[i][i];for(let s=i-1;s>=0;s--)n[s][t]-=n[s][i]*e[i]}return e}function zn(n){return n*Math.PI/180}function xi(n,t){const e=n%t;return e*t<0?e+t:e}function At(n,t,e){return n+e*(t-n)}function wr(n,t){const e=Math.pow(10,t);return Math.round(n*e)/e}function In(n,t){return Math.floor(wr(n,t))}function bn(n,t){return Math.ceil(wr(n,t))}class Ia extends se{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[Q.OPACITY]=t.opacity!==void 0?t.opacity:1,q(typeof e[Q.OPACITY]=="number","Layer opacity must be a number"),e[Q.VISIBLE]=t.visible!==void 0?t.visible:!0,e[Q.Z_INDEX]=t.zIndex,e[Q.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[Q.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[Q.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[Q.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},i=this.getZIndex();return e.opacity=rt(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return j()}getLayerStatesArray(t){return j()}getExtent(){return this.get(Q.EXTENT)}getMaxResolution(){return this.get(Q.MAX_RESOLUTION)}getMinResolution(){return this.get(Q.MIN_RESOLUTION)}getMinZoom(){return this.get(Q.MIN_ZOOM)}getMaxZoom(){return this.get(Q.MAX_ZOOM)}getOpacity(){return this.get(Q.OPACITY)}getSourceState(){return j()}getVisible(){return this.get(Q.VISIBLE)}getZIndex(){return this.get(Q.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(Q.EXTENT,t)}setMaxResolution(t){this.set(Q.MAX_RESOLUTION,t)}setMinResolution(t){this.set(Q.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(Q.MAX_ZOOM,t)}setMinZoom(t){this.set(Q.MIN_ZOOM,t)}setOpacity(t){q(typeof t=="number","Layer opacity must be a number"),this.set(Q.OPACITY,t)}setVisible(t){this.set(Q.VISIBLE,t)}setZIndex(t){this.set(Q.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Nt={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},yt={ANIMATING:0,INTERACTING:1},Bt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Ch=42,Cr=256,Rr={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class ba{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Rr[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const yn=6378137,mi=Math.PI*yn,Rh=[-mi,-mi,mi,mi],vh=[-180,-85,180,85],An=yn*Math.log(Math.tan(Math.PI/2));class si extends ba{constructor(t){super({code:t,units:"m",extent:Rh,global:!0,worldExtent:vh,getPointResolution:function(e,i){return e/Math.cosh(i[1]/yn)}})}}const wo=[new si("EPSG:3857"),new si("EPSG:102100"),new si("EPSG:102113"),new si("EPSG:900913"),new si("http://www.opengis.net/def/crs/EPSG/0/3857"),new si("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Th(n,t,e,i){const s=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(s));for(let r=0;rAn?o=An:o<-An&&(o=-An),t[r+1]=o}return t}function Sh(n,t,e,i){const s=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(s));for(let r=0;rs&&(l=l|ut.RIGHT),ar&&(l=l|ut.ABOVE),l===ut.UNKNOWN&&(l=ut.INTERSECTING),l}function Gt(){return[1/0,1/0,-1/0,-1/0]}function Pe(n,t,e,i,s){return s?(s[0]=n,s[1]=t,s[2]=e,s[3]=i,s):[n,t,e,i]}function as(n){return Pe(1/0,1/0,-1/0,-1/0,n)}function Ma(n,t){const e=n[0],i=n[1];return Pe(e,i,e,i,t)}function Sr(n,t,e,i,s){const r=as(s);return Oa(r,n,t,e,i)}function en(n,t){return n[0]==t[0]&&n[2]==t[2]&&n[1]==t[1]&&n[3]==t[3]}function Oh(n,t){return t[0]n[2]&&(n[2]=t[2]),t[1]n[3]&&(n[3]=t[3]),n}function Ji(n,t){t[0]n[2]&&(n[2]=t[0]),t[1]n[3]&&(n[3]=t[1])}function Oa(n,t,e,i,s){for(;et[0]?i[0]=n[0]:i[0]=t[0],n[1]>t[1]?i[1]=n[1]:i[1]=t[1],n[2]=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function us(n){return n[2]=o&&_<=l),!i&&r&ut.RIGHT&&!(s&ut.RIGHT)&&(m=f-(d-l)*g,i=m>=a&&m<=c),!i&&r&ut.BELOW&&!(s&ut.BELOW)&&(_=d-(f-a)/g,i=_>=o&&_<=l),!i&&r&ut.LEFT&&!(s&ut.LEFT)&&(m=f-(d-o)*g,i=m>=a&&m<=c)}return i}function Pa(n,t){const e=t.getExtent(),i=qe(n);if(t.canWrapX()&&(i[0]=e[2])){const s=$(e),o=Math.floor((i[0]-e[0])/s)*s;n[0]-=o,n[2]-=o}return n}function Ir(n,t,e){if(t.canWrapX()){const i=t.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[i[0],n[1],i[2],n[3]]];Pa(n,t);const s=$(i);if($(n)>s&&!e)return[[i[0],n[1],i[2],n[3]]];if(n[0]i[2])return[[n[0],n[1],i[2],n[3]],[i[0],n[1],n[2]-s,n[3]]]}return[n]}function Gh(n,t){return n[0]+=+t[0],n[1]+=+t[1],n}function Vn(n,t){let e=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=t[i]){e=!1;break}return e}function br(n,t){const e=Math.cos(t),i=Math.sin(t),s=n[0]*e-n[1]*i,r=n[1]*e+n[0]*i;return n[0]=s,n[1]=r,n}function zh(n,t){return n[0]*=t,n[1]*=t,n}function ka(n,t){if(t.canWrapX()){const e=$(t.getExtent()),i=Bh(n,t,e);i&&(n[0]-=i*e)}return n}function Bh(n,t,e){const i=t.getExtent();let s=0;return t.canWrapX()&&(n[0]i[2])&&(e=e||$(i),s=Math.floor((n[0]-i[0])/e)),s}const Xh=63710088e-1;function To(n,t,e){e=e||Xh;const i=zn(n[1]),s=zn(t[1]),r=(s-i)/2,o=zn(t[0]-n[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(s);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function Fa(...n){console.warn(...n)}let nr=!0;function Na(n){nr=!1}function Ar(n,t){if(t!==void 0){for(let e=0,i=n.length;e=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(nr=!1,Fa("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function Ba(n,t){return n}function Le(n,t){return n}function Vh(){Io(wo),Io(Ro),Kh(Ro,wo,Th,Sh)}Vh();function bo(n,t,e){return function(i,s,r,o,a){if(!i)return;if(!s&&!t)return i;const l=t?0:r[0]*s,c=t?0:r[1]*s,h=a?a[0]:0,u=a?a[1]:0;let d=n[0]+l/2+h,f=n[2]-l/2+h,g=n[1]+c/2+u,_=n[3]-c/2+u;d>f&&(d=(f+d)/2,f=d),g>_&&(g=(_+g)/2,_=g);let m=rt(i[0],d,f),p=rt(i[1],g,_);if(o&&e&&s){const y=30*s;m+=-y*Math.log(1+Math.max(0,d-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-f)/y),p+=-y*Math.log(1+Math.max(0,g-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-_)/y)}return[m,p]}}function Uh(n){return n}function Or(n,t,e,i){const s=$(t)/e[0],r=Et(t)/e[1];return i?Math.min(n,Math.max(s,r)):Math.min(n,Math.min(s,r))}function Dr(n,t,e){let i=Math.min(n,t);const s=50;return i*=Math.log(1+s*Math.max(0,n/t-1))/s+1,e&&(i=Math.max(i,e),i/=Math.log(1+s*Math.max(0,e/n-1))/s+1),rt(i,e/2,t*2)}function Zh(n,t,e,i){return t=t!==void 0?t:!0,function(s,r,o,a){if(s!==void 0){const l=n[0],c=n[n.length-1],h=e?Or(l,e,o,i):l;if(a)return t?Dr(s,h,c):rt(s,c,h);const u=Math.min(h,s),d=Math.floor(xr(n,u,r));return n[d]>h&&dMath.round(e*Mo[i])/Mo[i]).join(", ")+")"}function Oe(n,t,e,i,s,r,o){r=r||[],o=o||2;let a=0;for(let l=t;l{if(!i)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(i),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return j()}closestPointXY(t,e,i,s){return j()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return j()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&as(e),this.extentRevision_=this.getRevision()}return Fh(this.extent_,t)}rotate(t,e){j()}scale(t,e,i){j()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return j()}getType(){return j()}applyTransform(t){j()}intersectsExtent(t){return j()}translate(t,e){j()}transform(t,e){const i=zt(t),s=i.getUnits()=="tile-pixels"?function(r,o,a){const l=i.getExtent(),c=i.getWorldExtent(),h=Et(c)/Et(l);return ye(Oo,c[0],c[3],h,-h,0,0,0),Oe(r,0,r.length,a,Oo,o),Un(i,e)(r,o,a)}:Un(i,e);return this.applyTransform(s),this}}class ds extends sc{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return Sr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return j()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length1)u=e;else if(d>0){for(let f=0;fs&&(s=c),r=a,o=l}return s}function ac(n,t,e,i,s){for(let r=0,o=e.length;r0;){const u=c.pop(),d=c.pop();let f=0;const g=n[d],_=n[d+1],m=n[u],p=n[u+1];for(let y=d+i;yf&&(h=y,f=w)}f>s&&(l[(h-t)/i]=1,d+i0&&_>f)&&(g<0&&m0&&m>g)){c=u,h=d;continue}r[o++]=c,r[o++]=h,a=c,l=h,c=u,h=d}return r[o++]=c,r[o++]=h,o}function Ka(n,t,e,i,s,r,o,a){for(let l=0,c=e.length;lr&&(c-a)*(r-l)-(s-a)*(h-l)>0&&o++:h<=r&&(c-a)*(r-l)-(s-a)*(h-l)<0&&o--,a=c,l=h}return o!==0}function Ua(n,t,e,i,s,r){if(e.length===0||!Ve(n,t,e[0],i,s,r))return!1;for(let o=1,a=e.length;op&&(c=(h+u)/2,Ua(n,t,e,i,c,g)&&(m=c,p=y)),h=u}return isNaN(m)&&(m=s[r]),o?(o.push(m,g,p),o):[m,g,p]}function _c(n,t,e,i,s){let r=[];for(let o=0,a=e.length;o=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:Za(n,t,e,i,function(o,a){return Nh(s,o,a)}):!1}function ja(n,t,e,i,s){return!!(zr(n,t,e,i,s)||Ve(n,t,e,i,s[0],s[1])||Ve(n,t,e,i,s[0],s[3])||Ve(n,t,e,i,s[2],s[1])||Ve(n,t,e,i,s[2],s[3]))}function mc(n,t,e,i,s){if(!ja(n,t,e[0],i,s))return!1;if(e.length===1)return!0;for(let r=1,o=e.length;r0}function yc(n,t,e,i,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let s=0;for(;s0}getInteracting(){return this.hints_[yt.INTERACTING]>0}cancelAnimations(){this.setHint(yt.ANIMATING,-this.hints_[yt.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e=0;--i){const s=this.animations_[i];let r=!0;for(let o=0,a=s.length;o0?c/l.duration:1;h>=1?(l.complete=!0,h=1):r=!1;const u=l.easing(h);if(l.sourceCenter){const d=l.sourceCenter[0],f=l.sourceCenter[1],g=l.targetCenter[0],_=l.targetCenter[1];this.nextCenter_=l.targetCenter;const m=d+u*(g-d),p=f+u*(_-f);this.targetCenter_=[m,p]}if(l.sourceResolution&&l.targetResolution){const d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const f=this.getViewportSize_(this.getRotation()),g=this.constraints_.resolution(d,0,f,!0);this.targetCenter_=this.calculateCenterZoom(g,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=u===1?xi(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const f=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(f,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(r){this.animations_[i]=null,this.setHint(yt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&Ln(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const s=this.getCenterInternal();return s!==void 0&&(i=[s[0]-e[0],s[1]-e[1]],br(i,t-this.getRotation()),Gh(i,e)),i}calculateCenterZoom(t,e){let i;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=e[0]-t*(e[0]-s[0])/r,a=e[1]-t*(e[1]-s[1])/r;i=[o,a]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],s=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(s*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&sr(t,this.getProjection())}getCenterInternal(){return this.get(Bt.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return Ba(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();q(e,"The view center is not defined");const i=this.getResolution();q(i!==void 0,"The view resolution is not defined");const s=this.getRotation();return q(s!==void 0,"The view rotation is not defined"),ir(e,i,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Bt.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(Le(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=$(t)/e[0],s=Et(t)/e[1];return Math.max(i,s)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,s=Math.log(e/i)/Math.log(t);return function(r){return e/Math.pow(t,r*s)}}getRotation(){return this.get(Bt.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(i/s)/e;return function(o){return Math.log(i/o)/e/r}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=Ms(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,i)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,i,s;if(this.resolutions_){const r=xr(this.resolutions_,t,1);e=r,i=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=i/this.resolutions_[r+1]}else i=this.maxResolution_,s=this.zoomFactor_;return e+Math.log(i/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const e=rt(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,rt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(q(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){q(!us(t),"Cannot fit empty extent provided as `geometry`");const s=Le(t,this.getProjection());i=No(s)}else if(t.getType()==="Circle"){const s=Le(t.getExtent(),this.getProjection());i=No(s),i.rotate(this.getRotation(),qe(s))}else i=t;this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),s=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,c=-1/0,h=-1/0;for(let u=0,d=r.length;u{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof Yt?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let s;e.layerStatesArray?s=e.layerStatesArray.find(o=>o.layer===this):s=this.getLayerState();const r=this.getExtent();return Xr(s,e.viewState)&&(!r||St(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];const i=t instanceof Yt?t.getViewStateAndExtent():t;let s=e(i);return Array.isArray(s)||(s=[s]),s}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(Q.MAP,t)}getMapInternal(){return this.get(Q.MAP)}setMap(t){this.mapPrecomposeKey_&&(et(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(et(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Z(t,Nt.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=Z(this,z.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,i=this.getLayerState(!1);q(!e.some(s=>s.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(i)}setSource(t){this.set(Q.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function Xr(n,t){if(!n.visible)return!1;const e=t.resolution;if(e=n.maxResolution)return!1;const i=t.zoom;return i>n.minZoom&&i<=n.maxZoom}function qa(n,t,e=0,i=n.length-1,s=vc){for(;i>e;){if(i-e>600){const l=i-e+1,c=t-e+1,h=Math.log(l),u=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(e,Math.floor(t-c*u/l+d)),g=Math.min(i,Math.floor(t+(l-c)*u/l+d));qa(n,t,f,g,s)}const r=n[t];let o=e,a=i;for(Bi(n,e,t),s(n[i],r)>0&&Bi(n,e,i);o0;)a--}s(n[e],r)===0?Bi(n,e,a):(a++,Bi(n,a,i)),a<=t&&(e=a+1),t<=a&&(i=a-1)}}function Bi(n,t,e){const i=n[t];n[t]=n[e],n[e]=i}function vc(n,t){return nt?1:0}let Ha=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!On(t,e))return i;const s=this.toBBox,r=[];for(;e;){for(let o=0;o=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)}_split(t,e){const i=t[e],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);const o=this._chooseSplitIndex(i,r,s),a=di(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,ri(i,this.toBBox),ri(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=di([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ri(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let s,r=1/0,o=1/0;for(let a=e;a<=i-e;a++){const l=Vi(t,0,a,this.toBBox),c=Vi(t,a,i,this.toBBox),h=Ac(l,c),u=Os(l)+Os(c);h=e;c--){const h=t.children[c];Ui(a,t.leaf?r(h):h),l+=Mn(a)}return l}_adjustParentBBoxes(t,e,i){for(let s=i;s>=0;s--)Ui(e[s],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)t[e].children.length===0?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():ri(t[e],this.toBBox)}};function Tc(n,t,e){if(!e)return t.indexOf(n);for(let i=0;i=n.minX&&t.maxY>=n.minY}function di(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Go(n,t,e,i,s){const r=[t,e];for(;r.length;){if(e=r.pop(),t=r.pop(),e-t<=i)continue;const o=t+Math.ceil((e-t)/i/2)*i;qa(n,o,t,e,s),r.push(t,o,o,e)}}const W={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function zo(n){return n[0]>0&&n[1]>0}function Lc(n,t,e){return e===void 0&&(e=[0,0]),e[0]=n[0]*t+.5|0,e[1]=n[1]*t+.5|0,e}function bt(n,t){return Array.isArray(n)?n:(t===void 0?t=[n,n]:(t[0]=n,t[1]=n),t)}class _s{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=bt(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new _s({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return j()}getImage(t){return j()}getHitDetectionImage(){return j()}getPixelRatio(t){return 1}getImageState(){return j()}getImageSize(){return j()}getOrigin(){return j()}getSize(){return j()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=bt(t)}listenImageChange(t){j()}load(){j()}unlistenImageChange(t){j()}ready(){return Promise.resolve()}}const on={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var _t={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};_t.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}};_t.max=_t.whitepoint[2].D65;_t.rgb=function(n,t){t=t||_t.whitepoint[2].E;var e=n[0]/t[0],i=n[1]/t[1],s=n[2]/t[2],r,o,a;return r=e*3.240969941904521+i*-1.537383177570093+s*-.498610760293,o=e*-.96924363628087+i*1.87596750150772+s*.041555057407175,a=e*.055630079696993+i*-.20397695888897+s*1.056971514242878,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[r*255,o*255,a*255]};on.xyz=function(n,t){var e=n[0]/255,i=n[1]/255,s=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=e*.41239079926595+i*.35758433938387+s*.18048078840183,o=e*.21263900587151+i*.71516867876775+s*.072192315360733,a=e*.019330818715591+i*.11919477979462+s*.95053215224966;return t=t||_t.whitepoint[2].E,[r*t[0],o*t[1],a*t[2]]};const Wr={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(n,t,e){var i,s,r,o,a,l,c,h,u,d,f,g,_;if(r=n[0],o=n[1],a=n[2],r===0)return[0,0,0];var m=.0011070564598794539;return t=t||"D65",e=e||2,u=_t.whitepoint[e][t][0],d=_t.whitepoint[e][t][1],f=_t.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),i=o/(13*r)+g||0,s=a/(13*r)+_||0,c=r>8?d*Math.pow((r+16)/116,3):d*r*m,l=c*9*i/(4*s)||0,h=c*(12-3*i-20*s)/(4*s)||0,[l,c,h]}};_t.luv=function(n,t,e){var i,s,r,o,a,l,c,h,u,d,f,g,_,m=.008856451679035631,p=903.2962962962961;t=t||"D65",e=e||2,u=_t.whitepoint[e][t][0],d=_t.whitepoint[e][t][1],f=_t.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),l=n[0],c=n[1],h=n[2],i=4*l/(l+15*c+3*h)||0,s=9*c/(l+15*c+3*h)||0;var y=c/d;return r=y<=m?p*y:116*Math.pow(y,1/3)-16,o=13*r*(i-g),a=13*r*(s-_),[r,o,a]};var $a={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(n){var t=n[0],e=n[1],i=n[2],s,r,o;return o=i/360*2*Math.PI,s=e*Math.cos(o),r=e*Math.sin(o),[t,s,r]},xyz:function(n){return Wr.xyz($a.luv(n))}};Wr.lchuv=function(n){var t=n[0],e=n[1],i=n[2],s=Math.sqrt(e*e+i*i),r=Math.atan2(i,e),o=r*360/2/Math.PI;return o<0&&(o+=360),[t,s,o]};_t.lchuv=function(n){return Wr.lchuv(_t.luv(n))};const Bo={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var Xo={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Mc(n){var t,e=[],i=1,s;if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(n=String(n).toLowerCase(),Bo[n])e=Bo[n].slice(),s="rgb";else if(n==="transparent")i=0,s="rgb",e=[0,0,0];else if(n[0]==="#"){var r=n.slice(1),o=r.length,a=o<=4;i=1,a?(e=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],o===4&&(i=parseInt(r[3]+r[3],16)/255)):(e=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],o===8&&(i=parseInt(r[6]+r[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),s="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(n)){var l=t[1];s=l.replace(/a$/,"");var c=s==="cmyk"?4:s==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),s==="color"&&(s=e.shift()),e=e.map(function(h,u){if(h[h.length-1]==="%")return h=parseFloat(h)/100,u===3?h:s==="rgb"?h*255:s[0]==="h"||s[0]==="l"&&!u?h*100:s==="lab"?h*125:s==="lch"?u<2?h*150:h*360:s[0]==="o"&&!u?h:s==="oklab"?h*.4:s==="oklch"?u<2?h*.4:h*360:h;if(s[u]==="h"||u===2&&s[s.length-1]==="h"){if(Xo[h]!==void 0)return Xo[h];if(h.endsWith("deg"))return parseFloat(h);if(h.endsWith("turn"))return parseFloat(h)*360;if(h.endsWith("grad"))return parseFloat(h)*360/400;if(h.endsWith("rad"))return parseFloat(h)*180/Math.PI}return h==="none"?0:parseFloat(h)}),i=e.length>c?e.pop():1}else/[0-9](?:\s|\/|,)/.test(n)&&(e=n.match(/([0-9]+)/g).map(function(h){return parseFloat(h)}),s=n.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:s,values:e,alpha:i}}const Ps={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(n){var t=n[0]/360,e=n[1]/100,i=n[2]/100,s,r,o,a,l,c=0;if(e===0)return l=i*255,[l,l,l];for(r=i<.5?i*(1+e):i+e-i*e,s=2*i-r,a=[0,0,0];c<3;)o=t+1/3*-(c-1),o<0?o++:o>1&&o--,l=6*o<1?s+(r-s)*6*o:2*o<1?r:3*o<2?s+(r-s)*(2/3-o)*6:s,a[c++]=l*255;return a}};on.hsl=function(n){var t=n[0]/255,e=n[1]/255,i=n[2]/255,s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a,l,c;return r===s?a=0:t===r?a=(e-i)/o:e===r?a=2+(i-t)/o:i===r&&(a=4+(t-e)/o),a=Math.min(a*60,360),a<0&&(a+=360),c=(s+r)/2,r===s?l=0:c<=.5?l=o/(r+s):l=o/(2-r-s),[a,l*100,c*100]};function Oc(n){Array.isArray(n)&&n.raw&&(n=String.raw(...arguments)),n instanceof Number&&(n=+n);var t,e=Mc(n);if(!e.space)return[];const i=e.space[0]==="h"?Ps.min:on.min,s=e.space[0]==="h"?Ps.max:on.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],i[0]),s[0]),t[1]=Math.min(Math.max(e.values[1],i[1]),s[1]),t[2]=Math.min(Math.max(e.values[2],i[2]),s[2]),e.space[0]==="h"&&(t=Ps.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}const Yr=[NaN,NaN,NaN,0];function Dc(n){return typeof n=="string"?n:Vr(n)}const Pc=1024,Xi={};let ks=0;function kc(n){if(n.length===4)return n;const t=n.slice();return t[3]=1,t}function Wo(n){const t=_t.lchuv(on.xyz(n));return t[3]=n[3],t}function Fc(n){const t=_t.rgb($a.xyz(n));return t[3]=n[3],t}function Kr(n){if(n==="none")return Yr;if(Xi.hasOwnProperty(n))return Xi[n];if(ks>=Pc){let e=0;for(const i in Xi)e++&3||(delete Xi[i],--ks)}const t=Oc(n);if(t.length!==4)throw new Error('failed to parse "'+n+'" as color');for(const e of t)if(isNaN(e))throw new Error('failed to parse "'+n+'" as color');return Ja(t),Xi[n]=t,++ks,t}function an(n){return Array.isArray(n)?n:Kr(n)}function Ja(n){return n[0]=rt(n[0]+.5|0,0,255),n[1]=rt(n[1]+.5|0,0,255),n[2]=rt(n[2]+.5|0,0,255),n[3]=rt(n[3],0,1),n}function Vr(n){let t=n[0];t!=(t|0)&&(t=t+.5|0);let e=n[1];e!=(e|0)&&(e=e+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const s=n[3]===void 0?1:Math.round(n[3]*1e3)/1e3;return"rgba("+t+","+e+","+i+","+s+")"}const ke=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Nc=ke.includes("firefox"),Gc=ke.includes("safari")&&!ke.includes("chrom");Gc&&(ke.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(ke));const zc=ke.includes("webkit")&&!ke.includes("edge"),Qa=ke.includes("macintosh"),tl=typeof devicePixelRatio<"u"?devicePixelRatio:1,el=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,il=typeof Image<"u"&&Image.prototype.decode,nl=function(){let n=!1;try{const t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return n}();function ot(n,t,e,i){let s;return e&&e.length?s=e.shift():el?s=new OffscreenCanvas(n||300,t||300):s=document.createElement("canvas"),n&&(s.width=n),t&&(s.height=t),s.getContext("2d",i)}let Fs;function jn(){return Fs||(Fs=ot(1,1)),Fs}function Ii(n){const t=n.canvas;t.width=1,t.height=1,n.clearRect(0,0,1,1)}function Yo(n,t){const e=t.parentNode;e&&e.replaceChild(n,t)}function Bc(n){for(;n.lastChild;)n.lastChild.remove()}function Xc(n,t){const e=n.childNodes;for(let i=0;;++i){const s=e[i],r=t[i];if(!s&&!r)break;if(s!==r){if(!s){n.appendChild(r);continue}if(!r){n.removeChild(s),--i;continue}n.insertBefore(r,s)}}}function Wc(n,t,e){const i=n;let s=!0,r=!1,o=!1;const a=[Yn(i,z.LOAD,function(){o=!0,r||t()})];return i.src&&il?(r=!0,i.decode().then(function(){s&&t()}).catch(function(l){s&&(o?t():e())})):a.push(Yn(i,z.ERROR,e)),function(){s=!1,a.forEach(et)}}function Yc(n,t){return new Promise((e,i)=>{function s(){o(),e(n)}function r(){o(),i(new Error("Image load error"))}function o(){n.removeEventListener("load",s),n.removeEventListener("error",r)}n.addEventListener("load",s),n.addEventListener("error",r)})}function Kc(n,t){return t&&(n.src=t),n.src&&il?new Promise((e,i)=>n.decode().then(()=>e(n)).catch(s=>n.complete&&n.width?e(n):i(s))):Yc(n)}class Vc{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];!(t++&3)&&!i.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,i){const s=Ns(t,e,i);return s in this.cache_?this.cache_[s]:null}getPattern(t,e,i){const s=Ns(t,e,i);return s in this.patternCache_?this.patternCache_[s]:null}set(t,e,i,s,r){const o=Ns(t,e,i),a=o in this.cache_;this.cache_[o]=s,r&&(s.getImageState()===W.IDLE&&s.load(),s.getImageState()===W.LOADING?s.ready().then(()=>{this.patternCache_[o]=jn().createPattern(s.getImage(1),"repeat")}):this.patternCache_[o]=jn().createPattern(s.getImage(1),"repeat")),a||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Ns(n,t,e){const i=e?an(e):"null";return t+":"+n+":"+i}const te=new Vc;let Wi=null;class Uc extends os{constructor(t,e,i,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=r,this.imageState_=s===void 0?W.IDLE:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===W.LOADED){Wi||(Wi=ot(1,1,void 0,{willReadFrequently:!0})),Wi.drawImage(this.image_,0,0);try{Wi.getImageData(0,0,1,1),this.tainted_=!1}catch{Wi=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(z.CHANGE)}handleImageError_(){this.imageState_=W.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=W.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=ot(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===W.IDLE){this.image_||this.initializeImage_(),this.imageState_=W.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&Kc(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==W.LOADED)return;const e=this.image_,i=ot(Math.ceil(e.width*t),Math.ceil(e.height*t)),s=i.canvas;i.scale(t,t),i.drawImage(e,0,0),i.globalCompositeOperation="multiply",i.fillStyle=Dc(this.color_),i.fillRect(0,0,s.width/t,s.height/t),i.globalCompositeOperation="destination-in",i.drawImage(e,0,0),this.canvas_[t]=s}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===W.LOADED||this.imageState_===W.ERROR)t();else{const e=()=>{(this.imageState_===W.LOADED||this.imageState_===W.ERROR)&&(this.removeEventListener(z.CHANGE,e),t())};this.addEventListener(z.CHANGE,e)}})),this.ready_}}function Ur(n,t,e,i,s,r){let o=t===void 0?void 0:te.get(t,e,s);return o||(o=new Uc(n,n&&"src"in n?n.src||void 0:t,e,i,s),te.set(t,e,s,o,r)),r&&o&&!te.getPattern(t,e,s)&&te.set(t,e,s,o,r),o}function ee(n){return n?Array.isArray(n)?Vr(n):typeof n=="object"&&"src"in n?Zc(n):n:null}function Zc(n){if(!n.offset||!n.size)return te.getPattern(n.src,"anonymous",n.color);const t=n.src+":"+n.offset,e=te.getPattern(t,void 0,n.color);if(e)return e;const i=te.get(n.src,"anonymous",null);if(i.getImageState()!==W.LOADED)return null;const s=ot(n.size[0],n.size[1]);return s.drawImage(i.getImage(1),n.offset[0],n.offset[1],n.size[0],n.size[1],0,0,n.size[0],n.size[1]),Ur(s.canvas,t,void 0,W.LOADED,n.color,!0),te.getPattern(t,void 0,n.color)}const Dn="ol-hidden",ms="ol-unselectable",Zr="ol-control",Ko="ol-collapsed",jc=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),Vo=["style","variant","weight","size","lineHeight","family"],sl=function(n){const t=n.match(jc);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,s=Vo.length;iMath.max(s,Hn(n,r)),0);return e[t]=i,i}function $c(n,t){const e=[],i=[],s=[];let r=0,o=0,a=0,l=0;for(let c=0,h=t.length;c<=h;c+=2){const u=t[c];if(u===` +`||c===h){r=Math.max(r,o),s.push(o),o=0,a+=l,l=0;continue}const d=t[c+1]||n.font,f=Hn(d,u);e.push(f),o+=f;const g=Hc(d);i.push(g),l=Math.max(l,g)}return{width:r,height:a,widths:e,heights:i,lineWidths:s}}function Jc(n,t,e,i,s,r,o,a,l,c,h){n.save(),e!==1&&(n.globalAlpha===void 0?n.globalAlpha=u=>u.globalAlpha*=e:n.globalAlpha*=e),t&&n.transform.apply(n,t),i.contextInstructions?(n.translate(l,c),n.scale(h[0],h[1]),Qc(i,n)):h[0]<0||h[1]<0?(n.translate(l,c),n.scale(h[0],h[1]),n.drawImage(i,s,r,o,a,0,0,o,a)):n.drawImage(i,s,r,o,a,l,c,o*h[0],a*h[1]),n.restore()}function Qc(n,t){const e=n.contextInstructions;for(let i=0,s=e.length;ithis.imageState_=W.LOADED),this.render()}clone(){const t=this.getScale(),e=new ps({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const i=this.renderOptions_,s=ot(i.size*t,i.size*t);this.draw_(i,s,t),e=s.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let s=this.radius,r=this.radius2_===void 0?s:this.radius2_;if(s{this.patternImage_=null}),e.getImageState()===W.IDLE&&e.load(),e.getImageState()===W.LOADING&&(this.patternImage_=e)}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}class Fe{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new Fe({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}class Zt{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=Zo,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new Zt({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Zo,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function tu(n){let t;if(typeof n=="function")t=n;else{let e;Array.isArray(n)?e=n:(q(typeof n.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[n]),t=function(){return e}}return t}let Gs=null;function al(n,t){if(!Gs){const e=new Je({color:"rgba(255,255,255,0.4)"}),i=new Fe({color:"#3399CC",width:1.25});Gs=[new Zt({image:new Mi({fill:e,stroke:i,radius:5}),fill:e,stroke:i})]}return Gs}function Zo(n){return n.getGeometry()}function jo(n,t,e,i){return e!==void 0&&i!==void 0?[e/n,i/t]:e!==void 0?e/n:i!==void 0?i/t:1}class ys extends _s{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,i=t.rotation!==void 0?t.rotation:0,s=t.scale!==void 0?t.scale:1,r=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:i,scale:s,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const o=t.img!==void 0?t.img:null;let a=t.src;q(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||J(o)),q(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),q(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(t.src!==void 0?l=W.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?W.LOADED:W.IDLE:l=W.LOADING:l=W.LOADED),this.color_=t.color!==void 0?an(t.color):null,this.iconImage_=Ur(o,a,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,this.initialOptions_,t.width!==void 0||t.height!==void 0){let c,h;if(t.size)[c,h]=t.size;else{const u=this.getImage(1);if(u.width&&u.height)c=u.width,h=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const f=this.iconImage_.getSize();this.setScale(jo(f[0],f[1],t.width,t.height))};this.listenImageChange(d);return}}c!==void 0&&this.setScale(jo(c,h,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new ys({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const s=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!s)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=s[0]),this.anchorYUnits_=="fraction"&&(t[1]*=s[1])}if(this.anchorOrigin_!="top-left"){if(!s)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+s[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+s[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=i[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==W.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==W.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(z.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(z.CHANGE,t)}ready(){return this.iconImage_.ready()}}const eu="#333";class jr{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=bt(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new Je({color:eu}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new jr({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=bt(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}let Qe=0;const wt=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},ru={[C.Get]:N(X(1,1/0),qo),[C.Var]:N(X(1,1),ou),[C.Has]:N(X(1,1/0),qo),[C.Id]:N(au,oi),[C.Concat]:N(X(2,1/0),H(Tt)),[C.GeometryType]:N(lu,oi),[C.LineMetric]:N(oi),[C.Resolution]:N(oi),[C.Zoom]:N(oi),[C.Time]:N(oi),[C.Any]:N(X(2,1/0),H(wt)),[C.All]:N(X(2,1/0),H(wt)),[C.Not]:N(X(1,1),H(wt)),[C.Equal]:N(X(2,2),H(Pn)),[C.NotEqual]:N(X(2,2),H(Pn)),[C.GreaterThan]:N(X(2,2),H(V)),[C.GreaterThanOrEqualTo]:N(X(2,2),H(V)),[C.LessThan]:N(X(2,2),H(V)),[C.LessThanOrEqualTo]:N(X(2,2),H(V)),[C.Multiply]:N(X(2,1/0),Ho),[C.Coalesce]:N(X(2,1/0),Ho),[C.Divide]:N(X(2,2),H(V)),[C.Add]:N(X(2,1/0),H(V)),[C.Subtract]:N(X(2,2),H(V)),[C.Clamp]:N(X(3,3),H(V)),[C.Mod]:N(X(2,2),H(V)),[C.Pow]:N(X(2,2),H(V)),[C.Abs]:N(X(1,1),H(V)),[C.Floor]:N(X(1,1),H(V)),[C.Ceil]:N(X(1,1),H(V)),[C.Round]:N(X(1,1),H(V)),[C.Sin]:N(X(1,1),H(V)),[C.Cos]:N(X(1,1),H(V)),[C.Atan]:N(X(1,2),H(V)),[C.Sqrt]:N(X(1,1),H(V)),[C.Match]:N(X(4,1/0),$o,cu),[C.Between]:N(X(3,3),H(V)),[C.Interpolate]:N(X(6,1/0),$o,uu),[C.Case]:N(X(3,1/0),hu,du),[C.In]:N(X(2,2),fu),[C.Number]:N(X(1,1/0),H(Pn)),[C.String]:N(X(1,1/0),H(Pn)),[C.Array]:N(X(1,1/0),H(V)),[C.Color]:N(X(1,4),H(V)),[C.Band]:N(X(1,3),H(V)),[C.Palette]:N(X(2,2),gu),[C.ToString]:N(X(1,1),H(wt|V|Tt|Kt))};function qo(n,t,e){const i=n.length-1,s=new Array(i);for(let r=0;rt){const a=t===1/0?`${n} or more`:`${n} to ${t}`;throw new Error(`expected ${a} arguments for ${r}, got ${o}`)}}}function Ho(n,t,e){const i=n.length-1,s=new Array(i);for(let r=0;ri.featureId;case C.GeometryType:return i=>i.geometryType;case C.Concat:{const i=n.args.map(s=>jt(s));return s=>"".concat(...i.map(r=>r(s).toString()))}case C.Resolution:return i=>i.resolution;case C.Any:case C.All:case C.Between:case C.In:case C.Not:return Eu(n);case C.Equal:case C.NotEqual:case C.LessThan:case C.LessThanOrEqualTo:case C.GreaterThan:case C.GreaterThanOrEqualTo:return yu(n);case C.Multiply:case C.Divide:case C.Add:case C.Subtract:case C.Clamp:case C.Mod:case C.Pow:case C.Abs:case C.Floor:case C.Ceil:case C.Round:case C.Sin:case C.Cos:case C.Atan:case C.Sqrt:return xu(n);case C.Case:return wu(n);case C.Match:return Cu(n);case C.Interpolate:return Ru(n);case C.ToString:return vu(n);default:throw new Error(`Unsupported operator ${e}`)}}function mu(n,t){const e=n.operator,i=n.args.length,s=new Array(i);for(let r=0;r{for(let o=0;o{for(let o=0;o{const r=n.args;let o=s.properties[i];for(let a=1,l=r.length;as.variables[i];case C.Has:return s=>{const r=n.args;if(!(i in s.properties))return!1;let o=s.properties[i];for(let a=1,l=r.length;ai(r)===s(r);case C.NotEqual:return r=>i(r)!==s(r);case C.LessThan:return r=>i(r)i(r)<=s(r);case C.GreaterThan:return r=>i(r)>s(r);case C.GreaterThanOrEqualTo:return r=>i(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${e}`)}}function Eu(n,t){const e=n.operator,i=n.args.length,s=new Array(i);for(let r=0;r{for(let o=0;o{for(let o=0;o{const o=s[0](r),a=s[1](r),l=s[2](r);return o>=a&&o<=l};case C.In:return r=>{const o=s[0](r);for(let a=1;a!s[0](r);default:throw new Error(`Unsupported logical operator ${e}`)}}function xu(n,t){const e=n.operator,i=n.args.length,s=new Array(i);for(let r=0;r{let o=1;for(let a=0;as[0](r)/s[1](r);case C.Add:return r=>{let o=0;for(let a=0;as[0](r)-s[1](r);case C.Clamp:return r=>{const o=s[0](r),a=s[1](r);if(ol?l:o};case C.Mod:return r=>s[0](r)%s[1](r);case C.Pow:return r=>Math.pow(s[0](r),s[1](r));case C.Abs:return r=>Math.abs(s[0](r));case C.Floor:return r=>Math.floor(s[0](r));case C.Ceil:return r=>Math.ceil(s[0](r));case C.Round:return r=>Math.round(s[0](r));case C.Sin:return r=>Math.sin(s[0](r));case C.Cos:return r=>Math.cos(s[0](r));case C.Atan:return i===2?r=>Math.atan2(s[0](r),s[1](r)):r=>Math.atan(s[0](r));case C.Sqrt:return r=>Math.sqrt(s[0](r));default:throw new Error(`Unsupported numeric operator ${e}`)}}function wu(n,t){const e=n.args.length,i=new Array(e);for(let s=0;s{for(let r=0;r{const r=i[0](s);for(let o=1;o{const r=i[0](s),o=i[1](s);let a,l;for(let c=2;c=o)return c===2?u:d?Tu(r,o,a,l,h,u):Hi(r,o,a,l,h,u);a=h,l=u}return l}}function vu(n,t){const e=n.operator,i=n.args.length,s=new Array(i);for(let r=0;r{const o=s[0](r);return n.args[0].type===Kt?Vr(o):o.toString()};default:throw new Error(`Unsupported convert operator ${e}`)}}function Hi(n,t,e,i,s,r){const o=s-e;if(o===0)return i;const a=t-e,l=n===1?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1);return i+l*(r-i)}function Tu(n,t,e,i,s,r){if(s-e===0)return i;const a=Wo(i),l=Wo(r);let c=l[2]-a[2];c>180?c-=360:c<-180&&(c+=360);const h=[Hi(n,t,e,a[0],s,l[0]),Hi(n,t,e,a[1],s,l[1]),a[2]+Hi(n,t,e,0,s,c),Hi(n,t,e,i[3],s,r[3])];return Ja(Fc(h))}function Su(n){return!0}function Iu(n){const t=ll(),e=bu(n,t),i=cl();return function(s,r){if(i.properties=s.getPropertiesInternal(),i.resolution=r,t.featureId){const o=s.getId();o!==void 0?i.featureId=o:i.featureId=null}return t.geometryType&&(i.geometryType=hl(s.getGeometry())),e(i)}}function Jo(n){const t=ll(),e=n.length,i=new Array(e);for(let o=0;onull;i=Hr(n,t+"fill-color",e)}if(!i)return null;const s=new Je;return function(r){const o=i(r);return o===Yr?null:(s.setColor(o),s)}}function fn(n,t,e){const i=It(n,t+"stroke-width",e),s=Hr(n,t+"stroke-color",e);if(!i&&!s)return null;const r=fe(n,t+"stroke-line-cap",e),o=fe(n,t+"stroke-line-join",e),a=ul(n,t+"stroke-line-dash",e),l=It(n,t+"stroke-line-dash-offset",e),c=It(n,t+"stroke-miter-limit",e),h=new Fe;return function(u){if(s){const d=s(u);if(d===Yr)return null;h.setColor(d)}if(i&&h.setWidth(i(u)),r){const d=r(u);if(d!=="butt"&&d!=="round"&&d!=="square")throw new Error("Expected butt, round, or square line cap");h.setLineCap(d)}if(o){const d=o(u);if(d!=="bevel"&&d!=="round"&&d!=="miter")throw new Error("Expected bevel, round, or miter line join");h.setLineJoin(d)}return a&&h.setLineDash(a(u)),l&&h.setLineDashOffset(l(u)),c&&h.setMiterLimit(c(u)),h}}function Au(n,t){const e="text-",i=fe(n,e+"value",t);if(!i)return null;const s=dn(n,e,t),r=dn(n,e+"background-",t),o=fn(n,e,t),a=fn(n,e+"background-",t),l=fe(n,e+"font",t),c=It(n,e+"max-angle",t),h=It(n,e+"offset-x",t),u=It(n,e+"offset-y",t),d=gn(n,e+"overflow",t),f=fe(n,e+"placement",t),g=It(n,e+"repeat",t),_=Es(n,e+"scale",t),m=gn(n,e+"rotate-with-view",t),p=It(n,e+"rotation",t),y=fe(n,e+"align",t),x=fe(n,e+"justify",t),E=fe(n,e+"baseline",t),w=ul(n,e+"padding",t),S=xs(n,e+"declutter-mode"),v=new jr({declutterMode:S});return function(R){if(v.setText(i(R)),s&&v.setFill(s(R)),r&&v.setBackgroundFill(r(R)),o&&v.setStroke(o(R)),a&&v.setBackgroundStroke(a(R)),l&&v.setFont(l(R)),c&&v.setMaxAngle(c(R)),h&&v.setOffsetX(h(R)),u&&v.setOffsetY(u(R)),d&&v.setOverflow(d(R)),f){const T=f(R);if(T!=="point"&&T!=="line")throw new Error("Expected point or line for text-placement");v.setPlacement(T)}if(g&&v.setRepeat(g(R)),_&&v.setScale(_(R)),m&&v.setRotateWithView(m(R)),p&&v.setRotation(p(R)),y){const T=y(R);if(T!=="left"&&T!=="center"&&T!=="right"&&T!=="end"&&T!=="start")throw new Error("Expected left, right, center, start, or end for text-align");v.setTextAlign(T)}if(x){const T=x(R);if(T!=="left"&&T!=="right"&&T!=="center")throw new Error("Expected left, right, or center for text-justify");v.setJustify(T)}if(E){const T=E(R);if(T!=="bottom"&&T!=="top"&&T!=="middle"&&T!=="alphabetic"&&T!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");v.setTextBaseline(T)}return w&&v.setPadding(w(R)),v}}function Lu(n,t){return"icon-src"in n?Mu(n,t):"shape-points"in n?Ou(n,t):"circle-radius"in n?Du(n,t):null}function Mu(n,t){const e="icon-",i=e+"src",s=dl(n[i],i),r=$n(n,e+"anchor",t),o=Es(n,e+"scale",t),a=It(n,e+"opacity",t),l=$n(n,e+"displacement",t),c=It(n,e+"rotation",t),h=gn(n,e+"rotate-with-view",t),u=ta(n,e+"anchor-origin"),d=ea(n,e+"anchor-x-units"),f=ea(n,e+"anchor-y-units"),g=Gu(n,e+"color"),_=Fu(n,e+"cross-origin"),m=Nu(n,e+"offset"),p=ta(n,e+"offset-origin"),y=Jn(n,e+"width"),x=Jn(n,e+"height"),E=ku(n,e+"size"),w=xs(n,e+"declutter-mode"),S=new ys({src:s,anchorOrigin:u,anchorXUnits:d,anchorYUnits:f,color:g,crossOrigin:_,offset:m,offsetOrigin:p,height:x,width:y,size:E,declutterMode:w});return function(v){return a&&S.setOpacity(a(v)),l&&S.setDisplacement(l(v)),c&&S.setRotation(c(v)),h&&S.setRotateWithView(h(v)),o&&S.setScale(o(v)),r&&S.setAnchor(r(v)),S}}function Ou(n,t){const e="shape-",i=e+"points",s=e+"radius",r=lr(n[i],i),o=lr(n[s],s),a=dn(n,e,t),l=fn(n,e,t),c=Es(n,e+"scale",t),h=$n(n,e+"displacement",t),u=It(n,e+"rotation",t),d=gn(n,e+"rotate-with-view",t),f=Jn(n,e+"radius2"),g=Jn(n,e+"angle"),_=xs(n,e+"declutter-mode"),m=new ps({points:r,radius:o,radius2:f,angle:g,declutterMode:_});return function(p){return a&&m.setFill(a(p)),l&&m.setStroke(l(p)),h&&m.setDisplacement(h(p)),u&&m.setRotation(u(p)),d&&m.setRotateWithView(d(p)),c&&m.setScale(c(p)),m}}function Du(n,t){const e="circle-",i=dn(n,e,t),s=fn(n,e,t),r=It(n,e+"radius",t),o=Es(n,e+"scale",t),a=$n(n,e+"displacement",t),l=It(n,e+"rotation",t),c=gn(n,e+"rotate-with-view",t),h=xs(n,e+"declutter-mode"),u=new Mi({radius:5,declutterMode:h});return function(d){return r&&u.setRadius(r(d)),i&&u.setFill(i(d)),s&&u.setStroke(s(d)),a&&u.setDisplacement(a(d)),l&&u.setRotation(l(d)),c&&u.setRotateWithView(c(d)),o&&u.setScale(o(d)),u}}function It(n,t,e){if(!(t in n))return;const i=xe(n[t],V,e);return function(s){return lr(i(s),t)}}function fe(n,t,e){if(!(t in n))return null;const i=xe(n[t],Tt,e);return function(s){return dl(i(s),t)}}function Pu(n,t,e){const i=fe(n,t+"pattern-src",e),s=Qo(n,t+"pattern-offset",e),r=Qo(n,t+"pattern-size",e),o=Hr(n,t+"color",e);return function(a){return{src:i(a),offset:s&&s(a),size:r&&r(a),color:o&&o(a)}}}function gn(n,t,e){if(!(t in n))return null;const i=xe(n[t],wt,e);return function(s){const r=i(s);if(typeof r!="boolean")throw new Error(`Expected a boolean for ${t}`);return r}}function Hr(n,t,e){if(!(t in n))return null;const i=xe(n[t],Kt,e);return function(s){return fl(i(s),t)}}function ul(n,t,e){if(!(t in n))return null;const i=xe(n[t],He,e);return function(s){return En(i(s),t)}}function $n(n,t,e){if(!(t in n))return null;const i=xe(n[t],He,e);return function(s){const r=En(i(s),t);if(r.length!==2)throw new Error(`Expected two numbers for ${t}`);return r}}function Qo(n,t,e){if(!(t in n))return null;const i=xe(n[t],He,e);return function(s){return gl(i(s),t)}}function Es(n,t,e){if(!(t in n))return null;const i=xe(n[t],He|V,e);return function(s){return zu(i(s),t)}}function Jn(n,t){const e=n[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function ku(n,t){const e=n[t];if(e!==void 0){if(typeof e=="number")return bt(e);if(!Array.isArray(e))throw new Error(`Expected a number or size array for ${t}`);if(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return e}}function Fu(n,t){const e=n[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function ta(n,t){const e=n[t];if(e!==void 0){if(e!=="bottom-left"&&e!=="bottom-right"&&e!=="top-left"&&e!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return e}}function ea(n,t){const e=n[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function Nu(n,t){const e=n[t];if(e!==void 0)return En(e,t)}function xs(n,t){const e=n[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);if(e!=="declutter"&&e!=="obstacle"&&e!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return e}}function Gu(n,t){const e=n[t];if(e!==void 0)return fl(e,t)}function En(n,t){if(!Array.isArray(n))throw new Error(`Expected an array for ${t}`);const e=n.length;for(let i=0;i4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function gl(n,t){const e=En(n,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}function zu(n,t){return typeof n=="number"?n:gl(n,t)}const ia={RENDER_ORDER:"renderOrder"};class _l extends gs{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(ia.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const i=this.getDeclutter();i in t.declutter||(t.declutter[i]=new Ha(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(ia.RENDER_ORDER,t)}setStyle(t){this.style_=t===void 0?al:t;const e=Bu(t);this.styleFunction_=t===null?void 0:tu(e),this.changed()}}function Bu(n){if(n===void 0)return al;if(!n)return null;if(typeof n=="function"||n instanceof Zt)return n;if(!Array.isArray(n))return Jo([n]);if(n.length===0)return[];const t=n.length,e=n[0];if(e instanceof Zt){const s=new Array(t);for(let r=0;r=0;--w){const S=_[w],v=S.layer;if(v.hasRenderer()&&Xr(S,h)&&a.call(l,v)){const R=v.getRenderer(),T=v.getSource();if(R&&T){const G=T.getWrapX()?f:t,O=u.bind(null,S.managed);y[0]=G[0]+g[E][0],y[1]=G[1]+g[E][1],c=R.forEachFeatureAtCoordinate(y,e,i,O,p)}if(c)return c}}if(p.length===0)return;const x=1/p.length;return p.forEach((E,w)=>E.distanceSq+=w*x),p.sort((E,w)=>E.distanceSq-w.distanceSq),p.some(E=>c=E.callback(E.feature,E.layer,E.geometry)),c}hasFeatureAtCoordinate(t,e,i,s,r,o){return this.forEachFeatureAtCoordinate(t,e,i,s,tn,this,r,o)!==void 0}getMap(){return this.map_}renderFrame(t){j()}scheduleExpireIconCache(t){te.canExpireCache()&&t.postRenderFunctions.push(Wu)}}function Wu(n,t){te.expire()}class ml extends Ee{constructor(t,e,i,s){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=s}}class Yu extends Xu{constructor(t){super(t),this.fontChangeListenerKey_=Z(de,Ci.PROPERTYCHANGE,t.redrawText,t),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=ms+" ol-layers";const i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const i=this.getMap();if(i.hasListener(t)){const s=new ml(t,void 0,e);i.dispatchEvent(s)}}disposeInternal(){et(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(Nt.PRECOMPOSE,t);const e=t.layerStatesArray.sort((a,l)=>a.zIndex-l.zIndex);e.some(a=>a.layer instanceof _l&&a.layer.getDeclutter())&&(t.declutter={});const s=t.viewState;this.children_.length=0;const r=[];let o=null;for(let a=0,l=e.length;a=0;--i){const s=e[i],r=s.layer;r.getDeclutter()&&r.renderDeclutter(t,s)}e.forEach(i=>i.layer.renderDeferred(t))}}}class Ae extends Ee{constructor(t,e){super(t),this.layer=e}}const zs={LAYERS:"layers"};class Oi extends Ia{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(zs.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Qt(i.slice(),{unique:!0}):q(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Qt(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(et),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(Z(t,Rt.ADD,this.handleLayersAdd_,this),Z(t,Rt.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(et);mn(this.listenerKeys_);const e=t.getArray();for(let i=0,s=e.length;i{this.clickTimeoutId_=void 0;const i=new Ie(st.SINGLECLICK,this.map_,t);this.dispatchEvent(i)},250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==st.POINTERUP||e.type==st.POINTERCANCEL){delete this.trackedTouches_[i];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==e.target){delete this.trackedTouches_[s];break}}else(e.type==st.POINTERDOWN||e.type==st.POINTERMOVE)&&(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new Ie(st.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(et),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);const e=new Ie(st.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Z(i,st.POINTERMOVE,this.handlePointerMove_,this),Z(i,st.POINTERUP,this.handlePointerUp_,this),Z(this.element_,st.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(Z(this.element_.getRootNode(),st.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new Ie(st.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new Ie(st.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(et(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(z.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(et(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(et),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const be={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},pt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},Qn=1/0;class Vu{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,mn(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,i=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const s=this.keyFunction_(i);return delete this.queuedElements_[s],i}enqueue(t){q(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=Qn?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,i=this.priorities_,s=e.length,r=e[t],o=i[t],a=t;for(;t>1;){const l=this.getLeftChildIndex_(t),c=this.getRightChildIndex_(t),h=ct;){const a=this.getParentIndex_(e);if(s[a]>o)i[e]=i[a],s[e]=s[a],e=a;else break}i[e]=r,s[e]=o}reprioritize(){const t=this.priorityFunction_,e=this.elements_,i=this.priorities_;let s=0;const r=e.length;let o,a,l;for(a=0;a0;){const s=this.dequeue()[0],r=s.getKey();s.getState()===L.IDLE&&!(r in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++i,s.load())}}}function Zu(n,t,e,i,s){if(!n||!(e in n.wantedTiles)||!n.wantedTiles[e][t.getKey()])return Qn;const r=n.viewState.center,o=i[0]-r[0],a=i[1]-r[1];return 65536*Math.log(s)+Math.sqrt(o*o+a*a)/s}class $r extends se{constructor(t){super();const e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let e=0,i=this.listenerKeys.length;es.getAttributions(t)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(s=>i.add(s)):i.add(this.attributions_)),!this.overrideCollapsible_){const s=!e.some(r=>r.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(s)}return Array.from(i)}async updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=await Promise.all(this.collectSourceAttributions_(t).map(s=>ph(()=>s))),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Ne(e,this.renderedAttributions_)){Bc(this.ulElement_);for(let s=0,r=e.length;s0&&i%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:Li}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const i=e.viewState.rotation;if(i!=this.rotation_){const s="rotate("+i+"rad)";if(this.autoHide_){const r=this.element.classList.contains(Dn);!r&&i===0?this.element.classList.add(Dn):r&&i!==0&&this.element.classList.remove(Dn)}this.label_.style.transform=s}this.rotation_=i}}class Hu extends $r{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",i=t.delta!==void 0?t.delta:1,s=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",r=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",o=t.zoomInLabel!==void 0?t.zoomInLabel:"+",a=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",l=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",c=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=s,h.setAttribute("type","button"),h.title=l,h.appendChild(typeof o=="string"?document.createTextNode(o):o),h.addEventListener(z.CLICK,this.handleClick_.bind(this,i),!1);const u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=c,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(z.CLICK,this.handleClick_.bind(this,-i),!1);const d=e+" "+ms+" "+Zr,f=this.element;f.className=d,f.appendChild(h),f.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const i=this.getMap().getView();if(!i)return;const s=i.getZoom();if(s!==void 0){const r=i.getConstrainedZoom(s+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:r,duration:this.duration_,easing:Li})):i.setZoom(r)}}}function $u(n){n=n||{};const t=new Qt;return(n.zoom!==void 0?n.zoom:!0)&&t.push(new Hu(n.zoomOptions)),(n.rotate!==void 0?n.rotate:!0)&&t.push(new qu(n.rotateOptions)),(n.attribution!==void 0?n.attribution:!0)&&t.push(new ju(n.attributionOptions)),t}const na={ACTIVE:"active"};class xn extends se{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(na.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(na.ACTIVE,t)}setMap(t){this.map_=t}}function Ju(n,t,e){const i=n.getCenterInternal();if(i){const s=[i[0]+t[0],i[1]+t[1]];n.animateInternal({duration:e!==void 0?e:250,easing:Jh,center:n.getConstrainedCenter(s)})}}function Jr(n,t,e,i){const s=n.getZoom();if(s===void 0)return;const r=n.getConstrainedZoom(s+t),o=n.getResolutionForZoom(r);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:e,duration:i!==void 0?i:250,easing:Li})}class Qu extends xn{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==st.DBLCLICK){const i=t.originalEvent,s=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=s.getView();Jr(a,o,r,this.duration_),i.preventDefault(),e=!0}return!e}}class wn extends xn{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==st.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==st.POINTERUP){const i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==st.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==st.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function Qr(n){const t=n.length;let e=0,i=0;for(let s=0;s0&&this.condition_(t)){const i=t.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class ad extends wn{constructor(t){t=t||{},super({stopDown:rs}),this.condition_=t.condition?t.condition:td,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!Bs(t))return;const e=t.map,i=e.getView();if(i.getConstraints().rotation===Pr)return;const s=e.getSize(),r=t.pixel,o=Math.atan2(s[1]/2-r[1],r[0]-s[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(t){return Bs(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return Bs(t)&&yl(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class ld extends ns{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,i="px",s=this.element_.style;s.left=Math.min(t[0],e[0])+i,s.top=Math.min(t[1],e[1])+i,s.width=Math.abs(e[0]-t[0])+i,s.height=Math.abs(e[1]-t[1])+i}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,s=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new rn([s])}getGeometry(){return this.geometry_}}const ai={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Yi extends Ee{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}class hd extends wn{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new ld(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??yl,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){const s=i[0]-e[0],r=i[1]-e[1];return s*s+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Yi(ai.BOXDRAG,t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Yi(e?ai.BOXEND:ai.BOXCANCEL,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Yi(ai.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Yi(ai.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Yi(ai.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}}class cd extends hd{constructor(t){t=t||{};const e=t.condition?t.condition:sd;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){const i=this.getMap().getView();let s=this.getGeometry();if(this.out_){const r=i.rotatedExtentForGeometry(s),o=i.getResolutionForExtentInternal(r),a=i.getResolution()/o;s=s.clone(),s.scale(a*a)}i.fitInternal(s,{duration:this.duration_,easing:Li})}}const We={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class ud extends xn{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return El(e)&&xl(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==z.KEYDOWN){const i=t.originalEvent,s=i.key;if(this.condition_(t)&&(s==We.DOWN||s==We.LEFT||s==We.RIGHT||s==We.UP)){const o=t.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,c=0;s==We.DOWN?c=-a:s==We.LEFT?l=-a:s==We.RIGHT?l=a:c=a;const h=[l,c];br(h,o.getRotation()),Ju(o,h,this.duration_),i.preventDefault(),e=!0}}return!e}}class dd extends xn{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!nd(e)&&xl(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==z.KEYDOWN||t.type==z.KEYPRESS){const i=t.originalEvent,s=i.key;if(this.condition_(t)&&(s==="+"||s==="-")){const r=t.map,o=s==="+"?this.delta_:-this.delta_,a=r.getView();Jr(a,o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}}class fd{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[i+2]>t;)i-=3;const s=this.points_[e+2]-this.points_[i+2];if(s<1e3/60)return!1;const r=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/s,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}class gd extends xn{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const e=t.condition?t.condition:id;this.condition_=t.onFocusOnly?cr(pl,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t)||t.type!==z.WHEEL)return!0;const i=t.map,s=t.originalEvent;s.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel);let r;if(t.type==z.WHEEL&&(r=s.deltaY,Nc&&s.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(r/=tl),s.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=40)),r===0)return!1;this.lastDelta_=r;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?"trackpad":"wheel");const a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-r/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=r;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-rt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Jr(e,i,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}class _d extends wn{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=rs),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0;const i=this.targetPointers[0],s=this.targetPointers[1],r=Math.atan2(s.clientY-i.clientY,s.clientX-i.clientX);if(this.lastAngle_!==void 0){const l=r-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=l}this.lastAngle_=r;const o=t.map,a=o.getView();a.getConstraints().rotation!==Pr&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(Qr(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}class md extends wn{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=rs),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const i=this.targetPointers[0],s=this.targetPointers[1],r=i.clientX-s.clientX,o=i.clientY-s.clientY,a=Math.sqrt(r*r+o*o);this.lastDistance_!==void 0&&(e=this.lastDistance_/a),this.lastDistance_=a;const l=t.map,c=l.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(Qr(this.targetPointers))),l.render(),c.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const i=t.map.getView(),s=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,s),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}function pd(n){n=n||{};const t=new Qt,e=new fd(-.005,.05,100);return(n.altShiftDragRotate!==void 0?n.altShiftDragRotate:!0)&&t.push(new ad),(n.doubleClickZoom!==void 0?n.doubleClickZoom:!0)&&t.push(new Qu({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan!==void 0?n.dragPan:!0)&&t.push(new od({onFocusOnly:n.onFocusOnly,kinetic:e})),(n.pinchRotate!==void 0?n.pinchRotate:!0)&&t.push(new _d),(n.pinchZoom!==void 0?n.pinchZoom:!0)&&t.push(new md({duration:n.zoomDuration})),(n.keyboard!==void 0?n.keyboard:!0)&&(t.push(new ud),t.push(new dd({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom!==void 0?n.mouseWheelZoom:!0)&&t.push(new gd({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom!==void 0?n.shiftDragZoom:!0)&&t.push(new cd({duration:n.zoomDuration})),t}function wl(n){if(n instanceof gs){n.setMapInternal(null);return}n instanceof Oi&&n.getLayers().forEach(wl)}function Cl(n,t){if(n instanceof gs){n.setMapInternal(t);return}if(n instanceof Oi){const e=n.getLayers().getArray();for(let i=0,s=e.length;ithis.updateSize()),this.controls=e.controls||$u(),this.interactions=e.interactions||pd({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Uu(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(pt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(pt.VIEW,this.handleViewChanged_),this.addChangeListener(pt.SIZE,this.handleSizeChanged_),this.addChangeListener(pt.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const i=this;t.view&&!(t.view instanceof Yt)&&t.view.then(function(s){i.setView(new Yt(s))}),this.controls.addEventListener(Rt.ADD,s=>{s.element.setMap(this)}),this.controls.addEventListener(Rt.REMOVE,s=>{s.element.setMap(null)}),this.interactions.addEventListener(Rt.ADD,s=>{s.element.setMap(this)}),this.interactions.addEventListener(Rt.REMOVE,s=>{s.element.setMap(null)}),this.overlays_.addEventListener(Rt.ADD,s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener(Rt.REMOVE,s=>{const r=s.element.getId();r!==void 0&&delete this.overlayIdIndex_[r.toString()],s.element.setMap(null)}),this.controls.forEach(s=>{s.setMap(this)}),this.interactions.forEach(s=>{s.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){Cl(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;const s=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};const r=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:tn,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,r,a,e,null,o,null)}getFeaturesAtPixel(t,e){const i=[];return this.forEachFeatureAtPixel(t,function(s){i.push(s)},e),i}getAllLayers(){const t=[];function e(i){i.forEach(function(s){s instanceof Oi?e(s.getLayers()):t.push(s)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const s=e.layerFilter!==void 0?e.layerFilter:tn,r=e.hitTolerance!==void 0?e.hitTolerance:0,o=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,r,o,s,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const i=this.viewport_.getBoundingClientRect(),s=this.getSize(),r=i.width/s[0],o=i.height/s[1],a="changedTouches"in t?t.changedTouches[0]:t;return[(a.clientX-i.left)/r,(a.clientY-i.top)/o]}getTarget(){return this.get(pt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return sr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?gt(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(pt.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof Qt){e.setLayers(t);return}const i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e=0;r--){const o=s[r];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let s=this.maxTilesLoading_,r=s;if(t){const o=t.viewHints;if(o[yt.ANIMATING]||o[yt.INTERACTING]){const a=Date.now()-t.time>8;s=a?0:8,r=a?0:2}}e.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new Ae("removelayer",e)),this.set(pt.LAYERGROUP,t)}setSize(t){this.set(pt.SIZE,t)}setTarget(t){this.set(pt.TARGET,t)}setView(t){if(!t||t instanceof Yt){this.set(pt.VIEW,t);return}this.set(pt.VIEW,new Yt);const e=this;t.then(function(i){e.setView(new Yt(i))})}updateSize(){const t=this.getTargetElement();let e;if(t){const s=getComputedStyle(t),r=t.offsetWidth-parseFloat(s.borderLeftWidth)-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)-parseFloat(s.borderRightWidth),o=t.offsetHeight-parseFloat(s.borderTopWidth)-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)-parseFloat(s.borderBottomWidth);!isNaN(r)&&!isNaN(o)&&(e=[Math.max(0,r),Math.max(0,o)],!zo(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&Fa("No map visible because the map container's width or height are 0."))}const i=this.getSize();e&&(!i||!Ne(e,i))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}}function yd(n){let t=null;n.keyboardEventTarget!==void 0&&(t=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);const e={},i=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new Oi({layers:n.layers});e[pt.LAYERGROUP]=i,e[pt.TARGET]=n.target,e[pt.VIEW]=n.view instanceof Yt?n.view:new Yt;let s;n.controls!==void 0&&(Array.isArray(n.controls)?s=new Qt(n.controls.slice()):(q(typeof n.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),s=n.controls));let r;n.interactions!==void 0&&(Array.isArray(n.interactions)?r=new Qt(n.interactions.slice()):(q(typeof n.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),r=n.interactions));let o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new Qt(n.overlays.slice()):(q(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new Qt,{controls:s,interactions:r,keyboardEventTarget:t,overlays:o,values:e}}class to extends os{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(z.CHANGE)}release(){this.state===L.ERROR&&this.setState(L.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==L.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){j()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(!i)i=e,this.transitionStarts_[t]=i;else if(i===-1)return 1;const s=e-i+1e3/60;return s>=this.transition_?1:Xa(s/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}class vl extends to{constructor(t,e,i,s,r,o){super(t,e,o),this.crossOrigin_=s,this.src_=i,this.key=i,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=L.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=L.ERROR,this.unlistenImage_(),this.image_=Ed(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=L.LOADED:this.state=L.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==L.ERROR&&(this.state=L.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==L.IDLE&&(this.state=L.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Wc(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function Ed(){const n=ot(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}const Tl=.5,xd=10,sa=.25;class Sl{constructor(t,e,i,s,r,o){this.sourceProj_=t,this.targetProj_=e;let a={};const l=Un(this.targetProj_,this.sourceProj_);this.transformInv_=function(y){const x=y[0]+"/"+y[1];return a[x]||(a[x]=l(y)),a[x]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&$(s)>=$(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?$(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?$(this.targetProj_.getExtent()):null;const c=$e(i),h=cs(i),u=hs(i),d=ls(i),f=this.transformInv_(c),g=this.transformInv_(h),_=this.transformInv_(u),m=this.transformInv_(d),p=xd+(o?Math.max(0,Math.ceil(Math.log2(nn(i)/(o*o*256*256)))):0);if(this.addQuad_(c,h,u,d,f,g,_,m,p),this.wrapsXInSource_){let y=1/0;this.triangles_.forEach(function(x,E,w){y=Math.min(y,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach(x=>{if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-y>this.sourceWorldWidth_/2){const E=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];E[0][0]-y>this.sourceWorldWidth_/2&&(E[0][0]-=this.sourceWorldWidth_),E[1][0]-y>this.sourceWorldWidth_/2&&(E[1][0]-=this.sourceWorldWidth_),E[2][0]-y>this.sourceWorldWidth_/2&&(E[2][0]-=this.sourceWorldWidth_);const w=Math.min(E[0][0],E[1][0],E[2][0]);Math.max(E[0][0],E[1][0],E[2][0])-w.5&&u<1;let g=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const m=vo([t,e,i,s]);g=$(m)/this.targetWorldWidth_>sa||g}!f&&this.sourceProj_.isGlobal()&&u&&(g=u>sa||g)}if(!g&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!St(h,this.maxSourceExtent_))return;let _=0;if(!g&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)g=!0;else if(_=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),_!=1&&_!=2&&_!=4&&_!=8)return}if(c>0){if(!g){const m=[(t[0]+i[0])/2,(t[1]+i[1])/2],p=this.transformInv_(m);let y;f?y=(xi(r[0],d)+xi(a[0],d))/2-xi(p[0],d):y=(r[0]+a[0])/2-p[0];const x=(r[1]+a[1])/2-p[1];g=y*y+x*x>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){const m=[(e[0]+i[0])/2,(e[1]+i[1])/2],p=this.transformInv_(m),y=[(s[0]+t[0])/2,(s[1]+t[1])/2],x=this.transformInv_(y);this.addQuad_(t,e,m,y,r,o,p,x,c-1),this.addQuad_(y,m,i,s,x,p,a,l,c-1)}else{const m=[(t[0]+e[0])/2,(t[1]+e[1])/2],p=this.transformInv_(m),y=[(i[0]+s[0])/2,(i[1]+s[1])/2],x=this.transformInv_(y);this.addQuad_(t,m,y,s,r,p,x,l,c-1),this.addQuad_(m,e,i,y,p,o,a,x,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}_&11||this.addTriangle_(t,i,s,r,a,l),_&14||this.addTriangle_(t,i,e,r,a,o),_&&(_&13||this.addTriangle_(e,s,t,o,l,r),_&7||this.addTriangle_(e,s,i,o,l,a))}calculateSourceExtent(){const t=Gt();return this.triangles_.forEach(function(e,i,s){const r=e.source;Ji(t,r[0]),Ji(t,r[1]),Ji(t,r[2])}),t}getTriangles(){return this.triangles_}}let Xs;const pe=[];function ra(n,t,e,i,s){n.beginPath(),n.moveTo(0,0),n.lineTo(t,e),n.lineTo(i,s),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(t,i)+1,Math.max(e,s)),n.restore()}function Ws(n,t){return Math.abs(n[t*4]-210)>2||Math.abs(n[t*4+3]-.75*255)>2}function wd(){if(Xs===void 0){const n=ot(6,6,pe);n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",ra(n,4,5,4,0),ra(n,4,5,0,5);const t=n.getImageData(0,0,3,3).data;Xs=Ws(t,0)||Ws(t,4)||Ws(t,8),Ii(n),pe.push(n.canvas)}return Xs}function oa(n,t,e,i){const s=za(e,t,n);let r=So(t,i,e);const o=t.getMetersPerUnit();o!==void 0&&(r*=o);const a=n.getMetersPerUnit();a!==void 0&&(r/=a);const l=n.getExtent();if(!l||Ti(l,s)){const c=So(n,r,s)/r;isFinite(c)&&c>0&&(r/=c)}return r}function Il(n,t,e,i){const s=qe(e);let r=oa(n,t,s,i);return(!isFinite(r)||r<=0)&&Da(e,function(o){return r=oa(n,t,o,i),isFinite(r)&&r>0}),r}function bl(n,t,e,i,s,r,o,a,l,c,h,u,d,f){const g=ot(Math.round(e*n),Math.round(e*t),pe);if(u||(g.imageSmoothingEnabled=!1),l.length===0)return g.canvas;g.scale(e,e);function _(w){return Math.round(w*e)/e}g.globalCompositeOperation="lighter";const m=Gt();l.forEach(function(w,S,v){Oh(m,w.extent)});let p;const y=e/i,x=(u?1:1+Math.pow(2,-24))/y;if(!d||l.length!==1||c!==0){if(p=ot(Math.round($(m)*y),Math.round(Et(m)*y),pe),u||(p.imageSmoothingEnabled=!1),s&&f){const w=(s[0]-m[0])*y,S=-(s[3]-m[3])*y,v=$(s)*y,R=Et(s)*y;p.rect(w,S,v,R),p.clip()}l.forEach(function(w,S,v){if(w.image.width>0&&w.image.height>0){if(w.clipExtent){p.save();const M=(w.clipExtent[0]-m[0])*y,P=-(w.clipExtent[3]-m[3])*y,A=$(w.clipExtent)*y,k=Et(w.clipExtent)*y;p.rect(u?M:Math.round(M),u?P:Math.round(P),u?A:Math.round(M+A)-Math.round(M),u?k:Math.round(P+k)-Math.round(P)),p.clip()}const R=(w.extent[0]-m[0])*y,T=-(w.extent[3]-m[3])*y,G=$(w.extent)*y,O=Et(w.extent)*y;p.drawImage(w.image,c,c,w.image.width-2*c,w.image.height-2*c,u?R:Math.round(R),u?T:Math.round(T),u?G:Math.round(R+G)-Math.round(R),u?O:Math.round(T+O)-Math.round(T)),w.clipExtent&&p.restore()}})}const E=$e(o);return a.getTriangles().forEach(function(w,S,v){const R=w.source,T=w.target;let G=R[0][0],O=R[0][1],M=R[1][0],P=R[1][1],A=R[2][0],k=R[2][1];const b=_((T[0][0]-E[0])/r),Y=_(-(T[0][1]-E[1])/r),K=_((T[1][0]-E[0])/r),it=_(-(T[1][1]-E[1])/r),F=_((T[2][0]-E[0])/r),B=_(-(T[2][1]-E[1])/r),tt=G,dt=O;G=0,O=0,M-=tt,P-=dt,A-=tt,k-=dt;const I=[[M,P,0,0,K-b],[A,k,0,0,F-b],[0,0,M,P,it-Y],[0,0,A,k,B-Y]],Ct=wh(I);if(!Ct)return;if(g.save(),g.beginPath(),wd()||!u){g.moveTo(K,it);const ht=4,qt=b-K,re=Y-it;for(let Lt=0;Lt{const G=e.getTileRangeForExtentAndZ(T,this.sourceZ_);for(let O=G.minX;O<=G.maxX;O++)for(let M=G.minY;M<=G.maxY;M++){const P=c(this.sourceZ_,O,M,a);if(P){const A=v*S;this.sourceTiles_.push({tile:P,offset:A})}}++v}),this.sourceTiles_.length===0&&(this.state=L.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{const i=e.tile;if(i&&i.getState()==L.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);s[0]+=e.offset,s[2]+=e.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=e.offset,r[2]+=e.offset),t.push({extent:s,clipExtent:r,image:i.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=L.ERROR;else{const e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),s=typeof i=="number"?i:i[0],r=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=bl(s,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=L.LOADED}this.changed()}load(){if(this.state==L.IDLE){this.state=L.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{const i=e.getState();if(i==L.IDLE||i==L.LOADING){t++;const s=Z(e,z.CHANGE,r=>{const o=e.getState();(o==L.LOADED||o==L.ERROR||o==L.EMPTY)&&(et(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},i,s){e.getState()==L.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(et),this.sourcesListenerKeys_=null}release(){this.canvas_&&(Ii(this.canvas_.getContext("2d")),pe.push(this.canvas_),this.canvas_=null),super.release()}}const Ys={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Al extends se{constructor(t){super(),this.projection=zt(t.projection),this.attributions_=aa(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(i,s){e.viewResolver=i,e.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=aa(t),this.changed()}setState(t){this.state_=t,this.changed()}}function aa(n){return n?typeof n=="function"?n:(Array.isArray(n)||(n=[n]),t=>n):null}class eo{constructor(t,e,i,s){this.minX=t,this.maxX=e,this.minY=i,this.maxY=s}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function li(n,t,e,i,s){return s!==void 0?(s.minX=n,s.maxX=t,s.minY=e,s.maxY=i,s):new eo(n,t,e,i)}function ts(n,t,e,i){return i!==void 0?(i[0]=n,i[1]=t,i[2]=e,i):[n,t,e]}function Cd(n,t,e){return n+"/"+t+"/"+e}function Rd(n){return vd(n[0],n[1],n[2])}function vd(n,t,e){return(t<e||e>t.getMaxZoom())return!1;const r=t.getFullTileRange(e);return r?r.containsXY(i,s):!0}const hi=[0,0,0],Re=5;class Ll{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,q(mh(this.resolutions_,(s,r)=>r-s),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let s=0,r=this.resolutions_.length-1;s{const o=new eo(Math.min(0,s[0]),Math.max(s[0]-1,-1),Math.min(0,s[1]),Math.max(s[1]-1,-1));if(i){const a=this.getTileRangeForExtentAndZ(i,r);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){const s=this.getTileRangeForExtentAndZ(t,e);for(let r=s.minX,o=s.maxX;r<=o;++r)for(let a=s.minY,l=s.maxY;a<=l;++a)i([e,r,a])}forEachTileCoordParentTileRange(t,e,i,s){let r,o,a,l=null,c=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,s);c>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),r=li(o,o,a,a,i)):r=this.getTileRangeForExtentAndZ(l,c,i),e(c,r))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]this.maxZoom||e0?i:Math.max(r/e[0],s/e[1]);const o=t+1,a=new Array(o);for(let l=0;lthis.getTileInternal(f,g,_,m,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=l,d}getTileInternal(t,e,i,s,r){const o=this.getKey();return this.createTile_(t,e,i,s,r,o)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){const i=zt(t);if(i){const s=J(i);s in this.tileGridForProjection||(this.tileGridForProjection[s]=e)}}}function Wd(n,t){n.getImage().src=t}class Yd extends Xd{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",i=t.tileGrid!==void 0?t.tileGrid:bd({extent:io(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}const Kd='© OpenStreetMap contributors.';class Dl extends Yd{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[Kd];const i=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",s=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:s,wrapX:t.wrapX,zDirection:t.zDirection})}}const kn={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class Vd extends gs{constructor(t){t=t||{};const e=Object.assign({},t),i=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(kn.PRELOAD)}setPreload(t){this.set(kn.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(kn.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(kn.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}const Ud=5;class Zd extends pn{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=Ud}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return j()}getData(t){return null}prepareFrame(t){return j()}renderFrame(t,e){return j()}forEachFeatureAtCoordinate(t,e,i,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===W.LOADED||e.getState()===W.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=W.LOADED&&e!=W.ERROR&&t.addEventListener(z.CHANGE,this.boundHandleImageChange_),e==W.IDLE&&(t.load(),e=t.getState()),e==W.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}class Pl{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(jn(),{get:(t,e)=>{if(typeof jn()[e]=="function")return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,i)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,i),!0)})}pushMethodArgs_=(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this);pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let i=0,s=e.length;i0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();){const e=this.pop();e instanceof ns&&e.dispose()}}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const i=this.entries_[t];return q(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){const e=this.entries_[t];return q(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.key_;return t}getValues(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){q(!(t in this.entries_),"Tried to set a value for a key that is used already");const i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}}class tf extends dr{constructor(t){super({tileCoord:t.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:t.interpolate,transition:t.transition}),this.pixelRatio_=t.pixelRatio,this.gutter_=t.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=t.sourceTileGrid,this.targetTileGrid_=t.targetTileGrid,this.wrappedTileCoord_=t.wrappedTileCoord||t.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const e=t.sourceProj,i=e.getExtent(),s=t.sourceTileGrid.getExtent();this.clipExtent_=e.canWrapX()?s?Vt(i,s):i:s;const r=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),o=this.targetTileGrid_.getExtent();let a=this.sourceTileGrid_.getExtent();const l=o?Vt(r,o):r;if(nn(l)===0){this.state=L.EMPTY;return}i&&(a?a=Vt(a,i):a=i);const c=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),h=t.targetProj,u=Il(e,h,l,c);if(!isFinite(u)||u<=0){this.state=L.EMPTY;return}const d=t.errorThreshold!==void 0?t.errorThreshold:Tl;if(this.triangulation_=new Sl(e,h,l,a,u*d,c),this.triangulation_.getTriangles().length===0){this.state=L.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(u);let f=this.triangulation_.calculateSourceExtent();if(a&&(e.canWrapX()?(f[1]=rt(f[1],a[1],a[3]),f[3]=rt(f[3],a[1],a[3])):f=Vt(f,a)),!nn(f))this.state=L.EMPTY;else{let g=0,_=0;e.canWrapX()&&(g=$(i),_=Math.floor((f[0]-i[0])/g)),Ir(f.slice(),e,!0).forEach(p=>{const y=this.sourceTileGrid_.getTileRangeForExtentAndZ(p,this.sourceZ_),x=t.getTileFunction;for(let E=y.minX;E<=y.maxX;E++)for(let w=y.minY;w<=y.maxY;w++){const S=x(this.sourceZ_,E,w,this.pixelRatio_);if(S){const v=_*g;this.sourceTiles_.push({tile:S,offset:v})}}++_}),this.sourceTiles_.length===0&&(this.state=L.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const t=[];let e=!1;if(this.sourceTiles_.forEach(g=>{const _=g.tile;if(!_||_.getState()!==L.LOADED)return;const m=_.getSize(),p=this.gutter_;let y;const x=qd(_.getData());x?y=x:(e=!0,y=$d(es(_.getData())));const E=[m[0]+2*p,m[1]+2*p],w=y instanceof Float32Array,S=E[0]*E[1],v=w?Float32Array:Uint8ClampedArray,R=new v(y.buffer),T=v.BYTES_PER_ELEMENT,G=T*R.length/S,O=R.byteLength/E[1],M=Math.floor(O/T/E[0]),P=S*M;let A=R;if(R.length!==P){A=new v(P);let Y=0,K=0;const it=E[0]*M;for(let F=0;F=0;--g){const _=[];for(let w=0,S=t.length;w{const i=e.getState();if(i!==L.IDLE&&i!==L.LOADING)return;t++;const s=Z(e,z.CHANGE,()=>{const r=e.getState();(r==L.LOADED||r==L.ERROR||r==L.EMPTY)&&(et(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e}){e.getState()==L.IDLE&&e.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(et),this.sourcesListenerKeys_=null}}function Ks(n,t,e,i){return`${n},${Cd(t,e,i)}`}function Vs(n,t,e){if(!(e in n))return n[e]=new Set([t]),!0;const i=n[e],s=i.has(t);return s||i.add(t),!s}function ef(n,t,e){const i=n[e];return i?i.delete(t):!1}function ha(n,t){const e=n.layerStatesArray[n.layerIndex];e.extent&&(t=Vt(t,Le(e.extent,n.viewState.projection)));const i=e.layer.getRenderSource();if(!i.getWrapX()){const s=i.getTileGridForProjection(n.viewState.projection).getExtent();s&&(t=Vt(t,s))}return t}class nf extends kl{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=Gt(),this.tempTileRange_=new eo(0,0,0,0),this.tempTileCoord_=ts(0,0,0);const i=e.cacheSize!==void 0?e.cacheSize:512;this.tileCache_=new Qd(i),this.renderedProjection_=void 0,this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,i,s){const r=this.tileCache_,a=this.getLayer().getSource(),l=Ks(a.getKey(),t,e,i);let c;if(r.containsKey(l))c=r.get(l);else{if(c=a.getTile(t,e,i,s.pixelRatio,s.viewState.projection),!c)return null;r.set(l,c)}return c}getTile(t,e,i,s){const r=this.getOrCreateTile(t,e,i,s);return r||null}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),s=gt(e.pixelToCoordinateTransform,t.slice()),r=i.getExtent();if(r&&!Ti(r,s))return null;const o=e.viewState,a=i.getRenderSource(),l=a.getTileGridForProjection(o.projection),c=a.getTilePixelRatio(e.pixelRatio);for(let h=l.getZForResolution(o.resolution);h>=l.getMinZoom();--h){const u=l.getTileCoordForCoordAndZ(s,h),d=this.getTile(h,u[1],u[2],e);if(!d||d.getState()!==L.LOADED)continue;const f=l.getOrigin(h),g=bt(l.getTileSize(h)),_=l.getResolution(h);let m;if(d instanceof vl||d instanceof ur)m=d.getImage();else if(d instanceof dr){if(m=es(d.getData()),!m)continue}else continue;const p=Math.floor(c*((s[0]-f[0])/_-u[1]*g[0])),y=Math.floor(c*((f[1]-s[1])/_-u[2]*g[1])),x=Math.round(c*a.getGutterForProjection(o.projection));return this.getImageData(m,p+x,y+x)}return null}prepareFrame(t){this.renderedProjection_?t.viewState.projection!==this.renderedProjection_&&(this.tileCache_.clear(),this.renderedProjection_=t.viewState.projection):this.renderedProjection_=t.viewState.projection;const e=this.getLayer().getSource();if(!e)return!1;const i=e.getRevision();return this.renderedRevision_?this.renderedRevision_!==i&&(this.renderedRevision_=i,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedRevision_=i,!0}enqueueTiles(t,e,i,s,r){const o=t.viewState,a=this.getLayer(),l=a.getRenderSource(),c=l.getTileGridForProjection(o.projection),h=J(l);h in t.wantedTiles||(t.wantedTiles[h]={});const u=t.wantedTiles[h],d=a.getMapInternal(),f=Math.max(i-r,c.getMinZoom(),c.getZForResolution(Math.min(a.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):c.getResolution(0)),l.zDirection));for(let g=i;g>=f;--g){const _=c.getTileRangeForExtentAndZ(e,g,this.tempTileRange_),m=c.getResolution(g);for(let p=_.minX;p<=_.maxX;++p)for(let y=_.minY;y<=_.maxY;++y){const x=this.getTile(g,p,y,t);if(!x||!Vs(s,x,g))continue;const w=x.getKey();if(u[w]=!0,x.getState()===L.IDLE&&!t.tileQueue.isKeyQueued(w)){const S=ts(g,p,y,this.tempTileCoord_);t.tileQueue.enqueue([x,h,c.getTileCoordCenter(S),m])}}}}findStaleTile_(t,e){const i=this.tileCache_,s=t[0],r=t[1],o=t[2],a=this.getStaleKeys();for(let l=0;l0&&setTimeout(()=>{this.enqueueTiles(t,G,f-1,R,T-1)},0),!(f in R))return this.container;const O=J(this),M=t.time;for(const F of R[f]){const B=F.getState();if((F instanceof ur||F instanceof tf)&&B===L.EMPTY)continue;const tt=F.tileCoord;if(B===L.LOADED&&F.getAlpha(O,M)===1){F.endTransition(O);continue}if(this.renderComplete=!1,this.findStaleTile_(tt,R)){ef(R,F,f),t.animate=!0;continue}if(this.findAltTiles_(d,tt,f+1,R))continue;const Ct=d.getMinZoom();for(let ft=f-1;ft>=Ct&&!this.findAltTiles_(d,tt,ft,R);--ft);}const P=g/o*l/p,A=this.getRenderContext(t);ye(this.tempTransform,y/2,x/2,P,P,0,-y/2,-x/2),i.extent&&this.clipUnrotated(A,t,E),h.getInterpolate()||(A.imageSmoothingEnabled=!1),this.preRender(A,t);const k=Object.keys(R).map(Number);k.sort(ge);let b;const Y=[],K=[];for(let F=k.length-1;F>=0;--F){const B=k[F],tt=h.getTilePixelSize(B,l,r),I=d.getResolution(B)/g,Ct=tt[0]*I*P,ft=tt[1]*I*P,ht=d.getTileCoordForCoordAndZ($e(v),B),qt=d.getTileCoordExtent(ht),re=gt(this.tempTransform,[p*(qt[0]-v[0])/g,p*(v[3]-qt[3])/g]),Lt=p*h.getGutterForProjection(r);for(const we of R[B]){if(we.getState()!==L.LOADED)continue;const Pi=we.tileCoord,Rn=ht[1]-Pi[1],Rs=Math.round(re[0]-(Rn-1)*Ct),ki=ht[2]-Pi[2],Ge=Math.round(re[1]-(ki-1)*ft),Mt=Math.round(re[0]-Rn*Ct),Ht=Math.round(re[1]-ki*ft),ti=Rs-Mt,ei=Ge-Ht,Fi=k.length===1;let ze=!1;b=[Mt,Ht,Mt+ti,Ht,Mt+ti,Ht+ei,Mt,Ht+ei];for(let ii=0,ni=Y.length;ii{const tt=J(h),dt=B.wantedTiles[tt],I=dt?Object.keys(dt).length:0;this.updateCacheSize(I),this.tileCache_.expireCache()};return t.postRenderFunctions.push(it),this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,t*2)}drawTile(t,e,i,s,r,o,a,l){let c;if(t instanceof dr){if(c=es(t.getData()),!c)throw new Error("Rendering array data is not yet supported")}else c=this.getTileImage(t);if(!c)return;const h=this.getRenderContext(e),u=J(this),d=e.layerStatesArray[e.layerIndex],f=d.opacity*(l?t.getAlpha(u,e.time):1),g=f!==h.globalAlpha;g&&(h.save(),h.globalAlpha=f),h.drawImage(c,a,a,c.width-2*a,c.height-2*a,i,s,r,o),g&&h.restore(),f!==d.opacity?e.animate=!0:l&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,i){const s=J(e);s in t||(t[s]={}),t[s][i.getKey()]=!0}}class Fl extends Vd{constructor(t){super(t)}createRenderer(){return new nf(this,{cacheSize:this.getCacheSize()})}}class je extends se{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new je(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(et(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=Z(t,z.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?sf(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function sf(n){if(typeof n=="function")return n;let t;return Array.isArray(n)?t=n:(q(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[n]),function(){return t}}function fr(n,t,e,i,s,r,o){let a,l;const c=(e-t)/i;if(c===1)a=t;else if(c===2)a=t,l=s;else if(c!==0){let h=n[t],u=n[t+1],d=0;const f=[0];for(let m=t+i;m1?o:2,r=r||new Array(o);for(let h=0;h>1;sl&&(this.instructions.push([D.CUSTOM,l,h,t,i,Ke,r]),this.hitDetectionInstructions.push([D.CUSTOM,l,h,t,s||i,Ke,r]));break;case"Point":c=t.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),h=this.coordinates.length,this.instructions.push([D.CUSTOM,l,h,t,i,void 0,r]),this.hitDetectionInstructions.push([D.CUSTOM,l,h,t,s||i,void 0,r]);break}this.endGeometry(e)}beginGeometry(t,e,i){this.beginGeometryInstruction1_=[D.BEGIN_GEOMETRY,e,0,t,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[D.BEGIN_GEOMETRY,e,0,t,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const i=t.length;let s,r,o=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[D.SET_FILL_STYLE,e];return typeof e!="string"&&i.push(t.fillPatternScale),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[D.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,s=t.lineCap,r=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,l=t.lineWidth,c=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=s||r!=t.currentLineDash&&!Ne(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=c)&&(i!==void 0&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=s,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=l,t.currentMiterLimit=c)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[D.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Aa(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;vr(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class of extends Cn{constructor(t,e,i,s){super(t,e,i,s),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,i){if(!this.image_||this.maxExtent&&!Ti(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,i);const s=t.getFlatCoordinates(),r=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(s,r);this.instructions.push([D.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([D.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,i){if(!this.image_)return;this.beginGeometry(t,e,i);const s=t.getFlatCoordinates(),r=[];for(let l=0,c=s.length;l=n){const g=(n-a+f)/f,_=At(c,u,g),m=At(h,d,g);l.push(_,m),r.push(l),l=[_,m],a==n&&(o+=s),a=0}else if(a0&&r.push(l),r}function hf(n,t,e,i,s){let r=e,o=e,a=0,l=0,c=e,h,u,d,f,g,_,m,p,y,x;for(u=e;un&&(l>a&&(a=l,r=c,o=u),l=0,c=u-s)),d=f,m=y,p=x),g=E,_=w}return l+=f,l>a?[c,u]:[r,o]}const is={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class cf extends Cn{constructor(t,e,i,s){super(t,e,i,s),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[vt]={fillStyle:vt},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,i){const s=this.textFillState_,r=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!s&&!r)return;const a=this.coordinates;let l=a.length;const c=t.getType();let h=null,u=t.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!St(this.maxExtent,t.getExtent()))return;let d;if(h=t.getFlatCoordinates(),c=="LineString")d=[h.length];else if(c=="MultiLineString")d=t.getEnds();else if(c=="Polygon")d=t.getEnds().slice(0,1);else if(c=="MultiPolygon"){const m=t.getEndss();d=[];for(let p=0,y=m.length;p{const w=a[(y+E)*2]===h[E*u]&&a[(y+E)*2+1]===h[E*u+1];return w||--y,w})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&this.updateFillStyle(this.state,this.createFill),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e,i);let g=o.padding;if(g!=Ue&&(o.scale[0]<0||o.scale[1]<0)){let y=o.padding[0],x=o.padding[1],E=o.padding[2],w=o.padding[3];o.scale[0]<0&&(x=-x,w=-w),o.scale[1]<0&&(y=-y,E=-E),g=[y,x,E,w]}const _=this.pixelRatio;this.instructions.push([D.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,g==Ue?Ue:g.map(function(y){return y*_}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const m=1/_,p=this.state.fillStyle;o.backgroundFill&&(this.state.fillStyle=vt,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([D.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,this.declutterMode_,this.declutterImageWithText_,g,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?vt:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),o.backgroundFill&&(this.state.fillStyle=p,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||cn,justify:e.justify,textBaseline:e.textBaseline||qn,scale:e.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(t,e){const i=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,c=is[s.textBaseline],h=this.textOffsetY_*l,u=this.text_,d=i?i.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([D.DRAW_CHARS,t,e,c,s.overflow,a,s.maxAngle,l,h,r,d*l,u,o,1,this.declutterMode_]),this.hitDetectionInstructions.push([D.DRAW_CHARS,t,e,c,s.overflow,a&&vt,s.maxAngle,l,h,r,d*l,u,o,1/l,this.declutterMode_])}setTextStyle(t,e){let i,s,r;if(!t)this.text_="";else{const o=t.getFill();o?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=ee(o.getColor()||vt)):(s=null,this.textFillState_=s);const a=t.getStroke();if(!a)r=null,this.textStrokeState_=r;else{r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const g=a.getLineDash(),_=a.getLineDashOffset(),m=a.getWidth(),p=a.getMiterLimit();r.lineCap=a.getLineCap()||bi,r.lineDash=g?g.slice():_e,r.lineDashOffset=_===void 0?me:_,r.lineJoin=a.getLineJoin()||Ai,r.lineWidth=m===void 0?un:m,r.miterLimit=p===void 0?ln:p,r.strokeStyle=ee(a.getColor()||hn)}i=this.textState_;const l=t.getFont()||rl;qc(l);const c=t.getScaleArray();i.overflow=t.getOverflow(),i.font=l,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||qn,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Ue,i.scale=c===void 0?[1,1]:c;const h=t.getOffsetX(),u=t.getOffsetY(),d=t.getRotateWithView(),f=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=h===void 0?0:h,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textRotation_=f===void 0?0:f,this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:J(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=s&&s.fillStyle?typeof s.fillStyle=="string"?s.fillStyle:"|"+J(s.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const uf={Circle:ua,Default:Cn,Image:of,LineString:af,Polygon:ua,Text:cf};class df{constructor(t,e,i,s){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=s,this.resolution_=i,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const i=this.buildersByZIndex_[e];for(const s in i){const r=i[s].finish();t[e][s]=r}}return t}getBuilder(t,e){const i=t!==void 0?t.toString():"0";let s=this.buildersByZIndex_[i];s===void 0&&(s={},this.buildersByZIndex_[i]=s);let r=s[e];if(r===void 0){const o=uf[e];r=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[e]=r}return r}}function ff(n,t,e,i,s,r,o,a,l,c,h,u){let d=n[t],f=n[t+1],g=0,_=0,m=0,p=0;function y(){g=d,_=f,t+=i,d=n[t],f=n[t+1],p+=m,m=Math.sqrt((d-g)*(d-g)+(f-_)*(f-_))}do y();while(tb[2]}else O=E>T;const M=Math.PI,P=[],A=S+i===t;t=S,m=0,p=v,d=n[t],f=n[t+1];let k;if(A){y(),k=Math.atan2(f-_,d-g),O&&(k+=k>0?-M:M);const b=(T+E)/2,Y=(G+w)/2;return P[0]=[b,Y,(R-r)/2,k,s],P}s=s.replace(/\n/g," ");for(let b=0,Y=s.length;b0?-M:M),k!==void 0){let I=K-k;if(I+=I>M?-2*M:I<-M?2*M:0,Math.abs(I)>o)return null}k=K;const it=b;let F=0;for(;b0&&n.push(` +`,""),n.push(t,""),n}class _f{constructor(t,e,i,s,r){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=Ut(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new Pl:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,i,s){const r=t+e+i+s;if(this.labels_[r])return this.labels_[r];const o=s?this.strokeStates[s]:null,a=i?this.fillStates[i]:null,l=this.textStates[e],c=this.pixelRatio,h=[l.scale[0]*c,l.scale[1]*c],u=l.justify?is[l.justify]:Us(Array.isArray(t)?t[0]:t,l.textAlign||cn),d=s&&o.lineWidth?o.lineWidth:0,f=Array.isArray(t)?t:String(t).split(` +`).reduce(gf,[]),{width:g,height:_,widths:m,heights:p,lineWidths:y}=$c(l,f),x=g+d,E=[],w=(x+2)*h[0],S=(_+d)*h[1],v={width:w<0?Math.floor(w):Math.ceil(w),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:E};(h[0]!=1||h[1]!=1)&&E.push("scale",h),s&&(E.push("strokeStyle",o.strokeStyle),E.push("lineWidth",d),E.push("lineCap",o.lineCap),E.push("lineJoin",o.lineJoin),E.push("miterLimit",o.miterLimit),E.push("setLineDash",[o.lineDash]),E.push("lineDashOffset",o.lineDashOffset)),i&&E.push("fillStyle",a.fillStyle),E.push("textBaseline","middle"),E.push("textAlign","center");const R=.5-u;let T=u*x+R*d;const G=[],O=[];let M=0,P=0,A=0,k=0,b;for(let Y=0,K=f.length;Yt?t-c:r,E=o+h>e?e-h:o,w=g[3]+x*d[0]+g[1],S=g[0]+E*d[1]+g[2],v=p-g[3],R=y-g[0];(_||u!==0)&&(ve[0]=v,Te[0]=v,ve[1]=R,he[1]=R,he[0]=v+w,ce[0]=he[0],ce[1]=R+S,Te[1]=ce[1]);let T;return u!==0?(T=ye(Ut(),i,s,1,1,u,-i,-s),gt(T,ve),gt(T,he),gt(T,ce),gt(T,Te),Pe(Math.min(ve[0],he[0],ce[0],Te[0]),Math.min(ve[1],he[1],ce[1],Te[1]),Math.max(ve[0],he[0],ce[0],Te[0]),Math.max(ve[1],he[1],ce[1],Te[1]),ui)):Pe(Math.min(v,v+w),Math.min(R,R+S),Math.max(v,v+w),Math.max(R,R+S),ui),f&&(p=Math.round(p),y=Math.round(y)),{drawImageX:p,drawImageY:y,drawImageW:x,drawImageH:E,originX:c,originY:h,declutterBox:{minX:ui[0],minY:ui[1],maxX:ui[2],maxY:ui[3],value:m},canvasTransform:T,scale:d}}replayImageOrLabel_(t,e,i,s,r,o,a){const l=!!(o||a),c=s.declutterBox,h=a?a[2]*s.scale[0]/2:0;return c.minX-h<=e[0]&&c.maxX+h>=0&&c.minY-h<=e[1]&&c.maxY+h>=0&&(l&&this.replayTextBackground_(t,ve,he,ce,Te,o,a),Jc(t,s.canvasTransform,r,i,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const i=gt(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;t.save(),t.translate(i[0]%s,i[1]%s),e!==1&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,s){const r=this.textStates[e],o=this.createLabel(t,e,s,i),a=this.strokeStates[i],l=this.pixelRatio,c=Us(Array.isArray(t)?t[0]:t,r.textAlign||cn),h=is[r.textBaseline||qn],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*r.scale[0],f=c*d+2*(.5-c)*u,g=h*o.height/l+2*(.5-h)*u;return{label:o,anchorX:f,anchorY:g}}execute_(t,e,i,s,r,o,a,l){const c=this.zIndexContext_;let h;this.pixelCoordinates_&&Ne(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=Oe(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Qh(this.renderedTransform_,i));let u=0;const d=s.length;let f=0,g,_,m,p,y,x,E,w,S,v,R,T,G,O=0,M=0,P=null,A=null;const k=this.coordinateCache_,b=this.viewRotation_,Y=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,K={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:b},it=this.instructions!=s||this.overlaps?0:200;let F,B,tt,dt;for(;uit&&(this.fill_(t),O=0),M>it&&(t.stroke(),M=0),!O&&!M&&(t.beginPath(),y=NaN,x=NaN),++u;break;case D.CIRCLE:f=I[1];const ft=h[f],ht=h[f+1],qt=h[f+2],re=h[f+3],Lt=qt-ft,we=re-ht,Pi=Math.sqrt(Lt*Lt+we*we);t.moveTo(ft+Pi,ht),t.arc(ft,ht,Pi,0,2*Math.PI,!0),++u;break;case D.CLOSE_PATH:t.closePath(),++u;break;case D.CUSTOM:f=I[1],g=I[2];const Rn=I[3],Rs=I[4],ki=I[5];K.geometry=Rn,K.feature=F,u in k||(k[u]=[]);const Ge=k[u];ki?ki(h,f,g,2,Ge):(Ge[0]=h[f],Ge[1]=h[f+1],Ge.length=2),c&&(c.zIndex=I[6]),Rs(Ge,K),++u;break;case D.DRAW_IMAGE:f=I[1],g=I[2],S=I[3],_=I[4],m=I[5];let Mt=I[6];const Ht=I[7],ti=I[8],ei=I[9],Fi=I[10];let ze=I[11];const ii=I[12];let ni=I[13];p=I[14]||"declutter";const ct=I[15];if(!S&&I.length>=20){v=I[19],R=I[20],T=I[21],G=I[22];const Ot=this.drawLabelWithPointPlacement_(v,R,T,G);S=Ot.label,I[3]=S;const Be=I[23];_=(Ot.anchorX-Be)*this.pixelRatio,I[4]=_;const Dt=I[24];m=(Ot.anchorY-Dt)*this.pixelRatio,I[5]=m,Mt=S.height,I[6]=Mt,ni=S.width,I[13]=ni}let vs;I.length>25&&(vs=I[25]);let Ts,vn,Tn;I.length>17?(Ts=I[16],vn=I[17],Tn=I[18]):(Ts=Ue,vn=!1,Tn=!1),Fi&&Y?ze+=b:!Fi&&!Y&&(ze-=b);let sh=0;for(;f!zl.includes(n));class pf{constructor(t,e,i,s,r,o,a){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Ut(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,a)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t,e){for(const i in t){let s=this.executorsByZIndex_[i];s===void 0&&(s={},this.executorsByZIndex_[i]=s);const r=t[i];for(const o in r){const a=r[o];s[o]=new _f(this.resolution_,this.pixelRatio_,this.overlaps_,a,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let s=0,r=t.length;s0){if(!o||v==="none"||f!=="Image"&&f!=="Text"||o.includes(w)){const O=(d[T]-3)/4,M=s-O%a,P=s-(O/a|0),A=r(w,S,M*M+P*P);if(A)return A}h.clearRect(0,0,a,a);break}}const _=Object.keys(this.executorsByZIndex_).map(Number);_.sort(ge);let m,p,y,x,E;for(m=_.length-1;m>=0;--m){const w=_[m].toString();for(y=this.executorsByZIndex_[w],p=yi.length-1;p>=0;--p)if(f=yi[p],x=y[f],x!==void 0&&(E=x.executeHitDetection(h,l,i,g,u),E))return E}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],s=e[1],r=e[2],o=e[3],a=[i,s,i,o,r,o,r,s];return Oe(a,0,8,2,t,a),a}isEmpty(){return vi(this.executorsByZIndex_)}execute(t,e,i,s,r,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(ge),o=o||yi;const c=yi.length;let h,u,d,f,g;for(a&&l.reverse(),h=0,u=l.length;hp.execute(w,e,i,s,r,a)),E&&x.restore(),y){y.offset();const w=l[h]*c+d;this.deferredZIndexContexts_[w]||(this.deferredZIndexContexts_[w]=[]),this.deferredZIndexContexts_[w].push(y)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(ge);for(let i=0,s=e.length;i{r.draw(this.renderedContext_),r.clear()}),t[e[i]].length=0}}const Zs={};function yf(n){if(Zs[n]!==void 0)return Zs[n];const t=n*2+1,e=n*n,i=new Array(e+1);for(let r=0;r<=n;++r)for(let o=0;o<=n;++o){const a=r*r+o*o;if(a>e)break;let l=i[a];l||(l=[],i[a]=l),l.push(((n+r)*t+(n+o))*4+3),r>0&&l.push(((n-r)*t+(n+o))*4+3),o>0&&(l.push(((n+r)*t+(n-o))*4+3),r>0&&l.push(((n-r)*t+(n-o))*4+3))}const s=[];for(let r=0,o=i.length;ru*this.pixelRatio_),lineDashOffset:(o||me)*this.pixelRatio_,lineJoin:a!==void 0?a:Ai,lineWidth:(l!==void 0?l:un)*this.pixelRatio_,miterLimit:c!==void 0?c:ln,strokeStyle:ee(i||hn)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const i=t.getPixelRatio(this.pixelRatio_),s=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*i,this.imageAnchorY_=s[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const f=e.getColor();this.textFillState_={fillStyle:ee(f||vt)}}const i=t.getStroke();if(!i)this.textStrokeState_=null;else{const f=i.getColor(),g=i.getLineCap(),_=i.getLineDash(),m=i.getLineDashOffset(),p=i.getLineJoin(),y=i.getWidth(),x=i.getMiterLimit();this.textStrokeState_={lineCap:g!==void 0?g:bi,lineDash:_||_e,lineDashOffset:m||me,lineJoin:p!==void 0?p:Ai,lineWidth:y!==void 0?y:un,miterLimit:x!==void 0?x:ln,strokeStyle:ee(f||hn)}}const s=t.getFont(),r=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),l=t.getRotation(),c=t.getScaleArray(),h=t.getText(),u=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:s!==void 0?s:rl,textAlign:u!==void 0?u:cn,textBaseline:d!==void 0?d:qn},this.text_=h!==void 0?Array.isArray(h)?h.reduce((f,g,_)=>f+=_%2?" ":g,""):h:"",this.textOffsetX_=r!==void 0?this.pixelRatio_*r:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}}const Jt=.5;function xf(n,t,e,i,s,r,o,a,l){const c=s,h=n[0]*Jt,u=n[1]*Jt,d=ot(h,u);d.imageSmoothingEnabled=!1;const f=d.canvas,g=new Ef(d,Jt,s,null,o,a,null),_=e.length,m=Math.floor((256*256*256-1)/_),p={};for(let x=1;x<=_;++x){const E=e[x-1],w=E.getStyleFunction()||i;if(!w)continue;let S=w(E,r);if(!S)continue;Array.isArray(S)||(S=[S]);const R=(x*m).toString(16).padStart(7,"#00000");for(let T=0,G=S.length;T0;return u&&Promise.all(l).then(()=>s(null)),Tf(n,t,e,i,r,o,a),u}function Tf(n,t,e,i,s,r,o){const a=e.getGeometryFunction()(t);if(!a)return;const l=a.simplifyTransformed(i,s);if(e.getRenderer())Wl(n,l,e,t,o);else{const h=Bl[l.getType()];h(n,l,e,t,o,r)}}function Wl(n,t,e,i,s){if(t.getType()=="GeometryCollection"){const o=t.getGeometries();for(let a=0,l=o.length;a{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=this.frameState.size.slice(),s=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,c=this.getLayer(),h=[],u=i[0]*Jt,d=i[1]*Jt;h.push(this.getRenderTransform(s,r,o,Jt,u,d,0).slice());const f=c.getSource(),g=a.getExtent();if(f.getWrapX()&&a.canWrapX()&&!pi(g,l)){let _=l[0];const m=$(g);let p=0,y;for(;_g[2];)++p,y=m*p,h.push(this.getRenderTransform(s,r,o,Jt,u,d,y).slice()),_-=m}this.hitDetectionImageData_=xf(i,h,this.renderedFeatures_,c.getStyleFunction(),l,r,o,ga(r,this.renderedPixelRatio_))}e(wf(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,s,r){if(!this.replayGroup_)return;const o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),c={},h=function(g,_,m){const p=J(g),y=c[p];if(y){if(y!==!0&&mu=g.forEachFeatureAtCoordinate(t,o,a,i,h,f&&e.declutter[f]?e.declutter[f].all().map(_=>_.value):null)),u}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const s=t.viewHints[yt.ANIMATING],r=t.viewHints[yt.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&s||!a&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=t.extent,c=t.viewState,h=c.projection,u=c.resolution,d=t.pixelRatio,f=e.getRevision(),g=e.getRenderBuffer();let _=e.getRenderOrder();_===void 0&&(_=Rf);const m=c.center.slice(),p=vr(l,g*u),y=p.slice(),x=[p.slice()],E=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!pi(E,t.extent)){const A=$(E),k=Math.max($(p)/2,A);p[0]=E[0]-k,p[2]=E[2]+k,ka(m,h);const b=Pa(x[0],h);b[0]E[0]&&b[2]>E[2]&&x.push([b[0]-A,b[1],b[2]-A,b[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==_&&this.renderedFrameDeclutter_===!!t.declutter&&pi(this.wrappedRenderedExtent_,p))return Ne(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const w=new df(Xl(u,d),p,u,d);let S;for(let A=0,k=x.length;A{let b;const Y=A.getStyleFunction()||e.getStyleFunction();if(Y&&(b=Y(A,u)),b){const K=this.renderFeature(A,v,b,w,S,this.getLayer().getDeclutter(),k);R=R&&!K}},G=Ba(p),O=i.getFeaturesInExtent(G);_&&O.sort(_);for(let A=0,k=O.length;A{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":i.length=fs(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),s=[i.length];break;case"MultiLineString":s=[],i.length=uc(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,s);break;case"Polygon":s=[],i.length=Ka(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,s);break}return s&&(this.simplifiedGeometry_=new Wt(this.type_,i,s,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}Wt.prototype.getFlatCoordinates=Wt.prototype.getOrientedFlatCoordinates;const kt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function kf(n,t){return[[-1/0,-1/0,1/0,1/0]]}let Ff=!1;function Nf(n,t,e,i,s,r,o){const a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(e,i,s):n,!0),t.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=Ff,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const c=t.getType();try{let h;c=="text"||c=="json"?h=a.responseText:c=="xml"?h=a.responseXML||a.responseText:c=="arraybuffer"&&(h=a.response),h?r(t.readFeatures(h,{extent:e,featureProjection:s}),t.readProjection(h)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function ya(n,t){return function(e,i,s,r,o){const a=this;Nf(n,t,e,i,s,function(l,c){a.addFeatures(l),r!==void 0&&r(l)},o||Ri)}}class Se extends Ee{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class Kl extends Al{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Ri,this.format_=t.format||null,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(q(this.format_,"`format` must be set when `url` is set"),this.loader_=ya(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:kf;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new ma:null,this.loadedExtentsRtree_=new ma,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,s;Array.isArray(t.features)?s=t.features:t.features&&(i=t.features,s=i.getArray()),!e&&i===void 0&&(i=new Qt(s)),s!==void 0&&this.addFeaturesInternal(s),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=J(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const s=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Se(kt.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof Wt||(this.featureChangeKeys_[t]=[Z(e,z.CHANGE,this.handleFeatureChange_,this),Z(e,Ci.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(e.getId()!==void 0){const s=String(e.getId());if(!(s in this.idIndex_))this.idIndex_[s]=e;else if(e instanceof Wt){const r=this.idIndex_[s];r instanceof Wt?Array.isArray(r)?r.push(e):this.idIndex_[s]=[r,e]:i=!1}else i=!1}return i&&(q(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],s=[];for(let r=0,o=t.length;r{e||(e=!0,this.addFeature(i.element),e=!1)}),t.addEventListener(Rt.REMOVE,i=>{e||(e=!0,this.removeFeature(i.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(et);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=s=>{this.removeFeatureInternal(s)};this.featuresRtree_.forEach(i);for(const s in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[s])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new Se(kt.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(s){const r=s.getGeometry();if(r instanceof Wt||r.intersectsCoordinate(t))return e(s)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(i){const s=i.getGeometry();if(s instanceof Wt||s.intersectsExtent(t)){const r=e(i);if(r)return r}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),vi(this.nullGeometryFeatures_)||ss(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){e.push(i)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const s=Ir(t,e);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],s=t[1];let r=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return e=e||tn,this.featuresRtree_.forEachInExtent(l,function(c){if(e(c)){const h=c.getGeometry(),u=a;if(a=h instanceof Wt?0:h.closestPointXY(i,s,o,a),a{--this.loadingExtentsCount_,this.dispatchEvent(new Se(kt.FEATURESLOADEND,void 0,h))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Se(kt.FEATURESLOADERROR))}),s.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let i;e.forEachInExtent(t,function(s){if(en(s.extent,t))return i=s,!0}),i&&e.remove(i)}removeFeatures(t){let e=!1;for(let i=0,s=t.length;it.geo&&t.geo.lat&&t.geo.lon);return n?[n.geo.lon,n.geo.lat]:[0,0]}return[this.d.geo.lon,this.d.geo.lat]}},async mounted(){await fetch("https://tile.openstreetmap.org/",{signal:AbortSignal.timeout(1500)}).then(n=>{const t=new Rl({target:"map",layers:[new Fl({source:new Dl})],view:new Yt({center:Qi(this.getLastLonLat()),zoom:this.type==="traceroute"?3:10})}),e=[],i=new Kl;if(this.type==="traceroute")this.d.forEach(a=>{if(a.geo&&a.geo.lat&&a.geo.lon){const l=Qi([a.geo.lon,a.geo.lat]);e.push(l);const c=this.getLastLonLat(),h=new je({geometry:new Si(l),last:a.geo.lon===c[0]&&a.geo.lat===c[1]});i.addFeature(h)}});else{const a=Qi([this.d.geo.lon,this.d.geo.lat]);e.push(a);const l=new je({geometry:new Si(a)});i.addFeature(l)}const s=new _n(e),r=new je({geometry:s});console.log(s),i.addFeature(r);const o=new Yl({source:i,style:function(a){if(a.getGeometry().getType()==="Point")return new Zt({image:new Mi({radius:10,fill:new Je({color:a.get("last")?"#dc3545":"#0d6efd"}),stroke:new Fe({color:"white",width:5})})});if(a.getGeometry().getType()==="LineString")return new Zt({stroke:new Fe({color:"#0d6efd",width:2})})}});t.addLayer(o),this.store.Configuration.Server.dashboard_theme==="dark"&&t.on("postcompose",()=>{document.querySelector("#map").style.filter="grayscale(80%) invert(100%)"})}).catch(n=>{this.osmAvailable=!1})}},zf={key:0,id:"map",class:"w-100 rounded-3"};function Bf(n,t,e,i,s,r){return this.osmAvailable?(Js(),Qs("div",zf)):lh("",!0)}const Wg=va(Gf,[["render",Bf]]),ne=Object.create(null);ne.open="0";ne.close="1";ne.ping="2";ne.pong="3";ne.message="4";ne.upgrade="5";ne.noop="6";const Bn=Object.create(null);Object.keys(ne).forEach(n=>{Bn[ne[n]]=n});const gr={type:"error",data:"parser error"},Vl=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ul=typeof ArrayBuffer=="function",Zl=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,so=({type:n,data:t},e,i)=>Vl&&t instanceof Blob?e?i(t):Ea(t,i):Ul&&(t instanceof ArrayBuffer||Zl(t))?e?i(t):Ea(new Blob([t]),i):i(ne[n]+(t||"")),Ea=(n,t)=>{const e=new FileReader;return e.onload=function(){const i=e.result.split(",")[1];t("b"+(i||""))},e.readAsDataURL(n)};function xa(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let js;function Xf(n,t){if(Vl&&n.data instanceof Blob)return n.data.arrayBuffer().then(xa).then(t);if(Ul&&(n.data instanceof ArrayBuffer||Zl(n.data)))return t(xa(n.data));so(n,!1,e=>{js||(js=new TextEncoder),t(js.encode(e))})}const wa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$i=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n{let t=n.length*.75,e=n.length,i,s=0,r,o,a,l;n[n.length-1]==="="&&(t--,n[n.length-2]==="="&&t--);const c=new ArrayBuffer(t),h=new Uint8Array(c);for(i=0;i>4,h[s++]=(o&15)<<4|a>>2,h[s++]=(a&3)<<6|l&63;return c},Yf=typeof ArrayBuffer=="function",ro=(n,t)=>{if(typeof n!="string")return{type:"message",data:jl(n,t)};const e=n.charAt(0);return e==="b"?{type:"message",data:Kf(n.substring(1),t)}:Bn[e]?n.length>1?{type:Bn[e],data:n.substring(1)}:{type:Bn[e]}:gr},Kf=(n,t)=>{if(Yf){const e=Wf(n);return jl(e,t)}else return{base64:!0,data:n}},jl=(n,t)=>{switch(t){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},ql="",Vf=(n,t)=>{const e=n.length,i=new Array(e);let s=0;n.forEach((r,o)=>{so(r,!1,a=>{i[o]=a,++s===e&&t(i.join(ql))})})},Uf=(n,t)=>{const e=n.split(ql),i=[];for(let s=0;s{const i=e.length;let s;if(i<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,i);else if(i<65536){s=new Uint8Array(3);const r=new DataView(s.buffer);r.setUint8(0,126),r.setUint16(1,i)}else{s=new Uint8Array(9);const r=new DataView(s.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(i))}n.data&&typeof n.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(e)})}})}let qs;function Nn(n){return n.reduce((t,e)=>t+e.length,0)}function Gn(n,t){if(n[0].length===t)return n.shift();const e=new Uint8Array(t);let i=0;for(let s=0;sMath.pow(2,21)-1){a.enqueue(gr);break}s=h*Math.pow(2,32)+c.getUint32(4),i=3}else{if(Nn(e)n){a.enqueue(gr);break}}}})}const Hl=4;function at(n){if(n)return qf(n)}function qf(n){for(var t in at.prototype)n[t]=at.prototype[t];return n}at.prototype.on=at.prototype.addEventListener=function(n,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(t),this};at.prototype.once=function(n,t){function e(){this.off(n,e),t.apply(this,arguments)}return e.fn=t,this.on(n,e),this};at.prototype.off=at.prototype.removeListener=at.prototype.removeAllListeners=at.prototype.removeEventListener=function(n,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var e=this._callbacks["$"+n];if(!e)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var i,s=0;sPromise.resolve().then(t):(t,e)=>e(t,0),Ft=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Hf="arraybuffer";function $l(n,...t){return t.reduce((e,i)=>(n.hasOwnProperty(i)&&(e[i]=n[i]),e),{})}const $f=Ft.setTimeout,Jf=Ft.clearTimeout;function Cs(n,t){t.useNativeTimers?(n.setTimeoutFn=$f.bind(Ft),n.clearTimeoutFn=Jf.bind(Ft)):(n.setTimeoutFn=Ft.setTimeout.bind(Ft),n.clearTimeoutFn=Ft.clearTimeout.bind(Ft))}const Qf=1.33;function tg(n){return typeof n=="string"?eg(n):Math.ceil((n.byteLength||n.size)*Qf)}function eg(n){let t=0,e=0;for(let i=0,s=n.length;i=57344?e+=3:(i++,e+=4);return e}function Jl(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function ig(n){let t="";for(let e in n)n.hasOwnProperty(e)&&(t.length&&(t+="&"),t+=encodeURIComponent(e)+"="+encodeURIComponent(n[e]));return t}function ng(n){let t={},e=n.split("&");for(let i=0,s=e.length;i{this.readyState="paused",t()};if(this._polling||!this.writable){let i=0;this._polling&&(i++,this.once("pollComplete",function(){--i||e()})),this.writable||(i++,this.once("drain",function(){--i||e()}))}else e()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const e=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};Uf(t,this.socket.binaryType).forEach(e),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Vf(t,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",e=this.query||{};return this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=Jl()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.createUri(t,e)}}let Ql=!1;try{Ql=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const og=Ql;function ag(){}class lg extends rg{constructor(t){if(super(t),typeof location<"u"){const e=location.protocol==="https:";let i=location.port;i||(i=e?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}}doWrite(t,e){const i=this.request({method:"POST",data:t});i.on("success",e),i.on("error",(s,r)=>{this.onError("xhr post error",s,r)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(e,i)=>{this.onError("xhr poll error",e,i)}),this.pollXhr=t}}class ie extends at{constructor(t,e,i){super(),this.createRequest=t,Cs(this,i),this._opts=i,this._method=i.method||"GET",this._uri=e,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var t;const e=$l(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;const i=this._xhr=this.createRequest(e);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&i.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var s;i.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},i.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=ie.requestsCount++,ie.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=ag,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ie.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ie.requestsCount=0;ie.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ca);else if(typeof addEventListener=="function"){const n="onpagehide"in Ft?"pagehide":"unload";addEventListener(n,Ca,!1)}}function Ca(){for(let n in ie.requests)ie.requests.hasOwnProperty(n)&&ie.requests[n].abort()}const hg=function(){const n=th({xdomain:!1});return n&&n.responseType!==null}();class cg extends lg{constructor(t){super(t);const e=t&&t.forceBase64;this.supportsBinary=hg&&!e}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ie(th,this.uri(),t)}}function th(n){const t=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||og))return new XMLHttpRequest}catch{}if(!t)try{return new Ft[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const eh=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ug extends oo{get name(){return"websocket"}doOpen(){const t=this.uri(),e=this.opts.protocols,i=eh?{}:$l(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,e,i)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e{try{this.doWrite(i,r)}catch{}s&&ws(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=Jl()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}}const Hs=Ft.WebSocket||Ft.MozWebSocket;class dg extends ug{createSocket(t,e,i){return eh?new Hs(t,e,i):e?new Hs(t,e):new Hs(t)}doWrite(t,e){this.ws.send(e)}}class fg extends oo{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const e=jf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),i=t.readable.pipeThrough(e).getReader(),s=Zf();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const r=()=>{i.read().then(({done:a,value:l})=>{a||(this.onPacket(l),r())}).catch(a=>{})};r();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let e=0;e{s&&ws(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const gg={websocket:dg,webtransport:fg,polling:cg},_g=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mg=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function _r(n){if(n.length>8e3)throw"URI too long";const t=n,e=n.indexOf("["),i=n.indexOf("]");e!=-1&&i!=-1&&(n=n.substring(0,e)+n.substring(e,i).replace(/:/g,";")+n.substring(i,n.length));let s=_g.exec(n||""),r={},o=14;for(;o--;)r[mg[o]]=s[o]||"";return e!=-1&&i!=-1&&(r.source=t,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=pg(r,r.path),r.queryKey=yg(r,r.query),r}function pg(n,t){const e=/\/{2,9}/g,i=t.replace(e,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&i.splice(0,1),t.slice(-1)=="/"&&i.splice(i.length-1,1),i}function yg(n,t){const e={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,s,r){s&&(e[s]=r)}),e}const mr=typeof addEventListener=="function"&&typeof removeEventListener=="function",Xn=[];mr&&addEventListener("offline",()=>{Xn.forEach(n=>n())},!1);class De extends at{constructor(t,e){if(super(),this.binaryType=Hf,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(e=t,t=null),t){const i=_r(t);e.hostname=i.host,e.secure=i.protocol==="https"||i.protocol==="wss",e.port=i.port,i.query&&(e.query=i.query)}else e.host&&(e.hostname=_r(e.host).host);Cs(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(i=>{const s=i.prototype.name;this.transports.push(s),this._transportsByName[s]=i}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ng(this.opts.query)),mr&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Xn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const e=Object.assign({},this.opts.query);e.EIO=Hl,e.transport=t,this.id&&(e.sid=this.id);const i=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&De.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const e=this.createTransport(t);e.open(),this.setTransport(e)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",De.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const e=new Error("server error");e.code=t.data,this._onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let i=0;i0&&e>this._maxPayload)return this.writeBuffer.slice(0,i);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,ws(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,e,i){return this._sendPacket("message",t,e,i),this}send(t,e,i){return this._sendPacket("message",t,e,i),this}_sendPacket(t,e,i,s){if(typeof e=="function"&&(s=e,e=void 0),typeof i=="function"&&(s=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;const r={type:t,data:e,options:i};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},i=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}_onError(t){if(De.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),mr&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const i=Xn.indexOf(this._offlineEventListener);i!==-1&&Xn.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this._prevBufferLen=0}}}De.protocol=Hl;class Eg extends De{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{i||(e.send([{type:"ping",data:"probe"}]),e.once("packet",u=>{if(!i)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;De.priorWebsocketSuccess=e.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(h(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{const d=new Error("probe error");d.transport=e.name,this.emitReserved("upgradeError",d)}}))};function r(){i||(i=!0,h(),e.close(),e=null)}const o=u=>{const d=new Error("probe error: "+u);d.transport=e.name,r(),this.emitReserved("upgradeError",d)};function a(){o("transport closed")}function l(){o("socket closed")}function c(u){e&&u.name!==e.name&&r()}const h=()=>{e.removeListener("open",s),e.removeListener("error",o),e.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};e.once("open",s),e.once("error",o),e.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{i||e.open()},200):e.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const e=[];for(let i=0;igg[s]).filter(s=>!!s)),super(t,i)}};function wg(n,t="",e){let i=n;e=e||typeof location<"u"&&location,n==null&&(n=e.protocol+"//"+e.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=e.protocol+n:n=e.host+n),/^(https?|wss?):\/\//.test(n)||(typeof e<"u"?n=e.protocol+"//"+n:n="https://"+n),i=_r(n)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";const r=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+r+":"+i.port+t,i.href=i.protocol+"://"+r+(e&&e.port===i.port?"":":"+i.port),i}const Cg=typeof ArrayBuffer=="function",Rg=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,ih=Object.prototype.toString,vg=typeof Blob=="function"||typeof Blob<"u"&&ih.call(Blob)==="[object BlobConstructor]",Tg=typeof File=="function"||typeof File<"u"&&ih.call(File)==="[object FileConstructor]";function ao(n){return Cg&&(n instanceof ArrayBuffer||Rg(n))||vg&&n instanceof Blob||Tg&&n instanceof File}function Wn(n,t){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let e=0,i=n.length;e=0&&n.num{delete this.acks[t];for(let a=0;a{this.io.clearTimeoutFn(r),e.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...e){return new Promise((i,s)=>{const r=(o,a)=>o?s(o):i(a);r.withError=!0,e.push(r),this.emit(t,...e)})}_addToQueue(t){let e;typeof t[t.length-1]=="function"&&(e=t.pop());const i={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...r)=>i!==this._queue[0]?void 0:(s!==null?i.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(s)):(this._queue.shift(),e&&e(null,...r)),i.pending=!1,this._drainQueue())),this._queue.push(i),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:U.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(i=>String(i.id)===t)){const i=this.acks[t];delete this.acks[t],i.withError&&i.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case U.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case U.EVENT:case U.BINARY_EVENT:this.onevent(t);break;case U.ACK:case U.BINARY_ACK:this.onack(t);break;case U.DISCONNECT:this.ondisconnect();break;case U.CONNECT_ERROR:this.destroy();const i=new Error(t.data.message);i.data=t.data.data,this.emitReserved("connect_error",i);break}}onevent(t){const e=t.data||[];t.id!=null&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const i of e)i.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let i=!1;return function(...s){i||(i=!0,e.packet({type:U.ACK,id:t,data:s}))}}onack(t){const e=this.acks[t.id];typeof e=="function"&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:U.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let i=0;i0&&n.jitter<=1?n.jitter:0,this.attempts=0}Di.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),e=Math.floor(t*this.jitter*n);n=Math.floor(t*10)&1?n+e:n-e}return Math.min(n,this.max)|0};Di.prototype.reset=function(){this.attempts=0};Di.prototype.setMin=function(n){this.ms=n};Di.prototype.setMax=function(n){this.max=n};Di.prototype.setJitter=function(n){this.jitter=n};class Er extends at{constructor(t,e){var i;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.opts=e,Cs(this,e),this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor((i=e.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new Di({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this._readyState="closed",this.uri=t;const s=e.parser||Og;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=e.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(e=this.backoff)===null||e===void 0||e.setMin(t),this)}randomizationFactor(t){var e;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(e=this.backoff)===null||e===void 0||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(e=this.backoff)===null||e===void 0||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new xg(this.uri,this.opts);const e=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const s=Xt(e,"open",function(){i.onopen(),t&&t()}),r=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Xt(e,"error",r);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{s(),r(new Error("timeout")),e.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Xt(t,"ping",this.onping.bind(this)),Xt(t,"data",this.ondata.bind(this)),Xt(t,"error",this.onerror.bind(this)),Xt(t,"close",this.onclose.bind(this)),Xt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(e){this.onclose("parse error",e)}}ondecoded(t){ws(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let i=this.nsps[t];return i?this._autoConnect&&!i.active&&i.connect():(i=new nh(this,t,e),this.nsps[t]=i),i}_destroy(t){const e=Object.keys(this.nsps);for(const i of e)if(this.nsps[i].active)return;this._close()}_packet(t){const e=this.encoder.encode(t);for(let i=0;it()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,e){var i;this.cleanup(),(i=this.engine)===null||i===void 0||i.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const i=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},e);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ki={};function $s(n,t){typeof n=="object"&&(t=n,n=void 0),t=t||{};const e=wg(n,t.path||"/socket.io"),i=e.source,s=e.id,r=e.path,o=Ki[s]&&r in Ki[s].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Er(i,t):(Ki[s]||(Ki[s]=new Er(i,t)),l=Ki[s]),e.query&&!t.query&&(t.query=e.queryKey),l.socket(e.path,t)}Object.assign($s,{Manager:Er,Socket:nh,io:$s,connect:$s});const Pg={key:0,class:"bg-body-secondary rounded-3 mb-3 d-flex animate__animated animate__fadeIn",style:{height:"300px"}},kg={class:"m-auto"},Fg={class:"text-muted"},Ng={key:1,id:"map",class:"w-100 rounded-3"},Gg={__name:"osmapSocket",props:{type:"",d:Object||Array},async setup(n){let t,e;const i=Ta(),s=n,r=po(!1);if([t,e]=hh(()=>fetch("https://tile.openstreetmap.org/",{signal:AbortSignal.timeout(1500)}).then(()=>{r.value=!0}).catch(o=>{console.log(o)})),await t,e(),r.value){const o=new Yt({center:Qi([179.47,57.89]),zoom:1}),a=new Rl({layers:[new Fl({source:new Dl})],view:o}),l=new Yl({style:function(g){if(g.getGeometry().getType()==="Point")return new Zt({image:new Mi({radius:10,fill:new Je({color:g.get("last")?"#dc3545":"#0d6efd"}),stroke:new Fe({color:"white",width:5})})});if(g.getGeometry().getType()==="LineString")return new Zt({stroke:new Fe({color:"#0d6efd",width:2})})}});a.addLayer(l),ch(()=>{a.setTarget("map"),i.Configuration.Server.dashboard_theme==="dark"&&a.on("postcompose",()=>{document.querySelector("#map").style.filter="grayscale(80%) invert(100%)"})});let c=new Kl,h=[],u=new _n(h),d=new je({geometry:u});c.addFeature(d);let f=po([]);l.setSource(c),uh(()=>s.d,g=>{if(g.length>0){let _=g[g.length-1];if(_.geo&&_.geo.status==="success"){let m=Qi([_.geo.lon,_.geo.lat]);f.value.find(p=>p===_.address)||(h.push(m),u.setCoordinates(h),d.setGeometry(u),c.removeFeature(d),c.addFeature(d),c.addFeature(new je({geometry:new Si(m),last:!1})),f.value.push(_.address)),o.animate({center:m}),o.animate({zoom:10})}}else c.clear(),h=[],f.value=[]},{deep:!0})}return(o,a)=>r.value?(Js(),Qs("div",Ng)):(Js(),Qs("div",Pg,[yo("div",kg,[yo("small",Fg,[dh(fh,{t:"Sorry, OpenStreetMap is not available"})])])]))}},Kg=va(Gg,[["__scopeId","data-v-9b173738"]]);export{Kg as O,Wg as a,$s as l}; diff --git a/src/static/app/dist/assets/osmap-CoctJCk_.css b/src/static/app/dist/assets/osmapSocket-Di31nNcN.css similarity index 96% rename from src/static/app/dist/assets/osmap-CoctJCk_.css rename to src/static/app/dist/assets/osmapSocket-Di31nNcN.css index 68bd3c9..0fecdd3 100644 --- a/src/static/app/dist/assets/osmap-CoctJCk_.css +++ b/src/static/app/dist/assets/osmapSocket-Di31nNcN.css @@ -1 +1 @@ -:root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.ol-layer canvas{border-radius:var(--bs-border-radius-lg)!important}#map{height:300px} +:root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}.ol-layer canvas{border-radius:var(--bs-border-radius-lg)!important}#map{height:300px}.ol-layer canvas[data-v-9b173738]{border-radius:var(--bs-border-radius-lg)!important}#map[data-v-9b173738]{height:300px} diff --git a/src/static/app/dist/assets/peerAddModal-C7eF7J_U.js b/src/static/app/dist/assets/peerAddModal-gKaLiPyl.js similarity index 99% rename from src/static/app/dist/assets/peerAddModal-C7eF7J_U.js rename to src/static/app/dist/assets/peerAddModal-gKaLiPyl.js index 27a8f43..f5da04e 100644 --- a/src/static/app/dist/assets/peerAddModal-C7eF7J_U.js +++ b/src/static/app/dist/assets/peerAddModal-gKaLiPyl.js @@ -1 +1 @@ -import{_ as g,W as A,D as I,j as w,a as i,c as d,b as e,d as o,f as $,m as b,x as f,n as m,r as C,G as T,v as P,w as E,F as O,h as L,t as K,k as G,H as F,e as y,g as B,K as R,C as W,p as D,E as q,i as x,a5 as V,z}from"./index-7qLsecvh.js";import{L as r}from"./localeText-BguG5zGd.js";const J={name:"endpointAllowedIps",components:{LocaleText:r},props:{data:Object,saving:Boolean},setup(){const l=A(),t=I();return{store:l,dashboardStore:t}},data(){return{endpointAllowedIps:JSON.parse(JSON.stringify(this.data.endpoint_allowed_ip)),error:!1}},methods:{checkAllowedIP(){let l=this.endpointAllowedIps.split(",").map(t=>t.replaceAll(" ",""));for(let t in l)if(!this.store.checkCIDR(l[t])){this.error||this.dashboardStore.newMessage("WGDashboard","Endpoint Allowed IPs format is incorrect","danger"),this.data.endpoint_allowed_ip="",this.error=!0;return}this.error=!1,this.data.endpoint_allowed_ip=this.endpointAllowedIps}},watch:{endpointAllowedIps(){this.checkAllowedIP()}}},H={for:"peer_endpoint_allowed_ips",class:"form-label"},Q={class:"text-muted"},Y=["disabled"];function Z(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("label",H,[e("small",Q,[o(s,{t:"Endpoint Allowed IPs"}),t[2]||(t[2]=$()),e("code",null,[o(s,{t:"(Required)"})])])]),b(e("input",{type:"text",class:m(["form-control form-control-sm rounded-3",{"is-invalid":c.error}]),disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.endpointAllowedIps=a),onBlur:t[1]||(t[1]=a=>this.checkAllowedIP()),id:"peer_endpoint_allowed_ips"},null,42,Y),[[f,this.endpointAllowedIps]])])}const X=g(J,[["render",Z]]),ee={name:"allowedIPsInput",components:{LocaleText:r},props:{data:Object,saving:Boolean,bulk:Boolean,availableIp:void 0},data(){return{allowedIp:[],availableIpSearchString:"",customAvailableIp:"",allowedIpFormatError:!1}},setup(l){const t=A(),n=I(),u=C("");return Object.keys(l.availableIp).length>0&&(u.value=Object.keys(l.availableIp)[0]),{store:t,dashboardStore:n,selectedSubnet:u}},computed:{searchAvailableIps(){return this.availableIpSearchString?this.availableIp[this.selectedSubnet].filter(l=>l.includes(this.availableIpSearchString)&&!this.data.allowed_ips.includes(l)):this.availableIp[this.selectedSubnet].filter(l=>!this.data.allowed_ips.includes(l))},inputGetLocale(){return T("Enter IP Address/CIDR")}},methods:{addAllowedIp(l){let t=l.split(",");for(let n=0;n0&&this.data.allowed_ips.length===0)for(let l in this.availableIp)this.availableIp[l].length>0&&this.addAllowedIp(this.availableIp[l][0])}},te={class:"d-flex flex-column flex-md-row mb-2"},se={for:"peer_allowed_ip_textbox",class:"form-label mb-0"},ae={class:"text-muted"},le={class:"form-check form-switch ms-md-auto"},oe={class:"form-check-label",for:"disableIPValidation"},ie={class:"d-flex"},de=["onClick"],ne={class:"d-flex gap-2 align-items-center"},re={class:"input-group"},ue=["placeholder","disabled"],ce=["disabled"],pe={class:"text-muted"},be={class:"dropdown flex-grow-1"},he=["disabled"],_e={key:0,class:"dropdown-menu mt-2 shadow w-100 dropdown-menu-end rounded-3 pb-0",style:{width:"300px !important"}},me={class:"px-3 d-flex gap-3 align-items-center"},ve={class:"px-3 overflow-x-scroll d-flex overflow-x-scroll overflow-y-hidden align-items-center gap-2"},fe=["onClick"],ye={class:"overflow-y-scroll",style:{height:"270px"}},ke=["onClick"],ge={class:"me-auto"},we={key:0,class:"px-3 py-2"},xe={key:0,class:"text-muted"},$e={key:1,class:"text-muted"};function Ae(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",{class:m({inactiveField:this.bulk})},[e("div",te,[e("label",se,[e("small",ae,[o(s,{t:"Allowed IPs"}),t[5]||(t[5]=$()),e("code",null,[o(s,{t:"(Required)"})])])]),e("div",le,[b(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[0]||(t[0]=a=>this.data.allowed_ips_validation=a),role:"switch",id:"disableIPValidation"},null,512),[[P,this.data.allowed_ips_validation]]),e("label",oe,[e("small",null,[o(s,{t:"Allowed IPs Validation"})])])])]),e("div",ie,[e("div",{class:m(["d-flex gap-2 flex-wrap",{"mb-2":this.data.allowed_ips.length>0}])},[o(G,{name:"list"},{default:E(()=>[(i(!0),d(O,null,L(this.data.allowed_ips,(a,p)=>(i(),d("span",{class:"badge rounded-pill text-bg-success",key:a},[$(K(a)+" ",1),e("a",{role:"button",onClick:S=>this.data.allowed_ips.splice(p,1)},t[6]||(t[6]=[e("i",{class:"bi bi-x-circle-fill ms-1"},null,-1)]),8,de)]))),128))]),_:1})],2)]),e("div",ne,[e("div",re,[b(e("input",{type:"text",class:m(["form-control form-control-sm rounded-start-3",{"is-invalid":this.allowedIpFormatError}]),placeholder:this.inputGetLocale,onKeyup:t[1]||(t[1]=F(a=>this.customAvailableIp?this.addAllowedIp(this.customAvailableIp):void 0,["enter"])),"onUpdate:modelValue":t[2]||(t[2]=a=>c.customAvailableIp=a),id:"peer_allowed_ip_textbox",disabled:n.bulk},null,42,ue),[[f,c.customAvailableIp]]),e("button",{class:m(["btn btn-sm rounded-end-3",[this.customAvailableIp?"btn-success":"btn-outline-success"]]),disabled:n.bulk||!this.customAvailableIp,onClick:t[3]||(t[3]=a=>this.addAllowedIp(this.customAvailableIp)),type:"button",id:"button-addon2"},t[7]||(t[7]=[e("i",{class:"bi bi-plus-lg"},null,-1)]),10,ce)]),e("small",pe,[o(s,{t:"or"})]),e("div",be,[e("button",{class:"btn btn-outline-secondary btn-sm dropdown-toggle rounded-3 w-100",disabled:!n.availableIp||n.bulk,"data-bs-auto-close":"outside",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[t[8]||(t[8]=e("i",{class:"bi bi-filter-circle me-2"},null,-1)),o(s,{t:"Pick Available IP"})],8,he),this.availableIp?(i(),d("ul",_e,[e("li",null,[e("div",me,[t[9]||(t[9]=e("label",{for:"availableIpSearchString",class:"text-muted"},[e("i",{class:"bi bi-search"})],-1)),b(e("input",{id:"availableIpSearchString",class:"form-control form-control-sm rounded-3","onUpdate:modelValue":t[4]||(t[4]=a=>this.availableIpSearchString=a)},null,512),[[f,this.availableIpSearchString]])]),t[11]||(t[11]=e("hr",{class:"my-2"},null,-1)),e("div",ve,[t[10]||(t[10]=e("small",{class:"text-muted"},"Subnet",-1)),(i(!0),d(O,null,L(Object.keys(this.availableIp),a=>(i(),d("button",{key:a,onClick:p=>this.selectedSubnet=a,class:m([{"bg-primary-subtle":this.selectedSubnet===a},"btn btn-sm text-primary-emphasis rounded-3"])},K(a),11,fe))),128))]),t[12]||(t[12]=e("hr",{class:"mt-2 mb-0"},null,-1))]),e("li",null,[e("div",ye,[(i(!0),d(O,null,L(this.searchAvailableIps,a=>(i(),d("div",{style:{},key:a},[e("a",{class:"dropdown-item d-flex",role:"button",onClick:p=>this.addAllowedIp(a)},[e("span",ge,[e("small",null,K(a),1)])],8,ke)]))),128)),this.searchAvailableIps.length===0?(i(),d("div",we,[this.availableIpSearchString?(i(),d("small",xe,[o(s,{t:"No available IP containing"}),$('"'+K(this.availableIpSearchString)+'"',1)])):(i(),d("small",$e,[o(s,{t:"No more IP address available in this subnet"})]))])):y("",!0)])])])):y("",!0)])])],2)}const Ie=g(ee,[["render",Ae],["__scopeId","data-v-ed72944d"]]),Pe={name:"dnsInput",components:{LocaleText:r},props:{data:Object,saving:Boolean},data(){return{error:!1,dns:JSON.parse(JSON.stringify(this.data.DNS))}},setup(){const l=A(),t=I();return{store:l,dashboardStore:t}},methods:{checkDNS(){if(this.dns){let l=this.dns.split(",").map(t=>t.replaceAll(" ",""));for(let t in l)if(!this.store.regexCheckIP(l[t])){this.error||this.dashboardStore.newMessage("WGDashboard","DNS format is incorrect","danger"),this.error=!0,this.data.DNS="";return}this.error=!1,this.data.DNS=this.dns}}},watch:{dns(){this.checkDNS()}}},Se={for:"peer_DNS_textbox",class:"form-label"},Ke={class:"text-muted"},Ce=["disabled"];function Oe(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("label",Se,[e("small",Ke,[o(s,{t:"DNS"})])]),b(e("input",{type:"text",class:m(["form-control form-control-sm rounded-3",{"is-invalid":this.error}]),disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.dns=a),id:"peer_DNS_textbox"},null,10,Ce),[[f,this.dns]])])}const Le=g(Pe,[["render",Oe]]),Ne={name:"nameInput",components:{LocaleText:r},props:{bulk:Boolean,data:Object,saving:Boolean}},De={for:"peer_name_textbox",class:"form-label"},Ve={class:"text-muted"},Te=["disabled"];function Be(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",{class:m({inactiveField:this.bulk})},[e("label",De,[e("small",Ve,[o(s,{t:"Name"})])]),b(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||this.bulk,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.name=a),id:"peer_name_textbox",placeholder:""},null,8,Te),[[f,this.data.name]])],2)}const Me=g(Ne,[["render",Be]]),Ue={name:"privatePublicKeyInput",components:{LocaleText:r},props:{data:Object,saving:Boolean,bulk:Boolean},setup(){const l=I(),t=A();return{dashboardStore:l,wgStore:t}},data(){return{keypair:{publicKey:"",privateKey:"",presharedKey:""},editKey:!1,error:!1}},methods:{genKeyPair(){this.editKey=!1,this.keypair=window.wireguard.generateKeypair(),this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey},testKey(l){return/^[A-Za-z0-9+/]{43}=?=?$/.test(l)},checkMatching(){try{this.keypair.privateKey&&this.wgStore.checkWGKeyLength(this.keypair.privateKey)&&(this.keypair.publicKey=window.wireguard.generatePublicKey(this.keypair.privateKey),window.wireguard.generatePublicKey(this.keypair.privateKey)!==this.keypair.publicKey?(this.error=!0,this.dashboardStore.newMessage("WGDashboard","Private key does not match with the public key","danger")):(this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey))}catch{this.error=!0,this.data.private_key="",this.data.public_key=""}}},mounted(){this.genKeyPair()},watch:{keypair:{deep:!0,handler(){this.error=!1,this.checkMatching()}}}},je={for:"peer_private_key_textbox",class:"form-label"},Ee={class:"text-muted"},Ge={class:"input-group"},Fe=["disabled"],Re=["disabled"],We={class:"d-flex flex-column flex-md-row mb-2"},qe={for:"public_key",class:"form-label mb-0"},ze={class:"text-muted"},Je={class:"form-check form-switch ms-md-auto"},He=["disabled"],Qe={class:"form-check-label",for:"enablePublicKeyEdit"},Ye=["disabled"];function Ze(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",{class:m(["d-flex gap-2 flex-column",{inactiveField:this.bulk}])},[e("div",null,[e("label",je,[e("small",Ee,[o(s,{t:"Private Key"}),t[6]||(t[6]=$()),e("code",null,[o(s,{t:"(Required for QR Code and Download)"})])])]),e("div",Ge,[b(e("input",{type:"text",class:m(["form-control form-control-sm rounded-start-3",{"is-invalid":this.error}]),"onUpdate:modelValue":t[0]||(t[0]=a=>this.keypair.privateKey=a),disabled:!this.editKey||this.bulk,onBlur:t[1]||(t[1]=a=>this.checkMatching()),id:"peer_private_key_textbox"},null,42,Fe),[[f,this.keypair.privateKey]]),e("button",{class:"btn btn-outline-info btn-sm rounded-end-3",onClick:t[2]||(t[2]=a=>this.genKeyPair()),disabled:this.bulk,type:"button",id:"button-addon2"},t[7]||(t[7]=[e("i",{class:"bi bi-arrow-repeat"},null,-1)]),8,Re)])]),e("div",null,[e("div",We,[e("label",qe,[e("small",ze,[o(s,{t:"Public Key"}),t[8]||(t[8]=$()),e("code",null,[o(s,{t:"(Required)"})])])]),e("div",Je,[b(e("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:this.bulk,id:"enablePublicKeyEdit","onUpdate:modelValue":t[3]||(t[3]=a=>this.editKey=a)},null,8,He),[[P,this.editKey]]),e("label",Qe,[e("small",null,[o(s,{t:"Use your own Private and Public Key"})])])])]),b(e("input",{class:m(["form-control-sm form-control rounded-3",{"is-invalid":this.error}]),"onUpdate:modelValue":t[4]||(t[4]=a=>this.keypair.publicKey=a),onBlur:t[5]||(t[5]=a=>this.checkMatching()),disabled:!this.editKey||this.bulk,type:"text",id:"public_key"},null,42,Ye),[[f,this.keypair.publicKey]])])],2)}const Xe=g(Ue,[["render",Ze]]),et={name:"bulkAdd",components:{LocaleText:r},props:{saving:Boolean,data:Object,availableIp:void 0},data(){return{numberOfAvailableIPs:null}},computed:{bulkAddGetLocale(){return T("How many peers you want to add?")},getNumberOfAvailableIPs(){return this.numberOfAvailableIPs?Object.values(this.numberOfAvailableIPs).reduce((l,t)=>l+t):"..."}},watch:{"data.bulkAdd":{immediate:!0,handler(l){l&&B("/api/getNumberOfAvailableIPs/"+this.$route.params.id,{},t=>{t.status&&(this.numberOfAvailableIPs=t.data)})}}}},tt={class:"form-check form-switch"},st=["disabled"],at={class:"form-check-label me-2",for:"bulk_add"},lt={class:"text-muted d-block"},ot={key:0,class:"form-group"},it=["max","placeholder"],dt={class:"text-muted"};function nt(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("div",tt,[b(e("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:!this.availableIp,id:"bulk_add","onUpdate:modelValue":t[0]||(t[0]=a=>this.data.bulkAdd=a)},null,8,st),[[P,this.data.bulkAdd]]),e("label",at,[e("small",null,[e("strong",null,[o(s,{t:"Bulk Add"})])])])]),e("p",{class:m({"mb-0":!this.data.bulkAdd})},[e("small",lt,[o(s,{t:"By adding peers by bulk, each peer's name will be auto generated, and Allowed IP will be assign to the next available IP."})])],2),this.data.bulkAdd?(i(),d("div",ot,[b(e("input",{class:"form-control form-control-sm rounded-3 mb-1",type:"number",min:"1",id:"bulk_add_count",max:this.availableIp.length,"onUpdate:modelValue":t[1]||(t[1]=a=>this.data.bulkAddAmount=a),placeholder:this.bulkAddGetLocale},null,8,it),[[f,this.data.bulkAddAmount]]),e("small",dt,[o(s,{t:"You can add up to "+v.getNumberOfAvailableIPs+" peers"},null,8,["t"])])])):y("",!0)])}const rt=g(et,[["render",nt]]),ut={name:"presharedKeyInput",components:{LocaleText:r},props:{data:Object,saving:Boolean},data(){return{enable:!1}},watch:{enable(){this.enable?this.data.preshared_key=window.wireguard.generateKeypair().presharedKey:this.data.preshared_key=""}}},ct={class:"d-flex align-items-start"},pt={for:"peer_preshared_key_textbox",class:"form-label"},bt={class:"text-muted"},ht={class:"form-check form-switch ms-auto"},_t=["disabled"];function mt(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("div",ct,[e("label",pt,[e("small",bt,[o(s,{t:"Pre-Shared Key"})])]),e("div",ht,[b(e("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":t[0]||(t[0]=a=>this.enable=a),id:"peer_preshared_key_switch"},null,512),[[P,this.enable]])])]),b(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||!this.enable,"onUpdate:modelValue":t[1]||(t[1]=a=>this.data.preshared_key=a),id:"peer_preshared_key_textbox"},null,8,_t),[[f,this.data.preshared_key]])])}const vt=g(ut,[["render",mt]]),ft={name:"mtuInput",components:{LocaleText:r},props:{data:Object,saving:Boolean}},yt={for:"peer_mtu",class:"form-label"},kt={class:"text-muted"},gt=["disabled"];function wt(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("label",yt,[e("small",kt,[o(s,{t:"MTU"})])]),b(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.mtu=a),min:"0",id:"peer_mtu"},null,8,gt),[[f,this.data.mtu]])])}const xt=g(ft,[["render",wt]]),$t={name:"persistentKeepAliveInput",components:{LocaleText:r},props:{data:Object,saving:Boolean}},At={for:"peer_keep_alive",class:"form-label"},It={class:"text-muted"},Pt=["disabled"];function St(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("label",At,[e("small",It,[o(s,{t:"Persistent Keepalive"})])]),b(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.keepalive=a),id:"peer_keep_alive"},null,8,Pt),[[f,this.data.keepalive]])])}const Kt=g($t,[["render",St]]),Ct={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref:"editConfigurationContainer"},Ot={class:"container d-flex h-100 w-100"},Lt={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"1000px"}},Nt={class:"card rounded-3 shadow flex-grow-1"},Dt={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},Vt={class:"mb-0"},Tt={class:"card-body px-4 pb-4"},Bt={class:"d-flex flex-column gap-2"},Mt={class:"accordion mb-3",id:"peerAddModalAccordion"},Ut={class:"accordion-item"},jt={class:"accordion-header"},Et={class:"accordion-button collapsed rounded-3",type:"button","data-bs-toggle":"collapse","data-bs-target":"#peerAddModalAccordionAdvancedOptions"},Gt={id:"peerAddModalAccordionAdvancedOptions",class:"accordion-collapse collapse collapsed","data-bs-parent":"#peerAddModalAccordion"},Ft={class:"accordion-body rounded-bottom-3"},Rt={class:"d-flex flex-column gap-2"},Wt={class:"row gy-3"},qt={key:0,class:"col-sm"},zt={class:"col-sm"},Jt={class:"col-sm"},Ht={key:1,class:"col-12"},Qt={class:"form-check form-switch"},Yt={class:"form-check-label",for:"bullAdd_PresharedKey_Switch"},Zt={class:"fw-bold"},Xt={key:0},es={class:"form-label d-block"},ts={class:"text-muted"},ss={class:"btn-group",role:"group"},as={class:"btn btn-outline-primary btn-sm",for:"advanced_security_on"},ls={class:"btn btn-outline-primary btn-sm",for:"advanced_security_off"},os={class:"d-flex mt-2"},is=["disabled"],ds={key:0,class:"bi bi-plus-circle-fill me-2"},us={__name:"peerAddModal",emits:["close","addedPeers"],async setup(l,{emit:t}){let n,u;const c=I(),v=A(),s=C({bulkAdd:!1,bulkAddAmount:0,name:"",allowed_ips:[],private_key:"",public_key:"",DNS:c.Configuration.Peers.peer_global_dns,endpoint_allowed_ip:c.Configuration.Peers.peer_endpoint_allowed_ip,keepalive:parseInt(c.Configuration.Peers.peer_keep_alive),mtu:parseInt(c.Configuration.Peers.peer_mtu),preshared_key:"",preshared_key_bulkAdd:!1,advanced_security:"off",allowed_ips_validation:!0}),a=C([]),p=C(!1),S=R();[n,u]=W(()=>B("/api/getAvailableIPs/"+S.params.id,{},_=>{_.status&&(a.value=_.data)})),await n,u();const N=t,M=D(()=>v.Configurations.find(_=>_.Name===S.params.id).Protocol),U=D(()=>{let _=!0;return s.value.bulkAdd?(s.value.bulkAddAmount.length===0||s.value.bulkAddAmount>a.value.length)&&(_=!1):["allowed_ips","private_key","public_key","endpoint_allowed_ip","keepalive","mtu"].forEach(k=>{s.value[k].length===0&&(_=!1)}),_}),j=()=>{p.value=!0,z("/api/addPeers/"+S.params.id,s.value,_=>{_.status?(c.newMessage("Server","Peer created successfully","success"),N("addedPeers")):c.newMessage("Server",_.message,"danger"),p.value=!1})};return q(()=>s.value.bulkAddAmount,()=>{s.value.bulkAddAmount>a.value.length&&(s.value.bulkAddAmount=a.value.length)}),(_,h)=>(i(),d("div",Ct,[e("div",Ot,[e("div",Lt,[e("div",Nt,[e("div",Dt,[e("h4",Vt,[o(r,{t:"Add Peers"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:h[0]||(h[0]=k=>N("close"))})]),e("div",Tt,[e("div",Bt,[o(rt,{saving:p.value,data:s.value,availableIp:a.value},null,8,["saving","data","availableIp"]),h[5]||(h[5]=e("hr",{class:"mb-0 mt-2"},null,-1)),s.value.bulkAdd?y("",!0):(i(),x(Me,{key:0,saving:p.value,data:s.value},null,8,["saving","data"])),s.value.bulkAdd?y("",!0):(i(),x(Xe,{key:1,saving:p.value,data:s.value},null,8,["saving","data"])),s.value.bulkAdd?y("",!0):(i(),x(Ie,{key:2,availableIp:a.value,saving:p.value,data:s.value},null,8,["availableIp","saving","data"]))]),h[7]||(h[7]=e("hr",null,null,-1)),e("div",Mt,[e("div",Ut,[e("h2",jt,[e("button",Et,[o(r,{t:"Advanced Options"})])]),e("div",Gt,[e("div",Ft,[e("div",Rt,[o(Le,{saving:p.value,data:s.value},null,8,["saving","data"]),o(X,{saving:p.value,data:s.value},null,8,["saving","data"]),e("div",Wt,[s.value.bulkAdd?y("",!0):(i(),d("div",qt,[o(vt,{saving:p.value,data:s.value,bulk:s.value.bulkAdd},null,8,["saving","data","bulk"])])),e("div",zt,[o(xt,{saving:p.value,data:s.value},null,8,["saving","data"])]),e("div",Jt,[o(Kt,{saving:p.value,data:s.value},null,8,["saving","data"])]),s.value.bulkAdd?(i(),d("div",Ht,[e("div",Qt,[b(e("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":h[1]||(h[1]=k=>s.value.preshared_key_bulkAdd=k),id:"bullAdd_PresharedKey_Switch",checked:""},null,512),[[P,s.value.preshared_key_bulkAdd]]),e("label",Yt,[e("small",Zt,[o(r,{t:"Pre-Shared Key"}),h[6]||(h[6]=$()),s.value.preshared_key_bulkAdd?(i(),x(r,{key:0,t:"Enabled"})):(i(),x(r,{key:1,t:"Disabled"}))])])])])):y("",!0)])])])])])]),M.value==="awg"?(i(),d("div",Xt,[e("h5",null,[o(r,{t:"AmneziaWG Peer Setting"})]),e("div",null,[e("label",es,[e("small",ts,[o(r,{t:"Advanced Security"})])]),e("div",ss,[b(e("input",{type:"radio",class:"btn-check","onUpdate:modelValue":h[2]||(h[2]=k=>s.value.advanced_security=k),value:"on",name:"advanced_security_radio",id:"advanced_security_on",autocomplete:"off"},null,512),[[V,s.value.advanced_security]]),e("label",as,[o(r,{t:"On"})]),b(e("input",{type:"radio","onUpdate:modelValue":h[3]||(h[3]=k=>s.value.advanced_security=k),value:"off",class:"btn-check",name:"advanced_security_radio",id:"advanced_security_off",autocomplete:"off"},null,512),[[V,s.value.advanced_security]]),e("label",ls,[o(r,{t:"Off"})])])])])):y("",!0),e("div",os,[e("button",{class:"ms-auto btn btn-dark btn-brand rounded-3 px-3 py-2 shadow",disabled:!U.value||p.value,onClick:h[4]||(h[4]=k=>j())},[p.value?y("",!0):(i(),d("i",ds)),p.value?(i(),x(r,{key:1,t:"Adding..."})):(i(),x(r,{key:2,t:"Add"}))],8,is)])])])])])],512))}};export{us as default}; +import{_ as g,W as A,D as I,j as w,a as i,c as d,b as e,d as o,f as $,m as b,x as f,n as m,r as C,G as T,v as P,w as E,F as O,h as L,t as K,k as G,C as F,e as y,g as B,K as R,E as W,p as D,H as q,i as x,a5 as V,z}from"./index-CgM9eUIs.js";import{L as r}from"./localeText-Dh33930I.js";const J={name:"endpointAllowedIps",components:{LocaleText:r},props:{data:Object,saving:Boolean},setup(){const l=A(),t=I();return{store:l,dashboardStore:t}},data(){return{endpointAllowedIps:JSON.parse(JSON.stringify(this.data.endpoint_allowed_ip)),error:!1}},methods:{checkAllowedIP(){let l=this.endpointAllowedIps.split(",").map(t=>t.replaceAll(" ",""));for(let t in l)if(!this.store.checkCIDR(l[t])){this.error||this.dashboardStore.newMessage("WGDashboard","Endpoint Allowed IPs format is incorrect","danger"),this.data.endpoint_allowed_ip="",this.error=!0;return}this.error=!1,this.data.endpoint_allowed_ip=this.endpointAllowedIps}},watch:{endpointAllowedIps(){this.checkAllowedIP()}}},H={for:"peer_endpoint_allowed_ips",class:"form-label"},Q={class:"text-muted"},Y=["disabled"];function Z(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("label",H,[e("small",Q,[o(s,{t:"Endpoint Allowed IPs"}),t[2]||(t[2]=$()),e("code",null,[o(s,{t:"(Required)"})])])]),b(e("input",{type:"text",class:m(["form-control form-control-sm rounded-3",{"is-invalid":c.error}]),disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.endpointAllowedIps=a),onBlur:t[1]||(t[1]=a=>this.checkAllowedIP()),id:"peer_endpoint_allowed_ips"},null,42,Y),[[f,this.endpointAllowedIps]])])}const X=g(J,[["render",Z]]),ee={name:"allowedIPsInput",components:{LocaleText:r},props:{data:Object,saving:Boolean,bulk:Boolean,availableIp:void 0},data(){return{allowedIp:[],availableIpSearchString:"",customAvailableIp:"",allowedIpFormatError:!1}},setup(l){const t=A(),n=I(),u=C("");return Object.keys(l.availableIp).length>0&&(u.value=Object.keys(l.availableIp)[0]),{store:t,dashboardStore:n,selectedSubnet:u}},computed:{searchAvailableIps(){return this.availableIpSearchString?this.availableIp[this.selectedSubnet].filter(l=>l.includes(this.availableIpSearchString)&&!this.data.allowed_ips.includes(l)):this.availableIp[this.selectedSubnet].filter(l=>!this.data.allowed_ips.includes(l))},inputGetLocale(){return T("Enter IP Address/CIDR")}},methods:{addAllowedIp(l){let t=l.split(",");for(let n=0;n0&&this.data.allowed_ips.length===0)for(let l in this.availableIp)this.availableIp[l].length>0&&this.addAllowedIp(this.availableIp[l][0])}},te={class:"d-flex flex-column flex-md-row mb-2"},se={for:"peer_allowed_ip_textbox",class:"form-label mb-0"},ae={class:"text-muted"},le={class:"form-check form-switch ms-md-auto"},oe={class:"form-check-label",for:"disableIPValidation"},ie={class:"d-flex"},de=["onClick"],ne={class:"d-flex gap-2 align-items-center"},re={class:"input-group"},ue=["placeholder","disabled"],ce=["disabled"],pe={class:"text-muted"},be={class:"dropdown flex-grow-1"},he=["disabled"],_e={key:0,class:"dropdown-menu mt-2 shadow w-100 dropdown-menu-end rounded-3 pb-0",style:{width:"300px !important"}},me={class:"px-3 d-flex gap-3 align-items-center"},ve={class:"px-3 overflow-x-scroll d-flex overflow-x-scroll overflow-y-hidden align-items-center gap-2"},fe=["onClick"],ye={class:"overflow-y-scroll",style:{height:"270px"}},ke=["onClick"],ge={class:"me-auto"},we={key:0,class:"px-3 py-2"},xe={key:0,class:"text-muted"},$e={key:1,class:"text-muted"};function Ae(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",{class:m({inactiveField:this.bulk})},[e("div",te,[e("label",se,[e("small",ae,[o(s,{t:"Allowed IPs"}),t[5]||(t[5]=$()),e("code",null,[o(s,{t:"(Required)"})])])]),e("div",le,[b(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[0]||(t[0]=a=>this.data.allowed_ips_validation=a),role:"switch",id:"disableIPValidation"},null,512),[[P,this.data.allowed_ips_validation]]),e("label",oe,[e("small",null,[o(s,{t:"Allowed IPs Validation"})])])])]),e("div",ie,[e("div",{class:m(["d-flex gap-2 flex-wrap",{"mb-2":this.data.allowed_ips.length>0}])},[o(G,{name:"list"},{default:E(()=>[(i(!0),d(O,null,L(this.data.allowed_ips,(a,p)=>(i(),d("span",{class:"badge rounded-pill text-bg-success",key:a},[$(K(a)+" ",1),e("a",{role:"button",onClick:S=>this.data.allowed_ips.splice(p,1)},t[6]||(t[6]=[e("i",{class:"bi bi-x-circle-fill ms-1"},null,-1)]),8,de)]))),128))]),_:1})],2)]),e("div",ne,[e("div",re,[b(e("input",{type:"text",class:m(["form-control form-control-sm rounded-start-3",{"is-invalid":this.allowedIpFormatError}]),placeholder:this.inputGetLocale,onKeyup:t[1]||(t[1]=F(a=>this.customAvailableIp?this.addAllowedIp(this.customAvailableIp):void 0,["enter"])),"onUpdate:modelValue":t[2]||(t[2]=a=>c.customAvailableIp=a),id:"peer_allowed_ip_textbox",disabled:n.bulk},null,42,ue),[[f,c.customAvailableIp]]),e("button",{class:m(["btn btn-sm rounded-end-3",[this.customAvailableIp?"btn-success":"btn-outline-success"]]),disabled:n.bulk||!this.customAvailableIp,onClick:t[3]||(t[3]=a=>this.addAllowedIp(this.customAvailableIp)),type:"button",id:"button-addon2"},t[7]||(t[7]=[e("i",{class:"bi bi-plus-lg"},null,-1)]),10,ce)]),e("small",pe,[o(s,{t:"or"})]),e("div",be,[e("button",{class:"btn btn-outline-secondary btn-sm dropdown-toggle rounded-3 w-100",disabled:!n.availableIp||n.bulk,"data-bs-auto-close":"outside",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[t[8]||(t[8]=e("i",{class:"bi bi-filter-circle me-2"},null,-1)),o(s,{t:"Pick Available IP"})],8,he),this.availableIp?(i(),d("ul",_e,[e("li",null,[e("div",me,[t[9]||(t[9]=e("label",{for:"availableIpSearchString",class:"text-muted"},[e("i",{class:"bi bi-search"})],-1)),b(e("input",{id:"availableIpSearchString",class:"form-control form-control-sm rounded-3","onUpdate:modelValue":t[4]||(t[4]=a=>this.availableIpSearchString=a)},null,512),[[f,this.availableIpSearchString]])]),t[11]||(t[11]=e("hr",{class:"my-2"},null,-1)),e("div",ve,[t[10]||(t[10]=e("small",{class:"text-muted"},"Subnet",-1)),(i(!0),d(O,null,L(Object.keys(this.availableIp),a=>(i(),d("button",{key:a,onClick:p=>this.selectedSubnet=a,class:m([{"bg-primary-subtle":this.selectedSubnet===a},"btn btn-sm text-primary-emphasis rounded-3"])},K(a),11,fe))),128))]),t[12]||(t[12]=e("hr",{class:"mt-2 mb-0"},null,-1))]),e("li",null,[e("div",ye,[(i(!0),d(O,null,L(this.searchAvailableIps,a=>(i(),d("div",{style:{},key:a},[e("a",{class:"dropdown-item d-flex",role:"button",onClick:p=>this.addAllowedIp(a)},[e("span",ge,[e("small",null,K(a),1)])],8,ke)]))),128)),this.searchAvailableIps.length===0?(i(),d("div",we,[this.availableIpSearchString?(i(),d("small",xe,[o(s,{t:"No available IP containing"}),$('"'+K(this.availableIpSearchString)+'"',1)])):(i(),d("small",$e,[o(s,{t:"No more IP address available in this subnet"})]))])):y("",!0)])])])):y("",!0)])])],2)}const Ie=g(ee,[["render",Ae],["__scopeId","data-v-ed72944d"]]),Pe={name:"dnsInput",components:{LocaleText:r},props:{data:Object,saving:Boolean},data(){return{error:!1,dns:JSON.parse(JSON.stringify(this.data.DNS))}},setup(){const l=A(),t=I();return{store:l,dashboardStore:t}},methods:{checkDNS(){if(this.dns){let l=this.dns.split(",").map(t=>t.replaceAll(" ",""));for(let t in l)if(!this.store.regexCheckIP(l[t])){this.error||this.dashboardStore.newMessage("WGDashboard","DNS format is incorrect","danger"),this.error=!0,this.data.DNS="";return}this.error=!1,this.data.DNS=this.dns}}},watch:{dns(){this.checkDNS()}}},Se={for:"peer_DNS_textbox",class:"form-label"},Ke={class:"text-muted"},Ce=["disabled"];function Oe(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("label",Se,[e("small",Ke,[o(s,{t:"DNS"})])]),b(e("input",{type:"text",class:m(["form-control form-control-sm rounded-3",{"is-invalid":this.error}]),disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.dns=a),id:"peer_DNS_textbox"},null,10,Ce),[[f,this.dns]])])}const Le=g(Pe,[["render",Oe]]),Ne={name:"nameInput",components:{LocaleText:r},props:{bulk:Boolean,data:Object,saving:Boolean}},De={for:"peer_name_textbox",class:"form-label"},Ve={class:"text-muted"},Te=["disabled"];function Be(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",{class:m({inactiveField:this.bulk})},[e("label",De,[e("small",Ve,[o(s,{t:"Name"})])]),b(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||this.bulk,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.name=a),id:"peer_name_textbox",placeholder:""},null,8,Te),[[f,this.data.name]])],2)}const Me=g(Ne,[["render",Be]]),Ue={name:"privatePublicKeyInput",components:{LocaleText:r},props:{data:Object,saving:Boolean,bulk:Boolean},setup(){const l=I(),t=A();return{dashboardStore:l,wgStore:t}},data(){return{keypair:{publicKey:"",privateKey:"",presharedKey:""},editKey:!1,error:!1}},methods:{genKeyPair(){this.editKey=!1,this.keypair=window.wireguard.generateKeypair(),this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey},testKey(l){return/^[A-Za-z0-9+/]{43}=?=?$/.test(l)},checkMatching(){try{this.keypair.privateKey&&this.wgStore.checkWGKeyLength(this.keypair.privateKey)&&(this.keypair.publicKey=window.wireguard.generatePublicKey(this.keypair.privateKey),window.wireguard.generatePublicKey(this.keypair.privateKey)!==this.keypair.publicKey?(this.error=!0,this.dashboardStore.newMessage("WGDashboard","Private key does not match with the public key","danger")):(this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey))}catch{this.error=!0,this.data.private_key="",this.data.public_key=""}}},mounted(){this.genKeyPair()},watch:{keypair:{deep:!0,handler(){this.error=!1,this.checkMatching()}}}},je={for:"peer_private_key_textbox",class:"form-label"},Ee={class:"text-muted"},Ge={class:"input-group"},Fe=["disabled"],Re=["disabled"],We={class:"d-flex flex-column flex-md-row mb-2"},qe={for:"public_key",class:"form-label mb-0"},ze={class:"text-muted"},Je={class:"form-check form-switch ms-md-auto"},He=["disabled"],Qe={class:"form-check-label",for:"enablePublicKeyEdit"},Ye=["disabled"];function Ze(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",{class:m(["d-flex gap-2 flex-column",{inactiveField:this.bulk}])},[e("div",null,[e("label",je,[e("small",Ee,[o(s,{t:"Private Key"}),t[6]||(t[6]=$()),e("code",null,[o(s,{t:"(Required for QR Code and Download)"})])])]),e("div",Ge,[b(e("input",{type:"text",class:m(["form-control form-control-sm rounded-start-3",{"is-invalid":this.error}]),"onUpdate:modelValue":t[0]||(t[0]=a=>this.keypair.privateKey=a),disabled:!this.editKey||this.bulk,onBlur:t[1]||(t[1]=a=>this.checkMatching()),id:"peer_private_key_textbox"},null,42,Fe),[[f,this.keypair.privateKey]]),e("button",{class:"btn btn-outline-info btn-sm rounded-end-3",onClick:t[2]||(t[2]=a=>this.genKeyPair()),disabled:this.bulk,type:"button",id:"button-addon2"},t[7]||(t[7]=[e("i",{class:"bi bi-arrow-repeat"},null,-1)]),8,Re)])]),e("div",null,[e("div",We,[e("label",qe,[e("small",ze,[o(s,{t:"Public Key"}),t[8]||(t[8]=$()),e("code",null,[o(s,{t:"(Required)"})])])]),e("div",Je,[b(e("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:this.bulk,id:"enablePublicKeyEdit","onUpdate:modelValue":t[3]||(t[3]=a=>this.editKey=a)},null,8,He),[[P,this.editKey]]),e("label",Qe,[e("small",null,[o(s,{t:"Use your own Private and Public Key"})])])])]),b(e("input",{class:m(["form-control-sm form-control rounded-3",{"is-invalid":this.error}]),"onUpdate:modelValue":t[4]||(t[4]=a=>this.keypair.publicKey=a),onBlur:t[5]||(t[5]=a=>this.checkMatching()),disabled:!this.editKey||this.bulk,type:"text",id:"public_key"},null,42,Ye),[[f,this.keypair.publicKey]])])],2)}const Xe=g(Ue,[["render",Ze]]),et={name:"bulkAdd",components:{LocaleText:r},props:{saving:Boolean,data:Object,availableIp:void 0},data(){return{numberOfAvailableIPs:null}},computed:{bulkAddGetLocale(){return T("How many peers you want to add?")},getNumberOfAvailableIPs(){return this.numberOfAvailableIPs?Object.values(this.numberOfAvailableIPs).reduce((l,t)=>l+t):"..."}},watch:{"data.bulkAdd":{immediate:!0,handler(l){l&&B("/api/getNumberOfAvailableIPs/"+this.$route.params.id,{},t=>{t.status&&(this.numberOfAvailableIPs=t.data)})}}}},tt={class:"form-check form-switch"},st=["disabled"],at={class:"form-check-label me-2",for:"bulk_add"},lt={class:"text-muted d-block"},ot={key:0,class:"form-group"},it=["max","placeholder"],dt={class:"text-muted"};function nt(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("div",tt,[b(e("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:!this.availableIp,id:"bulk_add","onUpdate:modelValue":t[0]||(t[0]=a=>this.data.bulkAdd=a)},null,8,st),[[P,this.data.bulkAdd]]),e("label",at,[e("small",null,[e("strong",null,[o(s,{t:"Bulk Add"})])])])]),e("p",{class:m({"mb-0":!this.data.bulkAdd})},[e("small",lt,[o(s,{t:"By adding peers by bulk, each peer's name will be auto generated, and Allowed IP will be assign to the next available IP."})])],2),this.data.bulkAdd?(i(),d("div",ot,[b(e("input",{class:"form-control form-control-sm rounded-3 mb-1",type:"number",min:"1",id:"bulk_add_count",max:this.availableIp.length,"onUpdate:modelValue":t[1]||(t[1]=a=>this.data.bulkAddAmount=a),placeholder:this.bulkAddGetLocale},null,8,it),[[f,this.data.bulkAddAmount]]),e("small",dt,[o(s,{t:"You can add up to "+v.getNumberOfAvailableIPs+" peers"},null,8,["t"])])])):y("",!0)])}const rt=g(et,[["render",nt]]),ut={name:"presharedKeyInput",components:{LocaleText:r},props:{data:Object,saving:Boolean},data(){return{enable:!1}},watch:{enable(){this.enable?this.data.preshared_key=window.wireguard.generateKeypair().presharedKey:this.data.preshared_key=""}}},ct={class:"d-flex align-items-start"},pt={for:"peer_preshared_key_textbox",class:"form-label"},bt={class:"text-muted"},ht={class:"form-check form-switch ms-auto"},_t=["disabled"];function mt(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("div",ct,[e("label",pt,[e("small",bt,[o(s,{t:"Pre-Shared Key"})])]),e("div",ht,[b(e("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":t[0]||(t[0]=a=>this.enable=a),id:"peer_preshared_key_switch"},null,512),[[P,this.enable]])])]),b(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||!this.enable,"onUpdate:modelValue":t[1]||(t[1]=a=>this.data.preshared_key=a),id:"peer_preshared_key_textbox"},null,8,_t),[[f,this.data.preshared_key]])])}const vt=g(ut,[["render",mt]]),ft={name:"mtuInput",components:{LocaleText:r},props:{data:Object,saving:Boolean}},yt={for:"peer_mtu",class:"form-label"},kt={class:"text-muted"},gt=["disabled"];function wt(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("label",yt,[e("small",kt,[o(s,{t:"MTU"})])]),b(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.mtu=a),min:"0",id:"peer_mtu"},null,8,gt),[[f,this.data.mtu]])])}const xt=g(ft,[["render",wt]]),$t={name:"persistentKeepAliveInput",components:{LocaleText:r},props:{data:Object,saving:Boolean}},At={for:"peer_keep_alive",class:"form-label"},It={class:"text-muted"},Pt=["disabled"];function St(l,t,n,u,c,v){const s=w("LocaleText");return i(),d("div",null,[e("label",At,[e("small",It,[o(s,{t:"Persistent Keepalive"})])]),b(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.keepalive=a),id:"peer_keep_alive"},null,8,Pt),[[f,this.data.keepalive]])])}const Kt=g($t,[["render",St]]),Ct={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref:"editConfigurationContainer"},Ot={class:"container d-flex h-100 w-100"},Lt={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"1000px"}},Nt={class:"card rounded-3 shadow flex-grow-1"},Dt={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},Vt={class:"mb-0"},Tt={class:"card-body px-4 pb-4"},Bt={class:"d-flex flex-column gap-2"},Mt={class:"accordion mb-3",id:"peerAddModalAccordion"},Ut={class:"accordion-item"},jt={class:"accordion-header"},Et={class:"accordion-button collapsed rounded-3",type:"button","data-bs-toggle":"collapse","data-bs-target":"#peerAddModalAccordionAdvancedOptions"},Gt={id:"peerAddModalAccordionAdvancedOptions",class:"accordion-collapse collapse collapsed","data-bs-parent":"#peerAddModalAccordion"},Ft={class:"accordion-body rounded-bottom-3"},Rt={class:"d-flex flex-column gap-2"},Wt={class:"row gy-3"},qt={key:0,class:"col-sm"},zt={class:"col-sm"},Jt={class:"col-sm"},Ht={key:1,class:"col-12"},Qt={class:"form-check form-switch"},Yt={class:"form-check-label",for:"bullAdd_PresharedKey_Switch"},Zt={class:"fw-bold"},Xt={key:0},es={class:"form-label d-block"},ts={class:"text-muted"},ss={class:"btn-group",role:"group"},as={class:"btn btn-outline-primary btn-sm",for:"advanced_security_on"},ls={class:"btn btn-outline-primary btn-sm",for:"advanced_security_off"},os={class:"d-flex mt-2"},is=["disabled"],ds={key:0,class:"bi bi-plus-circle-fill me-2"},us={__name:"peerAddModal",emits:["close","addedPeers"],async setup(l,{emit:t}){let n,u;const c=I(),v=A(),s=C({bulkAdd:!1,bulkAddAmount:0,name:"",allowed_ips:[],private_key:"",public_key:"",DNS:c.Configuration.Peers.peer_global_dns,endpoint_allowed_ip:c.Configuration.Peers.peer_endpoint_allowed_ip,keepalive:parseInt(c.Configuration.Peers.peer_keep_alive),mtu:parseInt(c.Configuration.Peers.peer_mtu),preshared_key:"",preshared_key_bulkAdd:!1,advanced_security:"off",allowed_ips_validation:!0}),a=C([]),p=C(!1),S=R();[n,u]=W(()=>B("/api/getAvailableIPs/"+S.params.id,{},_=>{_.status&&(a.value=_.data)})),await n,u();const N=t,M=D(()=>v.Configurations.find(_=>_.Name===S.params.id).Protocol),U=D(()=>{let _=!0;return s.value.bulkAdd?(s.value.bulkAddAmount.length===0||s.value.bulkAddAmount>a.value.length)&&(_=!1):["allowed_ips","private_key","public_key","endpoint_allowed_ip","keepalive","mtu"].forEach(k=>{s.value[k].length===0&&(_=!1)}),_}),j=()=>{p.value=!0,z("/api/addPeers/"+S.params.id,s.value,_=>{_.status?(c.newMessage("Server","Peer created successfully","success"),N("addedPeers")):c.newMessage("Server",_.message,"danger"),p.value=!1})};return q(()=>s.value.bulkAddAmount,()=>{s.value.bulkAddAmount>a.value.length&&(s.value.bulkAddAmount=a.value.length)}),(_,h)=>(i(),d("div",Ct,[e("div",Ot,[e("div",Lt,[e("div",Nt,[e("div",Dt,[e("h4",Vt,[o(r,{t:"Add Peers"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:h[0]||(h[0]=k=>N("close"))})]),e("div",Tt,[e("div",Bt,[o(rt,{saving:p.value,data:s.value,availableIp:a.value},null,8,["saving","data","availableIp"]),h[5]||(h[5]=e("hr",{class:"mb-0 mt-2"},null,-1)),s.value.bulkAdd?y("",!0):(i(),x(Me,{key:0,saving:p.value,data:s.value},null,8,["saving","data"])),s.value.bulkAdd?y("",!0):(i(),x(Xe,{key:1,saving:p.value,data:s.value},null,8,["saving","data"])),s.value.bulkAdd?y("",!0):(i(),x(Ie,{key:2,availableIp:a.value,saving:p.value,data:s.value},null,8,["availableIp","saving","data"]))]),h[7]||(h[7]=e("hr",null,null,-1)),e("div",Mt,[e("div",Ut,[e("h2",jt,[e("button",Et,[o(r,{t:"Advanced Options"})])]),e("div",Gt,[e("div",Ft,[e("div",Rt,[o(Le,{saving:p.value,data:s.value},null,8,["saving","data"]),o(X,{saving:p.value,data:s.value},null,8,["saving","data"]),e("div",Wt,[s.value.bulkAdd?y("",!0):(i(),d("div",qt,[o(vt,{saving:p.value,data:s.value,bulk:s.value.bulkAdd},null,8,["saving","data","bulk"])])),e("div",zt,[o(xt,{saving:p.value,data:s.value},null,8,["saving","data"])]),e("div",Jt,[o(Kt,{saving:p.value,data:s.value},null,8,["saving","data"])]),s.value.bulkAdd?(i(),d("div",Ht,[e("div",Qt,[b(e("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":h[1]||(h[1]=k=>s.value.preshared_key_bulkAdd=k),id:"bullAdd_PresharedKey_Switch",checked:""},null,512),[[P,s.value.preshared_key_bulkAdd]]),e("label",Yt,[e("small",Zt,[o(r,{t:"Pre-Shared Key"}),h[6]||(h[6]=$()),s.value.preshared_key_bulkAdd?(i(),x(r,{key:0,t:"Enabled"})):(i(),x(r,{key:1,t:"Disabled"}))])])])])):y("",!0)])])])])])]),M.value==="awg"?(i(),d("div",Xt,[e("h5",null,[o(r,{t:"AmneziaWG Peer Setting"})]),e("div",null,[e("label",es,[e("small",ts,[o(r,{t:"Advanced Security"})])]),e("div",ss,[b(e("input",{type:"radio",class:"btn-check","onUpdate:modelValue":h[2]||(h[2]=k=>s.value.advanced_security=k),value:"on",name:"advanced_security_radio",id:"advanced_security_on",autocomplete:"off"},null,512),[[V,s.value.advanced_security]]),e("label",as,[o(r,{t:"On"})]),b(e("input",{type:"radio","onUpdate:modelValue":h[3]||(h[3]=k=>s.value.advanced_security=k),value:"off",class:"btn-check",name:"advanced_security_radio",id:"advanced_security_off",autocomplete:"off"},null,512),[[V,s.value.advanced_security]]),e("label",ls,[o(r,{t:"Off"})])])])])):y("",!0),e("div",os,[e("button",{class:"ms-auto btn btn-dark btn-brand rounded-3 px-3 py-2 shadow",disabled:!U.value||p.value,onClick:h[4]||(h[4]=k=>j())},[p.value?y("",!0):(i(),d("i",ds)),p.value?(i(),x(r,{key:1,t:"Adding..."})):(i(),x(r,{key:2,t:"Add"}))],8,is)])])])])])],512))}};export{us as default}; diff --git a/src/static/app/dist/assets/peerConfigurationFile-BnbSuKGY.js b/src/static/app/dist/assets/peerConfigurationFile-eAJKSkem.js similarity index 95% rename from src/static/app/dist/assets/peerConfigurationFile-BnbSuKGY.js rename to src/static/app/dist/assets/peerConfigurationFile-eAJKSkem.js index ddc6c0b..a063cf2 100644 --- a/src/static/app/dist/assets/peerConfigurationFile-BnbSuKGY.js +++ b/src/static/app/dist/assets/peerConfigurationFile-eAJKSkem.js @@ -1 +1 @@ -import{_ as v,D as g,r as o,o as h,K as y,g as x,a as i,c as n,b as s,d as c,w,T as C,n as k,e as F}from"./index-7qLsecvh.js";import{L as T}from"./localeText-BguG5zGd.js";import"./browser-CjSdxGTc.js";const M={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0"},S={class:"container d-flex h-100 w-100"},D={class:"m-auto modal-dialog-centered dashboardModal justify-content-center"},P={class:"card rounded-3 shadow w-100"},B={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},G={class:"mb-0"},L={class:"card-body p-4"},N={class:"d-flex"},V=["disabled"],j={key:0,class:"d-block"},I={key:1,class:"d-block",id:"check"},W={style:{height:"300px"},class:"d-flex"},$=["value"],q={key:0,class:"spinner-border m-auto",role:"status"},z={__name:"peerConfigurationFile",props:{selectedPeer:Object},emits:["close"],setup(u,{emit:p}){const m=p,f=u,r=g(),t=o(!1),l=o(""),a=o(!0);o({error:!1,message:void 0}),h(()=>{const d=y();x("/api/downloadPeer/"+d.params.id,{id:f.selectedPeer.id},e=>{e.status?(l.value=e.data.file,a.value=!1):this.dashboardStore.newMessage("Server",e.message,"danger")})});const _=async()=>{navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(l.value).then(()=>{t.value=!0,setTimeout(()=>{t.value=!1},3e3)}).catch(()=>{r.newMessage("WGDashboard","Failed to copy","danger")}):(document.querySelector("#peerConfigurationFile").select(),document.execCommand("copy")?(t.value=!0,setTimeout(()=>{t.value=!1},3e3)):r.newMessage("WGDashboard","Failed to copy","danger"))};return(d,e)=>(i(),n("div",M,[s("div",S,[s("div",D,[s("div",P,[s("div",B,[s("h4",G,[c(T,{t:"Peer Configuration File"})]),s("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=b=>m("close"))})]),s("div",L,[s("div",N,[s("button",{onClick:e[1]||(e[1]=b=>_()),disabled:t.value||a.value,class:"ms-auto btn bg-primary-subtle border-primary-subtle text-primary-emphasis rounded-3 position-relative"},[c(C,{name:"slide-up",mode:"out-in"},{default:w(()=>[t.value?(i(),n("span",I,e[3]||(e[3]=[s("i",{class:"bi bi-check-circle-fill"},null,-1)]))):(i(),n("span",j,e[2]||(e[2]=[s("i",{class:"bi bi-clipboard-fill"},null,-1)])))]),_:1})],8,V)]),s("div",W,[s("textarea",{style:{height:"300px"},class:k(["form-control w-100 rounded-3 mt-2 animate__fadeIn animate__faster animate__animated",{"d-none":a.value}]),id:"peerConfigurationFile",value:l.value},null,10,$),a.value?(i(),n("div",q,e[4]||(e[4]=[s("span",{class:"visually-hidden"},"Loading...",-1)]))):F("",!0)])])])])])]))}},R=v(z,[["__scopeId","data-v-9dd98f87"]]);export{R as default}; +import{_ as v,D as g,r as o,o as h,K as y,g as x,a as i,c as n,b as s,d as c,w,T as C,n as k,e as F}from"./index-CgM9eUIs.js";import{L as T}from"./localeText-Dh33930I.js";import"./browser-CjSdxGTc.js";const M={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0"},S={class:"container d-flex h-100 w-100"},D={class:"m-auto modal-dialog-centered dashboardModal justify-content-center"},P={class:"card rounded-3 shadow w-100"},B={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},G={class:"mb-0"},L={class:"card-body p-4"},N={class:"d-flex"},V=["disabled"],j={key:0,class:"d-block"},I={key:1,class:"d-block",id:"check"},W={style:{height:"300px"},class:"d-flex"},$=["value"],q={key:0,class:"spinner-border m-auto",role:"status"},z={__name:"peerConfigurationFile",props:{selectedPeer:Object},emits:["close"],setup(u,{emit:p}){const m=p,f=u,r=g(),t=o(!1),l=o(""),a=o(!0);o({error:!1,message:void 0}),h(()=>{const d=y();x("/api/downloadPeer/"+d.params.id,{id:f.selectedPeer.id},e=>{e.status?(l.value=e.data.file,a.value=!1):this.dashboardStore.newMessage("Server",e.message,"danger")})});const _=async()=>{navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(l.value).then(()=>{t.value=!0,setTimeout(()=>{t.value=!1},3e3)}).catch(()=>{r.newMessage("WGDashboard","Failed to copy","danger")}):(document.querySelector("#peerConfigurationFile").select(),document.execCommand("copy")?(t.value=!0,setTimeout(()=>{t.value=!1},3e3)):r.newMessage("WGDashboard","Failed to copy","danger"))};return(d,e)=>(i(),n("div",M,[s("div",S,[s("div",D,[s("div",P,[s("div",B,[s("h4",G,[c(T,{t:"Peer Configuration File"})]),s("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=b=>m("close"))})]),s("div",L,[s("div",N,[s("button",{onClick:e[1]||(e[1]=b=>_()),disabled:t.value||a.value,class:"ms-auto btn bg-primary-subtle border-primary-subtle text-primary-emphasis rounded-3 position-relative"},[c(C,{name:"slide-up",mode:"out-in"},{default:w(()=>[t.value?(i(),n("span",I,e[3]||(e[3]=[s("i",{class:"bi bi-check-circle-fill"},null,-1)]))):(i(),n("span",j,e[2]||(e[2]=[s("i",{class:"bi bi-clipboard-fill"},null,-1)])))]),_:1})],8,V)]),s("div",W,[s("textarea",{style:{height:"300px"},class:k(["form-control w-100 rounded-3 mt-2 animate__fadeIn animate__faster animate__animated",{"d-none":a.value}]),id:"peerConfigurationFile",value:l.value},null,10,$),a.value?(i(),n("div",q,e[4]||(e[4]=[s("span",{class:"visually-hidden"},"Loading...",-1)]))):F("",!0)])])])])])]))}},R=v(z,[["__scopeId","data-v-9dd98f87"]]);export{R as default}; diff --git a/src/static/app/dist/assets/peerJobs-CxUJ2ao7.js b/src/static/app/dist/assets/peerJobs-CQfx4Mi7.js similarity index 90% rename from src/static/app/dist/assets/peerJobs-CxUJ2ao7.js rename to src/static/app/dist/assets/peerJobs-CQfx4Mi7.js index 9e575ec..be94360 100644 --- a/src/static/app/dist/assets/peerJobs-CxUJ2ao7.js +++ b/src/static/app/dist/assets/peerJobs-CQfx4Mi7.js @@ -1 +1 @@ -import{S as p,a as b}from"./schedulePeerJob-DJNvnpjL.js";import{_ as h,W as u,y as m,j as i,a as o,c as a,b as e,d as r,w as _,F as v,h as f,i as J,e as x,k as g}from"./index-7qLsecvh.js";import{L as w}from"./localeText-BguG5zGd.js";import"./vue-datepicker-v4St2bKM.js";import"./dayjs.min-C341O-eN.js";const P={name:"peerJobs",setup(){return{store:u()}},props:{selectedPeer:Object},components:{LocaleText:w,SchedulePeerJob:p,ScheduleDropdown:b},data(){return{}},methods:{deleteJob(d){this.selectedPeer.jobs=this.selectedPeer.jobs.filter(t=>t.JobID!==d.JobID)},addJob(){this.selectedPeer.jobs.unshift(JSON.parse(JSON.stringify({JobID:m().toString(),Configuration:this.selectedPeer.configuration.Name,Peer:this.selectedPeer.id,Field:this.store.PeerScheduleJobs.dropdowns.Field[0].value,Operator:this.store.PeerScheduleJobs.dropdowns.Operator[0].value,Value:"",CreationDate:"",ExpireDate:"",Action:this.store.PeerScheduleJobs.dropdowns.Action[0].value})))}}},y={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},S={class:"container d-flex h-100 w-100"},$={class:"m-auto modal-dialog-centered dashboardModal"},C={class:"card rounded-3 shadow",style:{width:"700px"}},D={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},j={class:"mb-0 fw-normal"},k={class:"card-body px-4 pb-4 pt-2 position-relative"},N={class:"d-flex align-items-center mb-3"},T={class:"card shadow-sm",key:"none",style:{height:"153px"}},I={class:"card-body text-muted text-center d-flex"},L={class:"m-auto"};function O(d,t,B,F,V,A){const n=i("LocaleText"),l=i("SchedulePeerJob");return o(),a("div",y,[e("div",S,[e("div",$,[e("div",C,[e("div",D,[e("h4",j,[r(n,{t:"Schedule Jobs"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=s=>this.$emit("close"))})]),e("div",k,[e("div",N,[e("button",{class:"btn bg-primary-subtle border-1 border-primary-subtle text-primary-emphasis rounded-3 shadow",onClick:t[1]||(t[1]=s=>this.addJob())},[t[3]||(t[3]=e("i",{class:"bi bi-plus-lg me-2"},null,-1)),r(n,{t:"Job"})])]),r(g,{name:"schedulePeerJobTransition",tag:"div",class:"position-relative"},{default:_(()=>[(o(!0),a(v,null,f(this.selectedPeer.jobs,(s,E)=>(o(),J(l,{onRefresh:t[2]||(t[2]=c=>this.$emit("refresh")),onDelete:c=>this.deleteJob(s),dropdowns:this.store.PeerScheduleJobs.dropdowns,key:s.JobID,pjob:s},null,8,["onDelete","dropdowns","pjob"]))),128)),this.selectedPeer.jobs.length===0?(o(),a("div",T,[e("div",I,[e("h6",L,[r(n,{t:"This peer does not have any job yet."})])])])):x("",!0)]),_:1})])])])])])}const z=h(P,[["render",O],["__scopeId","data-v-5bbdd42b"]]);export{z as default}; +import{S as p,a as b}from"./schedulePeerJob-hRoInhjL.js";import{_ as h,W as u,y as m,j as i,a as o,c as a,b as e,d as r,w as _,F as v,h as f,i as J,e as x,k as g}from"./index-CgM9eUIs.js";import{L as w}from"./localeText-Dh33930I.js";import"./vue-datepicker-D7WdryeM.js";import"./dayjs.min-B2wceQaW.js";const P={name:"peerJobs",setup(){return{store:u()}},props:{selectedPeer:Object},components:{LocaleText:w,SchedulePeerJob:p,ScheduleDropdown:b},data(){return{}},methods:{deleteJob(d){this.selectedPeer.jobs=this.selectedPeer.jobs.filter(t=>t.JobID!==d.JobID)},addJob(){this.selectedPeer.jobs.unshift(JSON.parse(JSON.stringify({JobID:m().toString(),Configuration:this.selectedPeer.configuration.Name,Peer:this.selectedPeer.id,Field:this.store.PeerScheduleJobs.dropdowns.Field[0].value,Operator:this.store.PeerScheduleJobs.dropdowns.Operator[0].value,Value:"",CreationDate:"",ExpireDate:"",Action:this.store.PeerScheduleJobs.dropdowns.Action[0].value})))}}},y={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},S={class:"container d-flex h-100 w-100"},$={class:"m-auto modal-dialog-centered dashboardModal"},C={class:"card rounded-3 shadow",style:{width:"700px"}},D={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},j={class:"mb-0 fw-normal"},k={class:"card-body px-4 pb-4 pt-2 position-relative"},N={class:"d-flex align-items-center mb-3"},T={class:"card shadow-sm",key:"none",style:{height:"153px"}},I={class:"card-body text-muted text-center d-flex"},L={class:"m-auto"};function O(d,t,B,F,V,A){const n=i("LocaleText"),l=i("SchedulePeerJob");return o(),a("div",y,[e("div",S,[e("div",$,[e("div",C,[e("div",D,[e("h4",j,[r(n,{t:"Schedule Jobs"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=s=>this.$emit("close"))})]),e("div",k,[e("div",N,[e("button",{class:"btn bg-primary-subtle border-1 border-primary-subtle text-primary-emphasis rounded-3 shadow",onClick:t[1]||(t[1]=s=>this.addJob())},[t[3]||(t[3]=e("i",{class:"bi bi-plus-lg me-2"},null,-1)),r(n,{t:"Job"})])]),r(g,{name:"schedulePeerJobTransition",tag:"div",class:"position-relative"},{default:_(()=>[(o(!0),a(v,null,f(this.selectedPeer.jobs,(s,E)=>(o(),J(l,{onRefresh:t[2]||(t[2]=c=>this.$emit("refresh")),onDelete:c=>this.deleteJob(s),dropdowns:this.store.PeerScheduleJobs.dropdowns,key:s.JobID,pjob:s},null,8,["onDelete","dropdowns","pjob"]))),128)),this.selectedPeer.jobs.length===0?(o(),a("div",T,[e("div",I,[e("h6",L,[r(n,{t:"This peer does not have any job yet."})])])])):x("",!0)]),_:1})])])])])])}const z=h(P,[["render",O],["__scopeId","data-v-5bbdd42b"]]);export{z as default}; diff --git a/src/static/app/dist/assets/peerJobsAllModal-BF44c_Ai.js b/src/static/app/dist/assets/peerJobsAllModal-Dq3mvHTf.js similarity index 90% rename from src/static/app/dist/assets/peerJobsAllModal-BF44c_Ai.js rename to src/static/app/dist/assets/peerJobsAllModal-Dq3mvHTf.js index c4282ad..71b0f33 100644 --- a/src/static/app/dist/assets/peerJobsAllModal-BF44c_Ai.js +++ b/src/static/app/dist/assets/peerJobsAllModal-Dq3mvHTf.js @@ -1 +1 @@ -import{S as _}from"./schedulePeerJob-DJNvnpjL.js";import{_ as g,W as v,j as c,a as t,c as r,b as e,d as l,F as p,h as b,t as m,e as f,i as y}from"./index-7qLsecvh.js";import{L as x}from"./localeText-BguG5zGd.js";import"./vue-datepicker-v4St2bKM.js";import"./dayjs.min-C341O-eN.js";const J={name:"peerJobsAllModal",setup(){return{store:v()}},components:{LocaleText:x,SchedulePeerJob:_},props:{configurationPeers:Array[Object]},computed:{getAllJobs(){return this.configurationPeers.filter(a=>a.jobs.length>0)}}},w={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},$={class:"container d-flex h-100 w-100"},k={class:"m-auto modal-dialog-centered dashboardModal"},A={class:"card rounded-3 shadow",style:{width:"900px"}},L={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},S={class:"mb-0 fw-normal"},j={class:"card-body px-4 pb-4 pt-2"},C={key:0,class:"accordion",id:"peerJobsLogsModalAccordion"},P={class:"accordion-header"},M=["data-bs-target"],B={key:0},N={class:"text-muted"},D=["id"],T={class:"accordion-body"},V={key:1,class:"card shadow-sm",style:{height:"153px"}},F={class:"card-body text-muted text-center d-flex"},O={class:"m-auto"};function W(a,o,E,I,R,q){const n=c("LocaleText"),u=c("SchedulePeerJob");return t(),r("div",w,[e("div",$,[e("div",k,[e("div",A,[e("div",L,[e("h4",S,[l(n,{t:"All Active Jobs"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:o[0]||(o[0]=s=>this.$emit("close"))})]),e("div",j,[e("button",{class:"btn bg-primary-subtle border-1 border-primary-subtle text-primary-emphasis rounded-3 shadow mb-2",onClick:o[1]||(o[1]=s=>this.$emit("allLogs"))},[o[4]||(o[4]=e("i",{class:"bi bi-clock me-2"},null,-1)),l(n,{t:"Logs"})]),this.getAllJobs.length>0?(t(),r("div",C,[(t(!0),r(p,null,b(this.getAllJobs,(s,d)=>(t(),r("div",{class:"accordion-item",key:s.id},[e("h2",P,[e("button",{class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapse_"+d},[e("small",null,[e("strong",null,[s.name?(t(),r("span",B,m(s.name)+" • ",1)):f("",!0),e("samp",N,m(s.id),1)])])],8,M)]),e("div",{id:"collapse_"+d,class:"accordion-collapse collapse","data-bs-parent":"#peerJobsLogsModalAccordion"},[e("div",T,[(t(!0),r(p,null,b(s.jobs,i=>(t(),y(u,{onDelete:o[2]||(o[2]=h=>this.$emit("refresh")),onRefresh:o[3]||(o[3]=h=>this.$emit("refresh")),dropdowns:this.store.PeerScheduleJobs.dropdowns,viewOnly:!0,key:i.JobID,pjob:i},null,8,["dropdowns","pjob"]))),128))])],8,D)]))),128))])):(t(),r("div",V,[e("div",F,[e("span",O,[l(n,{t:"No active job at the moment."})])])]))])])])])])}const U=g(J,[["render",W]]);export{U as default}; +import{S as _}from"./schedulePeerJob-hRoInhjL.js";import{_ as g,W as v,j as c,a as t,c as r,b as e,d as l,F as p,h as b,t as m,e as f,i as y}from"./index-CgM9eUIs.js";import{L as x}from"./localeText-Dh33930I.js";import"./vue-datepicker-D7WdryeM.js";import"./dayjs.min-B2wceQaW.js";const J={name:"peerJobsAllModal",setup(){return{store:v()}},components:{LocaleText:x,SchedulePeerJob:_},props:{configurationPeers:Array[Object]},computed:{getAllJobs(){return this.configurationPeers.filter(a=>a.jobs.length>0)}}},w={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},$={class:"container d-flex h-100 w-100"},k={class:"m-auto modal-dialog-centered dashboardModal"},A={class:"card rounded-3 shadow",style:{width:"900px"}},L={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},S={class:"mb-0 fw-normal"},j={class:"card-body px-4 pb-4 pt-2"},C={key:0,class:"accordion",id:"peerJobsLogsModalAccordion"},P={class:"accordion-header"},M=["data-bs-target"],B={key:0},N={class:"text-muted"},D=["id"],T={class:"accordion-body"},V={key:1,class:"card shadow-sm",style:{height:"153px"}},F={class:"card-body text-muted text-center d-flex"},O={class:"m-auto"};function W(a,o,E,I,R,q){const n=c("LocaleText"),u=c("SchedulePeerJob");return t(),r("div",w,[e("div",$,[e("div",k,[e("div",A,[e("div",L,[e("h4",S,[l(n,{t:"All Active Jobs"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:o[0]||(o[0]=s=>this.$emit("close"))})]),e("div",j,[e("button",{class:"btn bg-primary-subtle border-1 border-primary-subtle text-primary-emphasis rounded-3 shadow mb-2",onClick:o[1]||(o[1]=s=>this.$emit("allLogs"))},[o[4]||(o[4]=e("i",{class:"bi bi-clock me-2"},null,-1)),l(n,{t:"Logs"})]),this.getAllJobs.length>0?(t(),r("div",C,[(t(!0),r(p,null,b(this.getAllJobs,(s,d)=>(t(),r("div",{class:"accordion-item",key:s.id},[e("h2",P,[e("button",{class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapse_"+d},[e("small",null,[e("strong",null,[s.name?(t(),r("span",B,m(s.name)+" • ",1)):f("",!0),e("samp",N,m(s.id),1)])])],8,M)]),e("div",{id:"collapse_"+d,class:"accordion-collapse collapse","data-bs-parent":"#peerJobsLogsModalAccordion"},[e("div",T,[(t(!0),r(p,null,b(s.jobs,i=>(t(),y(u,{onDelete:o[2]||(o[2]=h=>this.$emit("refresh")),onRefresh:o[3]||(o[3]=h=>this.$emit("refresh")),dropdowns:this.store.PeerScheduleJobs.dropdowns,viewOnly:!0,key:i.JobID,pjob:i},null,8,["dropdowns","pjob"]))),128))])],8,D)]))),128))])):(t(),r("div",V,[e("div",F,[e("span",O,[l(n,{t:"No active job at the moment."})])])]))])])])])])}const U=g(J,[["render",W]]);export{U as default}; diff --git a/src/static/app/dist/assets/peerJobsLogsModal-DBO2sNMy.js b/src/static/app/dist/assets/peerJobsLogsModal-DAi123qW.js similarity index 96% rename from src/static/app/dist/assets/peerJobsLogsModal-DBO2sNMy.js rename to src/static/app/dist/assets/peerJobsLogsModal-DAi123qW.js index 8a7dae6..ac9504f 100644 --- a/src/static/app/dist/assets/peerJobsLogsModal-DBO2sNMy.js +++ b/src/static/app/dist/assets/peerJobsLogsModal-DAi123qW.js @@ -1 +1 @@ -import{d as m}from"./dayjs.min-C341O-eN.js";import{_ as p,g,j as _,a,c as n,b as s,d as i,f as b,t as c,m as h,v as u,e as d,F as f,h as w,n as L}from"./index-7qLsecvh.js";import{L as k}from"./localeText-BguG5zGd.js";const x={name:"peerJobsLogsModal",components:{LocaleText:k},props:{configurationInfo:Object},data(){return{dataLoading:!0,data:[],logFetchTime:void 0,showLogID:!1,showJobID:!0,showSuccessJob:!0,showFailedJob:!0,showLogAmount:10}},async mounted(){await this.fetchLog()},methods:{async fetchLog(){this.dataLoading=!0,await g(`/api/getPeerScheduleJobLogs/${this.configurationInfo.Name}`,{},r=>{this.data=r.data,this.logFetchTime=m().format("YYYY-MM-DD HH:mm:ss"),this.dataLoading=!1})}},computed:{getLogs(){return this.data.filter(r=>this.showSuccessJob&&r.Status==="1"||this.showFailedJob&&r.Status==="0")},showLogs(){return this.getLogs.slice(0,this.showLogAmount)}}},y={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},v={class:"container-fluid d-flex h-100 w-100"},D={class:"m-auto mt-0 modal-dialog-centered dashboardModal",style:{width:"100%"}},S={class:"card rounded-3 shadow w-100"},I={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},J={class:"mb-0"},C={class:"card-body px-4 pb-4 pt-2"},F={key:0},j={class:"mb-2 d-flex gap-3"},M={class:"d-flex gap-3 align-items-center"},V={class:"text-muted"},T={class:"form-check"},A={class:"form-check-label",for:"jobLogsShowSuccessCheck"},N={class:"badge text-success-emphasis bg-success-subtle"},U={class:"form-check"},Y={class:"form-check-label",for:"jobLogsShowFailedCheck"},B={class:"badge text-danger-emphasis bg-danger-subtle"},z={class:"d-flex gap-3 align-items-center ms-auto"},H={class:"text-muted"},$={class:"form-check"},E={class:"form-check-label",for:"jobLogsShowJobIDCheck"},G={class:"form-check"},O={class:"form-check-label",for:"jobLogsShowLogIDCheck"},P={class:"table"},R={scope:"col"},q={key:0,scope:"col"},K={key:1,scope:"col"},Q={scope:"col"},W={scope:"col"},X={style:{"font-size":"0.875rem"}},Z={scope:"row"},ss={key:0},ts={class:"text-muted"},os={key:1},es={class:"text-muted"},is={class:"d-flex gap-2"},as={key:1,class:"d-flex align-items-center flex-column"};function ns(r,t,ls,cs,l,ds){const e=_("LocaleText");return a(),n("div",y,[s("div",v,[s("div",D,[s("div",S,[s("div",I,[s("h4",J,[i(e,{t:"Jobs Logs"})]),s("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=o=>this.$emit("close"))})]),s("div",C,[this.dataLoading?(a(),n("div",as,t[11]||(t[11]=[s("div",{class:"spinner-border text-body",role:"status"},[s("span",{class:"visually-hidden"},"Loading...")],-1)]))):(a(),n("div",F,[s("p",null,[i(e,{t:"Updated at"}),b(" : "+c(this.logFetchTime),1)]),s("div",j,[s("button",{onClick:t[1]||(t[1]=o=>this.fetchLog()),class:"btn btn-sm rounded-3 shadow-sm text-info-emphasis bg-info-subtle border-1 border-info-subtle me-1"},[t[8]||(t[8]=s("i",{class:"bi bi-arrow-clockwise me-2"},null,-1)),i(e,{t:"Refresh"})]),s("div",M,[s("span",V,[i(e,{t:"Filter"})]),s("div",T,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[2]||(t[2]=o=>this.showSuccessJob=o),id:"jobLogsShowSuccessCheck"},null,512),[[u,this.showSuccessJob]]),s("label",A,[s("span",N,[i(e,{t:"Success"})])])]),s("div",U,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[3]||(t[3]=o=>this.showFailedJob=o),id:"jobLogsShowFailedCheck"},null,512),[[u,this.showFailedJob]]),s("label",Y,[s("span",B,[i(e,{t:"Failed"})])])])]),s("div",z,[s("span",H,[i(e,{t:"Display"})]),s("div",$,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=o=>l.showJobID=o),id:"jobLogsShowJobIDCheck"},null,512),[[u,l.showJobID]]),s("label",E,[i(e,{t:"Job ID"})])]),s("div",G,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[5]||(t[5]=o=>l.showLogID=o),id:"jobLogsShowLogIDCheck"},null,512),[[u,l.showLogID]]),s("label",O,[i(e,{t:"Log ID"})])])])]),s("table",P,[s("thead",null,[s("tr",null,[s("th",R,[i(e,{t:"Date"})]),l.showLogID?(a(),n("th",q,[i(e,{t:"Log ID"})])):d("",!0),l.showJobID?(a(),n("th",K,[i(e,{t:"Job ID"})])):d("",!0),s("th",Q,[i(e,{t:"Status"})]),s("th",W,[i(e,{t:"Message"})])])]),s("tbody",null,[(a(!0),n(f,null,w(this.showLogs,o=>(a(),n("tr",X,[s("th",Z,c(o.LogDate),1),l.showLogID?(a(),n("td",ss,[s("samp",ts,c(o.LogID),1)])):d("",!0),l.showJobID?(a(),n("td",os,[s("samp",es,c(o.JobID),1)])):d("",!0),s("td",null,[s("span",{class:L(["badge",[o.Status==="1"?"text-success-emphasis bg-success-subtle":"text-danger-emphasis bg-danger-subtle"]])},c(o.Status==="1"?"Success":"Failed"),3)]),s("td",null,c(o.Message),1)]))),256))])]),s("div",is,[this.getLogs.length>this.showLogAmount?(a(),n("button",{key:0,onClick:t[6]||(t[6]=o=>this.showLogAmount+=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},t[9]||(t[9]=[s("i",{class:"bi bi-chevron-down me-2"},null,-1),b(" Show More ")]))):d("",!0),this.showLogAmount>20?(a(),n("button",{key:1,onClick:t[7]||(t[7]=o=>this.showLogAmount=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},t[10]||(t[10]=[s("i",{class:"bi bi-chevron-up me-2"},null,-1),b(" Collapse ")]))):d("",!0)])]))])])])])])}const bs=p(x,[["render",ns]]);export{bs as default}; +import{d as m}from"./dayjs.min-B2wceQaW.js";import{_ as p,g,j as _,a,c as n,b as s,d as i,f as b,t as c,m as h,v as u,e as d,F as f,h as w,n as L}from"./index-CgM9eUIs.js";import{L as k}from"./localeText-Dh33930I.js";const x={name:"peerJobsLogsModal",components:{LocaleText:k},props:{configurationInfo:Object},data(){return{dataLoading:!0,data:[],logFetchTime:void 0,showLogID:!1,showJobID:!0,showSuccessJob:!0,showFailedJob:!0,showLogAmount:10}},async mounted(){await this.fetchLog()},methods:{async fetchLog(){this.dataLoading=!0,await g(`/api/getPeerScheduleJobLogs/${this.configurationInfo.Name}`,{},r=>{this.data=r.data,this.logFetchTime=m().format("YYYY-MM-DD HH:mm:ss"),this.dataLoading=!1})}},computed:{getLogs(){return this.data.filter(r=>this.showSuccessJob&&r.Status==="1"||this.showFailedJob&&r.Status==="0")},showLogs(){return this.getLogs.slice(0,this.showLogAmount)}}},y={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},v={class:"container-fluid d-flex h-100 w-100"},D={class:"m-auto mt-0 modal-dialog-centered dashboardModal",style:{width:"100%"}},S={class:"card rounded-3 shadow w-100"},I={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},J={class:"mb-0"},C={class:"card-body px-4 pb-4 pt-2"},F={key:0},j={class:"mb-2 d-flex gap-3"},M={class:"d-flex gap-3 align-items-center"},V={class:"text-muted"},T={class:"form-check"},A={class:"form-check-label",for:"jobLogsShowSuccessCheck"},N={class:"badge text-success-emphasis bg-success-subtle"},U={class:"form-check"},Y={class:"form-check-label",for:"jobLogsShowFailedCheck"},B={class:"badge text-danger-emphasis bg-danger-subtle"},z={class:"d-flex gap-3 align-items-center ms-auto"},H={class:"text-muted"},$={class:"form-check"},E={class:"form-check-label",for:"jobLogsShowJobIDCheck"},G={class:"form-check"},O={class:"form-check-label",for:"jobLogsShowLogIDCheck"},P={class:"table"},R={scope:"col"},q={key:0,scope:"col"},K={key:1,scope:"col"},Q={scope:"col"},W={scope:"col"},X={style:{"font-size":"0.875rem"}},Z={scope:"row"},ss={key:0},ts={class:"text-muted"},os={key:1},es={class:"text-muted"},is={class:"d-flex gap-2"},as={key:1,class:"d-flex align-items-center flex-column"};function ns(r,t,ls,cs,l,ds){const e=_("LocaleText");return a(),n("div",y,[s("div",v,[s("div",D,[s("div",S,[s("div",I,[s("h4",J,[i(e,{t:"Jobs Logs"})]),s("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=o=>this.$emit("close"))})]),s("div",C,[this.dataLoading?(a(),n("div",as,t[11]||(t[11]=[s("div",{class:"spinner-border text-body",role:"status"},[s("span",{class:"visually-hidden"},"Loading...")],-1)]))):(a(),n("div",F,[s("p",null,[i(e,{t:"Updated at"}),b(" : "+c(this.logFetchTime),1)]),s("div",j,[s("button",{onClick:t[1]||(t[1]=o=>this.fetchLog()),class:"btn btn-sm rounded-3 shadow-sm text-info-emphasis bg-info-subtle border-1 border-info-subtle me-1"},[t[8]||(t[8]=s("i",{class:"bi bi-arrow-clockwise me-2"},null,-1)),i(e,{t:"Refresh"})]),s("div",M,[s("span",V,[i(e,{t:"Filter"})]),s("div",T,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[2]||(t[2]=o=>this.showSuccessJob=o),id:"jobLogsShowSuccessCheck"},null,512),[[u,this.showSuccessJob]]),s("label",A,[s("span",N,[i(e,{t:"Success"})])])]),s("div",U,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[3]||(t[3]=o=>this.showFailedJob=o),id:"jobLogsShowFailedCheck"},null,512),[[u,this.showFailedJob]]),s("label",Y,[s("span",B,[i(e,{t:"Failed"})])])])]),s("div",z,[s("span",H,[i(e,{t:"Display"})]),s("div",$,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=o=>l.showJobID=o),id:"jobLogsShowJobIDCheck"},null,512),[[u,l.showJobID]]),s("label",E,[i(e,{t:"Job ID"})])]),s("div",G,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[5]||(t[5]=o=>l.showLogID=o),id:"jobLogsShowLogIDCheck"},null,512),[[u,l.showLogID]]),s("label",O,[i(e,{t:"Log ID"})])])])]),s("table",P,[s("thead",null,[s("tr",null,[s("th",R,[i(e,{t:"Date"})]),l.showLogID?(a(),n("th",q,[i(e,{t:"Log ID"})])):d("",!0),l.showJobID?(a(),n("th",K,[i(e,{t:"Job ID"})])):d("",!0),s("th",Q,[i(e,{t:"Status"})]),s("th",W,[i(e,{t:"Message"})])])]),s("tbody",null,[(a(!0),n(f,null,w(this.showLogs,o=>(a(),n("tr",X,[s("th",Z,c(o.LogDate),1),l.showLogID?(a(),n("td",ss,[s("samp",ts,c(o.LogID),1)])):d("",!0),l.showJobID?(a(),n("td",os,[s("samp",es,c(o.JobID),1)])):d("",!0),s("td",null,[s("span",{class:L(["badge",[o.Status==="1"?"text-success-emphasis bg-success-subtle":"text-danger-emphasis bg-danger-subtle"]])},c(o.Status==="1"?"Success":"Failed"),3)]),s("td",null,c(o.Message),1)]))),256))])]),s("div",is,[this.getLogs.length>this.showLogAmount?(a(),n("button",{key:0,onClick:t[6]||(t[6]=o=>this.showLogAmount+=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},t[9]||(t[9]=[s("i",{class:"bi bi-chevron-down me-2"},null,-1),b(" Show More ")]))):d("",!0),this.showLogAmount>20?(a(),n("button",{key:1,onClick:t[7]||(t[7]=o=>this.showLogAmount=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},t[10]||(t[10]=[s("i",{class:"bi bi-chevron-up me-2"},null,-1),b(" Collapse ")]))):d("",!0)])]))])])])])])}const bs=p(x,[["render",ns]]);export{bs as default}; diff --git a/src/static/app/dist/assets/peerList-BRtqzCMG.js b/src/static/app/dist/assets/peerList-M29SPoZn.js similarity index 90% rename from src/static/app/dist/assets/peerList-BRtqzCMG.js rename to src/static/app/dist/assets/peerList-M29SPoZn.js index 99ff706..855c74e 100644 --- a/src/static/app/dist/assets/peerList-BRtqzCMG.js +++ b/src/static/app/dist/assets/peerList-M29SPoZn.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peerShareLinkModal-B-KVnbTg.js","assets/index-7qLsecvh.js","assets/index-D6m-8oA_.css","assets/dayjs.min-C341O-eN.js","assets/vue-datepicker-v4St2bKM.js","assets/localeText-BguG5zGd.js","assets/peerShareLinkModal-B5PnDn1q.css","assets/peerJobs-CxUJ2ao7.js","assets/schedulePeerJob-DJNvnpjL.js","assets/schedulePeerJob--V7cpve7.css","assets/peerJobs-voXURBEt.css","assets/peerQRCode-CcaIHs_s.js","assets/browser-CjSdxGTc.js","assets/peerConfigurationFile-BnbSuKGY.js","assets/peerConfigurationFile-Dma_bQR7.css","assets/peerSettings-7HT8XeGx.js","assets/peerSettings-oGNRGN1t.css","assets/peerSearchBar-CLQQyoqI.js","assets/peerSearchBar-5knTmb8D.css","assets/peerJobsAllModal-BF44c_Ai.js","assets/peerJobsLogsModal-DBO2sNMy.js","assets/editConfiguration-CQ2FrzUy.js","assets/editConfiguration-C_hKRy6y.css","assets/selectPeers-BIWdU0cy.js","assets/selectPeers-Wjnh8YUZ.css","assets/peerAddModal-C7eF7J_U.js","assets/peerAddModal-s_w1PY7H.css"])))=>i.map(i=>d[i]); -import{r as O,D as G,o as le,E as Y,s as te,p as E,a,c as v,b as e,d as i,A as k,t as y,e as w,K as ie,g as F,_ as z,W as de,G as R,z as J,F as B,h as K,n as D,j as U,L as fe,M as ge,w as T,T as se,f as N,i as P,k as ee,N as L,O as A,C as ve,m as be,v as he,S as _e}from"./index-7qLsecvh.js";import{_ as ye}from"./protocolBadge-CVzzEU4-.js";import{L as C}from"./localeText-BguG5zGd.js";import{C as Se,L as we,B as $e,a as Pe,b as xe,c as Ce,p as ke,d as Oe,e as De,f as Me,P as Le,h as Ae,g as ae}from"./index-CfW94M3m.js";import{d as Re}from"./dayjs.min-C341O-eN.js";const Ie={class:"row gx-2 gy-2 mb-3"},Ee={class:"col-12"},Te={class:"card rounded-3 bg-transparent",style:{height:"270px"}},Be={class:"card-header bg-transparent border-0"},Ne={class:"text-muted"},Je={class:"card-body pt-1"},Fe={class:"col-sm col-lg-6"},je={class:"card rounded-3 bg-transparent",style:{height:"270px"}},Ve={class:"card-header bg-transparent border-0 d-flex align-items-center"},Ue={class:"text-muted"},Ge={key:0,class:"text-primary fw-bold ms-auto"},ze={class:"card-body pt-1"},Qe={class:"col-sm col-lg-6"},We={class:"card rounded-3 bg-transparent",style:{height:"270px"}},qe={class:"card-header bg-transparent border-0 d-flex align-items-center"},Ke={class:"text-muted"},He={key:0,class:"text-success fw-bold ms-auto"},Ye={class:"card-body pt-1"},Ze={__name:"peerDataUsageCharts",props:{configurationPeers:Array,configurationInfo:Object},setup(o){Se.register(we,$e,Pe,xe,Ce,ke,Oe,De,Me,Le);const t=o,n=O({timestamp:[],data:[]}),r=O({timestamp:[],data:[]}),x=ie(),S=G(),d=O(void 0),b=async()=>{await F("/api/getWireguardConfigurationRealtimeTraffic",{configurationName:x.params.id},g=>{let _=Re().format("hh:mm:ss A");(g.data.sent!==0&&g.data.recv!==0||n.value.data.length>0&&r.value.data.length>0)&&(n.value.timestamp.push(_),n.value.data.push(g.data.sent),r.value.timestamp.push(_),r.value.data.push(g.data.recv))})},m=()=>{clearInterval(d.value),d.value=void 0,t.configurationInfo.Status&&(d.value=setInterval(()=>{b()},parseInt(S.Configuration.Server.dashboard_refresh_interval)))};le(()=>{m()}),Y(()=>t.configurationInfo.Status,()=>{m()}),Y(()=>S.Configuration.Server.dashboard_refresh_interval,()=>{m()}),te(()=>{clearInterval(d.value),d.value=void 0});const p=E(()=>{let g=t.configurationPeers.filter(_=>_.cumu_data+_.total_data>0);return{labels:g.map(_=>_.name?_.name:`Untitled Peer - ${_.id}`),datasets:[{label:"Total Data Usage",data:g.map(_=>_.cumu_data+_.total_data),backgroundColor:g.map(_=>"#ffc107"),tooltip:{callbacks:{label:_=>`${_.formattedValue} GB`}}}]}}),$=E(()=>({labels:[...n.value.timestamp],datasets:[{label:"Data Sent",data:[...n.value.data],fill:!1,borderColor:"#198754",backgroundColor:"#198754",tension:0}]})),M=E(()=>({labels:[...r.value.timestamp],datasets:[{label:"Data Received",data:[...r.value.data],fill:!1,borderColor:"#0d6efd",backgroundColor:"#0d6efd",tension:0}]})),l=E(()=>({responsive:!0,plugins:{legend:{display:!1}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(g,_)=>`${Math.round((g+Number.EPSILON)*1e3)/1e3} GB`},grid:{display:!1}}}})),c=E(()=>({responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:g=>`${g.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!0}},y:{ticks:{callback:(g,_)=>`${Math.round((g+Number.EPSILON)*1e3)/1e3} MB/s`},grid:{display:!0}}}}));return(g,_)=>(a(),v("div",Ie,[e("div",Ee,[e("div",Te,[e("div",Be,[e("small",Ne,[i(C,{t:"Peers Data Usage"})])]),e("div",Je,[i(k(Ae),{data:p.value,options:l.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["data","options"])])])]),e("div",Fe,[e("div",je,[e("div",Ve,[e("small",Ue,[i(C,{t:"Real Time Received Data Usage"})]),r.value.data.length>0?(a(),v("small",Ge,y(r.value.data[r.value.data.length-1])+" MB/s ",1)):w("",!0)]),e("div",ze,[i(k(ae),{options:c.value,data:M.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])]),e("div",Qe,[e("div",We,[e("div",qe,[e("small",Ke,[i(C,{t:"Real Time Sent Data Usage"})]),n.value.data.length>0?(a(),v("small",He,y(n.value.data[n.value.data.length-1])+" MB/s ",1)):w("",!0)]),e("div",Ye,[i(k(ae),{options:c.value,data:$.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])])]))}},Xe={name:"peerSearch",components:{LocaleText:C},setup(){const o=G(),t=de();return{store:o,wireguardConfigurationStore:t}},props:{configuration:Object},data(){return{sort:{status:R("Status"),name:R("Name"),allowed_ip:R("Allowed IPs"),restricted:R("Restricted")},interval:{5e3:R("5 Seconds"),1e4:R("10 Seconds"),3e4:R("30 Seconds"),6e4:R("1 Minutes")},display:{grid:R("Grid"),list:R("List")},searchString:"",searchStringTimeout:void 0,showDisplaySettings:!1,showMoreSettings:!1}},methods:{debounce(){this.searchStringTimeout?(clearTimeout(this.searchStringTimeout),this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)):this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)},updateSort(o){J("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_sort",value:o},t=>{t.status&&this.store.getConfiguration()})},updateRefreshInterval(o){J("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_refresh_interval",value:o},t=>{t.status&&this.store.getConfiguration()})},updateDisplay(o){J("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_peer_list_display",value:o},t=>{t.status&&this.store.getConfiguration()})},downloadAllPeer(){F(`/api/downloadAllPeers/${this.configuration.Name}`,{},o=>{o.data.forEach(t=>{t.fileName=t.fileName+".conf"}),window.wireguard.generateZipFiles(o,this.configuration.Name)})}}},et={class:"d-flex flex-column gap-2 my-4"},tt={class:"d-flex gap-2 peerSearchContainer"},st={class:"dropdown"},ot={"data-bs-toggle":"dropdown",class:"btn w-100 btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},nt={class:"badge text-bg-primary ms-2"},at={class:"dropdown-menu rounded-3"},rt=["onClick"],lt={class:"ms-auto"},it={key:0,class:"bi bi-check-circle-fill"},dt={class:"dropdown"},ut={"data-bs-toggle":"dropdown",class:"btn btn-sm w-100 text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},ct={class:"badge text-bg-primary ms-2"},mt={class:"dropdown-menu rounded-3"},pt=["onClick"],ft={class:"ms-auto"},gt={key:0,class:"bi bi-check-circle-fill"},vt={class:"dropdown"},bt={"data-bs-toggle":"dropdown",class:"btn btn-sm w-100 text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},ht={class:"badge text-bg-primary ms-2"},_t={class:"dropdown-menu rounded-3"},yt=["onClick"],St={class:"ms-auto"},wt={key:0,class:"bi bi-check-circle-fill"};function $t(o,t,n,r,x,S){const d=U("LocaleText");return a(),v("div",et,[e("div",tt,[e("div",st,[e("button",ot,[t[4]||(t[4]=e("i",{class:"bi bi-sort-up me-2"},null,-1)),i(d,{t:"Sort By"}),e("span",nt,y(this.sort[r.store.Configuration.Server.dashboard_sort]),1)]),e("ul",at,[(a(!0),v(B,null,K(this.sort,(b,m)=>(a(),v("li",null,[e("button",{class:"dropdown-item d-flex align-items-center",onClick:p=>this.updateSort(m)},[e("small",null,y(b),1),e("small",lt,[r.store.Configuration.Server.dashboard_sort===m?(a(),v("i",it)):w("",!0)])],8,rt)]))),256))])]),e("div",dt,[e("button",ut,[t[5]||(t[5]=e("i",{class:"bi bi-arrow-repeat me-2"},null,-1)),i(d,{t:"Refresh Interval"}),e("span",ct,y(this.interval[r.store.Configuration.Server.dashboard_refresh_interval]),1)]),e("ul",mt,[(a(!0),v(B,null,K(this.interval,(b,m)=>(a(),v("li",null,[e("button",{class:"dropdown-item d-flex align-items-center",onClick:p=>this.updateRefreshInterval(m)},[e("small",null,y(b),1),e("small",ft,[r.store.Configuration.Server.dashboard_refresh_interval===m?(a(),v("i",gt)):w("",!0)])],8,pt)]))),256))])]),e("div",vt,[e("button",bt,[e("i",{class:D(["bi me-2","bi-"+r.store.Configuration.Server.dashboard_peer_list_display])},null,2),i(d,{t:"Display"}),e("span",ht,y(this.display[r.store.Configuration.Server.dashboard_peer_list_display]),1)]),e("ul",_t,[(a(!0),v(B,null,K(this.display,(b,m)=>(a(),v("li",null,[e("button",{class:"dropdown-item d-flex align-items-center",onClick:p=>this.updateDisplay(m)},[e("small",null,y(b),1),e("small",St,[r.store.Configuration.Server.dashboard_peer_list_display===m?(a(),v("i",wt)):w("",!0)])],8,yt)]))),256))])]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle ms-lg-auto",onClick:t[0]||(t[0]=b=>this.$emit("search"))},[t[6]||(t[6]=e("i",{class:"bi bi-search me-2"},null,-1)),i(d,{t:"Search"})]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[1]||(t[1]=b=>this.downloadAllPeer())},[t[7]||(t[7]=e("i",{class:"bi bi-download me-2 me-lg-0 me-xl-2"},null,-1)),i(d,{t:"Download All",class:"d-sm-block d-lg-none d-xl-block"})]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[2]||(t[2]=b=>this.$emit("selectPeers"))},[t[8]||(t[8]=e("i",{class:"bi bi-check2-all me-2 me-lg-0 me-xl-2"},null,-1)),i(d,{t:"Select Peers",class:"d-sm-block d-lg-none d-xl-block"})]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[3]||(t[3]=b=>this.$emit("jobsAll")),type:"button","aria-expanded":"false"},[t[9]||(t[9]=e("i",{class:"bi bi-person-walking me-2 me-lg-0 me-xl-2"},null,-1)),i(d,{t:"Active Jobs",class:"d-sm-block d-lg-none d-xl-block"})])])])}const Pt=z(Xe,[["render",$t],["__scopeId","data-v-c96b078a"]]);function xt(o){return fe()?(ge(o),!0):!1}function ue(o){return typeof o=="function"?o():k(o)}const ce=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ct=Object.prototype.toString,kt=o=>Ct.call(o)==="[object Object]",H=()=>{},Ot=Dt();function Dt(){var o,t;return ce&&((o=window?.navigator)==null?void 0:o.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window?.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function V(o){var t;const n=ue(o);return(t=n?.$el)!=null?t:n}const me=ce?window:void 0;function X(...o){let t,n,r,x;if(typeof o[0]=="string"||Array.isArray(o[0])?([n,r,x]=o,t=me):[t,n,r,x]=o,!t)return H;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const S=[],d=()=>{S.forEach($=>$()),S.length=0},b=($,M,l,c)=>($.addEventListener(M,l,c),()=>$.removeEventListener(M,l,c)),m=Y(()=>[V(t),ue(x)],([$,M])=>{if(d(),!$)return;const l=kt(M)?{...M}:M;S.push(...n.flatMap(c=>r.map(g=>b($,c,g,l))))},{immediate:!0,flush:"post"}),p=()=>{m(),d()};return xt(p),p}let re=!1;function Mt(o,t,n={}){const{window:r=me,ignore:x=[],capture:S=!0,detectIframe:d=!1}=n;if(!r)return H;Ot&&!re&&(re=!0,Array.from(r.document.body.children).forEach(l=>l.addEventListener("click",H)),r.document.documentElement.addEventListener("click",H));let b=!0;const m=l=>x.some(c=>{if(typeof c=="string")return Array.from(r.document.querySelectorAll(c)).some(g=>g===l.target||l.composedPath().includes(g));{const g=V(c);return g&&(l.target===g||l.composedPath().includes(g))}}),$=[X(r,"click",l=>{const c=V(o);if(!(!c||c===l.target||l.composedPath().includes(c))){if(l.detail===0&&(b=!m(l)),!b){b=!0;return}t(l)}},{passive:!0,capture:S}),X(r,"pointerdown",l=>{const c=V(o);b=!m(l)&&!!(c&&!l.composedPath().includes(c))},{passive:!0}),d&&X(r,"blur",l=>{setTimeout(()=>{var c;const g=V(o);((c=r.document.activeElement)==null?void 0:c.tagName)==="IFRAME"&&!g?.contains(r.document.activeElement)&&t(l)},0)})].filter(Boolean);return()=>$.forEach(l=>l())}const Lt={key:0,class:"position-absolute d-block p-1 px-2 bg-body text-body rounded-3 border shadow"},At={__name:"peerSettingsDropdownTool",props:{icon:String,title:String},emits:["click"],setup(o,{emit:t}){const n=t,r=O(!1);return(x,S)=>(a(),v("a",{class:"dropdown-item text-center px-0 rounded-3 position-relative",role:"button",onMouseenter:S[0]||(S[0]=d=>r.value=!0),onMouseleave:S[1]||(S[1]=d=>r.value=!1),onClick:S[2]||(S[2]=d=>n("click"))},[e("i",{class:D(["me-auto bi",o.icon])},null,2),i(se,{name:"zoomReversed"},{default:T(()=>[r.value?(a(),v("span",Lt,[e("small",null,y(o.title),1)])):w("",!0)]),_:1})],32))}},Rt=z(At,[["__scopeId","data-v-2d66aeb6"]]),It={name:"peerSettingsDropdown",components:{PeerSettingsDropdownTool:Rt,LocaleText:C},setup(){return{dashboardStore:G()}},props:{Peer:Object},data(){return{deleteBtnDisabled:!1,restrictBtnDisabled:!1,allowAccessBtnDisabled:!1,confirmDelete:!1}},methods:{downloadPeer(){F("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},o=>{if(o.status){const t=new Blob([o.data.file],{type:"text/plain"}),n=URL.createObjectURL(t),r=`${o.data.fileName}.conf`,x=document.createElement("a");x.href=n,x.download=r,x.click(),this.dashboardStore.newMessage("WGDashboard","Peer download started","success")}else this.dashboardStore.newMessage("Server",o.message,"danger")})},downloadQRCode(o){F("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{t.status?this.$emit(o,t.data.file):this.dashboardStore.newMessage("Server",t.message,"danger")})},deletePeer(){this.deleteBtnDisabled=!0,J(`/api/deletePeers/${this.$route.params.id}`,{peers:[this.Peer.id]},o=>{this.dashboardStore.newMessage("Server",o.message,o.status?"success":"danger"),this.$emit("refresh"),this.deleteBtnDisabled=!1})},restrictPeer(){this.restrictBtnDisabled=!0,J(`/api/restrictPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},o=>{this.dashboardStore.newMessage("Server",o.message,o.status?"success":"danger"),this.$emit("refresh"),this.restrictBtnDisabled=!1})},allowAccessPeer(){this.allowAccessBtnDisabled=!0,J(`/api/allowAccessPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},o=>{this.dashboardStore.newMessage("Server",o.message,o.status?"success":"danger"),this.$emit("refresh"),this.allowAccessBtnDisabled=!1})}}},Et={class:"dropdown-menu mt-2 shadow-lg d-block rounded-3",style:{"max-width":"200px"}},Tt={style:{"font-size":"0.8rem","padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Bt={class:"text-body d-flex"},Nt={class:"ms-auto"},Jt={key:1},Ft={class:"w-100 dropdown-item text-muted",style:{"white-space":"break-spaces","font-size":"0.7rem"}},jt={key:2},Vt={class:"d-flex",style:{"padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Ut={key:1,class:"confirmDelete"},Gt={style:{"white-space":"break-spaces"},class:"mb-2 d-block fw-bold"},zt={class:"d-flex w-100 gap-2"},Qt=["disabled"],Wt=["disabled"],qt={key:1};function Kt(o,t,n,r,x,S){const d=U("LocaleText"),b=U("PeerSettingsDropdownTool");return a(),v("ul",Et,[this.Peer.restricted?(a(),v("li",qt,[e("a",{class:D(["dropdown-item d-flex text-warning",{disabled:this.allowAccessBtnDisabled}]),onClick:t[10]||(t[10]=m=>this.allowAccessPeer()),role:"button"},[t[22]||(t[22]=e("i",{class:"me-auto bi bi-unlock"},null,-1)),this.allowAccessBtnDisabled?(a(),P(d,{key:1,t:"Allowing Access..."})):(a(),P(d,{key:0,t:"Allow Access"}))],2)])):(a(),v(B,{key:0},[this.confirmDelete?(a(),v("li",Ut,[e("p",Gt,[i(d,{t:"Are you sure to delete this peer?"})]),e("div",zt,[e("button",{onClick:t[8]||(t[8]=m=>this.deletePeer()),disabled:this.deleteBtnDisabled,class:"flex-grow-1 ms-auto btn btn-sm bg-danger"},[i(d,{t:"Yes"})],8,Qt),e("button",{disabled:this.deleteBtnDisabled,onClick:t[9]||(t[9]=m=>this.confirmDelete=!1),class:"flex-grow-1 btn btn-sm bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle"},[i(d,{t:"No"})],8,Wt)])])):(a(),v(B,{key:0},[this.Peer.status==="running"?(a(),v(B,{key:0},[e("li",Tt,[e("span",Bt,[t[11]||(t[11]=e("i",{class:"bi bi-box-arrow-in-right"},null,-1)),e("span",Nt,y(this.Peer.endpoint),1)])]),t[12]||(t[12]=e("li",null,[e("hr",{class:"dropdown-divider"})],-1))],64)):w("",!0),this.Peer.private_key?(a(),v("li",jt,[t[13]||(t[13]=e("div",{class:"text-center text-muted"},null,-1)),e("div",Vt,[i(b,{icon:"bi-download",title:"Download",onClick:t[0]||(t[0]=m=>this.downloadPeer())}),i(b,{icon:"bi-qr-code",title:"QR Code",onClick:t[1]||(t[1]=m=>this.$emit("qrcode"))}),i(b,{icon:"bi-body-text",title:"Configuration File",onClick:t[2]||(t[2]=m=>this.$emit("configurationFile"))}),i(b,{icon:"bi-share",title:"Share",onClick:t[3]||(t[3]=m=>this.$emit("share"))})])])):(a(),v("li",Jt,[e("small",Ft,[i(d,{t:"Download & QR Code is not available due to no private key set for this peer"})])])),t[20]||(t[20]=e("li",null,[e("hr",{class:"dropdown-divider"})],-1)),e("li",null,[e("a",{class:"dropdown-item d-flex",role:"button",onClick:t[4]||(t[4]=m=>this.$emit("setting"))},[t[14]||(t[14]=e("i",{class:"me-auto bi bi-pen"},null,-1)),t[15]||(t[15]=N()),i(d,{t:"Peer Settings"})])]),e("li",null,[e("a",{class:"dropdown-item d-flex",role:"button",onClick:t[5]||(t[5]=m=>this.$emit("jobs"))},[t[16]||(t[16]=e("i",{class:"me-auto bi bi-app-indicator"},null,-1)),t[17]||(t[17]=N()),i(d,{t:"Schedule Jobs"})])]),t[21]||(t[21]=e("li",null,[e("hr",{class:"dropdown-divider"})],-1)),e("li",null,[e("a",{class:D(["dropdown-item d-flex text-warning",{disabled:this.restrictBtnDisabled}]),onClick:t[6]||(t[6]=m=>this.restrictPeer()),role:"button"},[t[18]||(t[18]=e("i",{class:"me-auto bi bi-lock"},null,-1)),this.restrictBtnDisabled?(a(),P(d,{key:1,t:"Restricting..."})):(a(),P(d,{key:0,t:"Restrict Access"}))],2)]),e("li",null,[e("a",{class:D(["dropdown-item d-flex fw-bold text-danger",{disabled:this.deleteBtnDisabled}]),onClick:t[7]||(t[7]=m=>this.confirmDelete=!0),role:"button"},[t[19]||(t[19]=e("i",{class:"me-auto bi bi-trash"},null,-1)),this.deleteBtnDisabled?(a(),P(d,{key:1,t:"Deleting..."})):(a(),P(d,{key:0,t:"Delete"}))],2)])],64))],64))])}const Ht=z(It,[["render",Kt],["__scopeId","data-v-d46268aa"]]),Yt={name:"peer",components:{LocaleText:C,PeerSettingsDropdown:Ht},props:{Peer:Object},data(){return{}},setup(){const o=O(null),t=O(!1),n=G();return Mt(o,r=>{t.value=!1}),{target:o,subMenuOpened:t,dashboardStore:n}},computed:{getLatestHandshake(){return this.Peer.latest_handshake.includes(",")?this.Peer.latest_handshake.split(",")[0]:this.Peer.latest_handshake}}},Zt={key:0,class:"card-header bg-transparent d-flex align-items-center gap-2 border-0"},Xt={key:0,style:{"font-size":"0.8rem",color:"#28a745"},class:"d-flex align-items-center"},es={style:{"font-size":"0.8rem"},class:"ms-auto d-flex gap-2"},ts={class:"text-primary"},ss={class:"text-success"},os={key:0,class:"text-secondary"},ns={key:1,class:"border-0 card-header bg-transparent text-warning fw-bold",style:{"font-size":"0.8rem"}},as={class:"card-body pt-1",style:{"font-size":"0.9rem"}},rs={class:"text-muted"},ls={class:"d-block"},is={class:"text-muted"},ds={class:"d-block"},us={class:"text-muted"},cs={class:"d-block"},ms={class:"d-flex align-items-end ms-auto"};function ps(o,t,n,r,x,S){const d=U("LocaleText"),b=U("PeerSettingsDropdown");return a(),v("div",{class:D(["card shadow-sm rounded-3 peerCard",{"border-warning":n.Peer.restricted}])},[e("div",null,[n.Peer.restricted?(a(),v("div",ns,[t[13]||(t[13]=e("i",{class:"bi-lock-fill me-2"},null,-1)),i(d,{t:"Access Restricted"})])):(a(),v("div",Zt,[e("div",{class:D(["dot ms-0",{active:n.Peer.status==="running"}])},null,2),r.dashboardStore.Configuration.Server.dashboard_peer_list_display==="list"&&n.Peer.status==="running"?(a(),v("div",Xt,[t[7]||(t[7]=e("i",{class:"bi bi-box-arrow-in-right me-2"},null,-1)),e("span",null,y(n.Peer.endpoint),1)])):w("",!0),e("div",es,[e("span",ts,[t[8]||(t[8]=e("i",{class:"bi bi-arrow-down"},null,-1)),e("strong",null,y((n.Peer.cumu_receive+n.Peer.total_receive).toFixed(4)),1),t[9]||(t[9]=N(" GB "))]),e("span",ss,[t[10]||(t[10]=e("i",{class:"bi bi-arrow-up"},null,-1)),e("strong",null,y((n.Peer.cumu_sent+n.Peer.total_sent).toFixed(4)),1),t[11]||(t[11]=N(" GB "))]),n.Peer.latest_handshake!=="No Handshake"?(a(),v("span",os,[t[12]||(t[12]=e("i",{class:"bi bi-arrows-angle-contract"},null,-1)),N(" "+y(S.getLatestHandshake)+" ago ",1)])):w("",!0)])]))]),e("div",as,[e("h6",null,y(n.Peer.name?n.Peer.name:"Untitled Peer"),1),e("div",{class:D(["d-flex",[r.dashboardStore.Configuration.Server.dashboard_peer_list_display==="grid"?"gap-1 flex-column":"flex-row gap-3"]])},[e("div",{class:D({"d-flex gap-2 align-items-center":r.dashboardStore.Configuration.Server.dashboard_peer_list_display==="list"})},[e("small",rs,[i(d,{t:"Public Key"})]),e("small",ls,[e("samp",null,y(n.Peer.id),1)])],2),e("div",{class:D({"d-flex gap-2 align-items-center":r.dashboardStore.Configuration.Server.dashboard_peer_list_display==="list"})},[e("small",is,[i(d,{t:"Allowed IPs"})]),e("small",ds,[e("samp",null,y(n.Peer.allowed_ip),1)])],2),n.Peer.advanced_security?(a(),v("div",{key:0,class:D({"d-flex gap-2 align-items-center":r.dashboardStore.Configuration.Server.dashboard_peer_list_display==="list"})},[e("small",us,[i(d,{t:"Advanced Security"})]),e("small",cs,[e("samp",null,y(n.Peer.advanced_security),1)])],2)):w("",!0),e("div",ms,[e("div",{class:D(["ms-auto px-2 rounded-3 subMenuBtn",{active:this.subMenuOpened}])},[e("a",{role:"button",class:"text-body",onClick:t[0]||(t[0]=m=>this.subMenuOpened=!0)},t[14]||(t[14]=[e("h5",{class:"mb-0"},[e("i",{class:"bi bi-three-dots"})],-1)])),i(se,{name:"slide-fade"},{default:T(()=>[this.subMenuOpened?(a(),P(b,{key:0,onQrcode:t[1]||(t[1]=m=>this.$emit("qrcode")),onConfigurationFile:t[2]||(t[2]=m=>this.$emit("configurationFile")),onSetting:t[3]||(t[3]=m=>this.$emit("setting")),onJobs:t[4]||(t[4]=m=>this.$emit("jobs")),onRefresh:t[5]||(t[5]=m=>this.$emit("refresh")),onShare:t[6]||(t[6]=m=>this.$emit("share")),Peer:n.Peer,ref:"target"},null,8,["Peer"])):w("",!0)]),_:1})],2)])],2)])],2)}const fs=z(Yt,[["render",ps],["__scopeId","data-v-da99e0f2"]]),gs={__name:"peerListModals",props:{configurationModals:Object,configurationModalSelectedPeer:Object},emits:["refresh"],setup(o,{emit:t}){const n=t,r=L(()=>A(()=>import("./peerShareLinkModal-B-KVnbTg.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),x=L(()=>A(()=>import("./peerJobs-CxUJ2ao7.js"),__vite__mapDeps([7,8,1,2,4,3,5,9,10]))),S=L(()=>A(()=>import("./peerQRCode-CcaIHs_s.js"),__vite__mapDeps([11,12,5,1,2]))),d=L(()=>A(()=>import("./peerConfigurationFile-BnbSuKGY.js"),__vite__mapDeps([13,1,2,5,12,14]))),b=L(()=>A(()=>import("./peerSettings-7HT8XeGx.js"),__vite__mapDeps([15,1,2,5,16])));return(m,p)=>(a(),P(ee,{name:"zoom"},{default:T(()=>[o.configurationModals.peerSetting.modalOpen?(a(),P(k(b),{key:"PeerSettingsModal",selectedPeer:o.configurationModalSelectedPeer,onRefresh:p[0]||(p[0]=$=>n("refresh")),onClose:p[1]||(p[1]=$=>o.configurationModals.peerSetting.modalOpen=!1)},null,8,["selectedPeer"])):w("",!0),o.configurationModals.peerQRCode.modalOpen?(a(),P(k(S),{key:"PeerQRCodeModal",selectedPeer:o.configurationModalSelectedPeer,onClose:p[2]||(p[2]=$=>o.configurationModals.peerQRCode.modalOpen=!1)},null,8,["selectedPeer"])):w("",!0),o.configurationModals.peerScheduleJobs.modalOpen?(a(),P(k(x),{key:"PeerJobsModal",onRefresh:p[3]||(p[3]=$=>n("refresh")),selectedPeer:o.configurationModalSelectedPeer,onClose:p[4]||(p[4]=$=>o.configurationModals.peerScheduleJobs.modalOpen=!1)},null,8,["selectedPeer"])):w("",!0),o.configurationModals.peerShare.modalOpen?(a(),P(k(r),{key:"PeerShareLinkModal",onClose:p[5]||(p[5]=$=>{o.configurationModals.peerShare.modalOpen=!1}),selectedPeer:o.configurationModalSelectedPeer},null,8,["selectedPeer"])):w("",!0),o.configurationModals.peerConfigurationFile.modalOpen?(a(),P(k(d),{key:4,onClose:p[6]||(p[6]=$=>o.configurationModals.peerConfigurationFile.modalOpen=!1),selectedPeer:o.configurationModalSelectedPeer},null,8,["selectedPeer"])):w("",!0)]),_:1}))}},vs={style:{"margin-bottom":"20px",height:"1px"},id:"loadMore"},bs={__name:"peerIntersectionObserver",props:["peerListLength","showPeersCount"],emits:["loadMore"],setup(o,{emit:t}){const n=O(void 0),r=t;return le(()=>{n.value=new IntersectionObserver(x=>{x.forEach(S=>{S.isIntersecting&&r("loadMore")})},{rootMargin:"20px",threshold:1}),n.value.observe(document.querySelector("#loadMore"))}),te(()=>{n.value.disconnect()}),(x,S)=>(a(),v("div",vs))}},hs={class:"container-fluid"},_s={class:"d-flex align-items-sm-center flex-column flex-sm-row gap-3"},ys={class:"text-muted d-flex align-items-center gap-2"},Ss={class:"mb-0"},ws={class:"d-flex align-items-center gap-3"},$s={class:"mb-0 display-4"},Ps={class:"ms-sm-auto d-flex gap-2 flex-column"},xs={class:"card rounded-3 bg-transparent"},Cs={class:"card-body py-2 d-flex align-items-center"},ks={class:"text-muted"},Os={class:"form-check form-switch mb-0 ms-auto pe-0 me-0"},Ds=["for"],Ms={key:2,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},Ls=["disabled","id"],As={class:"d-flex gap-2"},Rs={class:"row mt-3 gy-2 gx-2 mb-2"},Is={class:"col-12 col-lg-3"},Es={class:"card rounded-3 bg-transparent h-100"},Ts={class:"card-body py-2 d-flex flex-column justify-content-center"},Bs={class:"mb-0 text-muted"},Ns={class:"col-12 col-lg-3"},Js={class:"card rounded-3 bg-transparent h-100"},Fs={class:"card-body py-2 d-flex flex-column justify-content-center"},js={class:"mb-0 text-muted"},Vs={style:{"word-break":"break-all"},class:"col-12 col-lg-6"},Us={class:"card rounded-3 bg-transparent h-100"},Gs={class:"card-body py-2 d-flex flex-column justify-content-center"},zs={class:"mb-0 text-muted"},Qs={class:"row gx-2 gy-2 mb-2"},Ws={class:"col-12 col-lg-3"},qs={class:"card rounded-3 bg-transparent h-100"},Ks={class:"card-body d-flex"},Hs={class:"mb-0 text-muted"},Ys={class:"h4"},Zs={class:"col-12 col-lg-3"},Xs={class:"card rounded-3 bg-transparent h-100"},eo={class:"card-body d-flex"},to={class:"mb-0 text-muted"},so={class:"h4"},oo={class:"col-12 col-lg-3"},no={class:"card rounded-3 bg-transparent h-100"},ao={class:"card-body d-flex"},ro={class:"mb-0 text-muted"},lo={class:"h4 text-primary"},io={class:"col-12 col-lg-3"},uo={class:"card rounded-3 bg-transparent h-100"},co={class:"card-body d-flex"},mo={class:"mb-0 text-muted"},po={class:"h4 text-success"},fo={style:{"margin-bottom":"80px"}},go=20,vo={__name:"peerList",async setup(o){let t,n;const r=L(()=>A(()=>import("./peerSearchBar-CLQQyoqI.js"),__vite__mapDeps([17,1,2,5,18]))),x=L(()=>A(()=>import("./peerJobsAllModal-BF44c_Ai.js"),__vite__mapDeps([19,8,1,2,4,3,5,9]))),S=L(()=>A(()=>import("./peerJobsLogsModal-DBO2sNMy.js"),__vite__mapDeps([20,3,1,2,5]))),d=L(()=>A(()=>import("./editConfiguration-CQ2FrzUy.js"),__vite__mapDeps([21,1,2,5,3,22]))),b=L(()=>A(()=>import("./selectPeers-BIWdU0cy.js"),__vite__mapDeps([23,1,2,5,24]))),m=L(()=>A(()=>import("./peerAddModal-C7eF7J_U.js"),__vite__mapDeps([25,1,2,5,26]))),p=G(),$=de(),M=ie(),l=O({}),c=O([]),g=O(!1),_=O({}),h=O({peerNew:{modalOpen:!1},peerSetting:{modalOpen:!1},peerScheduleJobs:{modalOpen:!1},peerQRCode:{modalOpen:!1},peerConfigurationFile:{modalOpen:!1},peerCreate:{modalOpen:!1},peerScheduleJobsAll:{modalOpen:!1},peerScheduleJobsLogs:{modalOpen:!1},peerShare:{modalOpen:!1},editConfiguration:{modalOpen:!1},selectPeers:{modalOpen:!1},backupRestore:{modalOpen:!1},deleteConfiguration:{modalOpen:!1},editRawConfigurationFile:{modalOpen:!1}}),Z=O(!1),I=async()=>{await F("/api/getWireguardConfigurationInfo",{configurationName:M.params.id},f=>{f.status&&(l.value=f.data.configurationInfo,c.value=f.data.configurationPeers,c.value.forEach(s=>{s.restricted=!1}),f.data.configurationRestrictedPeers.forEach(s=>{s.restricted=!0,c.value.push(s)}))})};[t,n]=ve(()=>I()),await t,n();const Q=O(void 0),oe=()=>{clearInterval(Q.value),Q.value=setInterval(async()=>{await I()},parseInt(p.Configuration.Server.dashboard_refresh_interval))};oe(),te(()=>{clearInterval(Q.value),Q.value=void 0}),Y(()=>p.Configuration.Server.dashboard_refresh_interval,()=>{oe()});const pe=async()=>{g.value=!0,await F("/api/toggleWireguardConfiguration/",{configurationName:l.value.Name},f=>{f.status?p.newMessage("Server",`${l.value.Name} ${f.data?"is on":"is off"}`,"success"):p.newMessage("Server",f.message,"danger"),$.Configurations.find(s=>s.Name===l.value.Name).Status=f.data,l.value.Status=f.data,g.value=!1})},W=E(()=>({connectedPeers:c.value.filter(f=>f.status==="running").length,totalUsage:c.value.length>0?c.value.filter(f=>!f.restricted).map(f=>f.total_data+f.cumu_data).reduce((f,s)=>f+s,0).toFixed(4):0,totalReceive:c.value.length>0?c.value.filter(f=>!f.restricted).map(f=>f.total_receive+f.cumu_receive).reduce((f,s)=>f+s,0).toFixed(4):0,totalSent:c.value.length>0?c.value.filter(f=>!f.restricted).map(f=>f.total_sent+f.cumu_sent).reduce((f,s)=>f+s,0).toFixed(4):0})),q=O(10),ne=E(()=>{const f=$.searchString?c.value.filter(s=>s.name.includes($.searchString)||s.id.includes($.searchString)||s.allowed_ip.includes($.searchString)):c.value;return p.Configuration.Server.dashboard_sort==="restricted"?f.sort((s,u)=>s[p.Configuration.Server.dashboard_sort]u[p.Configuration.Server.dashboard_sort]?-1:0).slice(0,q.value):f.sort((s,u)=>s[p.Configuration.Server.dashboard_sort]u[p.Configuration.Server.dashboard_sort]?1:0).slice(0,q.value)});return(f,s)=>(a(),v("div",hs,[e("div",_s,[e("div",null,[e("div",ys,[e("h5",Ss,[i(ye,{protocol:l.value.Protocol},null,8,["protocol"])])]),e("div",ws,[e("h1",$s,[e("samp",null,y(l.value.Name),1)])])]),e("div",Ps,[e("div",xs,[e("div",Cs,[e("small",ks,[i(C,{t:"Status"})]),e("div",{class:D(["dot ms-2",{active:l.value.Status}])},null,2),e("div",Os,[e("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+l.value.id},[l.value.Status&&!g.value?(a(),P(C,{key:0,t:"On"})):!l.value.Status&&!g.value?(a(),P(C,{key:1,t:"Off"})):w("",!0),g.value?(a(),v("span",Ms)):w("",!0)],8,Ds),be(e("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:g.value,type:"checkbox",role:"switch",id:"switch"+l.value.id,onChange:s[0]||(s[0]=u=>pe()),"onUpdate:modelValue":s[1]||(s[1]=u=>l.value.Status=u)},null,40,Ls),[[he,l.value.Status]])])])]),e("div",As,[e("a",{role:"button",onClick:s[2]||(s[2]=u=>h.value.peerNew.modalOpen=!0),class:"titleBtn py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle"},[s[29]||(s[29]=e("i",{class:"bi bi-plus-circle me-2"},null,-1)),i(C,{t:"Peer"})]),e("button",{class:"titleBtn py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:s[3]||(s[3]=u=>h.value.editConfiguration.modalOpen=!0),type:"button","aria-expanded":"false"},[s[30]||(s[30]=e("i",{class:"bi bi-gear-fill me-2"},null,-1)),i(C,{t:"Configuration Settings"})])])])]),s[35]||(s[35]=e("hr",null,null,-1)),e("div",Rs,[e("div",Is,[e("div",Es,[e("div",Ts,[e("p",Bs,[e("small",null,[i(C,{t:"Address"})])]),N(" "+y(l.value.Address),1)])])]),e("div",Ns,[e("div",Js,[e("div",Fs,[e("p",js,[e("small",null,[i(C,{t:"Listen Port"})])]),N(" "+y(l.value.ListenPort),1)])])]),e("div",Vs,[e("div",Us,[e("div",Gs,[e("p",zs,[e("small",null,[i(C,{t:"Public Key"})])]),e("samp",null,y(l.value.PublicKey),1)])])])]),e("div",Qs,[e("div",Ws,[e("div",qs,[e("div",Ks,[e("div",null,[e("p",Hs,[e("small",null,[i(C,{t:"Connected Peers"})])]),e("strong",Ys,y(W.value.connectedPeers)+" / "+y(c.value.length),1)]),s[31]||(s[31]=e("i",{class:"bi bi-ethernet ms-auto h2 text-muted"},null,-1))])])]),e("div",Zs,[e("div",Xs,[e("div",eo,[e("div",null,[e("p",to,[e("small",null,[i(C,{t:"Total Usage"})])]),e("strong",so,y(W.value.totalUsage)+" GB",1)]),s[32]||(s[32]=e("i",{class:"bi bi-arrow-down-up ms-auto h2 text-muted"},null,-1))])])]),e("div",oo,[e("div",no,[e("div",ao,[e("div",null,[e("p",ro,[e("small",null,[i(C,{t:"Total Received"})])]),e("strong",lo,y(W.value.totalReceive)+" GB",1)]),s[33]||(s[33]=e("i",{class:"bi bi-arrow-down ms-auto h2 text-muted"},null,-1))])])]),e("div",io,[e("div",uo,[e("div",co,[e("div",null,[e("p",mo,[e("small",null,[i(C,{t:"Total Sent"})])]),e("strong",po,y(W.value.totalSent)+" GB",1)]),s[34]||(s[34]=e("i",{class:"bi bi-arrow-up ms-auto h2 text-muted"},null,-1))])])])]),i(Ze,{configurationPeers:c.value,configurationInfo:l.value},null,8,["configurationPeers","configurationInfo"]),s[36]||(s[36]=e("hr",null,null,-1)),e("div",fo,[c.value.length>0?(a(),P(Pt,{key:0,onSearch:s[4]||(s[4]=u=>Z.value=!0),onJobsAll:s[5]||(s[5]=u=>h.value.peerScheduleJobsAll.modalOpen=!0),onJobLogs:s[6]||(s[6]=u=>h.value.peerScheduleJobsLogs.modalOpen=!0),onEditConfiguration:s[7]||(s[7]=u=>h.value.editConfiguration.modalOpen=!0),onSelectPeers:s[8]||(s[8]=u=>h.value.selectPeers.modalOpen=!0),onBackupRestore:s[9]||(s[9]=u=>h.value.backupRestore.modalOpen=!0),onDeleteConfiguration:s[10]||(s[10]=u=>h.value.deleteConfiguration.modalOpen=!0),configuration:l.value},null,8,["configuration"])):w("",!0),i(ee,{name:"peerList",tag:"div",class:"row gx-2 gy-2 z-0 position-relative"},{default:T(()=>[(a(!0),v(B,null,K(ne.value,u=>(a(),v("div",{class:D(["col-12",{"col-lg-6 col-xl-4":k(p).Configuration.Server.dashboard_peer_list_display==="grid"}]),key:u.id},[i(fs,{Peer:u,onShare:j=>{h.value.peerShare.modalOpen=!0,_.value=u},onRefresh:s[11]||(s[11]=j=>I()),onJobs:j=>{h.value.peerScheduleJobs.modalOpen=!0,_.value=u},onSetting:j=>{h.value.peerSetting.modalOpen=!0,_.value=u},onQrcode:j=>{_.value=u,h.value.peerQRCode.modalOpen=!0},onConfigurationFile:j=>{_.value=u,h.value.peerConfigurationFile.modalOpen=!0}},null,8,["Peer","onShare","onJobs","onSetting","onQrcode","onConfigurationFile"])],2))),128))]),_:1})]),i(se,{name:"slideUp"},{default:T(()=>[Z.value?(a(),P(k(r),{key:0,onClose:s[12]||(s[12]=u=>Z.value=!1)})):w("",!0)]),_:1}),i(gs,{configurationModals:h.value,configurationModalSelectedPeer:_.value,onRefresh:s[13]||(s[13]=u=>I())},null,8,["configurationModals","configurationModalSelectedPeer"]),i(ee,{name:"zoom"},{default:T(()=>[(a(),P(_e,{key:"PeerAddModal"},{default:T(()=>[h.value.peerNew.modalOpen?(a(),P(k(m),{key:0,onClose:s[14]||(s[14]=u=>h.value.peerNew.modalOpen=!1),onAddedPeers:s[15]||(s[15]=u=>{h.value.peerNew.modalOpen=!1,I()})})):w("",!0)]),_:1})),h.value.peerScheduleJobsAll.modalOpen?(a(),P(k(x),{key:"PeerJobsAllModal",onRefresh:s[16]||(s[16]=u=>I()),onAllLogs:s[17]||(s[17]=u=>h.value.peerScheduleJobsLogs.modalOpen=!0),onClose:s[18]||(s[18]=u=>h.value.peerScheduleJobsAll.modalOpen=!1),configurationPeers:c.value},null,8,["configurationPeers"])):w("",!0),h.value.peerScheduleJobsLogs.modalOpen?(a(),P(k(S),{key:"PeerJobsLogsModal",onClose:s[19]||(s[19]=u=>h.value.peerScheduleJobsLogs.modalOpen=!1),configurationInfo:l.value},null,8,["configurationInfo"])):w("",!0),h.value.editConfiguration.modalOpen?(a(),P(k(d),{key:"EditConfigurationModal",onEditRaw:s[20]||(s[20]=u=>h.value.editRawConfigurationFile.modalOpen=!0),onClose:s[21]||(s[21]=u=>h.value.editConfiguration.modalOpen=!1),onDataChanged:s[22]||(s[22]=u=>l.value=u),onRefresh:s[23]||(s[23]=u=>I()),onBackupRestore:s[24]||(s[24]=u=>h.value.backupRestore.modalOpen=!0),onDeleteConfiguration:s[25]||(s[25]=u=>h.value.deleteConfiguration.modalOpen=!0),configurationInfo:l.value},null,8,["configurationInfo"])):w("",!0),h.value.selectPeers.modalOpen?(a(),P(k(b),{key:3,onRefresh:s[26]||(s[26]=u=>I()),configurationPeers:c.value,onClose:s[27]||(s[27]=u=>h.value.selectPeers.modalOpen=!1)},null,8,["configurationPeers"])):w("",!0)]),_:1}),i(bs,{showPeersCount:q.value,peerListLength:ne.value.length,onLoadMore:s[28]||(s[28]=u=>q.value+=go)},null,8,["showPeersCount","peerListLength"])]))}},wo=z(vo,[["__scopeId","data-v-9736e433"]]);export{wo as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/peerShareLinkModal-C_6aIgZ8.js","assets/index-CgM9eUIs.js","assets/index-D6m-8oA_.css","assets/dayjs.min-B2wceQaW.js","assets/vue-datepicker-D7WdryeM.js","assets/localeText-Dh33930I.js","assets/peerShareLinkModal-B5PnDn1q.css","assets/peerJobs-CQfx4Mi7.js","assets/schedulePeerJob-hRoInhjL.js","assets/schedulePeerJob--V7cpve7.css","assets/peerJobs-voXURBEt.css","assets/peerQRCode-DALw201D.js","assets/browser-CjSdxGTc.js","assets/peerConfigurationFile-eAJKSkem.js","assets/peerConfigurationFile-Dma_bQR7.css","assets/peerSettings-HqeEL_Gm.js","assets/peerSettings-oGNRGN1t.css","assets/peerSearchBar-Cxf5ghqE.js","assets/peerSearchBar-5knTmb8D.css","assets/peerJobsAllModal-Dq3mvHTf.js","assets/peerJobsLogsModal-DAi123qW.js","assets/editConfiguration-B5sONI17.js","assets/editConfiguration-C_hKRy6y.css","assets/selectPeers-CmmM9p8c.js","assets/selectPeers-Wjnh8YUZ.css","assets/peerAddModal-gKaLiPyl.js","assets/peerAddModal-s_w1PY7H.css"])))=>i.map(i=>d[i]); +import{r as O,D as G,o as le,H as Y,s as te,p as E,a,c as v,b as e,d as i,A as k,t as y,e as w,K as ie,g as F,_ as z,W as de,G as R,z as J,F as B,h as H,n as D,j as U,L as fe,M as ge,w as T,T as se,f as N,i as P,k as ee,N as L,O as A,E as ve,m as be,v as he,S as _e}from"./index-CgM9eUIs.js";import{_ as ye}from"./protocolBadge-DeLW9wVX.js";import{L as C}from"./localeText-Dh33930I.js";import{C as Se,L as we,B as $e,a as Pe,b as xe,c as Ce,p as ke,d as Oe,e as De,f as Me,P as Le,h as Ae,g as ae}from"./index-z-53TFlU.js";import{d as Re}from"./dayjs.min-B2wceQaW.js";const Ie={class:"row gx-2 gy-2 mb-3"},Ee={class:"col-12"},Te={class:"card rounded-3 bg-transparent",style:{height:"270px"}},Be={class:"card-header bg-transparent border-0"},Ne={class:"text-muted"},Je={class:"card-body pt-1"},Fe={class:"col-sm col-lg-6"},je={class:"card rounded-3 bg-transparent",style:{height:"270px"}},Ve={class:"card-header bg-transparent border-0 d-flex align-items-center"},Ue={class:"text-muted"},Ge={key:0,class:"text-primary fw-bold ms-auto"},ze={class:"card-body pt-1"},Qe={class:"col-sm col-lg-6"},We={class:"card rounded-3 bg-transparent",style:{height:"270px"}},qe={class:"card-header bg-transparent border-0 d-flex align-items-center"},He={class:"text-muted"},Ke={key:0,class:"text-success fw-bold ms-auto"},Ye={class:"card-body pt-1"},Ze={__name:"peerDataUsageCharts",props:{configurationPeers:Array,configurationInfo:Object},setup(o){Se.register(we,$e,Pe,xe,Ce,ke,Oe,De,Me,Le);const t=o,n=O({timestamp:[],data:[]}),r=O({timestamp:[],data:[]}),x=ie(),S=G(),d=O(void 0),b=async()=>{await F("/api/getWireguardConfigurationRealtimeTraffic",{configurationName:x.params.id},g=>{let _=Re().format("hh:mm:ss A");(g.data.sent!==0&&g.data.recv!==0||n.value.data.length>0&&r.value.data.length>0)&&(n.value.timestamp.push(_),n.value.data.push(g.data.sent),r.value.timestamp.push(_),r.value.data.push(g.data.recv))})},m=()=>{clearInterval(d.value),d.value=void 0,t.configurationInfo.Status&&(d.value=setInterval(()=>{b()},parseInt(S.Configuration.Server.dashboard_refresh_interval)))};le(()=>{m()}),Y(()=>t.configurationInfo.Status,()=>{m()}),Y(()=>S.Configuration.Server.dashboard_refresh_interval,()=>{m()}),te(()=>{clearInterval(d.value),d.value=void 0});const p=E(()=>{let g=t.configurationPeers.filter(_=>_.cumu_data+_.total_data>0);return{labels:g.map(_=>_.name?_.name:`Untitled Peer - ${_.id}`),datasets:[{label:"Total Data Usage",data:g.map(_=>_.cumu_data+_.total_data),backgroundColor:g.map(_=>"#ffc107"),tooltip:{callbacks:{label:_=>`${_.formattedValue} GB`}}}]}}),$=E(()=>({labels:[...n.value.timestamp],datasets:[{label:"Data Sent",data:[...n.value.data],fill:!1,borderColor:"#198754",backgroundColor:"#198754",tension:0}]})),M=E(()=>({labels:[...r.value.timestamp],datasets:[{label:"Data Received",data:[...r.value.data],fill:!1,borderColor:"#0d6efd",backgroundColor:"#0d6efd",tension:0}]})),l=E(()=>({responsive:!0,plugins:{legend:{display:!1}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(g,_)=>`${Math.round((g+Number.EPSILON)*1e3)/1e3} GB`},grid:{display:!1}}}})),c=E(()=>({responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:g=>`${g.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!0}},y:{ticks:{callback:(g,_)=>`${Math.round((g+Number.EPSILON)*1e3)/1e3} MB/s`},grid:{display:!0}}}}));return(g,_)=>(a(),v("div",Ie,[e("div",Ee,[e("div",Te,[e("div",Be,[e("small",Ne,[i(C,{t:"Peers Data Usage"})])]),e("div",Je,[i(k(Ae),{data:p.value,options:l.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["data","options"])])])]),e("div",Fe,[e("div",je,[e("div",Ve,[e("small",Ue,[i(C,{t:"Real Time Received Data Usage"})]),r.value.data.length>0?(a(),v("small",Ge,y(r.value.data[r.value.data.length-1])+" MB/s ",1)):w("",!0)]),e("div",ze,[i(k(ae),{options:c.value,data:M.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])]),e("div",Qe,[e("div",We,[e("div",qe,[e("small",He,[i(C,{t:"Real Time Sent Data Usage"})]),n.value.data.length>0?(a(),v("small",Ke,y(n.value.data[n.value.data.length-1])+" MB/s ",1)):w("",!0)]),e("div",Ye,[i(k(ae),{options:c.value,data:$.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])])]))}},Xe={name:"peerSearch",components:{LocaleText:C},setup(){const o=G(),t=de();return{store:o,wireguardConfigurationStore:t}},props:{configuration:Object},data(){return{sort:{status:R("Status"),name:R("Name"),allowed_ip:R("Allowed IPs"),restricted:R("Restricted")},interval:{5e3:R("5 Seconds"),1e4:R("10 Seconds"),3e4:R("30 Seconds"),6e4:R("1 Minutes")},display:{grid:R("Grid"),list:R("List")},searchString:"",searchStringTimeout:void 0,showDisplaySettings:!1,showMoreSettings:!1}},methods:{debounce(){this.searchStringTimeout?(clearTimeout(this.searchStringTimeout),this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)):this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)},updateSort(o){J("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_sort",value:o},t=>{t.status&&this.store.getConfiguration()})},updateRefreshInterval(o){J("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_refresh_interval",value:o},t=>{t.status&&this.store.getConfiguration()})},updateDisplay(o){J("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_peer_list_display",value:o},t=>{t.status&&this.store.getConfiguration()})},downloadAllPeer(){F(`/api/downloadAllPeers/${this.configuration.Name}`,{},o=>{o.data.forEach(t=>{t.fileName=t.fileName+".conf"}),window.wireguard.generateZipFiles(o,this.configuration.Name)})}}},et={class:"d-flex flex-column gap-2 my-4"},tt={class:"d-flex gap-2 peerSearchContainer"},st={class:"dropdown"},ot={"data-bs-toggle":"dropdown",class:"btn w-100 btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},nt={class:"badge text-bg-primary ms-2"},at={class:"dropdown-menu rounded-3"},rt=["onClick"],lt={class:"ms-auto"},it={key:0,class:"bi bi-check-circle-fill"},dt={class:"dropdown"},ut={"data-bs-toggle":"dropdown",class:"btn btn-sm w-100 text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},ct={class:"badge text-bg-primary ms-2"},mt={class:"dropdown-menu rounded-3"},pt=["onClick"],ft={class:"ms-auto"},gt={key:0,class:"bi bi-check-circle-fill"},vt={class:"dropdown"},bt={"data-bs-toggle":"dropdown",class:"btn btn-sm w-100 text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},ht={class:"badge text-bg-primary ms-2"},_t={class:"dropdown-menu rounded-3"},yt=["onClick"],St={class:"ms-auto"},wt={key:0,class:"bi bi-check-circle-fill"};function $t(o,t,n,r,x,S){const d=U("LocaleText");return a(),v("div",et,[e("div",tt,[e("div",st,[e("button",ot,[t[4]||(t[4]=e("i",{class:"bi bi-sort-up me-2"},null,-1)),i(d,{t:"Sort By"}),e("span",nt,y(this.sort[r.store.Configuration.Server.dashboard_sort]),1)]),e("ul",at,[(a(!0),v(B,null,H(this.sort,(b,m)=>(a(),v("li",null,[e("button",{class:"dropdown-item d-flex align-items-center",onClick:p=>this.updateSort(m)},[e("small",null,y(b),1),e("small",lt,[r.store.Configuration.Server.dashboard_sort===m?(a(),v("i",it)):w("",!0)])],8,rt)]))),256))])]),e("div",dt,[e("button",ut,[t[5]||(t[5]=e("i",{class:"bi bi-arrow-repeat me-2"},null,-1)),i(d,{t:"Refresh Interval"}),e("span",ct,y(this.interval[r.store.Configuration.Server.dashboard_refresh_interval]),1)]),e("ul",mt,[(a(!0),v(B,null,H(this.interval,(b,m)=>(a(),v("li",null,[e("button",{class:"dropdown-item d-flex align-items-center",onClick:p=>this.updateRefreshInterval(m)},[e("small",null,y(b),1),e("small",ft,[r.store.Configuration.Server.dashboard_refresh_interval===m?(a(),v("i",gt)):w("",!0)])],8,pt)]))),256))])]),e("div",vt,[e("button",bt,[e("i",{class:D(["bi me-2","bi-"+r.store.Configuration.Server.dashboard_peer_list_display])},null,2),i(d,{t:"Display"}),e("span",ht,y(this.display[r.store.Configuration.Server.dashboard_peer_list_display]),1)]),e("ul",_t,[(a(!0),v(B,null,H(this.display,(b,m)=>(a(),v("li",null,[e("button",{class:"dropdown-item d-flex align-items-center",onClick:p=>this.updateDisplay(m)},[e("small",null,y(b),1),e("small",St,[r.store.Configuration.Server.dashboard_peer_list_display===m?(a(),v("i",wt)):w("",!0)])],8,yt)]))),256))])]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle ms-lg-auto",onClick:t[0]||(t[0]=b=>this.$emit("search"))},[t[6]||(t[6]=e("i",{class:"bi bi-search me-2"},null,-1)),i(d,{t:"Search"})]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[1]||(t[1]=b=>this.downloadAllPeer())},[t[7]||(t[7]=e("i",{class:"bi bi-download me-2 me-lg-0 me-xl-2"},null,-1)),i(d,{t:"Download All",class:"d-sm-block d-lg-none d-xl-block"})]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[2]||(t[2]=b=>this.$emit("selectPeers"))},[t[8]||(t[8]=e("i",{class:"bi bi-check2-all me-2 me-lg-0 me-xl-2"},null,-1)),i(d,{t:"Select Peers",class:"d-sm-block d-lg-none d-xl-block"})]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[3]||(t[3]=b=>this.$emit("jobsAll")),type:"button","aria-expanded":"false"},[t[9]||(t[9]=e("i",{class:"bi bi-person-walking me-2 me-lg-0 me-xl-2"},null,-1)),i(d,{t:"Active Jobs",class:"d-sm-block d-lg-none d-xl-block"})])])])}const Pt=z(Xe,[["render",$t],["__scopeId","data-v-c96b078a"]]);function xt(o){return fe()?(ge(o),!0):!1}function ue(o){return typeof o=="function"?o():k(o)}const ce=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ct=Object.prototype.toString,kt=o=>Ct.call(o)==="[object Object]",K=()=>{},Ot=Dt();function Dt(){var o,t;return ce&&((o=window?.navigator)==null?void 0:o.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window?.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function V(o){var t;const n=ue(o);return(t=n?.$el)!=null?t:n}const me=ce?window:void 0;function X(...o){let t,n,r,x;if(typeof o[0]=="string"||Array.isArray(o[0])?([n,r,x]=o,t=me):[t,n,r,x]=o,!t)return K;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const S=[],d=()=>{S.forEach($=>$()),S.length=0},b=($,M,l,c)=>($.addEventListener(M,l,c),()=>$.removeEventListener(M,l,c)),m=Y(()=>[V(t),ue(x)],([$,M])=>{if(d(),!$)return;const l=kt(M)?{...M}:M;S.push(...n.flatMap(c=>r.map(g=>b($,c,g,l))))},{immediate:!0,flush:"post"}),p=()=>{m(),d()};return xt(p),p}let re=!1;function Mt(o,t,n={}){const{window:r=me,ignore:x=[],capture:S=!0,detectIframe:d=!1}=n;if(!r)return K;Ot&&!re&&(re=!0,Array.from(r.document.body.children).forEach(l=>l.addEventListener("click",K)),r.document.documentElement.addEventListener("click",K));let b=!0;const m=l=>x.some(c=>{if(typeof c=="string")return Array.from(r.document.querySelectorAll(c)).some(g=>g===l.target||l.composedPath().includes(g));{const g=V(c);return g&&(l.target===g||l.composedPath().includes(g))}}),$=[X(r,"click",l=>{const c=V(o);if(!(!c||c===l.target||l.composedPath().includes(c))){if(l.detail===0&&(b=!m(l)),!b){b=!0;return}t(l)}},{passive:!0,capture:S}),X(r,"pointerdown",l=>{const c=V(o);b=!m(l)&&!!(c&&!l.composedPath().includes(c))},{passive:!0}),d&&X(r,"blur",l=>{setTimeout(()=>{var c;const g=V(o);((c=r.document.activeElement)==null?void 0:c.tagName)==="IFRAME"&&!g?.contains(r.document.activeElement)&&t(l)},0)})].filter(Boolean);return()=>$.forEach(l=>l())}const Lt={key:0,class:"position-absolute d-block p-1 px-2 bg-body text-body rounded-3 border shadow"},At={__name:"peerSettingsDropdownTool",props:{icon:String,title:String},emits:["click"],setup(o,{emit:t}){const n=t,r=O(!1);return(x,S)=>(a(),v("a",{class:"dropdown-item text-center px-0 rounded-3 position-relative",role:"button",onMouseenter:S[0]||(S[0]=d=>r.value=!0),onMouseleave:S[1]||(S[1]=d=>r.value=!1),onClick:S[2]||(S[2]=d=>n("click"))},[e("i",{class:D(["me-auto bi",o.icon])},null,2),i(se,{name:"zoomReversed"},{default:T(()=>[r.value?(a(),v("span",Lt,[e("small",null,y(o.title),1)])):w("",!0)]),_:1})],32))}},Rt=z(At,[["__scopeId","data-v-2d66aeb6"]]),It={name:"peerSettingsDropdown",components:{PeerSettingsDropdownTool:Rt,LocaleText:C},setup(){return{dashboardStore:G()}},props:{Peer:Object},data(){return{deleteBtnDisabled:!1,restrictBtnDisabled:!1,allowAccessBtnDisabled:!1,confirmDelete:!1}},methods:{downloadPeer(){F("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},o=>{if(o.status){const t=new Blob([o.data.file],{type:"text/plain"}),n=URL.createObjectURL(t),r=`${o.data.fileName}.conf`,x=document.createElement("a");x.href=n,x.download=r,x.click(),this.dashboardStore.newMessage("WGDashboard","Peer download started","success")}else this.dashboardStore.newMessage("Server",o.message,"danger")})},downloadQRCode(o){F("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{t.status?this.$emit(o,t.data.file):this.dashboardStore.newMessage("Server",t.message,"danger")})},deletePeer(){this.deleteBtnDisabled=!0,J(`/api/deletePeers/${this.$route.params.id}`,{peers:[this.Peer.id]},o=>{this.dashboardStore.newMessage("Server",o.message,o.status?"success":"danger"),this.$emit("refresh"),this.deleteBtnDisabled=!1})},restrictPeer(){this.restrictBtnDisabled=!0,J(`/api/restrictPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},o=>{this.dashboardStore.newMessage("Server",o.message,o.status?"success":"danger"),this.$emit("refresh"),this.restrictBtnDisabled=!1})},allowAccessPeer(){this.allowAccessBtnDisabled=!0,J(`/api/allowAccessPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},o=>{this.dashboardStore.newMessage("Server",o.message,o.status?"success":"danger"),this.$emit("refresh"),this.allowAccessBtnDisabled=!1})}}},Et={class:"dropdown-menu mt-2 shadow-lg d-block rounded-3",style:{"max-width":"200px"}},Tt={style:{"font-size":"0.8rem","padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Bt={class:"text-body d-flex"},Nt={class:"ms-auto"},Jt={key:1},Ft={class:"w-100 dropdown-item text-muted",style:{"white-space":"break-spaces","font-size":"0.7rem"}},jt={key:2},Vt={class:"d-flex",style:{"padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Ut={key:1,class:"confirmDelete"},Gt={style:{"white-space":"break-spaces"},class:"mb-2 d-block fw-bold"},zt={class:"d-flex w-100 gap-2"},Qt=["disabled"],Wt=["disabled"],qt={key:1};function Ht(o,t,n,r,x,S){const d=U("LocaleText"),b=U("PeerSettingsDropdownTool");return a(),v("ul",Et,[this.Peer.restricted?(a(),v("li",qt,[e("a",{class:D(["dropdown-item d-flex text-warning",{disabled:this.allowAccessBtnDisabled}]),onClick:t[10]||(t[10]=m=>this.allowAccessPeer()),role:"button"},[t[22]||(t[22]=e("i",{class:"me-auto bi bi-unlock"},null,-1)),this.allowAccessBtnDisabled?(a(),P(d,{key:1,t:"Allowing Access..."})):(a(),P(d,{key:0,t:"Allow Access"}))],2)])):(a(),v(B,{key:0},[this.confirmDelete?(a(),v("li",Ut,[e("p",Gt,[i(d,{t:"Are you sure to delete this peer?"})]),e("div",zt,[e("button",{onClick:t[8]||(t[8]=m=>this.deletePeer()),disabled:this.deleteBtnDisabled,class:"flex-grow-1 ms-auto btn btn-sm bg-danger"},[i(d,{t:"Yes"})],8,Qt),e("button",{disabled:this.deleteBtnDisabled,onClick:t[9]||(t[9]=m=>this.confirmDelete=!1),class:"flex-grow-1 btn btn-sm bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle"},[i(d,{t:"No"})],8,Wt)])])):(a(),v(B,{key:0},[this.Peer.status==="running"?(a(),v(B,{key:0},[e("li",Tt,[e("span",Bt,[t[11]||(t[11]=e("i",{class:"bi bi-box-arrow-in-right"},null,-1)),e("span",Nt,y(this.Peer.endpoint),1)])]),t[12]||(t[12]=e("li",null,[e("hr",{class:"dropdown-divider"})],-1))],64)):w("",!0),this.Peer.private_key?(a(),v("li",jt,[t[13]||(t[13]=e("div",{class:"text-center text-muted"},null,-1)),e("div",Vt,[i(b,{icon:"bi-download",title:"Download",onClick:t[0]||(t[0]=m=>this.downloadPeer())}),i(b,{icon:"bi-qr-code",title:"QR Code",onClick:t[1]||(t[1]=m=>this.$emit("qrcode"))}),i(b,{icon:"bi-body-text",title:"Configuration File",onClick:t[2]||(t[2]=m=>this.$emit("configurationFile"))}),i(b,{icon:"bi-share",title:"Share",onClick:t[3]||(t[3]=m=>this.$emit("share"))})])])):(a(),v("li",Jt,[e("small",Ft,[i(d,{t:"Download & QR Code is not available due to no private key set for this peer"})])])),t[20]||(t[20]=e("li",null,[e("hr",{class:"dropdown-divider"})],-1)),e("li",null,[e("a",{class:"dropdown-item d-flex",role:"button",onClick:t[4]||(t[4]=m=>this.$emit("setting"))},[t[14]||(t[14]=e("i",{class:"me-auto bi bi-pen"},null,-1)),t[15]||(t[15]=N()),i(d,{t:"Peer Settings"})])]),e("li",null,[e("a",{class:"dropdown-item d-flex",role:"button",onClick:t[5]||(t[5]=m=>this.$emit("jobs"))},[t[16]||(t[16]=e("i",{class:"me-auto bi bi-app-indicator"},null,-1)),t[17]||(t[17]=N()),i(d,{t:"Schedule Jobs"})])]),t[21]||(t[21]=e("li",null,[e("hr",{class:"dropdown-divider"})],-1)),e("li",null,[e("a",{class:D(["dropdown-item d-flex text-warning",{disabled:this.restrictBtnDisabled}]),onClick:t[6]||(t[6]=m=>this.restrictPeer()),role:"button"},[t[18]||(t[18]=e("i",{class:"me-auto bi bi-lock"},null,-1)),this.restrictBtnDisabled?(a(),P(d,{key:1,t:"Restricting..."})):(a(),P(d,{key:0,t:"Restrict Access"}))],2)]),e("li",null,[e("a",{class:D(["dropdown-item d-flex fw-bold text-danger",{disabled:this.deleteBtnDisabled}]),onClick:t[7]||(t[7]=m=>this.confirmDelete=!0),role:"button"},[t[19]||(t[19]=e("i",{class:"me-auto bi bi-trash"},null,-1)),this.deleteBtnDisabled?(a(),P(d,{key:1,t:"Deleting..."})):(a(),P(d,{key:0,t:"Delete"}))],2)])],64))],64))])}const Kt=z(It,[["render",Ht],["__scopeId","data-v-d46268aa"]]),Yt={name:"peer",components:{LocaleText:C,PeerSettingsDropdown:Kt},props:{Peer:Object},data(){return{}},setup(){const o=O(null),t=O(!1),n=G();return Mt(o,r=>{t.value=!1}),{target:o,subMenuOpened:t,dashboardStore:n}},computed:{getLatestHandshake(){return this.Peer.latest_handshake.includes(",")?this.Peer.latest_handshake.split(",")[0]:this.Peer.latest_handshake}}},Zt={key:0,class:"card-header bg-transparent d-flex align-items-center gap-2 border-0"},Xt={key:0,style:{"font-size":"0.8rem",color:"#28a745"},class:"d-flex align-items-center"},es={style:{"font-size":"0.8rem"},class:"ms-auto d-flex gap-2"},ts={class:"text-primary"},ss={class:"text-success"},os={key:0,class:"text-secondary"},ns={key:1,class:"border-0 card-header bg-transparent text-warning fw-bold",style:{"font-size":"0.8rem"}},as={class:"card-body pt-1",style:{"font-size":"0.9rem"}},rs={class:"text-muted"},ls={class:"d-block"},is={class:"text-muted"},ds={class:"d-block"},us={class:"text-muted"},cs={class:"d-block"},ms={class:"d-flex align-items-end ms-auto"};function ps(o,t,n,r,x,S){const d=U("LocaleText"),b=U("PeerSettingsDropdown");return a(),v("div",{class:D(["card shadow-sm rounded-3 peerCard",{"border-warning":n.Peer.restricted}])},[e("div",null,[n.Peer.restricted?(a(),v("div",ns,[t[13]||(t[13]=e("i",{class:"bi-lock-fill me-2"},null,-1)),i(d,{t:"Access Restricted"})])):(a(),v("div",Zt,[e("div",{class:D(["dot ms-0",{active:n.Peer.status==="running"}])},null,2),r.dashboardStore.Configuration.Server.dashboard_peer_list_display==="list"&&n.Peer.status==="running"?(a(),v("div",Xt,[t[7]||(t[7]=e("i",{class:"bi bi-box-arrow-in-right me-2"},null,-1)),e("span",null,y(n.Peer.endpoint),1)])):w("",!0),e("div",es,[e("span",ts,[t[8]||(t[8]=e("i",{class:"bi bi-arrow-down"},null,-1)),e("strong",null,y((n.Peer.cumu_receive+n.Peer.total_receive).toFixed(4)),1),t[9]||(t[9]=N(" GB "))]),e("span",ss,[t[10]||(t[10]=e("i",{class:"bi bi-arrow-up"},null,-1)),e("strong",null,y((n.Peer.cumu_sent+n.Peer.total_sent).toFixed(4)),1),t[11]||(t[11]=N(" GB "))]),n.Peer.latest_handshake!=="No Handshake"?(a(),v("span",os,[t[12]||(t[12]=e("i",{class:"bi bi-arrows-angle-contract"},null,-1)),N(" "+y(S.getLatestHandshake)+" ago ",1)])):w("",!0)])]))]),e("div",as,[e("h6",null,y(n.Peer.name?n.Peer.name:"Untitled Peer"),1),e("div",{class:D(["d-flex",[r.dashboardStore.Configuration.Server.dashboard_peer_list_display==="grid"?"gap-1 flex-column":"flex-row gap-3"]])},[e("div",{class:D({"d-flex gap-2 align-items-center":r.dashboardStore.Configuration.Server.dashboard_peer_list_display==="list"})},[e("small",rs,[i(d,{t:"Public Key"})]),e("small",ls,[e("samp",null,y(n.Peer.id),1)])],2),e("div",{class:D({"d-flex gap-2 align-items-center":r.dashboardStore.Configuration.Server.dashboard_peer_list_display==="list"})},[e("small",is,[i(d,{t:"Allowed IPs"})]),e("small",ds,[e("samp",null,y(n.Peer.allowed_ip),1)])],2),n.Peer.advanced_security?(a(),v("div",{key:0,class:D({"d-flex gap-2 align-items-center":r.dashboardStore.Configuration.Server.dashboard_peer_list_display==="list"})},[e("small",us,[i(d,{t:"Advanced Security"})]),e("small",cs,[e("samp",null,y(n.Peer.advanced_security),1)])],2)):w("",!0),e("div",ms,[e("div",{class:D(["ms-auto px-2 rounded-3 subMenuBtn",{active:this.subMenuOpened}])},[e("a",{role:"button",class:"text-body",onClick:t[0]||(t[0]=m=>this.subMenuOpened=!0)},t[14]||(t[14]=[e("h5",{class:"mb-0"},[e("i",{class:"bi bi-three-dots"})],-1)])),i(se,{name:"slide-fade"},{default:T(()=>[this.subMenuOpened?(a(),P(b,{key:0,onQrcode:t[1]||(t[1]=m=>this.$emit("qrcode")),onConfigurationFile:t[2]||(t[2]=m=>this.$emit("configurationFile")),onSetting:t[3]||(t[3]=m=>this.$emit("setting")),onJobs:t[4]||(t[4]=m=>this.$emit("jobs")),onRefresh:t[5]||(t[5]=m=>this.$emit("refresh")),onShare:t[6]||(t[6]=m=>this.$emit("share")),Peer:n.Peer,ref:"target"},null,8,["Peer"])):w("",!0)]),_:1})],2)])],2)])],2)}const fs=z(Yt,[["render",ps],["__scopeId","data-v-da99e0f2"]]),gs={__name:"peerListModals",props:{configurationModals:Object,configurationModalSelectedPeer:Object},emits:["refresh"],setup(o,{emit:t}){const n=t,r=L(()=>A(()=>import("./peerShareLinkModal-C_6aIgZ8.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),x=L(()=>A(()=>import("./peerJobs-CQfx4Mi7.js"),__vite__mapDeps([7,8,1,2,4,3,5,9,10]))),S=L(()=>A(()=>import("./peerQRCode-DALw201D.js"),__vite__mapDeps([11,12,5,1,2]))),d=L(()=>A(()=>import("./peerConfigurationFile-eAJKSkem.js"),__vite__mapDeps([13,1,2,5,12,14]))),b=L(()=>A(()=>import("./peerSettings-HqeEL_Gm.js"),__vite__mapDeps([15,1,2,5,16])));return(m,p)=>(a(),P(ee,{name:"zoom"},{default:T(()=>[o.configurationModals.peerSetting.modalOpen?(a(),P(k(b),{key:"PeerSettingsModal",selectedPeer:o.configurationModalSelectedPeer,onRefresh:p[0]||(p[0]=$=>n("refresh")),onClose:p[1]||(p[1]=$=>o.configurationModals.peerSetting.modalOpen=!1)},null,8,["selectedPeer"])):w("",!0),o.configurationModals.peerQRCode.modalOpen?(a(),P(k(S),{key:"PeerQRCodeModal",selectedPeer:o.configurationModalSelectedPeer,onClose:p[2]||(p[2]=$=>o.configurationModals.peerQRCode.modalOpen=!1)},null,8,["selectedPeer"])):w("",!0),o.configurationModals.peerScheduleJobs.modalOpen?(a(),P(k(x),{key:"PeerJobsModal",onRefresh:p[3]||(p[3]=$=>n("refresh")),selectedPeer:o.configurationModalSelectedPeer,onClose:p[4]||(p[4]=$=>o.configurationModals.peerScheduleJobs.modalOpen=!1)},null,8,["selectedPeer"])):w("",!0),o.configurationModals.peerShare.modalOpen?(a(),P(k(r),{key:"PeerShareLinkModal",onClose:p[5]||(p[5]=$=>{o.configurationModals.peerShare.modalOpen=!1}),selectedPeer:o.configurationModalSelectedPeer},null,8,["selectedPeer"])):w("",!0),o.configurationModals.peerConfigurationFile.modalOpen?(a(),P(k(d),{key:4,onClose:p[6]||(p[6]=$=>o.configurationModals.peerConfigurationFile.modalOpen=!1),selectedPeer:o.configurationModalSelectedPeer},null,8,["selectedPeer"])):w("",!0)]),_:1}))}},vs={style:{"margin-bottom":"20px",height:"1px"},id:"loadMore"},bs={__name:"peerIntersectionObserver",props:["peerListLength","showPeersCount"],emits:["loadMore"],setup(o,{emit:t}){const n=O(void 0),r=t;return le(()=>{n.value=new IntersectionObserver(x=>{x.forEach(S=>{S.isIntersecting&&r("loadMore")})},{rootMargin:"20px",threshold:1}),n.value.observe(document.querySelector("#loadMore"))}),te(()=>{n.value.disconnect()}),(x,S)=>(a(),v("div",vs))}},hs={class:"container-fluid"},_s={class:"d-flex align-items-sm-center flex-column flex-sm-row gap-3"},ys={class:"text-muted d-flex align-items-center gap-2"},Ss={class:"mb-0"},ws={class:"d-flex align-items-center gap-3"},$s={class:"mb-0 display-4"},Ps={class:"ms-sm-auto d-flex gap-2 flex-column"},xs={class:"card rounded-3 bg-transparent"},Cs={class:"card-body py-2 d-flex align-items-center"},ks={class:"text-muted"},Os={class:"form-check form-switch mb-0 ms-auto pe-0 me-0"},Ds=["for"],Ms={key:2,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},Ls=["disabled","id"],As={class:"d-flex gap-2"},Rs={class:"row mt-3 gy-2 gx-2 mb-2"},Is={class:"col-12 col-lg-3"},Es={class:"card rounded-3 bg-transparent h-100"},Ts={class:"card-body py-2 d-flex flex-column justify-content-center"},Bs={class:"mb-0 text-muted"},Ns={class:"col-12 col-lg-3"},Js={class:"card rounded-3 bg-transparent h-100"},Fs={class:"card-body py-2 d-flex flex-column justify-content-center"},js={class:"mb-0 text-muted"},Vs={style:{"word-break":"break-all"},class:"col-12 col-lg-6"},Us={class:"card rounded-3 bg-transparent h-100"},Gs={class:"card-body py-2 d-flex flex-column justify-content-center"},zs={class:"mb-0 text-muted"},Qs={class:"row gx-2 gy-2 mb-2"},Ws={class:"col-12 col-lg-3"},qs={class:"card rounded-3 bg-transparent h-100"},Hs={class:"card-body d-flex"},Ks={class:"mb-0 text-muted"},Ys={class:"h4"},Zs={class:"col-12 col-lg-3"},Xs={class:"card rounded-3 bg-transparent h-100"},eo={class:"card-body d-flex"},to={class:"mb-0 text-muted"},so={class:"h4"},oo={class:"col-12 col-lg-3"},no={class:"card rounded-3 bg-transparent h-100"},ao={class:"card-body d-flex"},ro={class:"mb-0 text-muted"},lo={class:"h4 text-primary"},io={class:"col-12 col-lg-3"},uo={class:"card rounded-3 bg-transparent h-100"},co={class:"card-body d-flex"},mo={class:"mb-0 text-muted"},po={class:"h4 text-success"},fo={style:{"margin-bottom":"80px"}},go=20,vo={__name:"peerList",async setup(o){let t,n;const r=L(()=>A(()=>import("./peerSearchBar-Cxf5ghqE.js"),__vite__mapDeps([17,1,2,5,18]))),x=L(()=>A(()=>import("./peerJobsAllModal-Dq3mvHTf.js"),__vite__mapDeps([19,8,1,2,4,3,5,9]))),S=L(()=>A(()=>import("./peerJobsLogsModal-DAi123qW.js"),__vite__mapDeps([20,3,1,2,5]))),d=L(()=>A(()=>import("./editConfiguration-B5sONI17.js"),__vite__mapDeps([21,1,2,5,3,22]))),b=L(()=>A(()=>import("./selectPeers-CmmM9p8c.js"),__vite__mapDeps([23,1,2,5,24]))),m=L(()=>A(()=>import("./peerAddModal-gKaLiPyl.js"),__vite__mapDeps([25,1,2,5,26]))),p=G(),$=de(),M=ie(),l=O({}),c=O([]),g=O(!1),_=O({}),h=O({peerNew:{modalOpen:!1},peerSetting:{modalOpen:!1},peerScheduleJobs:{modalOpen:!1},peerQRCode:{modalOpen:!1},peerConfigurationFile:{modalOpen:!1},peerCreate:{modalOpen:!1},peerScheduleJobsAll:{modalOpen:!1},peerScheduleJobsLogs:{modalOpen:!1},peerShare:{modalOpen:!1},editConfiguration:{modalOpen:!1},selectPeers:{modalOpen:!1},backupRestore:{modalOpen:!1},deleteConfiguration:{modalOpen:!1},editRawConfigurationFile:{modalOpen:!1}}),Z=O(!1),I=async()=>{await F("/api/getWireguardConfigurationInfo",{configurationName:M.params.id},f=>{f.status&&(l.value=f.data.configurationInfo,c.value=f.data.configurationPeers,c.value.forEach(s=>{s.restricted=!1}),f.data.configurationRestrictedPeers.forEach(s=>{s.restricted=!0,c.value.push(s)}))})};[t,n]=ve(()=>I()),await t,n();const Q=O(void 0),oe=()=>{clearInterval(Q.value),Q.value=setInterval(async()=>{await I()},parseInt(p.Configuration.Server.dashboard_refresh_interval))};oe(),te(()=>{clearInterval(Q.value),Q.value=void 0}),Y(()=>p.Configuration.Server.dashboard_refresh_interval,()=>{oe()});const pe=async()=>{g.value=!0,await F("/api/toggleWireguardConfiguration/",{configurationName:l.value.Name},f=>{f.status?p.newMessage("Server",`${l.value.Name} ${f.data?"is on":"is off"}`,"success"):p.newMessage("Server",f.message,"danger"),$.Configurations.find(s=>s.Name===l.value.Name).Status=f.data,l.value.Status=f.data,g.value=!1})},W=E(()=>({connectedPeers:c.value.filter(f=>f.status==="running").length,totalUsage:c.value.length>0?c.value.filter(f=>!f.restricted).map(f=>f.total_data+f.cumu_data).reduce((f,s)=>f+s,0).toFixed(4):0,totalReceive:c.value.length>0?c.value.filter(f=>!f.restricted).map(f=>f.total_receive+f.cumu_receive).reduce((f,s)=>f+s,0).toFixed(4):0,totalSent:c.value.length>0?c.value.filter(f=>!f.restricted).map(f=>f.total_sent+f.cumu_sent).reduce((f,s)=>f+s,0).toFixed(4):0})),q=O(10),ne=E(()=>{const f=$.searchString?c.value.filter(s=>s.name.includes($.searchString)||s.id.includes($.searchString)||s.allowed_ip.includes($.searchString)):c.value;return p.Configuration.Server.dashboard_sort==="restricted"?f.sort((s,u)=>s[p.Configuration.Server.dashboard_sort]u[p.Configuration.Server.dashboard_sort]?-1:0).slice(0,q.value):f.sort((s,u)=>s[p.Configuration.Server.dashboard_sort]u[p.Configuration.Server.dashboard_sort]?1:0).slice(0,q.value)});return(f,s)=>(a(),v("div",hs,[e("div",_s,[e("div",null,[e("div",ys,[e("h5",Ss,[i(ye,{protocol:l.value.Protocol},null,8,["protocol"])])]),e("div",ws,[e("h1",$s,[e("samp",null,y(l.value.Name),1)])])]),e("div",Ps,[e("div",xs,[e("div",Cs,[e("small",ks,[i(C,{t:"Status"})]),e("div",{class:D(["dot ms-2",{active:l.value.Status}])},null,2),e("div",Os,[e("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+l.value.id},[l.value.Status&&!g.value?(a(),P(C,{key:0,t:"On"})):!l.value.Status&&!g.value?(a(),P(C,{key:1,t:"Off"})):w("",!0),g.value?(a(),v("span",Ms)):w("",!0)],8,Ds),be(e("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:g.value,type:"checkbox",role:"switch",id:"switch"+l.value.id,onChange:s[0]||(s[0]=u=>pe()),"onUpdate:modelValue":s[1]||(s[1]=u=>l.value.Status=u)},null,40,Ls),[[he,l.value.Status]])])])]),e("div",As,[e("a",{role:"button",onClick:s[2]||(s[2]=u=>h.value.peerNew.modalOpen=!0),class:"titleBtn py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle"},[s[29]||(s[29]=e("i",{class:"bi bi-plus-circle me-2"},null,-1)),i(C,{t:"Peer"})]),e("button",{class:"titleBtn py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:s[3]||(s[3]=u=>h.value.editConfiguration.modalOpen=!0),type:"button","aria-expanded":"false"},[s[30]||(s[30]=e("i",{class:"bi bi-gear-fill me-2"},null,-1)),i(C,{t:"Configuration Settings"})])])])]),s[35]||(s[35]=e("hr",null,null,-1)),e("div",Rs,[e("div",Is,[e("div",Es,[e("div",Ts,[e("p",Bs,[e("small",null,[i(C,{t:"Address"})])]),N(" "+y(l.value.Address),1)])])]),e("div",Ns,[e("div",Js,[e("div",Fs,[e("p",js,[e("small",null,[i(C,{t:"Listen Port"})])]),N(" "+y(l.value.ListenPort),1)])])]),e("div",Vs,[e("div",Us,[e("div",Gs,[e("p",zs,[e("small",null,[i(C,{t:"Public Key"})])]),e("samp",null,y(l.value.PublicKey),1)])])])]),e("div",Qs,[e("div",Ws,[e("div",qs,[e("div",Hs,[e("div",null,[e("p",Ks,[e("small",null,[i(C,{t:"Connected Peers"})])]),e("strong",Ys,y(W.value.connectedPeers)+" / "+y(c.value.length),1)]),s[31]||(s[31]=e("i",{class:"bi bi-ethernet ms-auto h2 text-muted"},null,-1))])])]),e("div",Zs,[e("div",Xs,[e("div",eo,[e("div",null,[e("p",to,[e("small",null,[i(C,{t:"Total Usage"})])]),e("strong",so,y(W.value.totalUsage)+" GB",1)]),s[32]||(s[32]=e("i",{class:"bi bi-arrow-down-up ms-auto h2 text-muted"},null,-1))])])]),e("div",oo,[e("div",no,[e("div",ao,[e("div",null,[e("p",ro,[e("small",null,[i(C,{t:"Total Received"})])]),e("strong",lo,y(W.value.totalReceive)+" GB",1)]),s[33]||(s[33]=e("i",{class:"bi bi-arrow-down ms-auto h2 text-muted"},null,-1))])])]),e("div",io,[e("div",uo,[e("div",co,[e("div",null,[e("p",mo,[e("small",null,[i(C,{t:"Total Sent"})])]),e("strong",po,y(W.value.totalSent)+" GB",1)]),s[34]||(s[34]=e("i",{class:"bi bi-arrow-up ms-auto h2 text-muted"},null,-1))])])])]),i(Ze,{configurationPeers:c.value,configurationInfo:l.value},null,8,["configurationPeers","configurationInfo"]),s[36]||(s[36]=e("hr",null,null,-1)),e("div",fo,[c.value.length>0?(a(),P(Pt,{key:0,onSearch:s[4]||(s[4]=u=>Z.value=!0),onJobsAll:s[5]||(s[5]=u=>h.value.peerScheduleJobsAll.modalOpen=!0),onJobLogs:s[6]||(s[6]=u=>h.value.peerScheduleJobsLogs.modalOpen=!0),onEditConfiguration:s[7]||(s[7]=u=>h.value.editConfiguration.modalOpen=!0),onSelectPeers:s[8]||(s[8]=u=>h.value.selectPeers.modalOpen=!0),onBackupRestore:s[9]||(s[9]=u=>h.value.backupRestore.modalOpen=!0),onDeleteConfiguration:s[10]||(s[10]=u=>h.value.deleteConfiguration.modalOpen=!0),configuration:l.value},null,8,["configuration"])):w("",!0),i(ee,{name:"peerList",tag:"div",class:"row gx-2 gy-2 z-0 position-relative"},{default:T(()=>[(a(!0),v(B,null,H(ne.value,u=>(a(),v("div",{class:D(["col-12",{"col-lg-6 col-xl-4":k(p).Configuration.Server.dashboard_peer_list_display==="grid"}]),key:u.id},[i(fs,{Peer:u,onShare:j=>{h.value.peerShare.modalOpen=!0,_.value=u},onRefresh:s[11]||(s[11]=j=>I()),onJobs:j=>{h.value.peerScheduleJobs.modalOpen=!0,_.value=u},onSetting:j=>{h.value.peerSetting.modalOpen=!0,_.value=u},onQrcode:j=>{_.value=u,h.value.peerQRCode.modalOpen=!0},onConfigurationFile:j=>{_.value=u,h.value.peerConfigurationFile.modalOpen=!0}},null,8,["Peer","onShare","onJobs","onSetting","onQrcode","onConfigurationFile"])],2))),128))]),_:1})]),i(se,{name:"slideUp"},{default:T(()=>[Z.value?(a(),P(k(r),{key:0,onClose:s[12]||(s[12]=u=>Z.value=!1)})):w("",!0)]),_:1}),i(gs,{configurationModals:h.value,configurationModalSelectedPeer:_.value,onRefresh:s[13]||(s[13]=u=>I())},null,8,["configurationModals","configurationModalSelectedPeer"]),i(ee,{name:"zoom"},{default:T(()=>[(a(),P(_e,{key:"PeerAddModal"},{default:T(()=>[h.value.peerNew.modalOpen?(a(),P(k(m),{key:0,onClose:s[14]||(s[14]=u=>h.value.peerNew.modalOpen=!1),onAddedPeers:s[15]||(s[15]=u=>{h.value.peerNew.modalOpen=!1,I()})})):w("",!0)]),_:1})),h.value.peerScheduleJobsAll.modalOpen?(a(),P(k(x),{key:"PeerJobsAllModal",onRefresh:s[16]||(s[16]=u=>I()),onAllLogs:s[17]||(s[17]=u=>h.value.peerScheduleJobsLogs.modalOpen=!0),onClose:s[18]||(s[18]=u=>h.value.peerScheduleJobsAll.modalOpen=!1),configurationPeers:c.value},null,8,["configurationPeers"])):w("",!0),h.value.peerScheduleJobsLogs.modalOpen?(a(),P(k(S),{key:"PeerJobsLogsModal",onClose:s[19]||(s[19]=u=>h.value.peerScheduleJobsLogs.modalOpen=!1),configurationInfo:l.value},null,8,["configurationInfo"])):w("",!0),h.value.editConfiguration.modalOpen?(a(),P(k(d),{key:"EditConfigurationModal",onEditRaw:s[20]||(s[20]=u=>h.value.editRawConfigurationFile.modalOpen=!0),onClose:s[21]||(s[21]=u=>h.value.editConfiguration.modalOpen=!1),onDataChanged:s[22]||(s[22]=u=>l.value=u),onRefresh:s[23]||(s[23]=u=>I()),onBackupRestore:s[24]||(s[24]=u=>h.value.backupRestore.modalOpen=!0),onDeleteConfiguration:s[25]||(s[25]=u=>h.value.deleteConfiguration.modalOpen=!0),configurationInfo:l.value},null,8,["configurationInfo"])):w("",!0),h.value.selectPeers.modalOpen?(a(),P(k(b),{key:3,onRefresh:s[26]||(s[26]=u=>I()),configurationPeers:c.value,onClose:s[27]||(s[27]=u=>h.value.selectPeers.modalOpen=!1)},null,8,["configurationPeers"])):w("",!0)]),_:1}),i(bs,{showPeersCount:q.value,peerListLength:ne.value.length,onLoadMore:s[28]||(s[28]=u=>q.value+=go)},null,8,["showPeersCount","peerListLength"])]))}},wo=z(vo,[["__scopeId","data-v-9736e433"]]);export{wo as default}; diff --git a/src/static/app/dist/assets/peerQRCode-CcaIHs_s.js b/src/static/app/dist/assets/peerQRCode-DALw201D.js similarity index 92% rename from src/static/app/dist/assets/peerQRCode-CcaIHs_s.js rename to src/static/app/dist/assets/peerQRCode-DALw201D.js index 042be31..f2959d7 100644 --- a/src/static/app/dist/assets/peerQRCode-CcaIHs_s.js +++ b/src/static/app/dist/assets/peerQRCode-DALw201D.js @@ -1 +1 @@ -import{b as r}from"./browser-CjSdxGTc.js";import{L as i}from"./localeText-BguG5zGd.js";import{_ as c,D as l,g as p,j as _,a,c as n,b as e,d as m,n as h,e as u}from"./index-7qLsecvh.js";const f={name:"peerQRCode",components:{LocaleText:i},props:{selectedPeer:Object},setup(){return{dashboardStore:l()}},data(){return{loading:!0}},mounted(){p("/api/downloadPeer/"+this.$route.params.id,{id:this.selectedPeer.id},t=>{this.loading=!1,t.status?r.toCanvas(document.querySelector("#qrcode"),t.data.file,s=>{s&&console.error(s)}):this.dashboardStore.newMessage("Server",t.message,"danger")})}},b={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0"},g={class:"container d-flex h-100 w-100"},v={class:"m-auto modal-dialog-centered dashboardModal justify-content-center"},x={class:"card rounded-3 shadow"},C={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},w={class:"mb-0"},y={class:"card-body p-4"},S={style:{width:"292px",height:"292px"},class:"d-flex"},L={key:0,class:"spinner-border m-auto",role:"status"};function $(t,s,k,j,o,q){const d=_("LocaleText");return a(),n("div",b,[e("div",g,[e("div",v,[e("div",x,[e("div",C,[e("h4",w,[m(d,{t:"QR Code"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:s[0]||(s[0]=B=>this.$emit("close"))})]),e("div",y,[e("div",S,[e("canvas",{id:"qrcode",class:h(["rounded-3 shadow animate__animated animate__fadeIn animate__faster",{"d-none":o.loading}])},null,2),o.loading?(a(),n("div",L,s[1]||(s[1]=[e("span",{class:"visually-hidden"},"Loading...",-1)]))):u("",!0)])])])])])])}const R=c(f,[["render",$]]);export{R as default}; +import{b as r}from"./browser-CjSdxGTc.js";import{L as i}from"./localeText-Dh33930I.js";import{_ as c,D as l,g as p,j as _,a,c as n,b as e,d as m,n as h,e as u}from"./index-CgM9eUIs.js";const f={name:"peerQRCode",components:{LocaleText:i},props:{selectedPeer:Object},setup(){return{dashboardStore:l()}},data(){return{loading:!0}},mounted(){p("/api/downloadPeer/"+this.$route.params.id,{id:this.selectedPeer.id},t=>{this.loading=!1,t.status?r.toCanvas(document.querySelector("#qrcode"),t.data.file,s=>{s&&console.error(s)}):this.dashboardStore.newMessage("Server",t.message,"danger")})}},b={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0"},g={class:"container d-flex h-100 w-100"},v={class:"m-auto modal-dialog-centered dashboardModal justify-content-center"},x={class:"card rounded-3 shadow"},C={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},w={class:"mb-0"},y={class:"card-body p-4"},S={style:{width:"292px",height:"292px"},class:"d-flex"},L={key:0,class:"spinner-border m-auto",role:"status"};function $(t,s,k,j,o,q){const d=_("LocaleText");return a(),n("div",b,[e("div",g,[e("div",v,[e("div",x,[e("div",C,[e("h4",w,[m(d,{t:"QR Code"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:s[0]||(s[0]=B=>this.$emit("close"))})]),e("div",y,[e("div",S,[e("canvas",{id:"qrcode",class:h(["rounded-3 shadow animate__animated animate__fadeIn animate__faster",{"d-none":o.loading}])},null,2),o.loading?(a(),n("div",L,s[1]||(s[1]=[e("span",{class:"visually-hidden"},"Loading...",-1)]))):u("",!0)])])])])])])}const R=c(f,[["render",$]]);export{R as default}; diff --git a/src/static/app/dist/assets/peerSearchBar-CLQQyoqI.js b/src/static/app/dist/assets/peerSearchBar-Cxf5ghqE.js similarity index 92% rename from src/static/app/dist/assets/peerSearchBar-CLQQyoqI.js rename to src/static/app/dist/assets/peerSearchBar-Cxf5ghqE.js index 40ba3c8..0999c28 100644 --- a/src/static/app/dist/assets/peerSearchBar-CLQQyoqI.js +++ b/src/static/app/dist/assets/peerSearchBar-Cxf5ghqE.js @@ -1 +1 @@ -import{_ as u,p as m,G as p,r as b,W as f,a2 as h,o as v,a as g,i as _,w as x,b as e,m as y,x as S,d as T,T as B}from"./index-7qLsecvh.js";import{L as w}from"./localeText-BguG5zGd.js";const C={class:"fixed-bottom w-100 bottom-0 z-2",style:{"z-index":"1"}},P={class:"container-fluid"},k={class:"row g-0"},L={class:"col-md-9 col-lg-10 d-flex justify-content-center py-2"},V={class:"rounded-3 p-2 border shadow searchPeersContainer bg-body-tertiary"},z={class:"d-flex gap-1 align-items-center px-2"},D=["placeholder"],G={__name:"peerSearchBar",emits:["close"],setup(M,{emit:n}){const i=m(()=>p("Search Peers..."));let t;const o=b(""),r=f(),l=()=>{t?(clearTimeout(t),t=setTimeout(()=>{r.searchString=o.value},300)):t=setTimeout(()=>{r.searchString=o.value},300)},d=n,c=h("searchBar");return v(()=>{c.value.focus()}),(N,s)=>(g(),_(B,{name:"slideUp",appear:"",type:"animation",style:{"animation-delay":"1s"}},{default:x(()=>[e("div",C,[e("div",P,[e("div",k,[s[5]||(s[5]=e("div",{class:"col-md-3 col-lg-2"},null,-1)),e("div",L,[e("div",V,[e("div",z,[s[4]||(s[4]=e("h6",{class:"mb-0 me-2"},[e("label",{for:"searchPeers"},[e("i",{class:"bi bi-search"})])],-1)),y(e("input",{ref:"searchBar",class:"form-control rounded-3 bg-secondary-subtle border-1 border-secondary-subtle",placeholder:i.value,id:"searchPeers",onKeyup:s[0]||(s[0]=a=>l()),"onUpdate:modelValue":s[1]||(s[1]=a=>o.value=a)},null,40,D),[[S,o.value]]),e("button",{onClick:s[2]||(s[2]=a=>d("close")),class:"btn bg-secondary-subtle text-secondary-emphasis border-secondary-subtle rounded-3 d-flex align-items-center"},[s[3]||(s[3]=e("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),T(w,{t:"Done"})])])])])])])])]),_:1}))}},$=u(G,[["__scopeId","data-v-21d93f94"]]);export{$ as default}; +import{_ as u,p as m,G as p,r as b,W as f,a2 as h,o as v,a as g,i as _,w as x,b as e,m as y,x as S,d as T,T as B}from"./index-CgM9eUIs.js";import{L as w}from"./localeText-Dh33930I.js";const C={class:"fixed-bottom w-100 bottom-0 z-2",style:{"z-index":"1"}},P={class:"container-fluid"},k={class:"row g-0"},L={class:"col-md-9 col-lg-10 d-flex justify-content-center py-2"},V={class:"rounded-3 p-2 border shadow searchPeersContainer bg-body-tertiary"},z={class:"d-flex gap-1 align-items-center px-2"},D=["placeholder"],G={__name:"peerSearchBar",emits:["close"],setup(M,{emit:n}){const i=m(()=>p("Search Peers..."));let t;const o=b(""),r=f(),l=()=>{t?(clearTimeout(t),t=setTimeout(()=>{r.searchString=o.value},300)):t=setTimeout(()=>{r.searchString=o.value},300)},d=n,c=h("searchBar");return v(()=>{c.value.focus()}),(N,s)=>(g(),_(B,{name:"slideUp",appear:"",type:"animation",style:{"animation-delay":"1s"}},{default:x(()=>[e("div",C,[e("div",P,[e("div",k,[s[5]||(s[5]=e("div",{class:"col-md-3 col-lg-2"},null,-1)),e("div",L,[e("div",V,[e("div",z,[s[4]||(s[4]=e("h6",{class:"mb-0 me-2"},[e("label",{for:"searchPeers"},[e("i",{class:"bi bi-search"})])],-1)),y(e("input",{ref:"searchBar",class:"form-control rounded-3 bg-secondary-subtle border-1 border-secondary-subtle",placeholder:i.value,id:"searchPeers",onKeyup:s[0]||(s[0]=a=>l()),"onUpdate:modelValue":s[1]||(s[1]=a=>o.value=a)},null,40,D),[[S,o.value]]),e("button",{onClick:s[2]||(s[2]=a=>d("close")),class:"btn bg-secondary-subtle text-secondary-emphasis border-secondary-subtle rounded-3 d-flex align-items-center"},[s[3]||(s[3]=e("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),T(w,{t:"Done"})])])])])])])])]),_:1}))}},$=u(G,[["__scopeId","data-v-21d93f94"]]);export{$ as default}; diff --git a/src/static/app/dist/assets/peerSettings-7HT8XeGx.js b/src/static/app/dist/assets/peerSettings-HqeEL_Gm.js similarity index 98% rename from src/static/app/dist/assets/peerSettings-7HT8XeGx.js rename to src/static/app/dist/assets/peerSettings-HqeEL_Gm.js index 69dc373..f5cb315 100644 --- a/src/static/app/dist/assets/peerSettings-7HT8XeGx.js +++ b/src/static/app/dist/assets/peerSettings-HqeEL_Gm.js @@ -1 +1 @@ -import{_ as m,D as _,z as c,j as b,a as n,c as r,b as e,d as a,t as h,m as d,x as l,n as f,$ as v,a5 as u,e as p}from"./index-7qLsecvh.js";import{L as g}from"./localeText-BguG5zGd.js";const y={name:"peerSettings",components:{LocaleText:g},props:{selectedPeer:Object},data(){return{data:void 0,dataChanged:!1,showKey:!1,saving:!1}},setup(){return{dashboardConfigurationStore:_()}},methods:{reset(){this.selectedPeer&&(this.data=JSON.parse(JSON.stringify(this.selectedPeer)),this.dataChanged=!1)},savePeer(){this.saving=!0,c(`/api/updatePeerSettings/${this.$route.params.id}`,this.data,i=>{this.saving=!1,i.status?this.dashboardConfigurationStore.newMessage("Server","Peer saved","success"):this.dashboardConfigurationStore.newMessage("Server",i.message,"danger"),this.$emit("refresh")})},resetPeerData(i){this.saving=!0,c(`/api/resetPeerData/${this.$route.params.id}`,{id:this.data.id,type:i},t=>{this.saving=!1,t.status?this.dashboardConfigurationStore.newMessage("Server","Peer data usage reset successfully","success"):this.dashboardConfigurationStore.newMessage("Server",t.message,"danger"),this.$emit("refresh")})}},beforeMount(){this.reset()},mounted(){this.$el.querySelectorAll("input").forEach(i=>{i.addEventListener("change",()=>{this.dataChanged=!0})})}},x={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},w={class:"container d-flex h-100 w-100"},S={class:"m-auto modal-dialog-centered dashboardModal"},k={class:"card rounded-3 shadow flex-grow-1"},C={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},P={class:"mb-0"},$={key:0,class:"card-body px-4"},D={class:"d-flex flex-column gap-2 mb-4"},V={class:"d-flex align-items-center"},U={class:"text-muted"},N={class:"ms-auto"},K={for:"peer_name_textbox",class:"form-label"},M={class:"text-muted"},A=["disabled"],O={class:"d-flex position-relative"},R={for:"peer_private_key_textbox",class:"form-label"},T={class:"text-muted"},L=["type","disabled"],q={for:"peer_allowed_ip_textbox",class:"form-label"},E={class:"text-muted"},B=["disabled"],I={for:"peer_endpoint_allowed_ips",class:"form-label"},j={class:"text-muted"},z=["disabled"],J={for:"peer_DNS_textbox",class:"form-label"},Q={class:"text-muted"},F=["disabled"],G={class:"accordion my-3",id:"peerSettingsAccordion"},H={class:"accordion-item"},W={class:"accordion-header"},X={class:"accordion-button rounded-3 collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#peerSettingsAccordionOptional"},Y={id:"peerSettingsAccordionOptional",class:"accordion-collapse collapse","data-bs-parent":"#peerSettingsAccordion"},Z={class:"accordion-body d-flex flex-column gap-2 mb-2"},ee={for:"peer_preshared_key_textbox",class:"form-label"},te={class:"text-muted"},se=["disabled"],oe={for:"peer_mtu",class:"form-label"},ae={class:"text-muted"},de=["disabled"],ie={for:"peer_keep_alive",class:"form-label"},le={class:"text-muted"},ne=["disabled"],re={key:0},ce={for:"peer_advance_security",class:"form-label d-block"},ue={class:"text-muted"},pe={class:"btn-group",role:"group"},me={class:"btn btn-outline-primary btn-sm",for:"advanced_security_on"},_e={class:"btn btn-outline-primary btn-sm",for:"advanced_security_off"},be={class:"d-flex align-items-center gap-2"},he=["disabled"],fe=["disabled"],ve={class:"d-flex gap-2 align-items-center"},ge={class:"d-flex gap-2 ms-auto"};function ye(i,t,xe,we,Se,ke){const o=b("LocaleText");return n(),r("div",x,[e("div",w,[e("div",S,[e("div",k,[e("div",C,[e("h4",P,[a(o,{t:"Peer Settings"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=s=>this.$emit("close"))})]),this.data?(n(),r("div",$,[e("div",D,[e("div",V,[e("small",U,[a(o,{t:"Public Key"})]),e("small",N,[e("samp",null,h(this.data.id),1)])]),e("div",null,[e("label",K,[e("small",M,[a(o,{t:"Name"})])]),d(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[1]||(t[1]=s=>this.data.name=s),id:"peer_name_textbox",placeholder:""},null,8,A),[[l,this.data.name]])]),e("div",null,[e("div",O,[e("label",R,[e("small",T,[a(o,{t:"Private Key"}),e("code",null,[a(o,{t:"(Required for QR Code and Download)"})])])]),e("a",{role:"button",class:"ms-auto text-decoration-none toggleShowKey",onClick:t[2]||(t[2]=s=>this.showKey=!this.showKey)},[e("i",{class:f(["bi",[this.showKey?"bi-eye-slash-fill":"bi-eye-fill"]])},null,2)])]),d(e("input",{type:[this.showKey?"text":"password"],class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[3]||(t[3]=s=>this.data.private_key=s),id:"peer_private_key_textbox",style:{"padding-right":"40px"}},null,8,L),[[v,this.data.private_key]])]),e("div",null,[e("label",q,[e("small",E,[a(o,{t:"Allowed IPs"}),e("code",null,[a(o,{t:"(Required)"})])])]),d(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[4]||(t[4]=s=>this.data.allowed_ip=s),id:"peer_allowed_ip_textbox"},null,8,B),[[l,this.data.allowed_ip]])]),e("div",null,[e("label",I,[e("small",j,[a(o,{t:"Endpoint Allowed IPs"}),e("code",null,[a(o,{t:"(Required)"})])])]),d(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[5]||(t[5]=s=>this.data.endpoint_allowed_ip=s),id:"peer_endpoint_allowed_ips"},null,8,z),[[l,this.data.endpoint_allowed_ip]])]),e("div",null,[e("label",J,[e("small",Q,[a(o,{t:"DNS"})])]),d(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[6]||(t[6]=s=>this.data.DNS=s),id:"peer_DNS_textbox"},null,8,F),[[l,this.data.DNS]])]),e("div",G,[e("div",H,[e("h2",W,[e("button",X,[a(o,{t:"Optional Settings"})])]),e("div",Y,[e("div",Z,[e("div",null,[e("label",ee,[e("small",te,[a(o,{t:"Pre-Shared Key"})])]),d(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[7]||(t[7]=s=>this.data.preshared_key=s),id:"peer_preshared_key_textbox"},null,8,se),[[l,this.data.preshared_key]])]),e("div",null,[e("label",oe,[e("small",ae,[a(o,{t:"MTU"})])]),d(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[8]||(t[8]=s=>this.data.mtu=s),id:"peer_mtu"},null,8,de),[[l,this.data.mtu]])]),e("div",null,[e("label",ie,[e("small",le,[a(o,{t:"Persistent Keepalive"})])]),d(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[9]||(t[9]=s=>this.data.keepalive=s),id:"peer_keep_alive"},null,8,ne),[[l,this.data.keepalive]])]),this.data.advanced_security?(n(),r("div",re,[e("label",ce,[e("small",ue,[a(o,{t:"Advanced Security"})])]),e("div",pe,[d(e("input",{type:"radio",class:"btn-check","onUpdate:modelValue":t[10]||(t[10]=s=>this.data.advanced_security=s),value:"on",name:"advanced_security_radio",id:"advanced_security_on",autocomplete:"off"},null,512),[[u,this.data.advanced_security]]),e("label",me,[a(o,{t:"On"})]),d(e("input",{type:"radio","onUpdate:modelValue":t[11]||(t[11]=s=>this.data.advanced_security=s),value:"off",class:"btn-check",name:"advanced_security_radio",id:"advanced_security_off",autocomplete:"off"},null,512),[[u,this.data.advanced_security]]),e("label",_e,[a(o,{t:"Off"})])])])):p("",!0)])])])]),e("div",be,[e("button",{class:"btn bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3 shadow ms-auto px-3 py-2",onClick:t[12]||(t[12]=s=>this.reset()),disabled:!this.dataChanged||this.saving},[t[17]||(t[17]=e("i",{class:"bi bi-arrow-clockwise me-2"},null,-1)),a(o,{t:"Reset"})],8,he),e("button",{class:"btn bg-primary-subtle border-primary-subtle text-primary-emphasis rounded-3 px-3 py-2 shadow",disabled:!this.dataChanged||this.saving,onClick:t[13]||(t[13]=s=>this.savePeer())},[t[18]||(t[18]=e("i",{class:"bi bi-save-fill me-2"},null,-1)),a(o,{t:"Save"})],8,fe)]),t[22]||(t[22]=e("hr",null,null,-1)),e("div",ve,[e("strong",null,[a(o,{t:"Reset Data Usage"})]),e("div",ge,[e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[14]||(t[14]=s=>this.resetPeerData("total"))},[t[19]||(t[19]=e("i",{class:"bi bi-arrow-down-up me-2"},null,-1)),a(o,{t:"Total"})]),e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[15]||(t[15]=s=>this.resetPeerData("receive"))},[t[20]||(t[20]=e("i",{class:"bi bi-arrow-down me-2"},null,-1)),a(o,{t:"Received"})]),e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[16]||(t[16]=s=>this.resetPeerData("sent"))},[t[21]||(t[21]=e("i",{class:"bi bi-arrow-up me-2"},null,-1)),a(o,{t:"Sent"})])])])])])):p("",!0)])])])])}const $e=m(y,[["render",ye],["__scopeId","data-v-2166fcf9"]]);export{$e as default}; +import{_ as m,D as _,z as c,j as b,a as n,c as r,b as e,d as a,t as h,m as d,x as l,n as f,$ as v,a5 as u,e as p}from"./index-CgM9eUIs.js";import{L as g}from"./localeText-Dh33930I.js";const y={name:"peerSettings",components:{LocaleText:g},props:{selectedPeer:Object},data(){return{data:void 0,dataChanged:!1,showKey:!1,saving:!1}},setup(){return{dashboardConfigurationStore:_()}},methods:{reset(){this.selectedPeer&&(this.data=JSON.parse(JSON.stringify(this.selectedPeer)),this.dataChanged=!1)},savePeer(){this.saving=!0,c(`/api/updatePeerSettings/${this.$route.params.id}`,this.data,i=>{this.saving=!1,i.status?this.dashboardConfigurationStore.newMessage("Server","Peer saved","success"):this.dashboardConfigurationStore.newMessage("Server",i.message,"danger"),this.$emit("refresh")})},resetPeerData(i){this.saving=!0,c(`/api/resetPeerData/${this.$route.params.id}`,{id:this.data.id,type:i},t=>{this.saving=!1,t.status?this.dashboardConfigurationStore.newMessage("Server","Peer data usage reset successfully","success"):this.dashboardConfigurationStore.newMessage("Server",t.message,"danger"),this.$emit("refresh")})}},beforeMount(){this.reset()},mounted(){this.$el.querySelectorAll("input").forEach(i=>{i.addEventListener("change",()=>{this.dataChanged=!0})})}},x={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},w={class:"container d-flex h-100 w-100"},S={class:"m-auto modal-dialog-centered dashboardModal"},k={class:"card rounded-3 shadow flex-grow-1"},C={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},P={class:"mb-0"},$={key:0,class:"card-body px-4"},D={class:"d-flex flex-column gap-2 mb-4"},V={class:"d-flex align-items-center"},U={class:"text-muted"},N={class:"ms-auto"},K={for:"peer_name_textbox",class:"form-label"},M={class:"text-muted"},A=["disabled"],O={class:"d-flex position-relative"},R={for:"peer_private_key_textbox",class:"form-label"},T={class:"text-muted"},L=["type","disabled"],q={for:"peer_allowed_ip_textbox",class:"form-label"},E={class:"text-muted"},B=["disabled"],I={for:"peer_endpoint_allowed_ips",class:"form-label"},j={class:"text-muted"},z=["disabled"],J={for:"peer_DNS_textbox",class:"form-label"},Q={class:"text-muted"},F=["disabled"],G={class:"accordion my-3",id:"peerSettingsAccordion"},H={class:"accordion-item"},W={class:"accordion-header"},X={class:"accordion-button rounded-3 collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#peerSettingsAccordionOptional"},Y={id:"peerSettingsAccordionOptional",class:"accordion-collapse collapse","data-bs-parent":"#peerSettingsAccordion"},Z={class:"accordion-body d-flex flex-column gap-2 mb-2"},ee={for:"peer_preshared_key_textbox",class:"form-label"},te={class:"text-muted"},se=["disabled"],oe={for:"peer_mtu",class:"form-label"},ae={class:"text-muted"},de=["disabled"],ie={for:"peer_keep_alive",class:"form-label"},le={class:"text-muted"},ne=["disabled"],re={key:0},ce={for:"peer_advance_security",class:"form-label d-block"},ue={class:"text-muted"},pe={class:"btn-group",role:"group"},me={class:"btn btn-outline-primary btn-sm",for:"advanced_security_on"},_e={class:"btn btn-outline-primary btn-sm",for:"advanced_security_off"},be={class:"d-flex align-items-center gap-2"},he=["disabled"],fe=["disabled"],ve={class:"d-flex gap-2 align-items-center"},ge={class:"d-flex gap-2 ms-auto"};function ye(i,t,xe,we,Se,ke){const o=b("LocaleText");return n(),r("div",x,[e("div",w,[e("div",S,[e("div",k,[e("div",C,[e("h4",P,[a(o,{t:"Peer Settings"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=s=>this.$emit("close"))})]),this.data?(n(),r("div",$,[e("div",D,[e("div",V,[e("small",U,[a(o,{t:"Public Key"})]),e("small",N,[e("samp",null,h(this.data.id),1)])]),e("div",null,[e("label",K,[e("small",M,[a(o,{t:"Name"})])]),d(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[1]||(t[1]=s=>this.data.name=s),id:"peer_name_textbox",placeholder:""},null,8,A),[[l,this.data.name]])]),e("div",null,[e("div",O,[e("label",R,[e("small",T,[a(o,{t:"Private Key"}),e("code",null,[a(o,{t:"(Required for QR Code and Download)"})])])]),e("a",{role:"button",class:"ms-auto text-decoration-none toggleShowKey",onClick:t[2]||(t[2]=s=>this.showKey=!this.showKey)},[e("i",{class:f(["bi",[this.showKey?"bi-eye-slash-fill":"bi-eye-fill"]])},null,2)])]),d(e("input",{type:[this.showKey?"text":"password"],class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[3]||(t[3]=s=>this.data.private_key=s),id:"peer_private_key_textbox",style:{"padding-right":"40px"}},null,8,L),[[v,this.data.private_key]])]),e("div",null,[e("label",q,[e("small",E,[a(o,{t:"Allowed IPs"}),e("code",null,[a(o,{t:"(Required)"})])])]),d(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[4]||(t[4]=s=>this.data.allowed_ip=s),id:"peer_allowed_ip_textbox"},null,8,B),[[l,this.data.allowed_ip]])]),e("div",null,[e("label",I,[e("small",j,[a(o,{t:"Endpoint Allowed IPs"}),e("code",null,[a(o,{t:"(Required)"})])])]),d(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[5]||(t[5]=s=>this.data.endpoint_allowed_ip=s),id:"peer_endpoint_allowed_ips"},null,8,z),[[l,this.data.endpoint_allowed_ip]])]),e("div",null,[e("label",J,[e("small",Q,[a(o,{t:"DNS"})])]),d(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[6]||(t[6]=s=>this.data.DNS=s),id:"peer_DNS_textbox"},null,8,F),[[l,this.data.DNS]])]),e("div",G,[e("div",H,[e("h2",W,[e("button",X,[a(o,{t:"Optional Settings"})])]),e("div",Y,[e("div",Z,[e("div",null,[e("label",ee,[e("small",te,[a(o,{t:"Pre-Shared Key"})])]),d(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[7]||(t[7]=s=>this.data.preshared_key=s),id:"peer_preshared_key_textbox"},null,8,se),[[l,this.data.preshared_key]])]),e("div",null,[e("label",oe,[e("small",ae,[a(o,{t:"MTU"})])]),d(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[8]||(t[8]=s=>this.data.mtu=s),id:"peer_mtu"},null,8,de),[[l,this.data.mtu]])]),e("div",null,[e("label",ie,[e("small",le,[a(o,{t:"Persistent Keepalive"})])]),d(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[9]||(t[9]=s=>this.data.keepalive=s),id:"peer_keep_alive"},null,8,ne),[[l,this.data.keepalive]])]),this.data.advanced_security?(n(),r("div",re,[e("label",ce,[e("small",ue,[a(o,{t:"Advanced Security"})])]),e("div",pe,[d(e("input",{type:"radio",class:"btn-check","onUpdate:modelValue":t[10]||(t[10]=s=>this.data.advanced_security=s),value:"on",name:"advanced_security_radio",id:"advanced_security_on",autocomplete:"off"},null,512),[[u,this.data.advanced_security]]),e("label",me,[a(o,{t:"On"})]),d(e("input",{type:"radio","onUpdate:modelValue":t[11]||(t[11]=s=>this.data.advanced_security=s),value:"off",class:"btn-check",name:"advanced_security_radio",id:"advanced_security_off",autocomplete:"off"},null,512),[[u,this.data.advanced_security]]),e("label",_e,[a(o,{t:"Off"})])])])):p("",!0)])])])]),e("div",be,[e("button",{class:"btn bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3 shadow ms-auto px-3 py-2",onClick:t[12]||(t[12]=s=>this.reset()),disabled:!this.dataChanged||this.saving},[t[17]||(t[17]=e("i",{class:"bi bi-arrow-clockwise me-2"},null,-1)),a(o,{t:"Reset"})],8,he),e("button",{class:"btn bg-primary-subtle border-primary-subtle text-primary-emphasis rounded-3 px-3 py-2 shadow",disabled:!this.dataChanged||this.saving,onClick:t[13]||(t[13]=s=>this.savePeer())},[t[18]||(t[18]=e("i",{class:"bi bi-save-fill me-2"},null,-1)),a(o,{t:"Save"})],8,fe)]),t[22]||(t[22]=e("hr",null,null,-1)),e("div",ve,[e("strong",null,[a(o,{t:"Reset Data Usage"})]),e("div",ge,[e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[14]||(t[14]=s=>this.resetPeerData("total"))},[t[19]||(t[19]=e("i",{class:"bi bi-arrow-down-up me-2"},null,-1)),a(o,{t:"Total"})]),e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[15]||(t[15]=s=>this.resetPeerData("receive"))},[t[20]||(t[20]=e("i",{class:"bi bi-arrow-down me-2"},null,-1)),a(o,{t:"Received"})]),e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[16]||(t[16]=s=>this.resetPeerData("sent"))},[t[21]||(t[21]=e("i",{class:"bi bi-arrow-up me-2"},null,-1)),a(o,{t:"Sent"})])])])])])):p("",!0)])])])])}const $e=m(y,[["render",ye],["__scopeId","data-v-2166fcf9"]]);export{$e as default}; diff --git a/src/static/app/dist/assets/peerShareLinkModal-B-KVnbTg.js b/src/static/app/dist/assets/peerShareLinkModal-C_6aIgZ8.js similarity index 96% rename from src/static/app/dist/assets/peerShareLinkModal-B-KVnbTg.js rename to src/static/app/dist/assets/peerShareLinkModal-C_6aIgZ8.js index 12868fe..7d3bebb 100644 --- a/src/static/app/dist/assets/peerShareLinkModal-B-KVnbTg.js +++ b/src/static/app/dist/assets/peerShareLinkModal-C_6aIgZ8.js @@ -1 +1 @@ -import{_ as E,r as v,C as V,E as T,a as i,c,b as e,t as B,e as x,n as w,z as P,g as Y,D as H,I as U,j as k,d as r,m as _,x as $,v as L,w as M,G as R,q as j,i as g,S as A}from"./index-7qLsecvh.js";import{d as D}from"./dayjs.min-C341O-eN.js";import{V as W}from"./vue-datepicker-v4St2bKM.js";import{L as h}from"./localeText-BguG5zGd.js";const O={class:"card rounded-0 border-start-0 border-bottom-0 bg-body-secondary",style:{height:"400px",overflow:"scroll"}},q={class:"card-body"},J={key:0,class:"alert alert-danger rounded-3"},z={class:"font-monospace"},G=["innerText"],F={__name:"peerShareWithEmailBodyPreview",props:["body","selectedPeer"],async setup(s){let t,f;const m=s,b=v(""),p=v(!1),n=v(""),l=async()=>{m.body&&(p.value=!1,b.value="",await P("/api/email/previewBody",{Body:m.body,ConfigurationName:m.selectedPeer.configuration.Name,Peer:m.selectedPeer.id},o=>{o.status?b.value=o.data:n.value=o.message,p.value=!o.status}))};[t,f]=V(()=>l()),await t,f();let d;return T(()=>m.body,async()=>{d===void 0?d=setTimeout(async()=>{await l()},500):(clearTimeout(d),d=setTimeout(async()=>{await l()},500))}),(o,S)=>(i(),c("div",O,[e("div",q,[p.value&&s.body?(i(),c("div",J,[S[0]||(S[0]=e("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),e("span",z,B(n.value),1)])):x("",!0),s.body?(i(),c("div",{key:1,class:w({"opacity-50":p.value}),innerText:b.value},null,10,G)):x("",!0)])]))}},K=E(F,[["__scopeId","data-v-8cfb4d4d"]]),Q={key:0},X={class:"mb-3"},Z={class:"position-relative"},ee=["disabled","placeholder"],te={class:"position-relative"},se=["placeholder","disabled"],ae={class:"row g-0"},oe=["disabled","placeholder"],ie={key:0,class:"col-6"},le={class:"card border-top-0 rounded-top-0 rounded-bottom-3 bg-body-tertiary",style:{border:"var(--bs-border-width) solid var(--bs-border-color)"}},re={class:"card-body d-flex flex-column gap-2"},ne={class:"form-check form-switch ms-auto"},de={class:"form-check-label",for:"livePreview"},ce={class:"form-check form-switch"},ue={class:"form-check-label",for:"includeAttachment"},me=["disabled"],pe={key:0},he={key:1},be={key:1},fe={__name:"peerShareWithEmail",props:["dataCopy","selectedPeer"],emits:["fullscreen"],async setup(s,{emit:t}){let f,m;const b=s,p=v(!1);[f,m]=V(()=>Y("/api/email/ready",{},y=>{p.value=y.status})),await f,m();const n=H(),l=U({Receiver:"",Body:n.Configuration.Email.email_template,Subject:"",IncludeAttachment:!1,ConfigurationName:b.selectedPeer.configuration.Name,Peer:b.selectedPeer.id}),d=v(!1),o=v(!1),S=async()=>{o.value=!0,await P("/api/email/send",l,y=>{y.status?n.newMessage("Server","Email sent successfully!","success"):n.newMessage("Server",`Email sent failed! Reason: ${y.message}`,"danger"),o.value=!1})},C=y=>R(y),I=t;return T(d,()=>{I("fullscreen",d.value)}),(y,a)=>{const N=k("RouterLink");return p.value?(i(),c("div",Q,[e("h6",X,[r(h,{t:"Share with Email"})]),e("form",{class:"d-flex gap-3 flex-column",onSubmit:a[5]||(a[5]=u=>{u.preventDefault(),S()})},[e("div",null,[e("div",Z,[a[6]||(a[6]=e("i",{class:"bi bi-person-circle",style:{position:"absolute",top:"0.4rem",left:"0.75rem"}},null,-1)),_(e("input",{type:"email",class:"form-control rounded-top-3 rounded-bottom-0",style:{"padding-left":"calc( 0.75rem + 24px )"},"onUpdate:modelValue":a[0]||(a[0]=u=>l.Receiver=u),disabled:o.value,placeholder:C("Send to who?"),required:"",id:"email_receiver","aria-describedby":"emailHelp"},null,8,ee),[[$,l.Receiver]])]),e("div",te,[a[7]||(a[7]=e("i",{class:"bi bi-hash",style:{position:"absolute",top:"0.4rem",left:"0.75rem"}},null,-1)),_(e("input",{type:"text",class:"form-control rounded-0 border-top-0 border-bottom-0",style:{"padding-left":"calc( 0.75rem + 24px )"},placeholder:C("Subject"),disabled:o.value,"onUpdate:modelValue":a[1]||(a[1]=u=>l.Subject=u),id:"email_subject","aria-describedby":"emailHelp"},null,8,se),[[$,l.Subject]])]),e("div",ae,[e("div",{class:w([d.value?"col-6":"col-12"])},[_(e("textarea",{class:"form-control rounded-top-0 rounded-bottom-0 font-monospace border-bottom-0","onUpdate:modelValue":a[2]||(a[2]=u=>l.Body=u),disabled:o.value,placeholder:C("Body"),style:{height:"400px","max-height":"400px"}},null,8,oe),[[$,l.Body]])],2),d.value?(i(),c("div",ie,[r(K,{body:l.Body,selectedPeer:s.selectedPeer},null,8,["body","selectedPeer"])])):x("",!0)]),e("div",le,[e("div",re,[e("div",ne,[_(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[3]||(a[3]=u=>d.value=u),role:"switch",id:"livePreview"},null,512),[[L,d.value]]),e("label",de,[r(h,{t:"Live Preview"})])])])])]),e("div",ce,[_(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=u=>l.IncludeAttachment=u),role:"switch",id:"includeAttachment"},null,512),[[L,l.IncludeAttachment]]),e("label",ue,[r(h,{t:"Include configuration file as an attachment"})])]),e("button",{disabled:o.value,class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3"},[o.value?(i(),c("span",he,[a[9]||(a[9]=e("span",{class:"spinner-border spinner-border-sm me-2"},null,-1)),r(h,{t:"Sending..."})])):(i(),c("span",pe,[a[8]||(a[8]=e("i",{class:"bi bi-send me-2"},null,-1)),r(h,{t:"Send"})]))],8,me)],32)])):(i(),c("div",be,[e("small",null,[r(h,{t:"SMTP is not configured, please navigate to "}),r(N,{to:"/settings"},{default:M(()=>[r(h,{t:"Settings"})]),_:1}),r(h,{t:" to finish setup"})])]))}}},ye=E(fe,[["__scopeId","data-v-f7bbc420"]]),ve={name:"peerShareLinkModal",props:{selectedPeer:Object},components:{PeerShareWithEmail:ye,LocaleText:h,VueDatePicker:W},data(){return{dataCopy:void 0,loading:!1,fullscreen:!1}},setup(){return{store:H()}},mounted(){this.dataCopy=JSON.parse(JSON.stringify(this.selectedPeer.ShareLink)).at(0)},watch:{"selectedPeer.ShareLink":{deep:!0,handler(s,t){t.length!==s.length&&(this.dataCopy=JSON.parse(JSON.stringify(this.selectedPeer.ShareLink)).at(0))}}},methods:{startSharing(){this.loading=!0,P("/api/sharePeer/create",{Configuration:this.selectedPeer.configuration.Name,Peer:this.selectedPeer.id,ExpireDate:D().add(7,"d").format("YYYY-MM-DD HH:mm:ss")},s=>{s.status?(this.selectedPeer.ShareLink=s.data,this.dataCopy=s.data.at(0)):this.store.newMessage("Server","Share link failed to create. Reason: "+s.message,"danger"),this.loading=!1})},updateLinkExpireDate(){P("/api/sharePeer/update",this.dataCopy,s=>{s.status?(this.dataCopy=s.data.at(0),this.selectedPeer.ShareLink=s.data,this.store.newMessage("Server","Link expire date updated","success")):this.store.newMessage("Server","Link expire date failed to update. Reason: "+s.message,"danger"),this.loading=!1})},stopSharing(){this.loading=!0,this.dataCopy.ExpireDate=D().format("YYYY-MM-DD HH:mm:ss"),this.updateLinkExpireDate()},parseTime(s){s?this.dataCopy.ExpireDate=D(s).format("YYYY-MM-DD HH:mm:ss"):this.dataCopy.ExpireDate=void 0,this.updateLinkExpireDate()}},computed:{getUrl(){const s=this.store.getActiveCrossServer();return s?`${s.host}/${this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}`:window.location.origin+window.location.pathname+this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}}},_e={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},ge={class:"container d-flex h-100 w-100"},Se={class:"card rounded-3 shadow flex-grow-1"},ke={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},xe={class:"mb-0"},we={key:0,class:"card-body px-4 pb-4"},Pe={key:0},Ce={class:"mb-3 text-muted"},$e=["disabled"],De={key:1},Me={class:"d-flex gap-2 mb-4"},Ee=["href"],Le={class:"d-flex flex-column gap-2 mb-3"},Ve=["disabled"],Te={class:"text-muted"};function Be(s,t,f,m,b,p){const n=k("LocaleText"),l=k("VueDatePicker"),d=k("PeerShareWithEmail");return i(),c("div",_e,[e("div",ge,[e("div",{class:"m-auto modal-dialog-centered dashboardModal",style:j([this.fullscreen?"width: 100%":"width: 700px"])},[e("div",Se,[e("div",ke,[e("h4",xe,[r(n,{t:"Share Peer"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=o=>this.$emit("close"))})]),this.selectedPeer.ShareLink?(i(),c("div",we,[this.dataCopy?(i(),c("div",De,[e("div",Me,[t[5]||(t[5]=e("i",{class:"bi bi-link-45deg"},null,-1)),e("a",{href:this.getUrl,class:"text-decoration-none",target:"_blank"},B(p.getUrl),9,Ee)]),e("div",Le,[e("small",null,[t[6]||(t[6]=e("i",{class:"bi bi-calendar me-2"},null,-1)),r(n,{t:"Expire At"})]),r(l,{is24:!0,"min-date":new Date,"model-value":this.dataCopy.ExpireDate,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","dark"])]),e("button",{onClick:t[2]||(t[2]=o=>this.stopSharing()),disabled:this.loading,class:"w-100 btn bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle rounded-3 shadow-sm"},[e("span",{class:w({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},t[7]||(t[7]=[e("i",{class:"bi bi-send-slash-fill me-2"},null,-1)]),2),this.loading?(i(),g(n,{key:0,t:"Stop Sharing..."})):(i(),g(n,{key:1,t:"Stop Sharing"}))],8,Ve),t[9]||(t[9]=e("hr",null,null,-1)),(i(),g(A,null,{fallback:M(()=>[e("h6",Te,[t[8]||(t[8]=e("span",{class:"spinner-border me-2 spinner-border-sm",role:"status"},null,-1)),r(n,{t:"Checking SMTP Configuration..."})])]),default:M(()=>[r(d,{onFullscreen:t[3]||(t[3]=o=>{this.fullscreen=o}),selectedPeer:f.selectedPeer,dataCopy:b.dataCopy},null,8,["selectedPeer","dataCopy"])]),_:1}))])):(i(),c("div",Pe,[e("h6",Ce,[r(n,{t:"Currently the peer is not sharing"})]),e("button",{onClick:t[1]||(t[1]=o=>this.startSharing()),disabled:this.loading,class:"w-100 btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm"},[e("span",{class:w({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},t[4]||(t[4]=[e("i",{class:"bi bi-send-fill me-2"},null,-1)]),2),this.loading?(i(),g(n,{key:0,t:"Sharing..."})):(i(),g(n,{key:1,t:"Start Sharing"}))],8,$e)]))])):x("",!0)])],4)])])}const Ue=E(ve,[["render",Be]]);export{Ue as default}; +import{_ as E,r as v,E as V,H as T,a as i,c,b as e,t as B,e as x,n as w,z as P,g as Y,D as H,I as U,j as k,d as r,m as _,x as $,v as L,w as M,G as R,q as j,i as g,S as A}from"./index-CgM9eUIs.js";import{d as D}from"./dayjs.min-B2wceQaW.js";import{V as W}from"./vue-datepicker-D7WdryeM.js";import{L as h}from"./localeText-Dh33930I.js";const O={class:"card rounded-0 border-start-0 border-bottom-0 bg-body-secondary",style:{height:"400px",overflow:"scroll"}},q={class:"card-body"},J={key:0,class:"alert alert-danger rounded-3"},z={class:"font-monospace"},G=["innerText"],F={__name:"peerShareWithEmailBodyPreview",props:["body","selectedPeer"],async setup(s){let t,f;const m=s,b=v(""),p=v(!1),n=v(""),l=async()=>{m.body&&(p.value=!1,b.value="",await P("/api/email/previewBody",{Body:m.body,ConfigurationName:m.selectedPeer.configuration.Name,Peer:m.selectedPeer.id},o=>{o.status?b.value=o.data:n.value=o.message,p.value=!o.status}))};[t,f]=V(()=>l()),await t,f();let d;return T(()=>m.body,async()=>{d===void 0?d=setTimeout(async()=>{await l()},500):(clearTimeout(d),d=setTimeout(async()=>{await l()},500))}),(o,S)=>(i(),c("div",O,[e("div",q,[p.value&&s.body?(i(),c("div",J,[S[0]||(S[0]=e("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),e("span",z,B(n.value),1)])):x("",!0),s.body?(i(),c("div",{key:1,class:w({"opacity-50":p.value}),innerText:b.value},null,10,G)):x("",!0)])]))}},K=E(F,[["__scopeId","data-v-8cfb4d4d"]]),Q={key:0},X={class:"mb-3"},Z={class:"position-relative"},ee=["disabled","placeholder"],te={class:"position-relative"},se=["placeholder","disabled"],ae={class:"row g-0"},oe=["disabled","placeholder"],ie={key:0,class:"col-6"},le={class:"card border-top-0 rounded-top-0 rounded-bottom-3 bg-body-tertiary",style:{border:"var(--bs-border-width) solid var(--bs-border-color)"}},re={class:"card-body d-flex flex-column gap-2"},ne={class:"form-check form-switch ms-auto"},de={class:"form-check-label",for:"livePreview"},ce={class:"form-check form-switch"},ue={class:"form-check-label",for:"includeAttachment"},me=["disabled"],pe={key:0},he={key:1},be={key:1},fe={__name:"peerShareWithEmail",props:["dataCopy","selectedPeer"],emits:["fullscreen"],async setup(s,{emit:t}){let f,m;const b=s,p=v(!1);[f,m]=V(()=>Y("/api/email/ready",{},y=>{p.value=y.status})),await f,m();const n=H(),l=U({Receiver:"",Body:n.Configuration.Email.email_template,Subject:"",IncludeAttachment:!1,ConfigurationName:b.selectedPeer.configuration.Name,Peer:b.selectedPeer.id}),d=v(!1),o=v(!1),S=async()=>{o.value=!0,await P("/api/email/send",l,y=>{y.status?n.newMessage("Server","Email sent successfully!","success"):n.newMessage("Server",`Email sent failed! Reason: ${y.message}`,"danger"),o.value=!1})},C=y=>R(y),I=t;return T(d,()=>{I("fullscreen",d.value)}),(y,a)=>{const N=k("RouterLink");return p.value?(i(),c("div",Q,[e("h6",X,[r(h,{t:"Share with Email"})]),e("form",{class:"d-flex gap-3 flex-column",onSubmit:a[5]||(a[5]=u=>{u.preventDefault(),S()})},[e("div",null,[e("div",Z,[a[6]||(a[6]=e("i",{class:"bi bi-person-circle",style:{position:"absolute",top:"0.4rem",left:"0.75rem"}},null,-1)),_(e("input",{type:"email",class:"form-control rounded-top-3 rounded-bottom-0",style:{"padding-left":"calc( 0.75rem + 24px )"},"onUpdate:modelValue":a[0]||(a[0]=u=>l.Receiver=u),disabled:o.value,placeholder:C("Send to who?"),required:"",id:"email_receiver","aria-describedby":"emailHelp"},null,8,ee),[[$,l.Receiver]])]),e("div",te,[a[7]||(a[7]=e("i",{class:"bi bi-hash",style:{position:"absolute",top:"0.4rem",left:"0.75rem"}},null,-1)),_(e("input",{type:"text",class:"form-control rounded-0 border-top-0 border-bottom-0",style:{"padding-left":"calc( 0.75rem + 24px )"},placeholder:C("Subject"),disabled:o.value,"onUpdate:modelValue":a[1]||(a[1]=u=>l.Subject=u),id:"email_subject","aria-describedby":"emailHelp"},null,8,se),[[$,l.Subject]])]),e("div",ae,[e("div",{class:w([d.value?"col-6":"col-12"])},[_(e("textarea",{class:"form-control rounded-top-0 rounded-bottom-0 font-monospace border-bottom-0","onUpdate:modelValue":a[2]||(a[2]=u=>l.Body=u),disabled:o.value,placeholder:C("Body"),style:{height:"400px","max-height":"400px"}},null,8,oe),[[$,l.Body]])],2),d.value?(i(),c("div",ie,[r(K,{body:l.Body,selectedPeer:s.selectedPeer},null,8,["body","selectedPeer"])])):x("",!0)]),e("div",le,[e("div",re,[e("div",ne,[_(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[3]||(a[3]=u=>d.value=u),role:"switch",id:"livePreview"},null,512),[[L,d.value]]),e("label",de,[r(h,{t:"Live Preview"})])])])])]),e("div",ce,[_(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=u=>l.IncludeAttachment=u),role:"switch",id:"includeAttachment"},null,512),[[L,l.IncludeAttachment]]),e("label",ue,[r(h,{t:"Include configuration file as an attachment"})])]),e("button",{disabled:o.value,class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3"},[o.value?(i(),c("span",he,[a[9]||(a[9]=e("span",{class:"spinner-border spinner-border-sm me-2"},null,-1)),r(h,{t:"Sending..."})])):(i(),c("span",pe,[a[8]||(a[8]=e("i",{class:"bi bi-send me-2"},null,-1)),r(h,{t:"Send"})]))],8,me)],32)])):(i(),c("div",be,[e("small",null,[r(h,{t:"SMTP is not configured, please navigate to "}),r(N,{to:"/settings"},{default:M(()=>[r(h,{t:"Settings"})]),_:1}),r(h,{t:" to finish setup"})])]))}}},ye=E(fe,[["__scopeId","data-v-f7bbc420"]]),ve={name:"peerShareLinkModal",props:{selectedPeer:Object},components:{PeerShareWithEmail:ye,LocaleText:h,VueDatePicker:W},data(){return{dataCopy:void 0,loading:!1,fullscreen:!1}},setup(){return{store:H()}},mounted(){this.dataCopy=JSON.parse(JSON.stringify(this.selectedPeer.ShareLink)).at(0)},watch:{"selectedPeer.ShareLink":{deep:!0,handler(s,t){t.length!==s.length&&(this.dataCopy=JSON.parse(JSON.stringify(this.selectedPeer.ShareLink)).at(0))}}},methods:{startSharing(){this.loading=!0,P("/api/sharePeer/create",{Configuration:this.selectedPeer.configuration.Name,Peer:this.selectedPeer.id,ExpireDate:D().add(7,"d").format("YYYY-MM-DD HH:mm:ss")},s=>{s.status?(this.selectedPeer.ShareLink=s.data,this.dataCopy=s.data.at(0)):this.store.newMessage("Server","Share link failed to create. Reason: "+s.message,"danger"),this.loading=!1})},updateLinkExpireDate(){P("/api/sharePeer/update",this.dataCopy,s=>{s.status?(this.dataCopy=s.data.at(0),this.selectedPeer.ShareLink=s.data,this.store.newMessage("Server","Link expire date updated","success")):this.store.newMessage("Server","Link expire date failed to update. Reason: "+s.message,"danger"),this.loading=!1})},stopSharing(){this.loading=!0,this.dataCopy.ExpireDate=D().format("YYYY-MM-DD HH:mm:ss"),this.updateLinkExpireDate()},parseTime(s){s?this.dataCopy.ExpireDate=D(s).format("YYYY-MM-DD HH:mm:ss"):this.dataCopy.ExpireDate=void 0,this.updateLinkExpireDate()}},computed:{getUrl(){const s=this.store.getActiveCrossServer();return s?`${s.host}/${this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}`:window.location.origin+window.location.pathname+this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}}},_e={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},ge={class:"container d-flex h-100 w-100"},Se={class:"card rounded-3 shadow flex-grow-1"},ke={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},xe={class:"mb-0"},we={key:0,class:"card-body px-4 pb-4"},Pe={key:0},Ce={class:"mb-3 text-muted"},$e=["disabled"],De={key:1},Me={class:"d-flex gap-2 mb-4"},Ee=["href"],Le={class:"d-flex flex-column gap-2 mb-3"},Ve=["disabled"],Te={class:"text-muted"};function Be(s,t,f,m,b,p){const n=k("LocaleText"),l=k("VueDatePicker"),d=k("PeerShareWithEmail");return i(),c("div",_e,[e("div",ge,[e("div",{class:"m-auto modal-dialog-centered dashboardModal",style:j([this.fullscreen?"width: 100%":"width: 700px"])},[e("div",Se,[e("div",ke,[e("h4",xe,[r(n,{t:"Share Peer"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=o=>this.$emit("close"))})]),this.selectedPeer.ShareLink?(i(),c("div",we,[this.dataCopy?(i(),c("div",De,[e("div",Me,[t[5]||(t[5]=e("i",{class:"bi bi-link-45deg"},null,-1)),e("a",{href:this.getUrl,class:"text-decoration-none",target:"_blank"},B(p.getUrl),9,Ee)]),e("div",Le,[e("small",null,[t[6]||(t[6]=e("i",{class:"bi bi-calendar me-2"},null,-1)),r(n,{t:"Expire At"})]),r(l,{is24:!0,"min-date":new Date,"model-value":this.dataCopy.ExpireDate,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","dark"])]),e("button",{onClick:t[2]||(t[2]=o=>this.stopSharing()),disabled:this.loading,class:"w-100 btn bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle rounded-3 shadow-sm"},[e("span",{class:w({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},t[7]||(t[7]=[e("i",{class:"bi bi-send-slash-fill me-2"},null,-1)]),2),this.loading?(i(),g(n,{key:0,t:"Stop Sharing..."})):(i(),g(n,{key:1,t:"Stop Sharing"}))],8,Ve),t[9]||(t[9]=e("hr",null,null,-1)),(i(),g(A,null,{fallback:M(()=>[e("h6",Te,[t[8]||(t[8]=e("span",{class:"spinner-border me-2 spinner-border-sm",role:"status"},null,-1)),r(n,{t:"Checking SMTP Configuration..."})])]),default:M(()=>[r(d,{onFullscreen:t[3]||(t[3]=o=>{this.fullscreen=o}),selectedPeer:f.selectedPeer,dataCopy:b.dataCopy},null,8,["selectedPeer","dataCopy"])]),_:1}))])):(i(),c("div",Pe,[e("h6",Ce,[r(n,{t:"Currently the peer is not sharing"})]),e("button",{onClick:t[1]||(t[1]=o=>this.startSharing()),disabled:this.loading,class:"w-100 btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm"},[e("span",{class:w({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},t[4]||(t[4]=[e("i",{class:"bi bi-send-fill me-2"},null,-1)]),2),this.loading?(i(),g(n,{key:0,t:"Sharing..."})):(i(),g(n,{key:1,t:"Start Sharing"}))],8,$e)]))])):x("",!0)])],4)])])}const Ue=E(ve,[["render",Be]]);export{Ue as default}; diff --git a/src/static/app/dist/assets/ping-3hO-rXXY.css b/src/static/app/dist/assets/ping-3hO-rXXY.css deleted file mode 100644 index 77ed46d..0000000 --- a/src/static/app/dist/assets/ping-3hO-rXXY.css +++ /dev/null @@ -1 +0,0 @@ -.ol-layer canvas[data-v-457711ff]{border-radius:var(--bs-border-radius-lg)!important}#map[data-v-457711ff]{height:300px}.pingPlaceholder[data-v-f5525716]{width:100%;height:79.98px}.ping-move[data-v-f5525716],.ping-enter-active[data-v-f5525716],.ping-leave-active[data-v-f5525716]{transition:all .4s cubic-bezier(.82,.58,.17,.9)}.ping-leave-active[data-v-f5525716]{position:absolute;width:100%}.ping-enter-from[data-v-f5525716],.ping-leave-to[data-v-f5525716]{opacity:0;filter:blur(3px)}table th[data-v-f5525716],table td[data-v-f5525716]{padding:.5rem}.table[data-v-f5525716]>:not(caption)>*>*{background-color:transparent!important} diff --git a/src/static/app/dist/assets/ping-BGGYdR4a.css b/src/static/app/dist/assets/ping-BGGYdR4a.css new file mode 100644 index 0000000..c075eab --- /dev/null +++ b/src/static/app/dist/assets/ping-BGGYdR4a.css @@ -0,0 +1 @@ +.pingPlaceholder[data-v-47f01fbc]{width:100%;height:79.98px}.ping-move[data-v-47f01fbc],.ping-enter-active[data-v-47f01fbc],.ping-leave-active[data-v-47f01fbc]{transition:all .4s cubic-bezier(.82,.58,.17,.9)}.ping-leave-active[data-v-47f01fbc]{position:absolute;width:100%}.ping-enter-from[data-v-47f01fbc],.ping-leave-to[data-v-47f01fbc]{opacity:0;filter:blur(3px)}table th[data-v-47f01fbc],table td[data-v-47f01fbc]{padding:.5rem}.table[data-v-47f01fbc]>:not(caption)>*>*{background-color:transparent!important} diff --git a/src/static/app/dist/assets/ping-DCNhLaR7.js b/src/static/app/dist/assets/ping-DCNhLaR7.js new file mode 100644 index 0000000..f14b677 --- /dev/null +++ b/src/static/app/dist/assets/ping-DCNhLaR7.js @@ -0,0 +1 @@ +import{_ as R,D as C,r as v,y as P,g as S,c as o,b as e,d as n,m as p,B as k,F as m,h as g,e as f,x as w,t as d,w as h,T as I,i as T,S as A,k as M,a as i,f as L,n as O,j as x}from"./index-CgM9eUIs.js";import{L as V}from"./localeText-Dh33930I.js";import{O as B,a as U,l as $}from"./osmapSocket-CJmzPMGM.js";const D={name:"ping",components:{OsmapSocket:B,OSMap:U,LocaleText:V},data(){return{loading:!1,cips:{},selectedConfiguration:void 0,selectedPeer:void 0,selectedIp:void 0,pingResult:void 0}},setup(){const u=C();let t;const _=v({pingTotalSentCount:0,pingReceivedSentCount:0,pingLostCount:0,pingResults:[]}),r=v(4),c=v(!1);try{t=$(),t.connect(),console.info("Successfully connected to socket.io")}catch{console.assert("Failed to connect socket.io")}return t.on("pingResponse",(...b)=>{let l=b[0];l.status&&c.value?(l.data.id=P().toString(),_.value.pingResults.push(l.data)):(u.newMessage("Server",l.message,"danger"),c.value=!1)}),t.on("pingResponseEnd",()=>{c.value=!1}),{store:u,sio:t,socketResult:_,count:r,pinging:c}},beforeUnmount(){this.sio&&this.sio.connected&&(this.sio.disconnect(),console.info("Successfully disconnected from socket.io"))},mounted(){S("/api/ping/getAllPeersIpAddress",{},u=>{u.status&&(this.loading=!0,this.cips=u.data)})},methods:{executeSocket(){this.sio.connected&&(this.socketResult.pingResults=[],this.pinging=!0,this.sio.emit("ping",{ipAddress:this.selectedIp,count:this.count}))}},watch:{selectedConfiguration(){this.selectedPeer=void 0,this.selectedIp=void 0},selectedPeer(){this.selectedIp=void 0}}},F={class:"mt-md-5 mt-3 text-body"},N={class:"container"},E={class:"row"},G={class:"col-sm-4 d-flex gap-2 flex-column"},j={class:"mb-1 text-muted",for:"configuration"},z=["disabled"],H=["value"],q={class:"mb-1 text-muted",for:"peer"},J=["disabled"],K=["value"],Q={class:"mb-1 text-muted",for:"ip"},W=["disabled"],X={class:"d-flex align-items-center gap-2"},Y={class:"text-muted"},Z={class:"mb-1 text-muted",for:"ipAddress"},ee=["disabled"],se={class:"mb-1 text-muted",for:"count"},te={class:"d-flex gap-3 align-items-center"},le=["disabled"],ne=["disabled"],ie={key:0,class:"d-block"},oe={key:1,class:"d-block"},de={class:"col-sm-8 position-relative d-flex flex-column gap-2 animate__fadeIn animate__animated"},ae={key:"pingResultTable"},ue={key:"table",class:"w-100 mt-2"},ce={class:"table table-sm rounded-3 w-100"},re={scope:"col"},pe={scope:"col"},me={scope:"col"},ge={scope:"col"},fe={key:0},he={key:0},_e={colspan:"4",class:"text-muted text-center"},be={class:"bg-body-tertiary border-top fw-bold",style:{"border-top":"2px solid !important"}},ve={colspan:"2"},ke={class:""},xe={class:""},ye={class:""},Re={colspan:"2"},Ce={key:0},Pe={key:1};function Se(u,t,_,r,c,b){const l=x("LocaleText"),y=x("OsmapSocket");return i(),o("div",F,[e("div",N,[t[18]||(t[18]=e("h3",{class:"mb-3 text-body"},"Ping",-1)),e("div",E,[e("div",G,[e("div",null,[e("label",j,[e("small",null,[n(l,{t:"Configuration"})])]),p(e("select",{class:"form-select","onUpdate:modelValue":t[0]||(t[0]=s=>this.selectedConfiguration=s),disabled:this.pinging},[t[7]||(t[7]=e("option",{disabled:"",selected:"",value:void 0},null,-1)),(i(!0),o(m,null,g(this.cips,(s,a)=>(i(),o("option",{value:a},d(a),9,H))),256))],8,z),[[k,this.selectedConfiguration]])]),e("div",null,[e("label",q,[e("small",null,[n(l,{t:"Peer"})])]),p(e("select",{id:"peer",class:"form-select","onUpdate:modelValue":t[1]||(t[1]=s=>this.selectedPeer=s),disabled:this.selectedConfiguration===void 0||this.pinging},[t[8]||(t[8]=e("option",{disabled:"",selected:"",value:void 0},null,-1)),this.selectedConfiguration!==void 0?(i(!0),o(m,{key:0},g(this.cips[this.selectedConfiguration],(s,a)=>(i(),o("option",{value:a},d(a),9,K))),256)):f("",!0)],8,J),[[k,this.selectedPeer]])]),e("div",null,[e("label",Q,[e("small",null,[n(l,{t:"IP Address"})])]),p(e("select",{id:"ip",class:"form-select","onUpdate:modelValue":t[2]||(t[2]=s=>this.selectedIp=s),disabled:this.selectedPeer===void 0||this.pinging},[t[9]||(t[9]=e("option",{disabled:"",selected:"",value:void 0},null,-1)),this.selectedPeer!==void 0?(i(!0),o(m,{key:0},g(this.cips[this.selectedConfiguration][this.selectedPeer].allowed_ips,s=>(i(),o("option",null,d(s),1))),256)):f("",!0)],8,W),[[k,this.selectedIp]])]),e("div",X,[t[10]||(t[10]=e("div",{class:"flex-grow-1 border-top"},null,-1)),e("small",Y,[n(l,{t:"OR"})]),t[11]||(t[11]=e("div",{class:"flex-grow-1 border-top"},null,-1))]),e("div",null,[e("label",Z,[e("small",null,[n(l,{t:"Enter IP Address / Hostname"})])]),p(e("input",{class:"form-control",type:"text",id:"ipAddress",disabled:this.pinging,"onUpdate:modelValue":t[3]||(t[3]=s=>this.selectedIp=s)},null,8,ee),[[w,this.selectedIp]])]),t[16]||(t[16]=e("div",{class:"w-100 border-top my-2"},null,-1)),e("div",null,[e("label",se,[e("small",null,[n(l,{t:"Count"})])]),e("div",te,[e("button",{onClick:t[4]||(t[4]=s=>this.count--),disabled:this.count===1,class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},t[12]||(t[12]=[e("i",{class:"bi bi-dash-lg"},null,-1)]),8,le),e("strong",null,d(this.count),1),e("button",{role:"button",onClick:t[5]||(t[5]=s=>this.count++),class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},t[13]||(t[13]=[e("i",{class:"bi bi-plus-lg"},null,-1)]))])]),e("button",{class:"btn btn-primary rounded-3 mt-3 position-relative",disabled:!this.selectedIp||this.pinging,onClick:t[6]||(t[6]=s=>this.executeSocket())},[n(I,{name:"slide"},{default:h(()=>[this.pinging?(i(),o("span",oe,t[15]||(t[15]=[e("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1),e("span",{class:"visually-hidden",role:"status"},"Loading...",-1)]))):(i(),o("span",ie,t[14]||(t[14]=[e("i",{class:"bi bi-person-walking me-2"},null,-1),L("Ping! ")])))]),_:1})],8,ne)]),e("div",de,[(i(),T(A,null,{fallback:h(()=>t[17]||(t[17]=[e("div",{class:"bg-body-secondary rounded-3 mb-3 d-flex",key:"OSMapPlaceholder",style:{height:"300px"}},[e("div",{class:"spinner-border m-auto",style:{"animation-duration":"2s"},role:"status"},[e("span",{class:"visually-hidden"},"Loading...")])],-1)])),default:h(()=>[n(y,{d:this.socketResult.pingResults,key:"OSMap",type:"traceroute"},null,8,["d"])]),_:1})),e("div",ae,[e("div",ue,[e("table",ce,[e("thead",null,[e("tr",null,[e("th",re,[n(l,{t:"IP Address"})]),e("th",pe,[n(l,{t:"Is Alive?"})]),e("th",me,[n(l,{t:"RTT"})]),e("th",ge,[n(l,{t:"Geolocation"})])])]),e("tbody",null,[n(M,{name:"ping"},{default:h(()=>[(i(!0),o(m,null,g(r.socketResult.pingResults,s=>(i(),o("tr",{key:s.id},[e("td",null,[e("small",null,d(s.address),1)]),e("td",null,[e("small",null,[e("i",{class:O(["bi",[s.is_alive?"bi-check-circle-fill text-success":"bi-x-circle-fill text-danger"]])},null,2)])]),e("td",null,[e("small",null,d(s.is_alive?s.max_rtt:""),1)]),e("td",null,[s.geo&&s.geo.status==="success"?(i(),o("small",fe,d(s.geo.city)+", "+d(s.geo.country),1)):f("",!0)])]))),128))]),_:1}),r.socketResult.pingResults.length===0?(i(),o("tr",he,[e("td",_e,[e("small",null,[n(l,{t:"Ping results will show here"})])])])):f("",!0),e("tr",be,[e("td",null,[e("small",null,[n(l,{t:"Sent Package(s)"})])]),e("td",null,[e("small",null,[n(l,{t:"Received Package(s)"})])]),e("td",null,[e("small",null,[n(l,{t:"Lost Package(s)"})])]),e("td",ve,[e("small",null,[n(l,{t:"Average / Min / Max Round Trip Time"})])])]),e("tr",null,[e("td",ke,[e("small",null,d(this.socketResult.pingResults.length),1)]),e("td",xe,[e("small",null,d(this.socketResult.pingResults.filter(s=>s.is_alive).length),1)]),e("td",ye,[e("small",null,d(this.socketResult.pingResults.filter(s=>!s.is_alive).length),1)]),e("td",Re,[this.socketResult.pingResults.filter(s=>s.is_alive).length>0?(i(),o("small",Ce,d((this.socketResult.pingResults.filter(s=>s.is_alive).map(s=>s.max_rtt).reduce((s,a)=>s+a)/this.socketResult.pingResults.filter(s=>s.is_alive).length).toFixed(3))+"ms / "+d(Math.min(...this.socketResult.pingResults.filter(s=>s.is_alive).map(s=>s.max_rtt)))+"ms / "+d(Math.max(...this.socketResult.pingResults.filter(s=>s.is_alive).map(s=>s.max_rtt)))+"ms ",1)):(i(),o("small",Pe," 0ms / 0ms / 0ms "))])])])])])])])])])])}const Ae=R(D,[["render",Se],["__scopeId","data-v-47f01fbc"]]);export{Ae as default}; diff --git a/src/static/app/dist/assets/ping-Dr8Ebh5i.js b/src/static/app/dist/assets/ping-Dr8Ebh5i.js deleted file mode 100644 index 6cd4366..0000000 --- a/src/static/app/dist/assets/ping-Dr8Ebh5i.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as ye,D as _e,r as O,C as Pe,o as qe,E as Ie,a as p,c as g,b as o,d as f,y as De,g as Ve,m as B,B as W,F as N,h as L,e as P,x as Fe,t as y,w as z,T as Ue,i as Me,S as $e,f as He,n as Ke,j as ae}from"./index-7qLsecvh.js";import{L as be}from"./localeText-BguG5zGd.js";import{V as We,f as ce,M as ze,T as Ye,O as Je,a as Xe,S as le,C as Qe,F as Ge,b as he,c as je,L as Ze,d as ue,P as et,e as tt}from"./osmap-CVrWGfN8.js";const E=Object.create(null);E.open="0";E.close="1";E.ping="2";E.pong="3";E.message="4";E.upgrade="5";E.noop="6";const D=Object.create(null);Object.keys(E).forEach(n=>{D[E[n]]=n});const Q={type:"error",data:"parser error"},ve=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",we=typeof ArrayBuffer=="function",ke=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,se=({type:n,data:e},t,s)=>ve&&e instanceof Blob?t?s(e):de(e,s):we&&(e instanceof ArrayBuffer||ke(e))?t?s(e):de(new Blob([e]),s):s(E[n]+(e||"")),de=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function fe(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Y;function st(n,e){if(ve&&n.data instanceof Blob)return n.data.arrayBuffer().then(fe).then(e);if(we&&(n.data instanceof ArrayBuffer||ke(n.data)))return e(fe(n.data));se(n,!1,t=>{Y||(Y=new TextEncoder),e(Y.encode(t))})}const pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n{let e=n.length*.75,t=n.length,s,i=0,r,c,l,a;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const u=new ArrayBuffer(e),m=new Uint8Array(u);for(s=0;s>4,m[i++]=(c&15)<<4|l>>2,m[i++]=(l&3)<<6|a&63;return u},it=typeof ArrayBuffer=="function",ne=(n,e)=>{if(typeof n!="string")return{type:"message",data:Ee(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:rt(n.substring(1),e)}:D[t]?n.length>1?{type:D[t],data:n.substring(1)}:{type:D[t]}:Q},rt=(n,e)=>{if(it){const t=nt(n);return Ee(t,e)}else return{base64:!0,data:n}},Ee=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},Re="",ot=(n,e)=>{const t=n.length,s=new Array(t);let i=0;n.forEach((r,c)=>{se(r,!1,l=>{s[c]=l,++i===t&&e(s.join(Re))})})},at=(n,e)=>{const t=n.split(Re),s=[];for(let i=0;i{const s=t.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const r=new DataView(i.buffer);r.setUint8(0,126),r.setUint16(1,s)}else{i=new Uint8Array(9);const r=new DataView(i.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let J;function q(n){return n.reduce((e,t)=>e+t.length,0)}function I(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let i=0;iMath.pow(2,21)-1){l.enqueue(Q);break}i=m*Math.pow(2,32)+u.getUint32(4),s=3}else{if(q(t)n){l.enqueue(Q);break}}}})}const Te=4;function d(n){if(n)return ht(n)}function ht(n){for(var e in d.prototype)n[e]=d.prototype[e];return n}d.prototype.on=d.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};d.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};d.prototype.off=d.prototype.removeListener=d.prototype.removeAllListeners=d.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,i=0;iPromise.resolve().then(e):(e,t)=>t(e,0),b=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ut="arraybuffer";function xe(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const dt=b.setTimeout,ft=b.clearTimeout;function $(n,e){e.useNativeTimers?(n.setTimeoutFn=dt.bind(b),n.clearTimeoutFn=ft.bind(b)):(n.setTimeoutFn=b.setTimeout.bind(b),n.clearTimeoutFn=b.clearTimeout.bind(b))}const pt=1.33;function mt(n){return typeof n=="string"?gt(n):Math.ceil((n.byteLength||n.size)*pt)}function gt(n){let e=0,t=0;for(let s=0,i=n.length;s=57344?t+=3:(s++,t+=4);return t}function Ae(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function yt(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function _t(n){let e={},t=n.split("&");for(let s=0,i=t.length;s{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};at(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,ot(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=Ae()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let Se=!1;try{Se=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const wt=Se;function kt(){}class Et extends vt{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,r)=>{this.onError("xhr post error",i,r)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}class k extends d{constructor(e,t,s){super(),this.createRequest=e,$(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=xe(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=k.requestsCount++,k.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=kt,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete k.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}k.requestsCount=0;k.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",me);else if(typeof addEventListener=="function"){const n="onpagehide"in b?"pagehide":"unload";addEventListener(n,me,!1)}}function me(){for(let n in k.requests)k.requests.hasOwnProperty(n)&&k.requests[n].abort()}const Rt=function(){const n=Ce({xdomain:!1});return n&&n.responseType!==null}();class Tt extends Et{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=Rt&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new k(Ce,this.uri(),e)}}function Ce(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||wt))return new XMLHttpRequest}catch{}if(!e)try{return new b[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Oe=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xt extends ie{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=Oe?{}:xe(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{try{this.doWrite(s,r)}catch{}i&&M(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Ae()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const X=b.WebSocket||b.MozWebSocket;class At extends xt{createSocket(e,t,s){return Oe?new X(e,t,s):t?new X(e,t):new X(e)}doWrite(e,t){this.ws.send(t)}}class St extends ie{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=lt(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=ct();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const r=()=>{s.read().then(({done:l,value:a})=>{l||(this.onPacket(a),r())}).catch(l=>{})};r();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t{i&&M(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Ct={websocket:At,webtransport:St,polling:Tt},Ot=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Bt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function G(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let i=Ot.exec(n||""),r={},c=14;for(;c--;)r[Bt[c]]=i[c]||"";return t!=-1&&s!=-1&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=Nt(r,r.path),r.queryKey=Lt(r,r.query),r}function Nt(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function Lt(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,r){i&&(t[i]=r)}),t}const j=typeof addEventListener=="function"&&typeof removeEventListener=="function",V=[];j&&addEventListener("offline",()=>{V.forEach(n=>n())},!1);class R extends d{constructor(e,t){if(super(),this.binaryType=ut,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const s=G(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=G(t.host).host);$(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=_t(this.opts.query)),j&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},V.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=Te,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&R.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",R.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,M(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,i){if(typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const r={type:e,data:t,options:s};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(R.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),j&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=V.indexOf(this._offlineEventListener);s!==-1&&V.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}R.protocol=Te;class Pt extends R{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",_=>{if(!s)if(_.type==="pong"&&_.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;R.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(m(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const v=new Error("probe error");v.transport=t.name,this.emitReserved("upgradeError",v)}}))};function r(){s||(s=!0,m(),t.close(),t=null)}const c=_=>{const v=new Error("probe error: "+_);v.transport=t.name,r(),this.emitReserved("upgradeError",v)};function l(){c("transport closed")}function a(){c("socket closed")}function u(_){t&&_.name!==t.name&&r()}const m=()=>{t.removeListener("open",i),t.removeListener("error",c),t.removeListener("close",l),this.off("close",a),this.off("upgrading",u)};t.once("open",i),t.once("error",c),t.once("close",l),this.once("close",a),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;sCt[i]).filter(i=>!!i)),super(e,s)}};function It(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=G(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const r=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+r+":"+s.port+e,s.href=s.protocol+"://"+r+(t&&t.port===s.port?"":":"+s.port),s}const Dt=typeof ArrayBuffer=="function",Vt=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,Be=Object.prototype.toString,Ft=typeof Blob=="function"||typeof Blob<"u"&&Be.call(Blob)==="[object BlobConstructor]",Ut=typeof File=="function"||typeof File<"u"&&Be.call(File)==="[object FileConstructor]";function re(n){return Dt&&(n instanceof ArrayBuffer||Vt(n))||Ft&&n instanceof Blob||Ut&&n instanceof File}function F(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t=0&&n.num{delete this.acks[e];for(let l=0;l{this.io.clearTimeoutFn(r),t.apply(this,l)};c.withError=!0,this.acks[e]=c}emitWithAck(e,...t){return new Promise((s,i)=>{const r=(c,l)=>c?i(c):s(l);r.withError=!0,t.push(r),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...r)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...r)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case h.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(e);break;case h.ACK:case h.BINARY_ACK:this.onack(e);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let s=!1;return function(...i){s||(s=!0,t.packet({type:h.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s0&&n.jitter<=1?n.jitter:0,this.attempts=0}A.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=Math.floor(e*10)&1?n+t:n-t}return Math.min(n,this.max)|0};A.prototype.reset=function(){this.attempts=0};A.prototype.setMin=function(n){this.ms=n};A.prototype.setMax=function(n){this.max=n};A.prototype.setJitter=function(n){this.jitter=n};class te extends d{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,$(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new A({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||Yt;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new qt(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=w(t,"open",function(){s.onopen(),e&&e()}),r=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),e?e(l):this.maybeReconnectOnOpen()},c=w(t,"error",r);if(this._timeout!==!1){const l=this._timeout,a=this.setTimeoutFn(()=>{i(),r(new Error("timeout")),t.close()},l);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(c),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(w(e,"ping",this.onping.bind(this)),w(e,"data",this.ondata.bind(this)),w(e,"error",this.onerror.bind(this)),w(e,"close",this.onclose.bind(this)),w(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){M(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new Ne(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;se()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const S={};function U(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=It(n,e.path||"/socket.io"),s=t.source,i=t.id,r=t.path,c=S[i]&&r in S[i].nsps,l=e.forceNew||e["force new connection"]||e.multiplex===!1||c;let a;return l?a=new te(s,e):(S[i]||(S[i]=new te(s,e)),a=S[i]),t.query&&!e.query&&(e.query=t.queryKey),a.socket(t.path,e)}Object.assign(U,{Manager:te,Socket:Ne,io:U,connect:U});const Xt={key:0,class:"bg-body-secondary rounded-3 mb-3 d-flex animate__animated animate__fadeIn",style:{height:"300px"}},Qt={class:"m-auto"},Gt={class:"text-muted"},jt={key:1,id:"map",class:"w-100 rounded-3"},Zt={__name:"osmapSocket",props:{type:"",d:Object||Array},async setup(n){let e,t;const s=_e(),i=n,r=O(!1);if([e,t]=Pe(()=>fetch("https://tile.openstreetmap.org/",{signal:AbortSignal.timeout(1500)}).then(()=>{r.value=!0}).catch(c=>{console.log(c)})),await e,t(),r.value){const c=new We({center:ce([179.47,57.89]),zoom:1}),l=new ze({layers:[new Ye({source:new Je})],view:c}),a=new Xe({style:function(T){if(T.getGeometry().getType()==="Point")return new le({image:new Qe({radius:10,fill:new Ge({color:T.get("last")?"#dc3545":"#0d6efd"}),stroke:new he({color:"white",width:5})})});if(T.getGeometry().getType()==="LineString")return new le({stroke:new he({color:"#0d6efd",width:2})})}});l.addLayer(a),qe(()=>{l.setTarget("map"),s.Configuration.Server.dashboard_theme==="dark"&&l.on("postcompose",()=>{document.querySelector("#map").style.filter="grayscale(80%) invert(100%)"})});let u=new je,m=[],_=new Ze(m),v=new ue({geometry:_});u.addFeature(v);let H=O([]);a.setSource(u),Ie(()=>i.d,T=>{if(T.length>0){let x=T[T.length-1];if(x.geo&&x.geo.status==="success"){let K=ce([x.geo.lon,x.geo.lat]);H.value.find(Le=>Le===x.address)||(m.push(K),_.setCoordinates(m),v.setGeometry(_),u.removeFeature(v),u.addFeature(v),console.log(v),u.addFeature(new ue({geometry:new et(K),last:!1})),H.value.push(x.address)),c.animate({center:K}),c.animate({zoom:10})}}else u.clear(),m=[],H.value=[]},{deep:!0})}return(c,l)=>r.value?(p(),g("div",jt)):(p(),g("div",Xt,[o("div",Qt,[o("small",Gt,[f(be,{t:"Sorry, OpenStreetMap is not available"})])])]))}},es=ye(Zt,[["__scopeId","data-v-457711ff"]]),ts={name:"ping",components:{OsmapSocket:es,OSMap:tt,LocaleText:be},data(){return{loading:!1,cips:{},selectedConfiguration:void 0,selectedPeer:void 0,selectedIp:void 0,pingResult:void 0}},setup(){const n=_e();let e;const t=O({pingTotalSentCount:0,pingReceivedSentCount:0,pingLostCount:0,pingResults:[]}),s=O(4),i=O(!1);try{e=U(),e.connect(),console.info("Successfully connected to socket.io")}catch{console.assert("Failed to connect socket.io")}return e.on("pingResponse",(...r)=>{let c=r[0].data;c.id=De().toString(),t.value.pingResults.push(c),t.value.pingResults.length===s.value&&(i.value=!1)}),{store:n,sio:e,socketResult:t,count:s,pinging:i}},beforeUnmount(){this.sio&&this.sio.connected&&(this.sio.disconnect(),console.info("Successfully disconnected from socket.io"))},mounted(){Ve("/api/ping/getAllPeersIpAddress",{},n=>{n.status&&(this.loading=!0,this.cips=n.data)})},methods:{executeSocket(){this.sio.connected&&(this.socketResult.pingResults=[],this.pinging=!0,this.sio.emit("ping",{ipAddress:this.selectedIp,count:this.count}))}},watch:{selectedConfiguration(){this.selectedPeer=void 0,this.selectedIp=void 0},selectedPeer(){this.selectedIp=void 0}}},ss={class:"mt-md-5 mt-3 text-body"},ns={class:"container"},is={class:"row"},rs={class:"col-sm-4 d-flex gap-2 flex-column"},os={class:"mb-1 text-muted",for:"configuration"},as=["disabled"],cs=["value"],ls={class:"mb-1 text-muted",for:"peer"},hs=["disabled"],us=["value"],ds={class:"mb-1 text-muted",for:"ip"},fs=["disabled"],ps={class:"d-flex align-items-center gap-2"},ms={class:"text-muted"},gs={class:"mb-1 text-muted",for:"ipAddress"},ys=["disabled"],_s={class:"mb-1 text-muted",for:"count"},bs={class:"d-flex gap-3 align-items-center"},vs=["disabled"],ws=["disabled"],ks={key:0,class:"d-block"},Es={key:1,class:"d-block"},Rs={class:"col-sm-8 position-relative d-flex flex-column gap-2 animate__fadeIn animate__animated"},Ts={key:"pingResultTable"},xs={key:"table",class:"w-100 mt-2"},As={class:"table table-sm rounded-3 w-100"},Ss={scope:"col"},Cs={scope:"col"},Os={scope:"col"},Bs={scope:"col"},Ns={key:0},Ls={key:0},Ps={colspan:"4",class:"text-muted text-center"},qs={class:"bg-body-tertiary border-top fw-bold",style:{"border-top":"2px solid !important"}},Is={colspan:"2"},Ds={class:""},Vs={class:""},Fs={class:""},Us={colspan:"2"},Ms={key:0},$s={key:1};function Hs(n,e,t,s,i,r){const c=ae("LocaleText"),l=ae("OsmapSocket");return p(),g("div",ss,[o("div",ns,[e[18]||(e[18]=o("h3",{class:"mb-3 text-body"},"Ping",-1)),o("div",is,[o("div",rs,[o("div",null,[o("label",os,[o("small",null,[f(c,{t:"Configuration"})])]),B(o("select",{class:"form-select","onUpdate:modelValue":e[0]||(e[0]=a=>this.selectedConfiguration=a),disabled:this.pinging},[e[7]||(e[7]=o("option",{disabled:"",selected:"",value:void 0},null,-1)),(p(!0),g(N,null,L(this.cips,(a,u)=>(p(),g("option",{value:u},y(u),9,cs))),256))],8,as),[[W,this.selectedConfiguration]])]),o("div",null,[o("label",ls,[o("small",null,[f(c,{t:"Peer"})])]),B(o("select",{id:"peer",class:"form-select","onUpdate:modelValue":e[1]||(e[1]=a=>this.selectedPeer=a),disabled:this.selectedConfiguration===void 0||this.pinging},[e[8]||(e[8]=o("option",{disabled:"",selected:"",value:void 0},null,-1)),this.selectedConfiguration!==void 0?(p(!0),g(N,{key:0},L(this.cips[this.selectedConfiguration],(a,u)=>(p(),g("option",{value:u},y(u),9,us))),256)):P("",!0)],8,hs),[[W,this.selectedPeer]])]),o("div",null,[o("label",ds,[o("small",null,[f(c,{t:"IP Address"})])]),B(o("select",{id:"ip",class:"form-select","onUpdate:modelValue":e[2]||(e[2]=a=>this.selectedIp=a),disabled:this.selectedPeer===void 0||this.pinging},[e[9]||(e[9]=o("option",{disabled:"",selected:"",value:void 0},null,-1)),this.selectedPeer!==void 0?(p(!0),g(N,{key:0},L(this.cips[this.selectedConfiguration][this.selectedPeer].allowed_ips,a=>(p(),g("option",null,y(a),1))),256)):P("",!0)],8,fs),[[W,this.selectedIp]])]),o("div",ps,[e[10]||(e[10]=o("div",{class:"flex-grow-1 border-top"},null,-1)),o("small",ms,[f(c,{t:"OR"})]),e[11]||(e[11]=o("div",{class:"flex-grow-1 border-top"},null,-1))]),o("div",null,[o("label",gs,[o("small",null,[f(c,{t:"Enter IP Address / Hostname"})])]),B(o("input",{class:"form-control",type:"text",id:"ipAddress",disabled:this.pinging,"onUpdate:modelValue":e[3]||(e[3]=a=>this.selectedIp=a)},null,8,ys),[[Fe,this.selectedIp]])]),e[16]||(e[16]=o("div",{class:"w-100 border-top my-2"},null,-1)),o("div",null,[o("label",_s,[o("small",null,[f(c,{t:"Count"})])]),o("div",bs,[o("button",{onClick:e[4]||(e[4]=a=>this.count--),disabled:this.count===1,class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},e[12]||(e[12]=[o("i",{class:"bi bi-dash-lg"},null,-1)]),8,vs),o("strong",null,y(this.count),1),o("button",{role:"button",onClick:e[5]||(e[5]=a=>this.count++),class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},e[13]||(e[13]=[o("i",{class:"bi bi-plus-lg"},null,-1)]))])]),o("button",{class:"btn btn-primary rounded-3 mt-3 position-relative",disabled:!this.selectedIp||this.pinging,onClick:e[6]||(e[6]=a=>this.executeSocket())},[f(Ue,{name:"slide"},{default:z(()=>[this.pinging?(p(),g("span",Es,e[15]||(e[15]=[o("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1),o("span",{class:"visually-hidden",role:"status"},"Loading...",-1)]))):(p(),g("span",ks,e[14]||(e[14]=[o("i",{class:"bi bi-person-walking me-2"},null,-1),He("Ping! ")])))]),_:1})],8,ws)]),o("div",Rs,[(p(),Me($e,null,{fallback:z(()=>e[17]||(e[17]=[o("div",{class:"bg-body-secondary rounded-3 mb-3 d-flex",key:"OSMapPlaceholder",style:{height:"300px"}},[o("div",{class:"spinner-border m-auto",style:{"animation-duration":"2s"},role:"status"},[o("span",{class:"visually-hidden"},"Loading...")])],-1)])),default:z(()=>[f(l,{d:this.socketResult.pingResults,key:"OSMap",type:"traceroute"},null,8,["d"])]),_:1})),o("div",Ts,[o("div",xs,[o("table",As,[o("thead",null,[o("tr",null,[o("th",Ss,[f(c,{t:"IP Address"})]),o("th",Cs,[f(c,{t:"Is Alive?"})]),o("th",Os,[f(c,{t:"Round-Trip Time (ms)"})]),o("th",Bs,[f(c,{t:"Geolocation"})])])]),o("tbody",null,[(p(!0),g(N,null,L(s.socketResult.pingResults,(a,u)=>(p(),g("tr",null,[o("td",null,[o("small",null,y(a.address),1)]),o("td",null,[o("small",null,[o("i",{class:Ke(["bi",[a.is_alive?"bi-check-circle-fill text-success":"bi-x-circle-fill text-danger"]])},null,2)])]),o("td",null,[o("small",null,y(a.is_alive?a.max_rtt:""),1)]),o("td",null,[a.geo&&a.geo.status==="success"?(p(),g("small",Ns,y(a.geo.city)+", "+y(a.geo.country),1)):P("",!0)])]))),256)),s.socketResult.pingResults.length===0?(p(),g("tr",Ls,[o("td",Ps,[o("small",null,[f(c,{t:"Ping results will show here"})])])])):P("",!0),o("tr",qs,[o("td",null,[o("small",null,[f(c,{t:"Sent Package(s)"})])]),o("td",null,[o("small",null,[f(c,{t:"Received Package(s)"})])]),o("td",null,[o("small",null,[f(c,{t:"Lost Package(s)"})])]),o("td",Is,[o("small",null,[f(c,{t:"Average / Min / Max Round Trip Time"})])])]),o("tr",null,[o("td",Ds,[o("small",null,y(this.socketResult.pingResults.length),1)]),o("td",Vs,[o("small",null,y(this.socketResult.pingResults.filter(a=>a.is_alive).length),1)]),o("td",Fs,[o("small",null,y(this.socketResult.pingResults.filter(a=>!a.is_alive).length),1)]),o("td",Us,[this.socketResult.pingResults.filter(a=>a.is_alive).length>0?(p(),g("small",Ms,y((this.socketResult.pingResults.filter(a=>a.is_alive).map(a=>a.max_rtt).reduce((a,u)=>a+u)/this.socketResult.pingResults.filter(a=>a.is_alive).length).toFixed(3))+"ms / "+y(Math.min(...this.socketResult.pingResults.filter(a=>a.is_alive).map(a=>a.max_rtt)))+"ms / "+y(Math.max(...this.socketResult.pingResults.filter(a=>a.is_alive).map(a=>a.max_rtt)))+"ms ",1)):(p(),g("small",$s," 0ms / 0ms / 0ms "))])])])])])])])])])])}const Js=ye(ts,[["render",Hs],["__scopeId","data-v-f5525716"]]);export{Js as default}; diff --git a/src/static/app/dist/assets/protocolBadge-CVzzEU4-.js b/src/static/app/dist/assets/protocolBadge-DeLW9wVX.js similarity index 77% rename from src/static/app/dist/assets/protocolBadge-CVzzEU4-.js rename to src/static/app/dist/assets/protocolBadge-DeLW9wVX.js index c71bf67..ff48db6 100644 --- a/src/static/app/dist/assets/protocolBadge-CVzzEU4-.js +++ b/src/static/app/dist/assets/protocolBadge-DeLW9wVX.js @@ -1 +1 @@ -import{L as r}from"./localeText-BguG5zGd.js";import{a as t,c as n,f as i,i as s,e as a}from"./index-7qLsecvh.js";const d={key:0,class:"badge wireguardBg rounded-3 shadow"},c={key:1,class:"badge amneziawgBg rounded-3 shadow"},u={__name:"protocolBadge",props:{protocol:String,mini:!1},setup(e){return(m,o)=>e.protocol==="wg"?(t(),n("span",d,[o[0]||(o[0]=i(" WireGuard ")),e.mini?a("",!0):(t(),s(r,{key:0,t:"Configuration"}))])):e.protocol==="awg"?(t(),n("span",c,[o[1]||(o[1]=i(" AmneziaWG ")),e.mini?a("",!0):(t(),s(r,{key:0,t:"Configuration"}))])):a("",!0)}};export{u as _}; +import{L as r}from"./localeText-Dh33930I.js";import{a as t,c as n,f as i,i as s,e as a}from"./index-CgM9eUIs.js";const d={key:0,class:"badge wireguardBg rounded-3 shadow"},c={key:1,class:"badge amneziawgBg rounded-3 shadow"},u={__name:"protocolBadge",props:{protocol:String,mini:!1},setup(e){return(m,o)=>e.protocol==="wg"?(t(),n("span",d,[o[0]||(o[0]=i(" WireGuard ")),e.mini?a("",!0):(t(),s(r,{key:0,t:"Configuration"}))])):e.protocol==="awg"?(t(),n("span",c,[o[1]||(o[1]=i(" AmneziaWG ")),e.mini?a("",!0):(t(),s(r,{key:0,t:"Configuration"}))])):a("",!0)}};export{u as _}; diff --git a/src/static/app/dist/assets/restoreConfiguration-BKQ8n4I1.js b/src/static/app/dist/assets/restoreConfiguration-DAp7sHOi.js similarity index 98% rename from src/static/app/dist/assets/restoreConfiguration-BKQ8n4I1.js rename to src/static/app/dist/assets/restoreConfiguration-DAp7sHOi.js index 621ab22..d05f9f9 100644 --- a/src/static/app/dist/assets/restoreConfiguration-BKQ8n4I1.js +++ b/src/static/app/dist/assets/restoreConfiguration-DAp7sHOi.js @@ -1,4 +1,4 @@ -import{_ as T,r as k,o as A,a as n,c as r,b as e,t as x,F as N,h as D,i as f,d as l,n as v,A as W,e as w,I as z,W as F,p as C,E as G,D as E,J as H,m as g,x as _,f as $,z as J,g as Z,w as B,T as V,j as Q}from"./index-7qLsecvh.js";import{L as o}from"./localeText-BguG5zGd.js";import{d as X}from"./dayjs.min-C341O-eN.js";import{_ as q}from"./protocolBadge-CVzzEU4-.js";import{p as O}from"./index-L60y6kc9.js";const ee={class:"card rounded-3 shadow-sm"},te={class:"mb-0 d-flex align-items-center gap-3"},se={class:"text-muted ms-auto d-block"},oe={key:0,class:"card-footer p-3 d-flex flex-column gap-2"},le=["onClick","id"],ne={class:"card-body d-flex p-3 gap-3 align-items-center"},ae={__name:"backupGroup",props:{configurationName:String,backups:Array,open:!1,selectedConfigurationBackup:Object,protocol:Array},emits:["select"],setup(m,{emit:u}){const t=m,y=u,p=k(t.open);return A(()=>{t.selectedConfigurationBackup&&document.querySelector(`#${t.selectedConfigurationBackup.filename.replace(".conf","")}`).scrollIntoView({behavior:"smooth"})}),(h,a)=>(n(),r("div",ee,[e("a",{role:"button",class:"card-body d-flex align-items-center text-decoration-none d-flex gap-3",onClick:a[0]||(a[0]=c=>p.value=!p.value)},[e("h6",te,[e("samp",null,x(m.configurationName),1),(n(!0),r(N,null,D(m.protocol,c=>(n(),f(q,{protocol:c},null,8,["protocol"]))),256))]),e("small",se,[l(o,{t:m.backups.length+(m.backups.length>1?" Backups":" Backup")},null,8,["t"])]),e("h5",{class:v(["mb-0 dropdownIcon text-muted",{active:p.value}])},a[1]||(a[1]=[e("i",{class:"bi bi-chevron-down"},null,-1)]),2)]),p.value?(n(),r("div",oe,[(n(!0),r(N,null,D(m.backups,c=>(n(),r("div",{class:"card rounded-3 shadow-sm animate__animated",key:c.filename,onClick:()=>{y("select",c)},id:c.filename.replace(".conf",""),role:"button"},[e("div",ne,[e("small",null,[a[2]||(a[2]=e("i",{class:"bi bi-file-earmark me-2"},null,-1)),e("samp",null,x(c.filename),1)]),e("small",null,[a[3]||(a[3]=e("i",{class:"bi bi-clock-history me-2"},null,-1)),e("samp",null,x(W(X)(c.backupDate).format("YYYY-MM-DD HH:mm:ss")),1)]),e("small",null,[a[4]||(a[4]=e("i",{class:"bi bi-database me-2"},null,-1)),c.database?(n(),f(o,{key:0,t:"Yes"})):(n(),f(o,{key:1,t:"No"}))]),a[5]||(a[5]=e("small",{class:"text-muted ms-auto"},[e("i",{class:"bi bi-chevron-right"})],-1))])],8,le))),128))])):w("",!0)]))}},ie=T(ae,[["__scopeId","data-v-ccf48ac7"]]),re={class:"d-flex flex-column gap-5",id:"confirmBackup"},de={class:"d-flex flex-column gap-3"},ue={class:"d-flex flex-column flex-sm-row align-items-start align-items-sm-center gap-3"},ce={class:"mb-0"},me={class:"text-muted mb-1"},fe={class:"mb-0"},pe={class:"text-muted mb-1",for:"ConfigurationName"},ve={class:"invalid-feedback"},be={key:0},ge={key:1},_e={class:"mb-0"},ke={class:"row g-3"},xe={class:"col-sm"},ye={class:"text-muted mb-1",for:"PrivateKey"},he={class:"input-group"},Ce={class:"col-sm"},Pe={class:"text-muted mb-1",for:"PublicKey"},we={class:"text-muted mb-1",for:"ListenPort"},$e={class:"invalid-feedback"},Be={key:0},Ne={key:1},De={class:"mb-0"},Ae={class:"text-muted mb-1 d-flex",for:"ListenPort"},Ie={class:"invalid-feedback"},Le={key:0},Se={key:1},Ue={class:"accordion",id:"newConfigurationOptionalAccordion"},Ke={class:"accordion-item"},Re={class:"accordion-header"},Ve={class:"accordion-button collapsed rounded-3",type:"button","data-bs-toggle":"collapse","data-bs-target":"#newConfigurationOptionalAccordionCollapse"},Oe={id:"newConfigurationOptionalAccordionCollapse",class:"accordion-collapse collapse","data-bs-parent":"#newConfigurationOptionalAccordion"},Te={class:"accordion-body d-flex flex-column gap-3"},Ee={class:"text-muted mb-1",for:"PreUp"},qe={class:"text-muted mb-1",for:"PreDown"},je={class:"text-muted mb-1",for:"PostUp"},Me={class:"text-muted mb-1",for:"PostDown"},Ye={class:"d-flex flex-column gap-3"},We={class:"d-flex flex-column flex-sm-row align-items-start align-items-sm-center gap-3"},ze={class:"mb-0"},Fe={key:0},Ge={class:"row g-3"},He={class:"col-sm"},Je={class:"card text-bg-success rounded-3"},Ze={class:"card-body"},Qe={class:"col-sm"},Xe={class:"card text-bg-warning rounded-3"},et={class:"card-body"},tt={class:"d-flex"},st=["disabled"],ot={__name:"confirmBackup",props:{selectedConfigurationBackup:Object},setup(m){const u=m,t=z({ConfigurationName:u.selectedConfigurationBackup.filename.split("_")[0],Backup:u.selectedConfigurationBackup.filename,Protocol:u.selectedConfigurationBackup.protocol}),y=u.selectedConfigurationBackup.content.split(` +import{_ as T,r as k,o as A,a as n,c as r,b as e,t as x,F as N,h as D,i as f,d as l,n as v,A as W,e as w,I as z,W as F,p as C,H as G,D as E,J as H,m as g,x as _,f as $,z as J,g as Z,w as B,T as V,j as Q}from"./index-CgM9eUIs.js";import{L as o}from"./localeText-Dh33930I.js";import{d as X}from"./dayjs.min-B2wceQaW.js";import{_ as q}from"./protocolBadge-DeLW9wVX.js";import{p as O}from"./index-L60y6kc9.js";const ee={class:"card rounded-3 shadow-sm"},te={class:"mb-0 d-flex align-items-center gap-3"},se={class:"text-muted ms-auto d-block"},oe={key:0,class:"card-footer p-3 d-flex flex-column gap-2"},le=["onClick","id"],ne={class:"card-body d-flex p-3 gap-3 align-items-center"},ae={__name:"backupGroup",props:{configurationName:String,backups:Array,open:!1,selectedConfigurationBackup:Object,protocol:Array},emits:["select"],setup(m,{emit:u}){const t=m,y=u,p=k(t.open);return A(()=>{t.selectedConfigurationBackup&&document.querySelector(`#${t.selectedConfigurationBackup.filename.replace(".conf","")}`).scrollIntoView({behavior:"smooth"})}),(h,a)=>(n(),r("div",ee,[e("a",{role:"button",class:"card-body d-flex align-items-center text-decoration-none d-flex gap-3",onClick:a[0]||(a[0]=c=>p.value=!p.value)},[e("h6",te,[e("samp",null,x(m.configurationName),1),(n(!0),r(N,null,D(m.protocol,c=>(n(),f(q,{protocol:c},null,8,["protocol"]))),256))]),e("small",se,[l(o,{t:m.backups.length+(m.backups.length>1?" Backups":" Backup")},null,8,["t"])]),e("h5",{class:v(["mb-0 dropdownIcon text-muted",{active:p.value}])},a[1]||(a[1]=[e("i",{class:"bi bi-chevron-down"},null,-1)]),2)]),p.value?(n(),r("div",oe,[(n(!0),r(N,null,D(m.backups,c=>(n(),r("div",{class:"card rounded-3 shadow-sm animate__animated",key:c.filename,onClick:()=>{y("select",c)},id:c.filename.replace(".conf",""),role:"button"},[e("div",ne,[e("small",null,[a[2]||(a[2]=e("i",{class:"bi bi-file-earmark me-2"},null,-1)),e("samp",null,x(c.filename),1)]),e("small",null,[a[3]||(a[3]=e("i",{class:"bi bi-clock-history me-2"},null,-1)),e("samp",null,x(W(X)(c.backupDate).format("YYYY-MM-DD HH:mm:ss")),1)]),e("small",null,[a[4]||(a[4]=e("i",{class:"bi bi-database me-2"},null,-1)),c.database?(n(),f(o,{key:0,t:"Yes"})):(n(),f(o,{key:1,t:"No"}))]),a[5]||(a[5]=e("small",{class:"text-muted ms-auto"},[e("i",{class:"bi bi-chevron-right"})],-1))])],8,le))),128))])):w("",!0)]))}},ie=T(ae,[["__scopeId","data-v-ccf48ac7"]]),re={class:"d-flex flex-column gap-5",id:"confirmBackup"},de={class:"d-flex flex-column gap-3"},ue={class:"d-flex flex-column flex-sm-row align-items-start align-items-sm-center gap-3"},ce={class:"mb-0"},me={class:"text-muted mb-1"},fe={class:"mb-0"},pe={class:"text-muted mb-1",for:"ConfigurationName"},ve={class:"invalid-feedback"},be={key:0},ge={key:1},_e={class:"mb-0"},ke={class:"row g-3"},xe={class:"col-sm"},ye={class:"text-muted mb-1",for:"PrivateKey"},he={class:"input-group"},Ce={class:"col-sm"},Pe={class:"text-muted mb-1",for:"PublicKey"},we={class:"text-muted mb-1",for:"ListenPort"},$e={class:"invalid-feedback"},Be={key:0},Ne={key:1},De={class:"mb-0"},Ae={class:"text-muted mb-1 d-flex",for:"ListenPort"},Ie={class:"invalid-feedback"},Le={key:0},Se={key:1},Ue={class:"accordion",id:"newConfigurationOptionalAccordion"},Ke={class:"accordion-item"},Re={class:"accordion-header"},Ve={class:"accordion-button collapsed rounded-3",type:"button","data-bs-toggle":"collapse","data-bs-target":"#newConfigurationOptionalAccordionCollapse"},Oe={id:"newConfigurationOptionalAccordionCollapse",class:"accordion-collapse collapse","data-bs-parent":"#newConfigurationOptionalAccordion"},Te={class:"accordion-body d-flex flex-column gap-3"},Ee={class:"text-muted mb-1",for:"PreUp"},qe={class:"text-muted mb-1",for:"PreDown"},je={class:"text-muted mb-1",for:"PostUp"},Me={class:"text-muted mb-1",for:"PostDown"},Ye={class:"d-flex flex-column gap-3"},We={class:"d-flex flex-column flex-sm-row align-items-start align-items-sm-center gap-3"},ze={class:"mb-0"},Fe={key:0},Ge={class:"row g-3"},He={class:"col-sm"},Je={class:"card text-bg-success rounded-3"},Ze={class:"card-body"},Qe={class:"col-sm"},Xe={class:"card text-bg-warning rounded-3"},et={class:"card-body"},tt={class:"d-flex"},st=["disabled"],ot={__name:"confirmBackup",props:{selectedConfigurationBackup:Object},setup(m){const u=m,t=z({ConfigurationName:u.selectedConfigurationBackup.filename.split("_")[0],Backup:u.selectedConfigurationBackup.filename,Protocol:u.selectedConfigurationBackup.protocol}),y=u.selectedConfigurationBackup.content.split(` `);for(let i of y){if(i==="[Peer]")break;if(i.length>0){let s=i.replace(" = ","=").split("=");s[0]==="ListenPort"?t[s[0]]=parseInt(s[1]):t[s[0]]=s[1]}}const p=k(!1),h=k(!1),a=k(""),c=F(),b=C(()=>/^[a-zA-Z0-9_=+.-]{1,15}$/.test(t.ConfigurationName)&&t.ConfigurationName.length>0&&!c.Configurations.find(i=>i.Name===t.ConfigurationName)),P=C(()=>{try{window.wireguard.generatePublicKey(t.PrivateKey)}catch{return!1}return!0}),I=C(()=>t.ListenPort>0&&t.ListenPort<=65353&&Number.isInteger(t.ListenPort)&&!c.Configurations.find(i=>parseInt(i.ListenPort)===t.ListenPort)),L=C(()=>{try{return O(t.Address),!0}catch{return!1}}),S=C(()=>L.value&&I.value&&P.value&&b.value);A(()=>{document.querySelector("main").scrollTo({top:0,behavior:"smooth"}),G(()=>P,i=>{i&&(t.PublicKey=window.wireguard.generatePublicKey(t.PrivateKey))},{immediate:!0})});const U=C(()=>{let i;try{i=O(t.Address)}catch{return 0}return i.end-i.start}),K=C(()=>u.selectedConfigurationBackup.database?u.selectedConfigurationBackup.databaseContent.split(` `).filter(s=>s.search(`INSERT INTO "${t.ConfigurationName}"`)>=0).length:0),R=C(()=>u.selectedConfigurationBackup.database?u.selectedConfigurationBackup.databaseContent.split(` `).filter(s=>s.search(`INSERT INTO "${t.ConfigurationName}_restrict_access"`)>=0).length:0),j=E(),M=H(),Y=async()=>{S.value&&(h.value=!0,await J("/api/addWireguardConfiguration",t,async i=>{i.status?(j.newMessage("Server","Configuration restored","success"),await c.getConfigurations(),await M.push(`/configuration/${t.ConfigurationName}/peers`)):h.value=!1}))};return(i,s)=>(n(),r("div",re,[e("form",de,[e("div",ue,[e("h4",ce,[l(o,{t:"Configuration"})])]),e("div",null,[e("label",me,[e("small",null,[l(o,{t:"Protocol"})])]),e("h5",fe,[l(q,{protocol:m.selectedConfigurationBackup.protocol,mini:!0},null,8,["protocol"])])]),e("div",null,[e("label",pe,[e("small",null,[l(o,{t:"Configuration Name"})])]),g(e("input",{type:"text",class:v(["form-control rounded-3",[b.value?"is-valid":"is-invalid"]]),placeholder:"ex. wg1",id:"ConfigurationName","onUpdate:modelValue":s[0]||(s[0]=d=>t.ConfigurationName=d),disabled:"",required:""},null,2),[[_,t.ConfigurationName]]),e("div",ve,[p.value?(n(),r("div",be,x(a.value),1)):(n(),r("div",ge,[l(o,{t:"Configuration name is invalid. Possible reasons:"}),e("ul",_e,[e("li",null,[l(o,{t:"Configuration name already exist."})]),e("li",null,[l(o,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])]))])]),e("div",ke,[e("div",xe,[e("div",null,[e("label",ye,[e("small",null,[l(o,{t:"Private Key"})])]),e("div",he,[g(e("input",{type:"text",class:v(["form-control rounded-start-3",[P.value?"is-valid":"is-invalid"]]),id:"PrivateKey",required:"","onUpdate:modelValue":s[1]||(s[1]=d=>t.PrivateKey=d),disabled:""},null,2),[[_,t.PrivateKey]])])])]),e("div",Ce,[e("div",null,[e("label",Pe,[e("small",null,[l(o,{t:"Public Key"})])]),g(e("input",{type:"text",class:"form-control rounded-3",id:"PublicKey","onUpdate:modelValue":s[2]||(s[2]=d=>t.PublicKey=d),disabled:""},null,512),[[_,t.PublicKey]])])])]),e("div",null,[e("label",we,[e("small",null,[l(o,{t:"Listen Port"})])]),g(e("input",{type:"number",class:v(["form-control rounded-3",[I.value?"is-valid":"is-invalid"]]),placeholder:"0-65353",id:"ListenPort",min:"1",max:"65353","onUpdate:modelValue":s[3]||(s[3]=d=>t.ListenPort=d),disabled:"",required:""},null,2),[[_,t.ListenPort]]),e("div",$e,[p.value?(n(),r("div",Be,x(a.value),1)):(n(),r("div",Ne,[l(o,{t:"Listen Port is invalid. Possible reasons:"}),e("ul",De,[e("li",null,[l(o,{t:"Invalid port."})]),e("li",null,[l(o,{t:"Port is assigned to existing WireGuard Configuration."})])])]))])]),e("div",null,[e("label",Ae,[e("small",null,[l(o,{t:"IP Address/CIDR"})]),e("small",{class:v(["ms-auto",[U.value>0?"text-success":"text-danger"]])},[l(o,{t:U.value+" Available IP Address"},null,8,["t"])],2)]),g(e("input",{type:"text",class:v(["form-control",[L.value?"is-valid":"is-invalid"]]),placeholder:"Ex: 10.0.0.1/24",id:"Address","onUpdate:modelValue":s[4]||(s[4]=d=>t.Address=d),disabled:"",required:""},null,2),[[_,t.Address]]),e("div",Ie,[p.value?(n(),r("div",Le,x(a.value),1)):(n(),r("div",Se,[l(o,{t:"IP Address/CIDR is invalid"})]))])]),e("div",Ue,[e("div",Ke,[e("h2",Re,[e("button",Ve,[l(o,{t:"Optional Settings"})])]),e("div",Oe,[e("div",Te,[e("div",null,[e("label",Ee,[e("small",null,[l(o,{t:"PreUp"})])]),g(e("input",{type:"text",class:"form-control rounded-3",id:"PreUp",disabled:"","onUpdate:modelValue":s[5]||(s[5]=d=>t.PreUp=d)},null,512),[[_,t.PreUp]])]),e("div",null,[e("label",qe,[e("small",null,[l(o,{t:"PreDown"})])]),g(e("input",{type:"text",class:"form-control rounded-3",id:"PreDown",disabled:"","onUpdate:modelValue":s[6]||(s[6]=d=>t.PreDown=d)},null,512),[[_,t.PreDown]])]),e("div",null,[e("label",je,[e("small",null,[l(o,{t:"PostUp"})])]),g(e("input",{type:"text",class:"form-control rounded-3",id:"PostUp",disabled:"","onUpdate:modelValue":s[7]||(s[7]=d=>t.PostUp=d)},null,512),[[_,t.PostUp]])]),e("div",null,[e("label",Me,[e("small",null,[l(o,{t:"PostDown"})])]),g(e("input",{type:"text",class:"form-control rounded-3",id:"PostDown",disabled:"","onUpdate:modelValue":s[8]||(s[8]=d=>t.PostDown=d)},null,512),[[_,t.PostDown]])])])])])])]),e("div",Ye,[e("div",We,[e("h4",ze,[l(o,{t:"Database File"})]),e("h4",{class:v(["mb-0 ms-auto",[m.selectedConfigurationBackup.database?"text-success":"text-danger"]])},[e("i",{class:v(["bi",[m.selectedConfigurationBackup.database?"bi-check-circle-fill":"bi-x-circle-fill"]])},null,2)],2)]),m.selectedConfigurationBackup.database?(n(),r("div",Fe,[e("div",Ge,[e("div",He,[e("div",Je,[e("div",Ze,[s[10]||(s[10]=e("i",{class:"bi bi-person-fill me-2"},null,-1)),l(o,{t:"Contain"}),s[11]||(s[11]=$()),e("strong",null,x(K.value),1),s[12]||(s[12]=$()),K.value>1?(n(),f(o,{key:0,t:"Peer"})):(n(),f(o,{key:1,t:"Peer"}))])])]),e("div",Qe,[e("div",Xe,[e("div",et,[s[13]||(s[13]=e("i",{class:"bi bi-person-fill-lock me-2"},null,-1)),l(o,{t:"Contain"}),s[14]||(s[14]=$()),e("strong",null,x(R.value),1),s[15]||(s[15]=$()),R.value>1?(n(),f(o,{key:0,t:"Restricted Peers"})):(n(),f(o,{key:1,t:"Restricted Peers"}))])])])])])):w("",!0)]),e("div",tt,[e("button",{class:"btn btn-dark btn-brand rounded-3 px-3 py-2 shadow ms-auto",disabled:!S.value||h.value,onClick:s[9]||(s[9]=d=>Y())},[s[16]||(s[16]=e("i",{class:"bi bi-clock-history me-2"},null,-1)),l(o,{t:h.value?"Restoring...":"Restore"},null,8,["t"])],8,st)])]))}},lt={class:"mt-md-5 mt-3 text-body"},nt={class:"container mb-4"},at={class:"mb-5 d-flex align-items-center gap-4"},it={class:"mb-0"},rt={key:0},dt={class:"d-flex text-decoration-none text-body flex-grow-1 align-items-center gap-3"},ut={class:"mb-0"},ct={class:"text-muted"},mt={key:0,class:"ms-sm-auto"},ft={class:"text-muted"},pt={key:0,id:"step1Detail"},vt={class:"mb-4"},bt={class:"d-flex gap-3 flex-column"},gt={key:0},_t={class:"card rounded-3"},kt={class:"card-body"},xt={class:"mb-0"},yt={class:"my-5",key:"step2",id:"step2"},ht={class:"text-muted"},Ct={__name:"restoreConfiguration",setup(m){const u=k(void 0);E(),k(!1),A(()=>{Z("/api/getAllWireguardConfigurationBackup",{},h=>{u.value=h.data})});const t=k(!1),y=k(void 0),p=k("");return(h,a)=>{const c=Q("RouterLink");return n(),r("div",lt,[e("div",nt,[e("div",at,[l(c,{to:"/",class:"btn btn-dark btn-brand p-2 shadow",style:{"border-radius":"100%"}},{default:B(()=>a[1]||(a[1]=[e("h2",{class:"mb-0",style:{"line-height":"0"}},[e("i",{class:"bi bi-arrow-left-circle"})],-1)])),_:1}),e("h2",it,[l(o,{t:"Restore Configuration"})])]),l(V,{name:"fade",appear:""},{default:B(()=>[u.value?(n(),r("div",rt,[e("div",{class:v(["d-flex mb-5 align-items-center steps",{active:!t.value}]),role:"button",onClick:a[0]||(a[0]=b=>t.value=!1),key:"step1"},[e("div",dt,[a[2]||(a[2]=e("h1",{class:"mb-0",style:{"line-height":"0"}},[e("i",{class:"bi bi-1-circle-fill"})],-1)),e("div",null,[e("h4",ut,[l(o,{t:"Step 1"})]),e("small",ct,[t.value?(n(),f(o,{key:1,t:"Click to change a backup"})):(n(),f(o,{key:0,t:"Select a backup you want to restore"}))])])]),l(V,{name:"zoomReversed"},{default:B(()=>[t.value?(n(),r("div",mt,[e("small",ft,[l(o,{t:"Selected Backup"})]),e("h6",null,[e("samp",null,x(y.value.filename),1)])])):w("",!0)]),_:1})],2),t.value?w("",!0):(n(),r("div",pt,[e("div",vt,[e("div",bt,[(n(!0),r(N,null,D(Object.keys(u.value.NonExistingConfigurations),b=>(n(),f(ie,{onSelect:P=>{y.value=P,p.value=b,t.value=!0},selectedConfigurationBackup:y.value,open:p.value===b,protocol:[...new Set(u.value.NonExistingConfigurations[b].map(P=>P.protocol))],"configuration-name":b,backups:u.value.NonExistingConfigurations[b]},null,8,["onSelect","selectedConfigurationBackup","open","protocol","configuration-name","backups"]))),256)),Object.keys(u.value.NonExistingConfigurations).length===0?(n(),r("div",gt,[e("div",_t,[e("div",kt,[e("p",xt,[l(o,{t:"You don't have any configuration to restore"})])])])])):w("",!0)])])])),e("div",yt,[e("div",{class:v(["steps d-flex text-decoration-none text-body flex-grow-1 align-items-center gap-3",{active:t.value}])},[a[4]||(a[4]=e("h1",{class:"mb-0",style:{"line-height":"0"}},[e("i",{class:"bi bi-2-circle-fill"})],-1)),e("div",null,[a[3]||(a[3]=e("h4",{class:"mb-0"},"Step 2",-1)),e("small",ht,[t.value?(n(),f(o,{key:1,t:"Confirm & edit restore information"})):(n(),f(o,{key:0,t:"Backup not selected"}))])])],2)]),t.value?(n(),f(ot,{selectedConfigurationBackup:y.value,key:"confirm"},null,8,["selectedConfigurationBackup"])):w("",!0)])):w("",!0)]),_:1})])])}}},Dt=T(Ct,[["__scopeId","data-v-324df2b1"]]);export{Dt as default}; diff --git a/src/static/app/dist/assets/schedulePeerJob-DJNvnpjL.js b/src/static/app/dist/assets/schedulePeerJob-hRoInhjL.js similarity index 96% rename from src/static/app/dist/assets/schedulePeerJob-DJNvnpjL.js rename to src/static/app/dist/assets/schedulePeerJob-hRoInhjL.js index 2bd3e33..30fd3f8 100644 --- a/src/static/app/dist/assets/schedulePeerJob-DJNvnpjL.js +++ b/src/static/app/dist/assets/schedulePeerJob-hRoInhjL.js @@ -1 +1 @@ -import{_,a as d,c as r,b as s,t as m,n as y,F as j,h as S,e as f,r as h,D as x,z as v,j as b,d as n,i as k,m as D,x as $,f as p}from"./index-7qLsecvh.js";import{V as J}from"./vue-datepicker-v4St2bKM.js";import{d as V}from"./dayjs.min-C341O-eN.js";import{L as C}from"./localeText-BguG5zGd.js";const O={name:"scheduleDropdown",props:{options:Array,data:String,edit:!1},setup(t){t.data===void 0&&this.$emit("update",this.options[0].value)},computed:{currentSelection(){return this.options.find(t=>t.value===this.data)}}},M={class:"dropdown scheduleDropdown"},N={class:"dropdown-menu rounded-3 shadow",style:{"font-size":"0.875rem",width:"200px"}},P=["onClick"],F={key:0,class:"bi bi-check ms-auto"};function L(t,e,l,o,c,w){return d(),r("div",M,[s("button",{class:y(["btn btn-sm btn-outline-primary rounded-3",{"disabled border-transparent":!l.edit}]),type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[s("samp",null,m(this.currentSelection.display),1)],2),s("ul",N,[l.edit?(d(!0),r(j,{key:0},S(this.options,a=>(d(),r("li",null,[s("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:u=>t.$emit("update",a.value)},[s("samp",null,m(a.display),1),a.value===this.currentSelection.value?(d(),r("i",F)):f("",!0)],8,P)]))),256)):f("",!0)])])}const T=_(O,[["render",L],["__scopeId","data-v-6a5aba2a"]]),A={name:"schedulePeerJob",components:{LocaleText:C,VueDatePicker:J,ScheduleDropdown:T},props:{dropdowns:Array[Object],pjob:Object,viewOnly:!1},setup(t){const e=h({}),l=h(!1),o=h(!1);e.value=JSON.parse(JSON.stringify(t.pjob)),e.value.CreationDate||(l.value=!0,o.value=!0);const c=x();return{job:e,edit:l,newJob:o,store:c}},data(){return{inputType:void 0}},watch:{pjob:{deep:!0,immediate:!0,handler(t){this.edit||(this.job=JSON.parse(JSON.stringify(t)))}}},methods:{save(){this.job.Field&&this.job.Operator&&this.job.Action&&this.job.Value?v("/api/savePeerScheduleJob/",{Job:this.job},t=>{t.status?(this.edit=!1,this.store.newMessage("Server","Peer job saved","success"),console.log(t.data),this.$emit("refresh",t.data[0]),this.newJob=!1):this.store.newMessage("Server",t.message,"danger")}):this.alert()},alert(){let t="animate__flash",e=this.$el.querySelectorAll(".scheduleDropdown"),l=this.$el.querySelectorAll("input");e.forEach(o=>o.classList.add("animate__animated",t)),l.forEach(o=>o.classList.add("animate__animated",t)),setTimeout(()=>{e.forEach(o=>o.classList.remove("animate__animated",t)),l.forEach(o=>o.classList.remove("animate__animated",t))},2e3)},reset(){this.job.CreationDate?(this.job=JSON.parse(JSON.stringify(this.pjob)),this.edit=!1):this.$emit("delete")},delete(){this.job.CreationDate&&v("/api/deletePeerScheduleJob/",{Job:this.job},t=>{t.status?this.store.newMessage("Server","Peer job deleted","success"):(this.store.newMessage("Server",t.message,"danger"),this.$emit("delete"))}),this.$emit("delete")},parseTime(t){t&&(this.job.Value=V(t).format("YYYY-MM-DD HH:mm:ss"))}}},E={class:"card-header bg-transparent text-muted border-0"},U={key:0,class:"d-flex"},H={class:"me-auto"},B={key:1},I={class:"badge text-bg-warning"},Y={class:"card-body pt-1",style:{"font-family":"var(--bs-font-monospace)"}},z={class:"d-flex gap-2 align-items-center mb-2"},q=["disabled"],G={class:"px-5 d-flex gap-2 align-items-center"},K={class:"d-flex gap-3"},Q={key:0,class:"ms-auto d-flex gap-3"},R={key:1,class:"ms-auto d-flex gap-3"};function W(t,e,l,o,c,w){const a=b("LocaleText"),u=b("ScheduleDropdown"),g=b("VueDatePicker");return d(),r("div",{class:y(["card shadow-sm rounded-3 mb-2",{"border-warning-subtle":this.newJob}])},[s("div",E,[this.newJob?(d(),r("small",B,[s("span",I,[n(a,{t:"Unsaved Job"})])])):(d(),r("small",U,[s("strong",H,[n(a,{t:"Job ID"})]),s("samp",null,m(this.job.JobID),1)]))]),s("div",Y,[s("div",z,[s("samp",null,[n(a,{t:"if"})]),n(u,{edit:o.edit,options:this.dropdowns.Field,data:this.job.Field,onUpdate:e[0]||(e[0]=i=>{this.job.Field=i})},null,8,["edit","options","data"]),s("samp",null,[n(a,{t:"is"})]),n(u,{edit:o.edit,options:this.dropdowns.Operator,data:this.job.Operator,onUpdate:e[1]||(e[1]=i=>this.job.Operator=i)},null,8,["edit","options","data"]),this.job.Field==="date"?(d(),k(g,{key:0,is24:!0,"min-date":new Date,"model-value":this.job.Value,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:!o.edit,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])):D((d(),r("input",{key:1,class:"form-control form-control-sm form-control-dark rounded-3 flex-grow-1",disabled:!o.edit,"onUpdate:modelValue":e[2]||(e[2]=i=>this.job.Value=i),style:{width:"auto"}},null,8,q)),[[$,this.job.Value]]),s("samp",null,m(this.dropdowns.Field.find(i=>i.value===this.job.Field)?.unit)+" { ",1)]),s("div",G,[s("samp",null,[n(a,{t:"then"})]),n(u,{edit:o.edit,options:this.dropdowns.Action,data:this.job.Action,onUpdate:e[3]||(e[3]=i=>this.job.Action=i)},null,8,["edit","options","data"])]),s("div",K,[e[12]||(e[12]=s("samp",null,"}",-1)),this.edit?(d(),r("div",R,[s("a",{role:"button",class:"text-secondary text-decoration-none",onClick:e[6]||(e[6]=i=>this.reset())},[e[10]||(e[10]=p("[C] ")),n(a,{t:"Cancel"})]),s("a",{role:"button",class:"text-primary ms-auto text-decoration-none",onClick:e[7]||(e[7]=i=>this.save())},[e[11]||(e[11]=p("[S] ")),n(a,{t:"Save"})])])):(d(),r("div",Q,[s("a",{role:"button",class:"ms-auto text-decoration-none",onClick:e[4]||(e[4]=i=>this.edit=!0)},[e[8]||(e[8]=p("[E] ")),n(a,{t:"Edit"})]),s("a",{role:"button",onClick:e[5]||(e[5]=i=>this.delete()),class:"text-danger text-decoration-none"},[e[9]||(e[9]=p("[D] ")),n(a,{t:"Delete"})])]))])])],2)}const se=_(A,[["render",W],["__scopeId","data-v-8f3f1b93"]]);export{se as S,T as a}; +import{_,a as d,c as r,b as s,t as m,n as y,F as j,h as S,e as f,r as h,D as x,z as v,j as b,d as n,i as k,m as D,x as $,f as p}from"./index-CgM9eUIs.js";import{V as J}from"./vue-datepicker-D7WdryeM.js";import{d as V}from"./dayjs.min-B2wceQaW.js";import{L as C}from"./localeText-Dh33930I.js";const O={name:"scheduleDropdown",props:{options:Array,data:String,edit:!1},setup(t){t.data===void 0&&this.$emit("update",this.options[0].value)},computed:{currentSelection(){return this.options.find(t=>t.value===this.data)}}},M={class:"dropdown scheduleDropdown"},N={class:"dropdown-menu rounded-3 shadow",style:{"font-size":"0.875rem",width:"200px"}},P=["onClick"],F={key:0,class:"bi bi-check ms-auto"};function L(t,e,l,o,c,w){return d(),r("div",M,[s("button",{class:y(["btn btn-sm btn-outline-primary rounded-3",{"disabled border-transparent":!l.edit}]),type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[s("samp",null,m(this.currentSelection.display),1)],2),s("ul",N,[l.edit?(d(!0),r(j,{key:0},S(this.options,a=>(d(),r("li",null,[s("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:u=>t.$emit("update",a.value)},[s("samp",null,m(a.display),1),a.value===this.currentSelection.value?(d(),r("i",F)):f("",!0)],8,P)]))),256)):f("",!0)])])}const T=_(O,[["render",L],["__scopeId","data-v-6a5aba2a"]]),A={name:"schedulePeerJob",components:{LocaleText:C,VueDatePicker:J,ScheduleDropdown:T},props:{dropdowns:Array[Object],pjob:Object,viewOnly:!1},setup(t){const e=h({}),l=h(!1),o=h(!1);e.value=JSON.parse(JSON.stringify(t.pjob)),e.value.CreationDate||(l.value=!0,o.value=!0);const c=x();return{job:e,edit:l,newJob:o,store:c}},data(){return{inputType:void 0}},watch:{pjob:{deep:!0,immediate:!0,handler(t){this.edit||(this.job=JSON.parse(JSON.stringify(t)))}}},methods:{save(){this.job.Field&&this.job.Operator&&this.job.Action&&this.job.Value?v("/api/savePeerScheduleJob/",{Job:this.job},t=>{t.status?(this.edit=!1,this.store.newMessage("Server","Peer job saved","success"),console.log(t.data),this.$emit("refresh",t.data[0]),this.newJob=!1):this.store.newMessage("Server",t.message,"danger")}):this.alert()},alert(){let t="animate__flash",e=this.$el.querySelectorAll(".scheduleDropdown"),l=this.$el.querySelectorAll("input");e.forEach(o=>o.classList.add("animate__animated",t)),l.forEach(o=>o.classList.add("animate__animated",t)),setTimeout(()=>{e.forEach(o=>o.classList.remove("animate__animated",t)),l.forEach(o=>o.classList.remove("animate__animated",t))},2e3)},reset(){this.job.CreationDate?(this.job=JSON.parse(JSON.stringify(this.pjob)),this.edit=!1):this.$emit("delete")},delete(){this.job.CreationDate&&v("/api/deletePeerScheduleJob/",{Job:this.job},t=>{t.status?this.store.newMessage("Server","Peer job deleted","success"):(this.store.newMessage("Server",t.message,"danger"),this.$emit("delete"))}),this.$emit("delete")},parseTime(t){t&&(this.job.Value=V(t).format("YYYY-MM-DD HH:mm:ss"))}}},E={class:"card-header bg-transparent text-muted border-0"},U={key:0,class:"d-flex"},H={class:"me-auto"},B={key:1},I={class:"badge text-bg-warning"},Y={class:"card-body pt-1",style:{"font-family":"var(--bs-font-monospace)"}},z={class:"d-flex gap-2 align-items-center mb-2"},q=["disabled"],G={class:"px-5 d-flex gap-2 align-items-center"},K={class:"d-flex gap-3"},Q={key:0,class:"ms-auto d-flex gap-3"},R={key:1,class:"ms-auto d-flex gap-3"};function W(t,e,l,o,c,w){const a=b("LocaleText"),u=b("ScheduleDropdown"),g=b("VueDatePicker");return d(),r("div",{class:y(["card shadow-sm rounded-3 mb-2",{"border-warning-subtle":this.newJob}])},[s("div",E,[this.newJob?(d(),r("small",B,[s("span",I,[n(a,{t:"Unsaved Job"})])])):(d(),r("small",U,[s("strong",H,[n(a,{t:"Job ID"})]),s("samp",null,m(this.job.JobID),1)]))]),s("div",Y,[s("div",z,[s("samp",null,[n(a,{t:"if"})]),n(u,{edit:o.edit,options:this.dropdowns.Field,data:this.job.Field,onUpdate:e[0]||(e[0]=i=>{this.job.Field=i})},null,8,["edit","options","data"]),s("samp",null,[n(a,{t:"is"})]),n(u,{edit:o.edit,options:this.dropdowns.Operator,data:this.job.Operator,onUpdate:e[1]||(e[1]=i=>this.job.Operator=i)},null,8,["edit","options","data"]),this.job.Field==="date"?(d(),k(g,{key:0,is24:!0,"min-date":new Date,"model-value":this.job.Value,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:!o.edit,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])):D((d(),r("input",{key:1,class:"form-control form-control-sm form-control-dark rounded-3 flex-grow-1",disabled:!o.edit,"onUpdate:modelValue":e[2]||(e[2]=i=>this.job.Value=i),style:{width:"auto"}},null,8,q)),[[$,this.job.Value]]),s("samp",null,m(this.dropdowns.Field.find(i=>i.value===this.job.Field)?.unit)+" { ",1)]),s("div",G,[s("samp",null,[n(a,{t:"then"})]),n(u,{edit:o.edit,options:this.dropdowns.Action,data:this.job.Action,onUpdate:e[3]||(e[3]=i=>this.job.Action=i)},null,8,["edit","options","data"])]),s("div",K,[e[12]||(e[12]=s("samp",null,"}",-1)),this.edit?(d(),r("div",R,[s("a",{role:"button",class:"text-secondary text-decoration-none",onClick:e[6]||(e[6]=i=>this.reset())},[e[10]||(e[10]=p("[C] ")),n(a,{t:"Cancel"})]),s("a",{role:"button",class:"text-primary ms-auto text-decoration-none",onClick:e[7]||(e[7]=i=>this.save())},[e[11]||(e[11]=p("[S] ")),n(a,{t:"Save"})])])):(d(),r("div",Q,[s("a",{role:"button",class:"ms-auto text-decoration-none",onClick:e[4]||(e[4]=i=>this.edit=!0)},[e[8]||(e[8]=p("[E] ")),n(a,{t:"Edit"})]),s("a",{role:"button",onClick:e[5]||(e[5]=i=>this.delete()),class:"text-danger text-decoration-none"},[e[9]||(e[9]=p("[D] ")),n(a,{t:"Delete"})])]))])])],2)}const se=_(A,[["render",W],["__scopeId","data-v-8f3f1b93"]]);export{se as S,T as a}; diff --git a/src/static/app/dist/assets/selectPeers-BIWdU0cy.js b/src/static/app/dist/assets/selectPeers-CmmM9p8c.js similarity index 86% rename from src/static/app/dist/assets/selectPeers-BIWdU0cy.js rename to src/static/app/dist/assets/selectPeers-CmmM9p8c.js index 7ee9225..9ef9526 100644 --- a/src/static/app/dist/assets/selectPeers-BIWdU0cy.js +++ b/src/static/app/dist/assets/selectPeers-CmmM9p8c.js @@ -1 +1 @@ -import{_ as R,r as g,p as j,E as A,K as F,D as M,I as z,a2 as C,a as o,c as n,b as t,d as r,e as b,m as O,x as G,F as p,h as K,n as w,t as S,f as h,z as Y,g as q}from"./index-7qLsecvh.js";import{L as d}from"./localeText-BguG5zGd.js";const H={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref:"selectPeersContainer"},J={class:"container d-flex h-100 w-100"},Q={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"700px"}},W={class:"card rounded-3 shadow flex-grow-1"},X={class:"card-header bg-transparent d-flex align-items-center gap-2 p-4 flex-column pb-3"},Z={class:"mb-2 w-100 d-flex"},ee={class:"mb-0"},te={class:"d-flex w-100 align-items-center gap-2"},se={class:"d-flex gap-3"},le={class:"card-body px-4 flex-grow-1 d-flex gap-2 flex-column position-relative",ref:"card-body",style:{"overflow-y":"scroll"}},ae=["onClick","disabled","data-id"],oe={key:0},ne={class:"d-flex flex-column"},ie={class:"fw-bold"},re={class:"text-muted"},de={key:1,class:"ms-auto"},ue={key:0,class:"spinner-border spinner-border-sm",role:"status"},ce={class:"card-footer px-4 py-3 gap-2 d-flex align-items-center"},fe=["disabled"],be={key:0,class:"flex-grow-1 text-center"},ve=["disabled"],me={key:0,class:"flex-grow-1 text-center"},ge=["disabled"],pe={key:0,class:"flex-grow-1 text-center"},he=["disabled"],xe={__name:"selectPeers",props:{configurationPeers:Array},emits:["refresh","close"],setup(x,{emit:$}){const y=x,f=g(!1),u=g(!1),s=g([]),m=g(""),D=a=>{s.value.find(e=>e===a)?s.value=s.value.filter(e=>e!==a):s.value.push(a)},B=j(()=>f.value||u.value?y.configurationPeers.filter(a=>s.value.find(e=>e===a.id)):m.value.length>0?y.configurationPeers.filter(a=>a.id.includes(m.value)||a.name.includes(m.value)):y.configurationPeers);A(s,()=>{s.value.length===0&&(f.value=!1,u.value=!1)});const P=F(),N=M(),_=$,v=g(!1),T=()=>{v.value=!0,Y(`/api/deletePeers/${P.params.id}`,{peers:s.value},a=>{N.newMessage("Server",a.message,a.status?"success":"danger"),a.status&&(s.value=[],f.value=!1),_("refresh"),v.value=!1})},c=z({success:[],failed:[]}),I=C("card-body"),L=C("sp"),U=async()=>{u.value=!0;for(const a of s.value)I.value.scrollTo({top:L.value.find(e=>e.dataset.id===a).offsetTop-20,behavior:"smooth"}),await q("/api/downloadPeer/"+P.params.id,{id:a},e=>{if(e.status){const l=new Blob([e.data.file],{type:"text/plain"}),i=URL.createObjectURL(l),E=`${e.data.fileName}.conf`,k=document.createElement("a");k.href=i,k.download=E,k.click(),c.success.push(a)}else c.failed.push(a)})},V=()=>{c.success=[],c.failed=[],u.value=!1};return(a,e)=>(o(),n("div",H,[t("div",J,[t("div",Q,[t("div",W,[t("div",X,[t("div",Z,[t("h4",ee,[r(d,{t:"Select Peers"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>_("close"))})]),t("div",te,[t("div",se,[!u.value&&s.value.length!==x.configurationPeers.map(l=>l.id).length?(o(),n("a",{key:0,role:"button",onClick:e[1]||(e[1]=l=>s.value=x.configurationPeers.map(i=>i.id)),class:"text-decoration-none text-body"},[t("small",null,[e[9]||(e[9]=t("i",{class:"bi bi-check-all me-2"},null,-1)),r(d,{t:"Select All"})])])):b("",!0),s.value.length>0&&!u.value?(o(),n("a",{key:1,role:"button",class:"text-decoration-none text-body",onClick:e[2]||(e[2]=l=>s.value=[])},[t("small",null,[e[10]||(e[10]=t("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),r(d,{t:"Clear Selection"})])])):b("",!0)]),e[11]||(e[11]=t("label",{class:"ms-auto",for:"selectPeersSearchInput"},[t("i",{class:"bi bi-search"})],-1)),O(t("input",{class:"form-control form-control-sm rounded-3","onUpdate:modelValue":e[3]||(e[3]=l=>m.value=l),id:"selectPeersSearchInput",style:{width:"200px !important"},type:"text"},null,512),[[G,m.value]])])]),t("div",le,[(o(!0),n(p,null,K(B.value,l=>(o(),n("button",{type:"button",class:w(["btn w-100 peerBtn text-start rounded-3 d-flex align-items-center gap-3",{active:s.value.find(i=>i===l.id)}]),onClick:i=>D(l.id),key:l.id,disabled:f.value||u.value,ref_for:!0,ref:"sp","data-id":l.id},[u.value?b("",!0):(o(),n("span",oe,[t("i",{class:w(["bi",[s.value.find(i=>i===l.id)?"bi-check-circle-fill":"bi-circle"]])},null,2)])),t("span",ne,[t("small",ie,S(l.name?l.name:"Untitled Peer"),1),t("small",re,[t("samp",null,S(l.id),1)])]),u.value?(o(),n("span",de,[!c.success.find(i=>i===l.id)&&!c.failed.find(i=>i===l.id)?(o(),n("span",ue)):(o(),n("i",{key:1,class:w(["bi",[c.failed.find(i=>i===l.id)?"bi-x-circle-fill":"bi-check-circle-fill"]])},null,2))])):b("",!0)],10,ae))),128))],512),t("div",ce,[!f.value&&!u.value?(o(),n(p,{key:0},[t("button",{class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3",disabled:s.value.length===0||v.value,onClick:e[4]||(e[4]=l=>U())},e[12]||(e[12]=[t("i",{class:"bi bi-download"},null,-1)]),8,fe),s.value.length>0?(o(),n("span",be,[e[13]||(e[13]=t("i",{class:"bi bi-check-circle-fill me-2"},null,-1)),r(d,{t:s.value.length+" Peer"+(s.value.length>1?"s":"")},null,8,["t"])])):b("",!0),t("button",{class:"btn bg-danger-subtle text-danger-emphasis border-danger-subtle ms-auto rounded-3",onClick:e[5]||(e[5]=l=>f.value=!0),disabled:s.value.length===0||v.value},e[14]||(e[14]=[t("i",{class:"bi bi-trash"},null,-1)]),8,ve)],64)):u.value?(o(),n(p,{key:1},[c.failed.length+c.success.length1?"s":"")},null,8,["t"]),e[16]||(e[16]=h("... "))])):(o(),n(p,{key:1},[t("strong",null,[r(d,{t:"Download Finished"})]),t("button",{onClick:e[6]||(e[6]=l=>V()),class:"btn bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle rounded-3 ms-auto"},[r(d,{t:"Done"})])],64))],64)):f.value?(o(),n(p,{key:2},[t("button",{class:"btn btn-danger rounded-3",disabled:s.value.length===0||v.value,onClick:e[7]||(e[7]=l=>T())},[r(d,{t:"Yes"})],8,ge),s.value.length>0?(o(),n("strong",pe,[r(d,{t:"Are you sure to delete"}),e[17]||(e[17]=h()),r(d,{t:s.value.length+" Peer"+(s.value.length>1?"s":"")},null,8,["t"]),e[18]||(e[18]=h("? "))])):b("",!0),t("button",{class:"btn bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle ms-auto rounded-3",disabled:s.value.length===0||v.value,onClick:e[8]||(e[8]=l=>f.value=!1)},[r(d,{t:"No"})],8,he)],64)):b("",!0)])])])])],512))}},we=R(xe,[["__scopeId","data-v-177407c1"]]);export{we as default}; +import{_ as j,r as g,p as A,H as E,K as F,D as M,I as z,a2 as C,a as o,c as n,b as t,d as r,e as b,m as O,x as G,F as p,h as H,n as w,t as S,f as h,z as K,g as Y}from"./index-CgM9eUIs.js";import{L as d}from"./localeText-Dh33930I.js";const q={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref:"selectPeersContainer"},J={class:"container d-flex h-100 w-100"},Q={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"700px"}},W={class:"card rounded-3 shadow flex-grow-1"},X={class:"card-header bg-transparent d-flex align-items-center gap-2 p-4 flex-column pb-3"},Z={class:"mb-2 w-100 d-flex"},ee={class:"mb-0"},te={class:"d-flex w-100 align-items-center gap-2"},se={class:"d-flex gap-3"},le={class:"card-body px-4 flex-grow-1 d-flex gap-2 flex-column position-relative",ref:"card-body",style:{"overflow-y":"scroll"}},ae=["onClick","disabled","data-id"],oe={key:0},ne={class:"d-flex flex-column"},ie={class:"fw-bold"},re={class:"text-muted"},de={key:1,class:"ms-auto"},ue={key:0,class:"spinner-border spinner-border-sm",role:"status"},ce={class:"card-footer px-4 py-3 gap-2 d-flex align-items-center"},fe=["disabled"],be={key:0,class:"flex-grow-1 text-center"},ve=["disabled"],me={key:0,class:"flex-grow-1 text-center"},ge=["disabled"],pe={key:0,class:"flex-grow-1 text-center"},he=["disabled"],xe={__name:"selectPeers",props:{configurationPeers:Array},emits:["refresh","close"],setup(x,{emit:$}){const y=x,f=g(!1),u=g(!1),s=g([]),m=g(""),D=a=>{s.value.find(e=>e===a)?s.value=s.value.filter(e=>e!==a):s.value.push(a)},B=A(()=>f.value||u.value?y.configurationPeers.filter(a=>s.value.find(e=>e===a.id)):m.value.length>0?y.configurationPeers.filter(a=>a.id.includes(m.value)||a.name.includes(m.value)):y.configurationPeers);E(s,()=>{s.value.length===0&&(f.value=!1,u.value=!1)});const P=F(),N=M(),_=$,v=g(!1),T=()=>{v.value=!0,K(`/api/deletePeers/${P.params.id}`,{peers:s.value},a=>{N.newMessage("Server",a.message,a.status?"success":"danger"),a.status&&(s.value=[],f.value=!1),_("refresh"),v.value=!1})},c=z({success:[],failed:[]}),I=C("card-body"),L=C("sp"),U=async()=>{u.value=!0;for(const a of s.value)I.value.scrollTo({top:L.value.find(e=>e.dataset.id===a).offsetTop-20,behavior:"smooth"}),await Y("/api/downloadPeer/"+P.params.id,{id:a},e=>{if(e.status){const l=new Blob([e.data.file],{type:"text/plain"}),i=URL.createObjectURL(l),R=`${e.data.fileName}.conf`,k=document.createElement("a");k.href=i,k.download=R,k.click(),c.success.push(a)}else c.failed.push(a)})},V=()=>{c.success=[],c.failed=[],u.value=!1};return(a,e)=>(o(),n("div",q,[t("div",J,[t("div",Q,[t("div",W,[t("div",X,[t("div",Z,[t("h4",ee,[r(d,{t:"Select Peers"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>_("close"))})]),t("div",te,[t("div",se,[!u.value&&s.value.length!==x.configurationPeers.map(l=>l.id).length?(o(),n("a",{key:0,role:"button",onClick:e[1]||(e[1]=l=>s.value=x.configurationPeers.map(i=>i.id)),class:"text-decoration-none text-body"},[t("small",null,[e[9]||(e[9]=t("i",{class:"bi bi-check-all me-2"},null,-1)),r(d,{t:"Select All"})])])):b("",!0),s.value.length>0&&!u.value?(o(),n("a",{key:1,role:"button",class:"text-decoration-none text-body",onClick:e[2]||(e[2]=l=>s.value=[])},[t("small",null,[e[10]||(e[10]=t("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),r(d,{t:"Clear Selection"})])])):b("",!0)]),e[11]||(e[11]=t("label",{class:"ms-auto",for:"selectPeersSearchInput"},[t("i",{class:"bi bi-search"})],-1)),O(t("input",{class:"form-control form-control-sm rounded-3","onUpdate:modelValue":e[3]||(e[3]=l=>m.value=l),id:"selectPeersSearchInput",style:{width:"200px !important"},type:"text"},null,512),[[G,m.value]])])]),t("div",le,[(o(!0),n(p,null,H(B.value,l=>(o(),n("button",{type:"button",class:w(["btn w-100 peerBtn text-start rounded-3 d-flex align-items-center gap-3",{active:s.value.find(i=>i===l.id)}]),onClick:i=>D(l.id),key:l.id,disabled:f.value||u.value,ref_for:!0,ref:"sp","data-id":l.id},[u.value?b("",!0):(o(),n("span",oe,[t("i",{class:w(["bi",[s.value.find(i=>i===l.id)?"bi-check-circle-fill":"bi-circle"]])},null,2)])),t("span",ne,[t("small",ie,S(l.name?l.name:"Untitled Peer"),1),t("small",re,[t("samp",null,S(l.id),1)])]),u.value?(o(),n("span",de,[!c.success.find(i=>i===l.id)&&!c.failed.find(i=>i===l.id)?(o(),n("span",ue)):(o(),n("i",{key:1,class:w(["bi",[c.failed.find(i=>i===l.id)?"bi-x-circle-fill":"bi-check-circle-fill"]])},null,2))])):b("",!0)],10,ae))),128))],512),t("div",ce,[!f.value&&!u.value?(o(),n(p,{key:0},[t("button",{class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3",disabled:s.value.length===0||v.value,onClick:e[4]||(e[4]=l=>U())},e[12]||(e[12]=[t("i",{class:"bi bi-download"},null,-1)]),8,fe),s.value.length>0?(o(),n("span",be,[e[13]||(e[13]=t("i",{class:"bi bi-check-circle-fill me-2"},null,-1)),r(d,{t:s.value.length+" Peer"+(s.value.length>1?"s":"")},null,8,["t"])])):b("",!0),t("button",{class:"btn bg-danger-subtle text-danger-emphasis border-danger-subtle ms-auto rounded-3",onClick:e[5]||(e[5]=l=>f.value=!0),disabled:s.value.length===0||v.value},e[14]||(e[14]=[t("i",{class:"bi bi-trash"},null,-1)]),8,ve)],64)):u.value?(o(),n(p,{key:1},[c.failed.length+c.success.length1?"s":"")},null,8,["t"]),e[16]||(e[16]=h("... "))])):(o(),n(p,{key:1},[t("strong",null,[r(d,{t:"Download Finished"})]),t("button",{onClick:e[6]||(e[6]=l=>V()),class:"btn bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle rounded-3 ms-auto"},[r(d,{t:"Done"})])],64))],64)):f.value?(o(),n(p,{key:2},[t("button",{class:"btn btn-danger rounded-3",disabled:s.value.length===0||v.value,onClick:e[7]||(e[7]=l=>T())},[r(d,{t:"Yes"})],8,ge),s.value.length>0?(o(),n("strong",pe,[r(d,{t:"Are you sure to delete"}),e[17]||(e[17]=h()),r(d,{t:s.value.length+" Peer"+(s.value.length>1?"s":"")},null,8,["t"]),e[18]||(e[18]=h("? "))])):b("",!0),t("button",{class:"btn bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle ms-auto rounded-3",disabled:s.value.length===0||v.value,onClick:e[8]||(e[8]=l=>f.value=!1)},[r(d,{t:"No"})],8,he)],64)):b("",!0)])])])])],512))}},we=j(xe,[["__scopeId","data-v-177407c1"]]);export{we as default}; diff --git a/src/static/app/dist/assets/settings-iVnO1xa4.js b/src/static/app/dist/assets/settings-DCAbH1gn.js similarity index 99% rename from src/static/app/dist/assets/settings-iVnO1xa4.js rename to src/static/app/dist/assets/settings-DCAbH1gn.js index 6583175..9e0d4dc 100644 --- a/src/static/app/dist/assets/settings-iVnO1xa4.js +++ b/src/static/app/dist/assets/settings-DCAbH1gn.js @@ -1 +1 @@ -import{_ as k,D as y,y as I,z as v,a as n,c as l,b as t,d as i,m as b,x as f,n as $,t as D,e as _,j as m,W as M,f as S,v as L,i as x,F as C,g as E,w as F,h as V,k as j,T as U,r as T,p as z,o as O,A as w,B as q}from"./index-7qLsecvh.js";import{L as p}from"./localeText-BguG5zGd.js";import{d as A}from"./dayjs.min-C341O-eN.js";import{V as Q}from"./vue-datepicker-v4St2bKM.js";const J={components:{LocaleText:p},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const s=y(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Peers[this.targetData]},methods:{async useValidation(){this.changed&&await v("/api/updateDashboardConfigurationItem",{section:"Peers",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Peers[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message),this.changed=!1,this.updating=!1})}}},X={class:"form-group mb-2"},Z=["for"],tt=["id","disabled"],et={class:"invalid-feedback"},st={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1"};function at(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",X,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:this.title},null,8,["t"])])])],8,Z),b(t("input",{type:"text",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),onBlur:e[2]||(e[2]=a=>g.useValidation()),disabled:this.updating},null,42,tt),[[f,this.value]]),t("div",et,D(this.invalidFeedback),1),c.warning?(n(),l("div",st,[t("small",null,[e[3]||(e[3]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),i(o,{t:c.warningText},null,8,["t"])])])):_("",!0)])}const it=k(J,[["render",at]]),ot=s=>{},nt={name:"accountSettingsInputUsername",components:{LocaleText:p},props:{targetData:String,title:String},setup(){const s=y(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Account[this.targetData]},methods:{async useValidation(s){this.changed&&(this.updating=!0,await v("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},e=>{e.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=e.message),this.changed=!1,this.updating=!1}))}}},lt={class:"form-group mb-2"},dt=["for"],rt=["id","disabled"],ut={class:"invalid-feedback"};function ct(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",lt,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:this.title},null,8,["t"])])])],8,dt),b(t("input",{type:"text",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),onBlur:e[2]||(e[2]=a=>g.useValidation()),disabled:this.updating},null,42,rt),[[f,this.value]]),t("div",ut,D(this.invalidFeedback),1)])}const ht=k(nt,[["render",ct]]),mt={name:"accountSettingsInputPassword",components:{LocaleText:p},props:{targetData:String,warning:!1,warningText:""},setup(){const s=y(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:{currentPassword:"",newPassword:"",repeatNewPassword:""},invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0}},methods:{async useValidation(){Object.values(this.value).find(s=>s.length===0)===void 0?this.value.newPassword===this.value.repeatNewPassword?await v("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.isValid=!1,this.value={currentPassword:"",newPassword:"",repeatNewPassword:""}},5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message)}):(this.showInvalidFeedback=!0,this.invalidFeedback="New passwords does not match"):(this.showInvalidFeedback=!0,this.invalidFeedback="Please fill in all required fields.")}},computed:{passwordValid(){return Object.values(this.value).find(s=>s.length===0)===void 0&&this.value.newPassword===this.value.repeatNewPassword}}},pt={class:"d-flex flex-column gap-2"},gt={class:"row g-2"},bt={class:"col-sm"},_t={class:"form-group"},ft=["for"],vt=["id"],yt={key:0,class:"invalid-feedback d-block"},wt={class:"col-sm"},$t={class:"form-group"},kt=["for"],xt=["id"],Dt={class:"col-sm"},St={class:"form-group"},It=["for"],Ct=["id"],Pt=["disabled"];function At(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("form",pt,[t("div",gt,[t("div",bt,[t("div",_t,[t("label",{for:"currentPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:"Current Password"})])])],8,ft),b(t("input",{type:"password",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),autocomplete:"current-password","onUpdate:modelValue":e[0]||(e[0]=a=>this.value.currentPassword=a),id:"currentPassword_"+this.uuid},null,10,vt),[[f,this.value.currentPassword]]),u.showInvalidFeedback?(n(),l("div",yt,D(this.invalidFeedback),1)):_("",!0)])]),t("div",wt,[t("div",$t,[t("label",{for:"newPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:"New Password"})])])],8,kt),b(t("input",{type:"password",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),autocomplete:"new-password","onUpdate:modelValue":e[1]||(e[1]=a=>this.value.newPassword=a),id:"newPassword_"+this.uuid},null,10,xt),[[f,this.value.newPassword]])])]),t("div",Dt,[t("div",St,[t("label",{for:"repeatNewPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:"Repeat New Password"})])])],8,It),b(t("input",{type:"password",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),autocomplete:"new-password","onUpdate:modelValue":e[2]||(e[2]=a=>this.value.repeatNewPassword=a),id:"repeatNewPassword_"+this.uuid},null,10,Ct),[[f,this.value.repeatNewPassword]])])])]),t("button",{disabled:!this.passwordValid,class:"ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",onClick:e[3]||(e[3]=a=>this.useValidation())},[e[4]||(e[4]=t("i",{class:"bi bi-save2-fill me-2"},null,-1)),i(o,{t:"Update Password"})],8,Pt)])}const Tt=k(mt,[["render",At]]),Vt={name:"dashboardSettingsInputWireguardConfigurationPath",components:{LocaleText:p},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const s=y(),e=M(),c=`input_${I()}`;return{store:s,uuid:c,WireguardConfigurationStore:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Server[this.targetData]},methods:{async useValidation(){this.changed&&(this.updating=!0,await v("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3),this.WireguardConfigurationStore.getConfigurations(),this.store.newMessage("Server","WireGuard configuration path saved","success")):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message),this.changed=!1,this.updating=!1}))}}},Kt={class:"card"},Ft={class:"card-header"},Lt={class:"my-2"},Et={class:"card-body"},Mt={class:"form-group"},Ut=["for"],Wt={class:"d-flex gap-2 align-items-start"},Nt={class:"flex-grow-1"},Gt=["id","disabled"],Rt={class:"invalid-feedback fw-bold"},Yt=["disabled"],Ht={key:0,class:"bi bi-save2-fill"},Bt={key:1,class:"spinner-border spinner-border-sm"},jt={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1 mb-2"};function zt(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",Kt,[t("div",Ft,[t("h6",Lt,[i(o,{t:"Path"})])]),t("div",Et,[t("div",Mt,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:this.title},null,8,["t"])])])],8,Ut),t("div",Wt,[t("div",Nt,[b(t("input",{type:"text",class:$(["form-control rounded-3",{"is-invalid":this.showInvalidFeedback,"is-valid":this.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),disabled:this.updating},null,42,Gt),[[f,this.value]]),t("div",Rt,D(this.invalidFeedback),1)]),t("button",{onClick:e[2]||(e[2]=a=>this.useValidation()),disabled:!this.changed,class:"ms-auto btn rounded-3 border-success-subtle bg-success-subtle text-success-emphasis"},[this.updating?(n(),l("span",Bt)):(n(),l("i",Ht))],8,Yt)]),c.warning?(n(),l("div",jt,[t("small",null,[e[3]||(e[3]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),i(o,{t:c.warningText},null,8,["t"])])])):_("",!0)])])])}const Ot=k(Vt,[["render",zt]]),qt={name:"dashboardTheme",components:{LocaleText:p},setup(){return{dashboardConfigurationStore:y()}},methods:{async switchTheme(s){await v("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_theme",value:s},e=>{e.status&&(this.dashboardConfigurationStore.Configuration.Server.dashboard_theme=s)})}}},Qt={class:"text-muted mb-1 d-block"},Jt={class:"d-flex gap-1"};function Xt(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",null,[t("small",Qt,[t("strong",null,[i(o,{t:"Theme"})])]),t("div",Jt,[t("button",{class:$(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="light"}]),onClick:e[0]||(e[0]=a=>this.switchTheme("light"))},[e[2]||(e[2]=t("i",{class:"bi bi-sun-fill me-2"},null,-1)),i(o,{t:"Light"})],2),t("button",{class:$(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="dark"}]),onClick:e[1]||(e[1]=a=>this.switchTheme("dark"))},[e[3]||(e[3]=t("i",{class:"bi bi-moon-fill me-2"},null,-1)),i(o,{t:"Dark"})],2)])])}const Zt=k(qt,[["render",Xt]]),te={name:"dashboardSettingsInputIPAddressAndPort",props:{},setup(){const s=y(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{app_ip:"",app_port:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.app_ip=this.store.Configuration.Server.app_ip,this.app_port=this.store.Configuration.Server.app_port},methods:{async useValidation(){this.changed&&await v("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message)})}}},ee={class:"invalid-feedback d-block mt-0"},se={class:"row"},ae={class:"form-group mb-2 col-sm"},ie=["for"],oe=["id"],ne={class:"form-group col-sm"},le=["for"],de=["id"];function re(s,e,c,h,u,g){return n(),l("div",null,[t("div",ee,D(this.invalidFeedback),1),t("div",se,[t("div",ae,[t("label",{for:"app_ip_"+this.uuid,class:"text-muted mb-1"},e[2]||(e[2]=[t("strong",null,[t("small",null,"Dashboard IP Address")],-1)]),8,ie),b(t("input",{type:"text",class:"form-control mb-2",id:"app_ip_"+this.uuid,"onUpdate:modelValue":e[0]||(e[0]=o=>this.app_ip=o)},null,8,oe),[[f,this.app_ip]]),e[3]||(e[3]=t("div",{class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block"},[t("small",null,[t("i",{class:"bi bi-exclamation-triangle-fill me-2"}),t("code",null,"0.0.0.0"),S(" means it can be access by anyone with your server IP Address.")])],-1))]),t("div",ne,[t("label",{for:"app_port_"+this.uuid,class:"text-muted mb-1"},e[4]||(e[4]=[t("strong",null,[t("small",null,"Dashboard Port")],-1)]),8,le),b(t("input",{type:"text",class:"form-control mb-2",id:"app_port_"+this.uuid,"onUpdate:modelValue":e[1]||(e[1]=o=>this.app_port=o)},null,8,de),[[f,this.app_port]])])]),e[5]||(e[5]=t("button",{class:"btn btn-success btn-sm fw-bold rounded-3"},[t("i",{class:"bi bi-floppy-fill me-2"}),S("Update Dashboard Settings & Restart ")],-1))])}const ue=k(te,[["render",re]]),ce={name:"newDashboardAPIKey",components:{LocaleText:p,VueDatePicker:Q},data(){return{newKeyData:{ExpiredAt:A().add(7,"d").format("YYYY-MM-DD HH:mm:ss"),neverExpire:!1},submitting:!1}},setup(){return{store:y()}},mounted(){console.log(this.newKeyData.ExpiredAt)},methods:{submitNewAPIKey(){this.submitting=!0,v("/api/newDashboardAPIKey",this.newKeyData,s=>{s.status?(this.$emit("created",s.data),this.store.newMessage("Server","API Key created","success"),this.$emit("close")):this.store.newMessage("Server",s.message,"danger"),this.submitting=!1})},fixDate(s){return console.log(A(s).format("YYYY-MM-DDTHH:mm:ss")),A(s).format("YYYY-MM-DDTHH:mm:ss")},parseTime(s){s?this.newKeyData.ExpiredAt=A(s).format("YYYY-MM-DD HH:mm:ss"):this.newKeyData.ExpiredAt=void 0}}},he={class:"position-absolute w-100 h-100 top-0 start-0 rounded-bottom-3 p-3 d-flex",style:{"background-color":"#00000060","backdrop-filter":"blur(3px)"}},me={class:"card m-auto rounded-3 mt-5"},pe={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},ge={class:"mb-0"},be={class:"card-body d-flex gap-2 p-4 flex-column"},_e={class:"text-muted"},fe={class:"d-flex align-items-center gap-2"},ve={class:"form-check"},ye=["disabled"],we={class:"form-check-label",for:"neverExpire"},$e={key:0,class:"bi bi-check-lg me-2"};function ke(s,e,c,h,u,g){const o=m("LocaleText"),a=m("VueDatePicker");return n(),l("div",he,[t("div",me,[t("div",pe,[t("h6",ge,[i(o,{t:"Create API Key"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=r=>this.$emit("close"))})]),t("div",be,[t("small",_e,[i(o,{t:"When should this API Key expire?"})]),t("div",fe,[i(a,{is24:!0,"min-date":new Date,"model-value":this.newKeyData.ExpiredAt,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:this.newKeyData.neverExpire||this.submitting,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])]),t("div",ve,[b(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[1]||(e[1]=r=>this.newKeyData.neverExpire=r),id:"neverExpire",disabled:this.submitting},null,8,ye),[[L,this.newKeyData.neverExpire]]),t("label",we,[i(o,{t:"Never Expire"}),e[3]||(e[3]=S(" (")),e[4]||(e[4]=t("i",{class:"bi bi-emoji-grimace-fill me-2"},null,-1)),i(o,{t:"Don't think that's a good idea"}),e[5]||(e[5]=S(") "))])]),t("button",{class:$(["ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",{disabled:this.submitting}]),onClick:e[2]||(e[2]=r=>this.submitNewAPIKey())},[this.submitting?_("",!0):(n(),l("i",$e)),this.submitting?(n(),x(o,{key:1,t:"Creating..."})):(n(),x(o,{key:2,t:"Create"}))],2)])])])}const xe=k(ce,[["render",ke]]),De={name:"dashboardAPIKey",components:{LocaleText:p},props:{apiKey:Object},setup(){return{store:y()}},data(){return{confirmDelete:!1}},methods:{deleteAPIKey(){v("/api/deleteDashboardAPIKey",{Key:this.apiKey.Key},s=>{s.status?(this.$emit("deleted",s.data),this.store.newMessage("Server","API Key deleted","success")):this.store.newMessage("Server",s.message,"danger")})}}},Se={class:"card rounded-3 shadow-sm"},Ie={key:0,class:"card-body d-flex gap-3 align-items-center apiKey-card-body"},Ce={class:"d-flex align-items-center gap-2"},Pe={class:"text-muted"},Ae={style:{"word-break":"break-all"}},Te={class:"d-flex align-items-center gap-2 ms-auto"},Ve={class:"text-muted"},Ke={key:0,class:"card-body d-flex gap-3 align-items-center justify-content-end"};function Fe(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",Se,[this.confirmDelete?(n(),l(C,{key:1},[this.store.getActiveCrossServer()?_("",!0):(n(),l("div",Ke,[i(o,{t:"Are you sure to delete this API key?"}),t("a",{role:"button",class:"btn btn-sm bg-success-subtle text-success-emphasis rounded-3",onClick:e[1]||(e[1]=a=>this.deleteAPIKey())},e[4]||(e[4]=[t("i",{class:"bi bi-check-lg"},null,-1)])),t("a",{role:"button",class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis rounded-3",onClick:e[2]||(e[2]=a=>this.confirmDelete=!1)},e[5]||(e[5]=[t("i",{class:"bi bi-x-lg"},null,-1)]))]))],64)):(n(),l("div",Ie,[t("div",Ce,[t("small",Pe,[i(o,{t:"Key"})]),t("span",Ae,D(this.apiKey.Key),1)]),t("div",Te,[t("small",Ve,[i(o,{t:"Expire At"})]),this.apiKey.ExpiredAt?_("",!0):(n(),x(o,{key:0,t:"Never Expire"})),t("span",null,D(this.apiKey.ExpiredAt),1)]),this.store.getActiveCrossServer()?_("",!0):(n(),l("a",{key:0,role:"button",class:"btn btn-sm bg-danger-subtle text-danger-emphasis rounded-3",onClick:e[0]||(e[0]=a=>this.confirmDelete=!0)},e[3]||(e[3]=[t("i",{class:"bi bi-trash-fill"},null,-1)])))]))])}const Le=k(De,[["render",Fe],["__scopeId","data-v-a76253c8"]]),Ee={name:"dashboardAPIKeys",components:{LocaleText:p,DashboardAPIKey:Le,NewDashboardAPIKey:xe},setup(){return{store:y()}},data(){return{value:this.store.Configuration.Server.dashboard_api_key,apiKeys:[],newDashboardAPIKey:!1}},methods:{async toggleDashboardAPIKeys(){await v("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_api_key",value:this.value},s=>{s.status?(this.store.Configuration.Peers[this.targetData]=this.value,this.store.newMessage("Server",`API Keys function is successfully ${this.value?"enabled":"disabled"}`,"success")):(this.value=this.store.Configuration.Peers[this.targetData],this.store.newMessage("Server",`API Keys function is failed to ${this.value?"enabled":"disabled"}`,"danger"))})}},watch:{value:{immediate:!0,handler(s){s?E("/api/getDashboardAPIKeys",{},e=>{e.status?this.apiKeys=e.data:(this.apiKeys=[],this.store.newMessage("Server",e.message,"danger"))}):this.apiKeys=[]}}}},Me={class:"card rounded-3"},Ue={class:"my-2"},We={key:0,class:"form-check form-switch ms-auto"},Ne={class:"form-check-label",for:"allowAPIKeysSwitch"},Ge={key:0,class:"card-body position-relative d-flex flex-column gap-2"},Re={key:1,class:"card",style:{height:"300px"}},Ye={class:"card-body d-flex text-muted"},He={class:"m-auto"},Be={key:2,class:"d-flex flex-column gap-2 position-relative",style:{"min-height":"300px"}};function je(s,e,c,h,u,g){const o=m("LocaleText"),a=m("DashboardAPIKey"),r=m("NewDashboardAPIKey");return n(),l("div",Me,[t("div",{class:$(["card-header d-flex align-items-center",{"border-bottom-0 rounded-3":!this.value}])},[t("h6",Ue,[i(o,{t:"API Keys"})]),this.store.getActiveCrossServer()?_("",!0):(n(),l("div",We,[b(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=d=>this.value=d),onChange:e[1]||(e[1]=d=>this.toggleDashboardAPIKeys()),role:"switch",id:"allowAPIKeysSwitch"},null,544),[[L,this.value]]),t("label",Ne,[this.value?(n(),x(o,{key:0,t:"Enabled"})):(n(),x(o,{key:1,t:"Disabled"}))])]))],2),this.value?(n(),l("div",Ge,[this.store.getActiveCrossServer()?_("",!0):(n(),l("button",{key:0,class:"btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle rounded-3 shadow-sm",onClick:e[2]||(e[2]=d=>this.newDashboardAPIKey=!0)},[e[6]||(e[6]=t("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),i(o,{t:"API Key"})])),this.apiKeys.length===0?(n(),l("div",Re,[t("div",Ye,[t("span",He,[i(o,{t:"No WGDashboard API Key"})])])])):(n(),l("div",Be,[i(j,{name:"apiKey"},{default:F(()=>[(n(!0),l(C,null,V(this.apiKeys,d=>(n(),x(a,{apiKey:d,key:d.Key,onDeleted:e[3]||(e[3]=P=>this.apiKeys=P)},null,8,["apiKey"]))),128))]),_:1})])),i(U,{name:"zoomReversed"},{default:F(()=>[this.newDashboardAPIKey?(n(),x(r,{key:0,onCreated:e[4]||(e[4]=d=>this.apiKeys=d),onClose:e[5]||(e[5]=d=>this.newDashboardAPIKey=!1)})):_("",!0)]),_:1})])):_("",!0)])}const ze=k(Ee,[["render",je],["__scopeId","data-v-100ee9f9"]]),Oe={name:"accountSettingsMFA",components:{LocaleText:p},setup(){const s=y(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{status:!1}},mounted(){this.status=this.store.Configuration.Account.enable_totp},methods:{async resetMFA(){await v("/api/updateDashboardConfigurationItem",{section:"Account",key:"totp_verified",value:"false"},async s=>{await v("/api/updateDashboardConfigurationItem",{section:"Account",key:"enable_totp",value:"false"},e=>{e.status&&this.$router.push("/2FASetup")})})}}},qe={class:"d-flex align-items-center"},Qe={class:"form-check form-switch"},Je={for:"allowMFAKeysSwitch"};function Xe(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",null,[t("div",qe,[t("div",Qe,[b(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=a=>this.status=a),role:"switch",id:"allowMFAKeysSwitch"},null,512),[[L,this.status]]),t("label",Je,[this.status?(n(),x(o,{key:0,t:"Enabled"})):(n(),x(o,{key:1,t:"Disabled"}))])]),this.status?(n(),l("button",{key:0,class:"btn bg-warning-subtle text-warning-emphasis border-1 border-warning-subtle ms-auto rounded-3 shadow-sm",onClick:e[1]||(e[1]=a=>this.resetMFA())},[e[2]||(e[2]=t("i",{class:"bi bi-shield-lock-fill me-2"},null,-1)),this.store.Configuration.Account.totp_verified?(n(),x(o,{key:0,t:"Reset"})):(n(),x(o,{key:1,t:"Setup"})),e[3]||(e[3]=S(" MFA "))])):_("",!0)])])}const Ze=k(Oe,[["render",Xe]]),ts={name:"dashboardLanguage",components:{LocaleText:p},setup(){return{store:y()}},data(){return{languages:void 0}},mounted(){E("/api/locale/available",{},s=>{this.languages=s.data})},methods:{changeLanguage(s){v("/api/locale/update",{lang_id:s},e=>{e.status?(this.store.Configuration.Server.dashboard_language=s,this.store.Locale=e.data):this.store.newMessage("Server","WGDashboard language update failed","danger")})}},computed:{currentLanguage(){let s=this.store.Configuration.Server.dashboard_language;return this.languages.find(e=>e.lang_id===s)}}},es={class:"text-muted d-block mb-1"},ss={class:"d-flex gap-2"},as={class:"dropdown w-100"},is=["disabled"],os={key:1},ns={class:"dropdown-menu rounded-3 shadow"},ls=["onClick"],ds={class:"me-auto mb-0"},rs={class:"d-block",style:{"font-size":"0.8rem"}},us={key:0,class:"bi bi-check text-primary fs-5"};function cs(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",null,[t("small",es,[t("strong",null,[i(o,{t:"Language"})])]),t("div",ss,[t("div",as,[t("button",{class:"btn bg-primary-subtle text-primary-emphasis dropdown-toggle w-100 rounded-3",disabled:!this.languages,type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[this.languages?(n(),l("span",os,D(g.currentLanguage?.lang_name_localized),1)):(n(),x(o,{key:0,t:"Loading..."}))],8,is),t("ul",ns,[(n(!0),l(C,null,V(this.languages,a=>(n(),l("li",null,[t("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:r=>this.changeLanguage(a.lang_id)},[t("p",ds,[S(D(a.lang_name_localized)+" ",1),t("small",rs,D(a.lang_name),1)]),g.currentLanguage?.lang_id===a.lang_id?(n(),l("i",us)):_("",!0)],8,ls)]))),256))])])])])}const hs=k(ts,[["render",cs],["__scopeId","data-v-0f26916d"]]),ms={name:"dashboardIPPortInput",components:{LocaleText:p},setup(){return{store:y()}},data(){return{ipAddress:"",port:0,invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.ipAddress=this.store.Configuration.Server.app_ip,this.port=this.store.Configuration.Server.app_port},methods:{async useValidation(s,e,c){this.changed&&(this.updating=!0,await v("/api/updateDashboardConfigurationItem",{section:"Server",key:e,value:c},h=>{h.status?(s.target.classList.add("is-valid"),this.showInvalidFeedback=!1,this.store.Configuration.Server[e]=c,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{s.target.classList.remove("is-valid")},5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=h.message),this.changed=!1,this.updating=!1}))}}},ps={class:"row g-2"},gs={class:"col-sm"},bs={class:"form-group"},_s={for:"input_dashboard_ip",class:"text-muted mb-1"},fs=["disabled"],vs={class:"invalid-feedback"},ys={class:"col-sm"},ws={class:"form-group"},$s={for:"input_dashboard_ip",class:"text-muted mb-1"},ks=["disabled"],xs={class:"invalid-feedback"},Ds={class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mb-2 mt-2"};function Ss(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",null,[t("div",ps,[t("div",gs,[t("div",bs,[t("label",_s,[t("strong",null,[t("small",null,[i(o,{t:"IP Address / Hostname"})])])]),b(t("input",{type:"text",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),id:"input_dashboard_ip","onUpdate:modelValue":e[0]||(e[0]=a=>this.ipAddress=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),onBlur:e[2]||(e[2]=a=>g.useValidation(a,"app_ip",this.ipAddress)),disabled:this.updating},null,42,fs),[[f,this.ipAddress]]),t("div",vs,D(this.invalidFeedback),1)])]),t("div",ys,[t("div",ws,[t("label",$s,[t("strong",null,[t("small",null,[i(o,{t:"Listen Port"})])])]),b(t("input",{type:"number",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),id:"input_dashboard_ip","onUpdate:modelValue":e[3]||(e[3]=a=>this.port=a),onKeydown:e[4]||(e[4]=a=>this.changed=!0),onBlur:e[5]||(e[5]=a=>g.useValidation(a,"app_port",this.port)),disabled:this.updating},null,42,ks),[[f,this.port]]),t("div",xs,D(this.invalidFeedback),1)])])]),t("div",Ds,[t("small",null,[e[6]||(e[6]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),i(o,{t:"Manual restart of WGDashboard is needed to apply changes on IP Address and Listen Port"})])])])}const Is=k(ms,[["render",Ss]]),Cs={class:"card rounded-3"},Ps={class:"card-header"},As={class:"my-2"},Ts={class:"card-body d-flex gap-2"},Vs={class:"list-group w-100"},Ks=["onClick"],Fs={__name:"dashboardSettingsWireguardConfigurationAutostart",setup(s){const e=y(),c=M(),h=T(e.Configuration.WireGuardConfiguration.autostart),u=z(()=>c.Configurations.map(a=>a.Name)),g=async()=>{await v("/api/updateDashboardConfigurationItem",{section:"WireGuardConfiguration",key:"autostart",value:h.value},async a=>{a.status?(e.newMessage("Server","Start up configurations saved","success"),h.value=a.data):e.newMessage("Server","Start up configurations failed to save","danger")})},o=a=>{h.value.includes(a)?h.value=h.value.filter(r=>r!==a):h.value.push(a),g()};return(a,r)=>(n(),l("div",Cs,[t("div",Ps,[t("h6",As,[i(p,{t:"Toggle When Start Up"})])]),t("div",Ts,[t("div",Vs,[(n(!0),l(C,null,V(u.value,d=>(n(),l("button",{type:"button",key:d,onClick:P=>o(d),class:"list-group-item list-group-item-action py-2 w-100 d-flex align-items-center"},[t("samp",null,D(d),1),t("i",{class:$(["ms-auto",[h.value.includes(d)?"bi-check-circle-fill":"bi-circle"]])},null,2)],8,Ks))),128))])])]))}},Ls=k(Fs,[["__scopeId","data-v-4aa2aed9"]]),Es={class:"card"},Ms={class:"card-header"},Us={class:"my-2 d-flex"},Ws={key:0,class:"text-success ms-auto"},Ns={class:"card-body d-flex flex-column gap-3"},Gs={class:"row gx-2 gy-2"},Rs={class:"col-12 col-lg-4"},Ys={class:"form-group"},Hs={for:"server",class:"text-muted mb-1"},Bs={class:"col-12 col-lg-4"},js={class:"form-group"},zs={for:"port",class:"text-muted mb-1"},Os={class:"col-12 col-lg-4"},qs={class:"form-group"},Qs={for:"encryption",class:"text-muted mb-1"},Js={value:"NOTLS"},Xs={class:"col-12 col-lg-4"},Zs={class:"form-group"},ta={for:"username",class:"text-muted mb-1"},ea={class:"col-12 col-lg-4"},sa={class:"form-group"},aa={for:"email_password",class:"text-muted mb-1"},ia={class:"col-12 col-lg-4"},oa={class:"form-group"},na={for:"send_from",class:"text-muted mb-1"},la={key:0},da={key:1},ra={class:"text-muted mb-1",for:"test_email"},ua={class:"fw-bold"},ca=["disabled"],ha=["disabled"],ma={key:0,class:"bi bi-send me-2"},pa={key:1,class:"spinner-border spinner-border-sm me-2"},ga={class:"text-muted mb-1",for:"email_template"},ba={class:"fw-bold"},_a={__name:"dashboardEmailSettings",setup(s){const e=y();O(()=>{g(),document.querySelectorAll("#emailAccount input, #emailAccount select, #email_template").forEach(a=>{a.addEventListener("change",async()=>{let r=a.attributes.getNamedItem("id").value;await v("/api/updateDashboardConfigurationItem",{section:"Email",key:r,value:a.value},d=>{d.status?(a.classList.remove("is-invalid"),a.classList.add("is-valid")):(a.classList.remove("is-valid"),a.classList.add("is-invalid")),g()})})})});const c=T(!1),h=T(""),u=T(!1),g=async()=>{await E("/api/email/ready",{},a=>{c.value=a.status})},o=async()=>{u.value=!0,await v("/api/email/send",{Receiver:h.value,Subject:"WGDashboard Testing Email",Body:"Test 1, 2, 3! Hello World :)"},a=>{a.status?e.newMessage("Server","Test email sent successfully!","success"):e.newMessage("Server",`Test email sent failed! Reason: ${a.message}`,"danger"),u.value=!1})};return(a,r)=>(n(),l("div",Es,[t("div",Ms,[t("h6",Us,[i(p,{t:"Email Account"}),c.value?(n(),l("span",Ws,[r[10]||(r[10]=t("i",{class:"bi bi-check-circle-fill me-2"},null,-1)),i(p,{t:"Ready"})])):_("",!0)])]),t("div",Ns,[t("form",{onSubmit:r[6]||(r[6]=d=>d.preventDefault(d)),id:"emailAccount"},[t("div",Gs,[t("div",Rs,[t("div",Ys,[t("label",Hs,[t("strong",null,[t("small",null,[i(p,{t:"Server"})])])]),b(t("input",{id:"server","onUpdate:modelValue":r[0]||(r[0]=d=>w(e).Configuration.Email.server=d),type:"text",class:"form-control"},null,512),[[f,w(e).Configuration.Email.server]])])]),t("div",Bs,[t("div",js,[t("label",zs,[t("strong",null,[t("small",null,[i(p,{t:"Port"})])])]),b(t("input",{id:"port","onUpdate:modelValue":r[1]||(r[1]=d=>w(e).Configuration.Email.port=d),type:"text",class:"form-control"},null,512),[[f,w(e).Configuration.Email.port]])])]),t("div",Os,[t("div",qs,[t("label",Qs,[t("strong",null,[t("small",null,[i(p,{t:"Encryption"})])])]),b(t("select",{class:"form-select","onUpdate:modelValue":r[2]||(r[2]=d=>w(e).Configuration.Email.encryption=d),id:"encryption"},[r[11]||(r[11]=t("option",{value:"STARTTLS"}," STARTTLS ",-1)),t("option",Js,[i(p,{t:"No Encryption"})])],512),[[q,w(e).Configuration.Email.encryption]])])]),t("div",Xs,[t("div",Zs,[t("label",ta,[t("strong",null,[t("small",null,[i(p,{t:"Username"})])])]),b(t("input",{id:"username","onUpdate:modelValue":r[3]||(r[3]=d=>w(e).Configuration.Email.username=d),type:"text",class:"form-control"},null,512),[[f,w(e).Configuration.Email.username]])])]),t("div",ea,[t("div",sa,[t("label",aa,[t("strong",null,[t("small",null,[i(p,{t:"Password"})])])]),b(t("input",{id:"email_password","onUpdate:modelValue":r[4]||(r[4]=d=>w(e).Configuration.Email.email_password=d),type:"password",class:"form-control"},null,512),[[f,w(e).Configuration.Email.email_password]])])]),t("div",ia,[t("div",oa,[t("label",na,[t("strong",null,[t("small",null,[i(p,{t:"Send From"})])])]),b(t("input",{id:"send_from","onUpdate:modelValue":r[5]||(r[5]=d=>w(e).Configuration.Email.send_from=d),type:"text",class:"form-control"},null,512),[[f,w(e).Configuration.Email.send_from]])])])])],32),c.value?(n(),l("hr",la)):_("",!0),c.value?(n(),l("div",da,[t("label",ra,[t("small",ua,[i(p,{t:"Send Test Email"})])]),t("form",{onSubmit:r[8]||(r[8]=d=>{d.preventDefault(),o()}),class:"input-group"},[b(t("input",{type:"email",class:"form-control rounded-start-3",id:"test_email",placeholder:"john@example.com","onUpdate:modelValue":r[7]||(r[7]=d=>h.value=d),disabled:u.value},null,8,ca),[[f,h.value]]),t("button",{class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-end-3",type:"submit",value:"Submit",disabled:h.value.length===0||u.value,id:"button-addon2"},[u.value?(n(),l("span",pa,r[12]||(r[12]=[t("span",{class:"visually-hidden"},"Loading...",-1)]))):(n(),l("i",ma)),i(p,{t:u.value?"Sending...":"Send"},null,8,["t"])],8,ha)],32)])):_("",!0),r[13]||(r[13]=t("hr",null,null,-1)),t("div",null,[t("label",ga,[t("small",ba,[i(p,{t:"Email Body Template"})])]),b(t("textarea",{class:"form-control rounded-3 font-monospace","onUpdate:modelValue":r[9]||(r[9]=d=>w(e).Configuration.Email.email_template=d),id:"email_template",style:{"min-height":"400px"}},null,512),[[f,w(e).Configuration.Email.email_template]])])])]))}},fa={name:"settings",methods:{ipV46RegexCheck:ot},components:{DashboardEmailSettings:_a,DashboardSettingsWireguardConfigurationAutostart:Ls,DashboardIPPortInput:Is,DashboardLanguage:hs,LocaleText:p,AccountSettingsMFA:Ze,DashboardAPIKeys:ze,DashboardSettingsInputIPAddressAndPort:ue,DashboardTheme:Zt,DashboardSettingsInputWireguardConfigurationPath:Ot,AccountSettingsInputPassword:Tt,AccountSettingsInputUsername:ht,PeersDefaultSettingsInput:it},setup(){return{dashboardConfigurationStore:y()}},data(){return{activeTab:"WGDashboard",tabs:[{id:"WGDashboard",title:"WGDashboard Settings"},{id:"Peers",title:"Peers Settings"},{id:"WireGuardConfiguration",title:"WireGuard Configuration Settings"}]}}},va={class:"mt-md-5 mt-3 text-body mb-3"},ya={class:"container-md d-flex flex-column gap-4"},wa={class:"nav nav-pills nav-justified align-items-center gap-2"},$a={class:"nav-item"},ka=["onClick"],xa={class:"my-2"},Da={key:0,class:"d-flex gap-3 flex-column"},Sa={key:1,class:"d-flex gap-3 flex-column"},Ia={class:"card rounded-3"},Ca={class:"card-header"},Pa={class:"my-2"},Aa={class:"card-body"},Ta={key:2,class:"d-flex gap-3 flex-column"},Va={class:"card rounded-3"},Ka={class:"card-header"},Fa={class:"my-2"},La={class:"card-body"},Ea={class:"row g-2"},Ma={class:"col-sm"},Ua={class:"col-sm"},Wa={class:"card"},Na={class:"card-header"},Ga={class:"my-2"},Ra={class:"card-body"},Ya={class:"card"},Ha={class:"card-header"},Ba={class:"my-2"},ja={class:"card-body d-flex flex-column gap-3"},za={class:"card"},Oa={class:"card-header"},qa={class:"my-2"},Qa={class:"card-body"};function Ja(s,e,c,h,u,g){const o=m("LocaleText"),a=m("DashboardSettingsInputWireguardConfigurationPath"),r=m("DashboardSettingsWireguardConfigurationAutostart"),d=m("PeersDefaultSettingsInput"),P=m("DashboardTheme"),W=m("DashboardLanguage"),N=m("DashboardIPPortInput"),G=m("AccountSettingsInputUsername"),R=m("AccountSettingsInputPassword"),Y=m("AccountSettingsMFA"),H=m("DashboardAPIKeys"),B=m("DashboardEmailSettings");return n(),l("div",va,[t("div",ya,[t("div",null,[t("ul",wa,[(n(!0),l(C,null,V(this.tabs,K=>(n(),l("li",$a,[t("a",{class:$(["nav-link rounded-3",{active:this.activeTab===K.id}]),onClick:Xa=>this.activeTab=K.id,role:"button"},[t("h6",xa,[i(o,{t:K.title},null,8,["t"])])],10,ka)]))),256))]),e[1]||(e[1]=t("hr",null,null,-1)),t("div",null,[i(U,{name:"fade2",mode:"out-in"},{default:F(()=>[u.activeTab==="WireGuardConfiguration"?(n(),l("div",Da,[i(a,{targetData:"wg_conf_path",title:"Configurations Directory",warning:!0,"warning-text":"Remember to remove / at the end of your path. e.g /etc/wireguard"}),i(r)])):u.activeTab==="Peers"?(n(),l("div",Sa,[t("div",Ia,[t("div",Ca,[t("h6",Pa,[i(o,{t:"Peer Default Settings"})])]),t("div",Aa,[t("div",null,[i(d,{targetData:"peer_global_dns",title:"DNS"}),i(d,{targetData:"peer_endpoint_allowed_ip",title:"Endpoint Allowed IPs"}),i(d,{targetData:"peer_mtu",title:"MTU"}),i(d,{targetData:"peer_keep_alive",title:"Persistent Keepalive"}),i(d,{targetData:"remote_endpoint",title:"Peer Remote Endpoint",warning:!0,warningText:"This will be changed globally, and will be apply to all peer's QR code and configuration file."})])])])])):u.activeTab==="WGDashboard"?(n(),l("div",Ta,[t("div",Va,[t("div",Ka,[t("h6",Fa,[i(o,{t:"Appearance"})])]),t("div",La,[t("div",Ea,[t("div",Ma,[i(P)]),t("div",Ua,[i(W)])])])]),t("div",Wa,[t("div",Na,[t("h6",Ga,[i(o,{t:"Dashboard IP Address & Listen Port"})])]),t("div",Ra,[i(N)])]),t("div",Ya,[t("div",Ha,[t("h6",Ba,[i(o,{t:"Account Settings"})])]),t("div",ja,[t("div",null,[i(G,{targetData:"username",title:"Username"})]),e[0]||(e[0]=t("hr",null,null,-1)),t("div",null,[i(R,{targetData:"password"})])])]),t("div",za,[t("div",Oa,[t("h6",qa,[i(o,{t:"Multi-Factor Authentication (MFA)"})])]),t("div",Qa,[this.dashboardConfigurationStore.getActiveCrossServer()?_("",!0):(n(),x(Y,{key:0}))])]),i(H),i(B)])):_("",!0)]),_:1})])])])])}const ai=k(fa,[["render",Ja]]);export{ai as default}; +import{_ as k,D as y,y as I,z as v,a as n,c as l,b as t,d as i,m as b,x as f,n as $,t as D,e as _,j as m,W as M,f as S,v as L,i as x,F as C,g as E,w as F,h as V,k as j,T as U,r as T,p as z,o as O,A as w,B as q}from"./index-CgM9eUIs.js";import{L as p}from"./localeText-Dh33930I.js";import{d as A}from"./dayjs.min-B2wceQaW.js";import{V as Q}from"./vue-datepicker-D7WdryeM.js";const J={components:{LocaleText:p},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const s=y(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Peers[this.targetData]},methods:{async useValidation(){this.changed&&await v("/api/updateDashboardConfigurationItem",{section:"Peers",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Peers[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message),this.changed=!1,this.updating=!1})}}},X={class:"form-group mb-2"},Z=["for"],tt=["id","disabled"],et={class:"invalid-feedback"},st={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1"};function at(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",X,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:this.title},null,8,["t"])])])],8,Z),b(t("input",{type:"text",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),onBlur:e[2]||(e[2]=a=>g.useValidation()),disabled:this.updating},null,42,tt),[[f,this.value]]),t("div",et,D(this.invalidFeedback),1),c.warning?(n(),l("div",st,[t("small",null,[e[3]||(e[3]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),i(o,{t:c.warningText},null,8,["t"])])])):_("",!0)])}const it=k(J,[["render",at]]),ot=s=>{},nt={name:"accountSettingsInputUsername",components:{LocaleText:p},props:{targetData:String,title:String},setup(){const s=y(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Account[this.targetData]},methods:{async useValidation(s){this.changed&&(this.updating=!0,await v("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},e=>{e.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=e.message),this.changed=!1,this.updating=!1}))}}},lt={class:"form-group mb-2"},dt=["for"],rt=["id","disabled"],ut={class:"invalid-feedback"};function ct(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",lt,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:this.title},null,8,["t"])])])],8,dt),b(t("input",{type:"text",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),onBlur:e[2]||(e[2]=a=>g.useValidation()),disabled:this.updating},null,42,rt),[[f,this.value]]),t("div",ut,D(this.invalidFeedback),1)])}const ht=k(nt,[["render",ct]]),mt={name:"accountSettingsInputPassword",components:{LocaleText:p},props:{targetData:String,warning:!1,warningText:""},setup(){const s=y(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:{currentPassword:"",newPassword:"",repeatNewPassword:""},invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0}},methods:{async useValidation(){Object.values(this.value).find(s=>s.length===0)===void 0?this.value.newPassword===this.value.repeatNewPassword?await v("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.isValid=!1,this.value={currentPassword:"",newPassword:"",repeatNewPassword:""}},5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message)}):(this.showInvalidFeedback=!0,this.invalidFeedback="New passwords does not match"):(this.showInvalidFeedback=!0,this.invalidFeedback="Please fill in all required fields.")}},computed:{passwordValid(){return Object.values(this.value).find(s=>s.length===0)===void 0&&this.value.newPassword===this.value.repeatNewPassword}}},pt={class:"d-flex flex-column gap-2"},gt={class:"row g-2"},bt={class:"col-sm"},_t={class:"form-group"},ft=["for"],vt=["id"],yt={key:0,class:"invalid-feedback d-block"},wt={class:"col-sm"},$t={class:"form-group"},kt=["for"],xt=["id"],Dt={class:"col-sm"},St={class:"form-group"},It=["for"],Ct=["id"],Pt=["disabled"];function At(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("form",pt,[t("div",gt,[t("div",bt,[t("div",_t,[t("label",{for:"currentPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:"Current Password"})])])],8,ft),b(t("input",{type:"password",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),autocomplete:"current-password","onUpdate:modelValue":e[0]||(e[0]=a=>this.value.currentPassword=a),id:"currentPassword_"+this.uuid},null,10,vt),[[f,this.value.currentPassword]]),u.showInvalidFeedback?(n(),l("div",yt,D(this.invalidFeedback),1)):_("",!0)])]),t("div",wt,[t("div",$t,[t("label",{for:"newPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:"New Password"})])])],8,kt),b(t("input",{type:"password",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),autocomplete:"new-password","onUpdate:modelValue":e[1]||(e[1]=a=>this.value.newPassword=a),id:"newPassword_"+this.uuid},null,10,xt),[[f,this.value.newPassword]])])]),t("div",Dt,[t("div",St,[t("label",{for:"repeatNewPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:"Repeat New Password"})])])],8,It),b(t("input",{type:"password",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),autocomplete:"new-password","onUpdate:modelValue":e[2]||(e[2]=a=>this.value.repeatNewPassword=a),id:"repeatNewPassword_"+this.uuid},null,10,Ct),[[f,this.value.repeatNewPassword]])])])]),t("button",{disabled:!this.passwordValid,class:"ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",onClick:e[3]||(e[3]=a=>this.useValidation())},[e[4]||(e[4]=t("i",{class:"bi bi-save2-fill me-2"},null,-1)),i(o,{t:"Update Password"})],8,Pt)])}const Tt=k(mt,[["render",At]]),Vt={name:"dashboardSettingsInputWireguardConfigurationPath",components:{LocaleText:p},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const s=y(),e=M(),c=`input_${I()}`;return{store:s,uuid:c,WireguardConfigurationStore:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Server[this.targetData]},methods:{async useValidation(){this.changed&&(this.updating=!0,await v("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3),this.WireguardConfigurationStore.getConfigurations(),this.store.newMessage("Server","WireGuard configuration path saved","success")):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message),this.changed=!1,this.updating=!1}))}}},Kt={class:"card"},Ft={class:"card-header"},Lt={class:"my-2"},Et={class:"card-body"},Mt={class:"form-group"},Ut=["for"],Wt={class:"d-flex gap-2 align-items-start"},Nt={class:"flex-grow-1"},Gt=["id","disabled"],Rt={class:"invalid-feedback fw-bold"},Yt=["disabled"],Ht={key:0,class:"bi bi-save2-fill"},Bt={key:1,class:"spinner-border spinner-border-sm"},jt={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1 mb-2"};function zt(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",Kt,[t("div",Ft,[t("h6",Lt,[i(o,{t:"Path"})])]),t("div",Et,[t("div",Mt,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[i(o,{t:this.title},null,8,["t"])])])],8,Ut),t("div",Wt,[t("div",Nt,[b(t("input",{type:"text",class:$(["form-control rounded-3",{"is-invalid":this.showInvalidFeedback,"is-valid":this.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.value=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),disabled:this.updating},null,42,Gt),[[f,this.value]]),t("div",Rt,D(this.invalidFeedback),1)]),t("button",{onClick:e[2]||(e[2]=a=>this.useValidation()),disabled:!this.changed,class:"ms-auto btn rounded-3 border-success-subtle bg-success-subtle text-success-emphasis"},[this.updating?(n(),l("span",Bt)):(n(),l("i",Ht))],8,Yt)]),c.warning?(n(),l("div",jt,[t("small",null,[e[3]||(e[3]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),i(o,{t:c.warningText},null,8,["t"])])])):_("",!0)])])])}const Ot=k(Vt,[["render",zt]]),qt={name:"dashboardTheme",components:{LocaleText:p},setup(){return{dashboardConfigurationStore:y()}},methods:{async switchTheme(s){await v("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_theme",value:s},e=>{e.status&&(this.dashboardConfigurationStore.Configuration.Server.dashboard_theme=s)})}}},Qt={class:"text-muted mb-1 d-block"},Jt={class:"d-flex gap-1"};function Xt(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",null,[t("small",Qt,[t("strong",null,[i(o,{t:"Theme"})])]),t("div",Jt,[t("button",{class:$(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="light"}]),onClick:e[0]||(e[0]=a=>this.switchTheme("light"))},[e[2]||(e[2]=t("i",{class:"bi bi-sun-fill me-2"},null,-1)),i(o,{t:"Light"})],2),t("button",{class:$(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="dark"}]),onClick:e[1]||(e[1]=a=>this.switchTheme("dark"))},[e[3]||(e[3]=t("i",{class:"bi bi-moon-fill me-2"},null,-1)),i(o,{t:"Dark"})],2)])])}const Zt=k(qt,[["render",Xt]]),te={name:"dashboardSettingsInputIPAddressAndPort",props:{},setup(){const s=y(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{app_ip:"",app_port:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.app_ip=this.store.Configuration.Server.app_ip,this.app_port=this.store.Configuration.Server.app_port},methods:{async useValidation(){this.changed&&await v("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message)})}}},ee={class:"invalid-feedback d-block mt-0"},se={class:"row"},ae={class:"form-group mb-2 col-sm"},ie=["for"],oe=["id"],ne={class:"form-group col-sm"},le=["for"],de=["id"];function re(s,e,c,h,u,g){return n(),l("div",null,[t("div",ee,D(this.invalidFeedback),1),t("div",se,[t("div",ae,[t("label",{for:"app_ip_"+this.uuid,class:"text-muted mb-1"},e[2]||(e[2]=[t("strong",null,[t("small",null,"Dashboard IP Address")],-1)]),8,ie),b(t("input",{type:"text",class:"form-control mb-2",id:"app_ip_"+this.uuid,"onUpdate:modelValue":e[0]||(e[0]=o=>this.app_ip=o)},null,8,oe),[[f,this.app_ip]]),e[3]||(e[3]=t("div",{class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block"},[t("small",null,[t("i",{class:"bi bi-exclamation-triangle-fill me-2"}),t("code",null,"0.0.0.0"),S(" means it can be access by anyone with your server IP Address.")])],-1))]),t("div",ne,[t("label",{for:"app_port_"+this.uuid,class:"text-muted mb-1"},e[4]||(e[4]=[t("strong",null,[t("small",null,"Dashboard Port")],-1)]),8,le),b(t("input",{type:"text",class:"form-control mb-2",id:"app_port_"+this.uuid,"onUpdate:modelValue":e[1]||(e[1]=o=>this.app_port=o)},null,8,de),[[f,this.app_port]])])]),e[5]||(e[5]=t("button",{class:"btn btn-success btn-sm fw-bold rounded-3"},[t("i",{class:"bi bi-floppy-fill me-2"}),S("Update Dashboard Settings & Restart ")],-1))])}const ue=k(te,[["render",re]]),ce={name:"newDashboardAPIKey",components:{LocaleText:p,VueDatePicker:Q},data(){return{newKeyData:{ExpiredAt:A().add(7,"d").format("YYYY-MM-DD HH:mm:ss"),neverExpire:!1},submitting:!1}},setup(){return{store:y()}},mounted(){console.log(this.newKeyData.ExpiredAt)},methods:{submitNewAPIKey(){this.submitting=!0,v("/api/newDashboardAPIKey",this.newKeyData,s=>{s.status?(this.$emit("created",s.data),this.store.newMessage("Server","API Key created","success"),this.$emit("close")):this.store.newMessage("Server",s.message,"danger"),this.submitting=!1})},fixDate(s){return console.log(A(s).format("YYYY-MM-DDTHH:mm:ss")),A(s).format("YYYY-MM-DDTHH:mm:ss")},parseTime(s){s?this.newKeyData.ExpiredAt=A(s).format("YYYY-MM-DD HH:mm:ss"):this.newKeyData.ExpiredAt=void 0}}},he={class:"position-absolute w-100 h-100 top-0 start-0 rounded-bottom-3 p-3 d-flex",style:{"background-color":"#00000060","backdrop-filter":"blur(3px)"}},me={class:"card m-auto rounded-3 mt-5"},pe={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},ge={class:"mb-0"},be={class:"card-body d-flex gap-2 p-4 flex-column"},_e={class:"text-muted"},fe={class:"d-flex align-items-center gap-2"},ve={class:"form-check"},ye=["disabled"],we={class:"form-check-label",for:"neverExpire"},$e={key:0,class:"bi bi-check-lg me-2"};function ke(s,e,c,h,u,g){const o=m("LocaleText"),a=m("VueDatePicker");return n(),l("div",he,[t("div",me,[t("div",pe,[t("h6",ge,[i(o,{t:"Create API Key"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=r=>this.$emit("close"))})]),t("div",be,[t("small",_e,[i(o,{t:"When should this API Key expire?"})]),t("div",fe,[i(a,{is24:!0,"min-date":new Date,"model-value":this.newKeyData.ExpiredAt,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:this.newKeyData.neverExpire||this.submitting,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])]),t("div",ve,[b(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[1]||(e[1]=r=>this.newKeyData.neverExpire=r),id:"neverExpire",disabled:this.submitting},null,8,ye),[[L,this.newKeyData.neverExpire]]),t("label",we,[i(o,{t:"Never Expire"}),e[3]||(e[3]=S(" (")),e[4]||(e[4]=t("i",{class:"bi bi-emoji-grimace-fill me-2"},null,-1)),i(o,{t:"Don't think that's a good idea"}),e[5]||(e[5]=S(") "))])]),t("button",{class:$(["ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",{disabled:this.submitting}]),onClick:e[2]||(e[2]=r=>this.submitNewAPIKey())},[this.submitting?_("",!0):(n(),l("i",$e)),this.submitting?(n(),x(o,{key:1,t:"Creating..."})):(n(),x(o,{key:2,t:"Create"}))],2)])])])}const xe=k(ce,[["render",ke]]),De={name:"dashboardAPIKey",components:{LocaleText:p},props:{apiKey:Object},setup(){return{store:y()}},data(){return{confirmDelete:!1}},methods:{deleteAPIKey(){v("/api/deleteDashboardAPIKey",{Key:this.apiKey.Key},s=>{s.status?(this.$emit("deleted",s.data),this.store.newMessage("Server","API Key deleted","success")):this.store.newMessage("Server",s.message,"danger")})}}},Se={class:"card rounded-3 shadow-sm"},Ie={key:0,class:"card-body d-flex gap-3 align-items-center apiKey-card-body"},Ce={class:"d-flex align-items-center gap-2"},Pe={class:"text-muted"},Ae={style:{"word-break":"break-all"}},Te={class:"d-flex align-items-center gap-2 ms-auto"},Ve={class:"text-muted"},Ke={key:0,class:"card-body d-flex gap-3 align-items-center justify-content-end"};function Fe(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",Se,[this.confirmDelete?(n(),l(C,{key:1},[this.store.getActiveCrossServer()?_("",!0):(n(),l("div",Ke,[i(o,{t:"Are you sure to delete this API key?"}),t("a",{role:"button",class:"btn btn-sm bg-success-subtle text-success-emphasis rounded-3",onClick:e[1]||(e[1]=a=>this.deleteAPIKey())},e[4]||(e[4]=[t("i",{class:"bi bi-check-lg"},null,-1)])),t("a",{role:"button",class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis rounded-3",onClick:e[2]||(e[2]=a=>this.confirmDelete=!1)},e[5]||(e[5]=[t("i",{class:"bi bi-x-lg"},null,-1)]))]))],64)):(n(),l("div",Ie,[t("div",Ce,[t("small",Pe,[i(o,{t:"Key"})]),t("span",Ae,D(this.apiKey.Key),1)]),t("div",Te,[t("small",Ve,[i(o,{t:"Expire At"})]),this.apiKey.ExpiredAt?_("",!0):(n(),x(o,{key:0,t:"Never Expire"})),t("span",null,D(this.apiKey.ExpiredAt),1)]),this.store.getActiveCrossServer()?_("",!0):(n(),l("a",{key:0,role:"button",class:"btn btn-sm bg-danger-subtle text-danger-emphasis rounded-3",onClick:e[0]||(e[0]=a=>this.confirmDelete=!0)},e[3]||(e[3]=[t("i",{class:"bi bi-trash-fill"},null,-1)])))]))])}const Le=k(De,[["render",Fe],["__scopeId","data-v-a76253c8"]]),Ee={name:"dashboardAPIKeys",components:{LocaleText:p,DashboardAPIKey:Le,NewDashboardAPIKey:xe},setup(){return{store:y()}},data(){return{value:this.store.Configuration.Server.dashboard_api_key,apiKeys:[],newDashboardAPIKey:!1}},methods:{async toggleDashboardAPIKeys(){await v("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_api_key",value:this.value},s=>{s.status?(this.store.Configuration.Peers[this.targetData]=this.value,this.store.newMessage("Server",`API Keys function is successfully ${this.value?"enabled":"disabled"}`,"success")):(this.value=this.store.Configuration.Peers[this.targetData],this.store.newMessage("Server",`API Keys function is failed to ${this.value?"enabled":"disabled"}`,"danger"))})}},watch:{value:{immediate:!0,handler(s){s?E("/api/getDashboardAPIKeys",{},e=>{e.status?this.apiKeys=e.data:(this.apiKeys=[],this.store.newMessage("Server",e.message,"danger"))}):this.apiKeys=[]}}}},Me={class:"card rounded-3"},Ue={class:"my-2"},We={key:0,class:"form-check form-switch ms-auto"},Ne={class:"form-check-label",for:"allowAPIKeysSwitch"},Ge={key:0,class:"card-body position-relative d-flex flex-column gap-2"},Re={key:1,class:"card",style:{height:"300px"}},Ye={class:"card-body d-flex text-muted"},He={class:"m-auto"},Be={key:2,class:"d-flex flex-column gap-2 position-relative",style:{"min-height":"300px"}};function je(s,e,c,h,u,g){const o=m("LocaleText"),a=m("DashboardAPIKey"),r=m("NewDashboardAPIKey");return n(),l("div",Me,[t("div",{class:$(["card-header d-flex align-items-center",{"border-bottom-0 rounded-3":!this.value}])},[t("h6",Ue,[i(o,{t:"API Keys"})]),this.store.getActiveCrossServer()?_("",!0):(n(),l("div",We,[b(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=d=>this.value=d),onChange:e[1]||(e[1]=d=>this.toggleDashboardAPIKeys()),role:"switch",id:"allowAPIKeysSwitch"},null,544),[[L,this.value]]),t("label",Ne,[this.value?(n(),x(o,{key:0,t:"Enabled"})):(n(),x(o,{key:1,t:"Disabled"}))])]))],2),this.value?(n(),l("div",Ge,[this.store.getActiveCrossServer()?_("",!0):(n(),l("button",{key:0,class:"btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle rounded-3 shadow-sm",onClick:e[2]||(e[2]=d=>this.newDashboardAPIKey=!0)},[e[6]||(e[6]=t("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),i(o,{t:"API Key"})])),this.apiKeys.length===0?(n(),l("div",Re,[t("div",Ye,[t("span",He,[i(o,{t:"No WGDashboard API Key"})])])])):(n(),l("div",Be,[i(j,{name:"apiKey"},{default:F(()=>[(n(!0),l(C,null,V(this.apiKeys,d=>(n(),x(a,{apiKey:d,key:d.Key,onDeleted:e[3]||(e[3]=P=>this.apiKeys=P)},null,8,["apiKey"]))),128))]),_:1})])),i(U,{name:"zoomReversed"},{default:F(()=>[this.newDashboardAPIKey?(n(),x(r,{key:0,onCreated:e[4]||(e[4]=d=>this.apiKeys=d),onClose:e[5]||(e[5]=d=>this.newDashboardAPIKey=!1)})):_("",!0)]),_:1})])):_("",!0)])}const ze=k(Ee,[["render",je],["__scopeId","data-v-100ee9f9"]]),Oe={name:"accountSettingsMFA",components:{LocaleText:p},setup(){const s=y(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{status:!1}},mounted(){this.status=this.store.Configuration.Account.enable_totp},methods:{async resetMFA(){await v("/api/updateDashboardConfigurationItem",{section:"Account",key:"totp_verified",value:"false"},async s=>{await v("/api/updateDashboardConfigurationItem",{section:"Account",key:"enable_totp",value:"false"},e=>{e.status&&this.$router.push("/2FASetup")})})}}},qe={class:"d-flex align-items-center"},Qe={class:"form-check form-switch"},Je={for:"allowMFAKeysSwitch"};function Xe(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",null,[t("div",qe,[t("div",Qe,[b(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=a=>this.status=a),role:"switch",id:"allowMFAKeysSwitch"},null,512),[[L,this.status]]),t("label",Je,[this.status?(n(),x(o,{key:0,t:"Enabled"})):(n(),x(o,{key:1,t:"Disabled"}))])]),this.status?(n(),l("button",{key:0,class:"btn bg-warning-subtle text-warning-emphasis border-1 border-warning-subtle ms-auto rounded-3 shadow-sm",onClick:e[1]||(e[1]=a=>this.resetMFA())},[e[2]||(e[2]=t("i",{class:"bi bi-shield-lock-fill me-2"},null,-1)),this.store.Configuration.Account.totp_verified?(n(),x(o,{key:0,t:"Reset"})):(n(),x(o,{key:1,t:"Setup"})),e[3]||(e[3]=S(" MFA "))])):_("",!0)])])}const Ze=k(Oe,[["render",Xe]]),ts={name:"dashboardLanguage",components:{LocaleText:p},setup(){return{store:y()}},data(){return{languages:void 0}},mounted(){E("/api/locale/available",{},s=>{this.languages=s.data})},methods:{changeLanguage(s){v("/api/locale/update",{lang_id:s},e=>{e.status?(this.store.Configuration.Server.dashboard_language=s,this.store.Locale=e.data):this.store.newMessage("Server","WGDashboard language update failed","danger")})}},computed:{currentLanguage(){let s=this.store.Configuration.Server.dashboard_language;return this.languages.find(e=>e.lang_id===s)}}},es={class:"text-muted d-block mb-1"},ss={class:"d-flex gap-2"},as={class:"dropdown w-100"},is=["disabled"],os={key:1},ns={class:"dropdown-menu rounded-3 shadow"},ls=["onClick"],ds={class:"me-auto mb-0"},rs={class:"d-block",style:{"font-size":"0.8rem"}},us={key:0,class:"bi bi-check text-primary fs-5"};function cs(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",null,[t("small",es,[t("strong",null,[i(o,{t:"Language"})])]),t("div",ss,[t("div",as,[t("button",{class:"btn bg-primary-subtle text-primary-emphasis dropdown-toggle w-100 rounded-3",disabled:!this.languages,type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[this.languages?(n(),l("span",os,D(g.currentLanguage?.lang_name_localized),1)):(n(),x(o,{key:0,t:"Loading..."}))],8,is),t("ul",ns,[(n(!0),l(C,null,V(this.languages,a=>(n(),l("li",null,[t("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:r=>this.changeLanguage(a.lang_id)},[t("p",ds,[S(D(a.lang_name_localized)+" ",1),t("small",rs,D(a.lang_name),1)]),g.currentLanguage?.lang_id===a.lang_id?(n(),l("i",us)):_("",!0)],8,ls)]))),256))])])])])}const hs=k(ts,[["render",cs],["__scopeId","data-v-0f26916d"]]),ms={name:"dashboardIPPortInput",components:{LocaleText:p},setup(){return{store:y()}},data(){return{ipAddress:"",port:0,invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.ipAddress=this.store.Configuration.Server.app_ip,this.port=this.store.Configuration.Server.app_port},methods:{async useValidation(s,e,c){this.changed&&(this.updating=!0,await v("/api/updateDashboardConfigurationItem",{section:"Server",key:e,value:c},h=>{h.status?(s.target.classList.add("is-valid"),this.showInvalidFeedback=!1,this.store.Configuration.Server[e]=c,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{s.target.classList.remove("is-valid")},5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=h.message),this.changed=!1,this.updating=!1}))}}},ps={class:"row g-2"},gs={class:"col-sm"},bs={class:"form-group"},_s={for:"input_dashboard_ip",class:"text-muted mb-1"},fs=["disabled"],vs={class:"invalid-feedback"},ys={class:"col-sm"},ws={class:"form-group"},$s={for:"input_dashboard_ip",class:"text-muted mb-1"},ks=["disabled"],xs={class:"invalid-feedback"},Ds={class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mb-2 mt-2"};function Ss(s,e,c,h,u,g){const o=m("LocaleText");return n(),l("div",null,[t("div",ps,[t("div",gs,[t("div",bs,[t("label",_s,[t("strong",null,[t("small",null,[i(o,{t:"IP Address / Hostname"})])])]),b(t("input",{type:"text",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),id:"input_dashboard_ip","onUpdate:modelValue":e[0]||(e[0]=a=>this.ipAddress=a),onKeydown:e[1]||(e[1]=a=>this.changed=!0),onBlur:e[2]||(e[2]=a=>g.useValidation(a,"app_ip",this.ipAddress)),disabled:this.updating},null,42,fs),[[f,this.ipAddress]]),t("div",vs,D(this.invalidFeedback),1)])]),t("div",ys,[t("div",ws,[t("label",$s,[t("strong",null,[t("small",null,[i(o,{t:"Listen Port"})])])]),b(t("input",{type:"number",class:$(["form-control",{"is-invalid":u.showInvalidFeedback,"is-valid":u.isValid}]),id:"input_dashboard_ip","onUpdate:modelValue":e[3]||(e[3]=a=>this.port=a),onKeydown:e[4]||(e[4]=a=>this.changed=!0),onBlur:e[5]||(e[5]=a=>g.useValidation(a,"app_port",this.port)),disabled:this.updating},null,42,ks),[[f,this.port]]),t("div",xs,D(this.invalidFeedback),1)])])]),t("div",Ds,[t("small",null,[e[6]||(e[6]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),i(o,{t:"Manual restart of WGDashboard is needed to apply changes on IP Address and Listen Port"})])])])}const Is=k(ms,[["render",Ss]]),Cs={class:"card rounded-3"},Ps={class:"card-header"},As={class:"my-2"},Ts={class:"card-body d-flex gap-2"},Vs={class:"list-group w-100"},Ks=["onClick"],Fs={__name:"dashboardSettingsWireguardConfigurationAutostart",setup(s){const e=y(),c=M(),h=T(e.Configuration.WireGuardConfiguration.autostart),u=z(()=>c.Configurations.map(a=>a.Name)),g=async()=>{await v("/api/updateDashboardConfigurationItem",{section:"WireGuardConfiguration",key:"autostart",value:h.value},async a=>{a.status?(e.newMessage("Server","Start up configurations saved","success"),h.value=a.data):e.newMessage("Server","Start up configurations failed to save","danger")})},o=a=>{h.value.includes(a)?h.value=h.value.filter(r=>r!==a):h.value.push(a),g()};return(a,r)=>(n(),l("div",Cs,[t("div",Ps,[t("h6",As,[i(p,{t:"Toggle When Start Up"})])]),t("div",Ts,[t("div",Vs,[(n(!0),l(C,null,V(u.value,d=>(n(),l("button",{type:"button",key:d,onClick:P=>o(d),class:"list-group-item list-group-item-action py-2 w-100 d-flex align-items-center"},[t("samp",null,D(d),1),t("i",{class:$(["ms-auto",[h.value.includes(d)?"bi-check-circle-fill":"bi-circle"]])},null,2)],8,Ks))),128))])])]))}},Ls=k(Fs,[["__scopeId","data-v-4aa2aed9"]]),Es={class:"card"},Ms={class:"card-header"},Us={class:"my-2 d-flex"},Ws={key:0,class:"text-success ms-auto"},Ns={class:"card-body d-flex flex-column gap-3"},Gs={class:"row gx-2 gy-2"},Rs={class:"col-12 col-lg-4"},Ys={class:"form-group"},Hs={for:"server",class:"text-muted mb-1"},Bs={class:"col-12 col-lg-4"},js={class:"form-group"},zs={for:"port",class:"text-muted mb-1"},Os={class:"col-12 col-lg-4"},qs={class:"form-group"},Qs={for:"encryption",class:"text-muted mb-1"},Js={value:"NOTLS"},Xs={class:"col-12 col-lg-4"},Zs={class:"form-group"},ta={for:"username",class:"text-muted mb-1"},ea={class:"col-12 col-lg-4"},sa={class:"form-group"},aa={for:"email_password",class:"text-muted mb-1"},ia={class:"col-12 col-lg-4"},oa={class:"form-group"},na={for:"send_from",class:"text-muted mb-1"},la={key:0},da={key:1},ra={class:"text-muted mb-1",for:"test_email"},ua={class:"fw-bold"},ca=["disabled"],ha=["disabled"],ma={key:0,class:"bi bi-send me-2"},pa={key:1,class:"spinner-border spinner-border-sm me-2"},ga={class:"text-muted mb-1",for:"email_template"},ba={class:"fw-bold"},_a={__name:"dashboardEmailSettings",setup(s){const e=y();O(()=>{g(),document.querySelectorAll("#emailAccount input, #emailAccount select, #email_template").forEach(a=>{a.addEventListener("change",async()=>{let r=a.attributes.getNamedItem("id").value;await v("/api/updateDashboardConfigurationItem",{section:"Email",key:r,value:a.value},d=>{d.status?(a.classList.remove("is-invalid"),a.classList.add("is-valid")):(a.classList.remove("is-valid"),a.classList.add("is-invalid")),g()})})})});const c=T(!1),h=T(""),u=T(!1),g=async()=>{await E("/api/email/ready",{},a=>{c.value=a.status})},o=async()=>{u.value=!0,await v("/api/email/send",{Receiver:h.value,Subject:"WGDashboard Testing Email",Body:"Test 1, 2, 3! Hello World :)"},a=>{a.status?e.newMessage("Server","Test email sent successfully!","success"):e.newMessage("Server",`Test email sent failed! Reason: ${a.message}`,"danger"),u.value=!1})};return(a,r)=>(n(),l("div",Es,[t("div",Ms,[t("h6",Us,[i(p,{t:"Email Account"}),c.value?(n(),l("span",Ws,[r[10]||(r[10]=t("i",{class:"bi bi-check-circle-fill me-2"},null,-1)),i(p,{t:"Ready"})])):_("",!0)])]),t("div",Ns,[t("form",{onSubmit:r[6]||(r[6]=d=>d.preventDefault(d)),id:"emailAccount"},[t("div",Gs,[t("div",Rs,[t("div",Ys,[t("label",Hs,[t("strong",null,[t("small",null,[i(p,{t:"Server"})])])]),b(t("input",{id:"server","onUpdate:modelValue":r[0]||(r[0]=d=>w(e).Configuration.Email.server=d),type:"text",class:"form-control"},null,512),[[f,w(e).Configuration.Email.server]])])]),t("div",Bs,[t("div",js,[t("label",zs,[t("strong",null,[t("small",null,[i(p,{t:"Port"})])])]),b(t("input",{id:"port","onUpdate:modelValue":r[1]||(r[1]=d=>w(e).Configuration.Email.port=d),type:"text",class:"form-control"},null,512),[[f,w(e).Configuration.Email.port]])])]),t("div",Os,[t("div",qs,[t("label",Qs,[t("strong",null,[t("small",null,[i(p,{t:"Encryption"})])])]),b(t("select",{class:"form-select","onUpdate:modelValue":r[2]||(r[2]=d=>w(e).Configuration.Email.encryption=d),id:"encryption"},[r[11]||(r[11]=t("option",{value:"STARTTLS"}," STARTTLS ",-1)),t("option",Js,[i(p,{t:"No Encryption"})])],512),[[q,w(e).Configuration.Email.encryption]])])]),t("div",Xs,[t("div",Zs,[t("label",ta,[t("strong",null,[t("small",null,[i(p,{t:"Username"})])])]),b(t("input",{id:"username","onUpdate:modelValue":r[3]||(r[3]=d=>w(e).Configuration.Email.username=d),type:"text",class:"form-control"},null,512),[[f,w(e).Configuration.Email.username]])])]),t("div",ea,[t("div",sa,[t("label",aa,[t("strong",null,[t("small",null,[i(p,{t:"Password"})])])]),b(t("input",{id:"email_password","onUpdate:modelValue":r[4]||(r[4]=d=>w(e).Configuration.Email.email_password=d),type:"password",class:"form-control"},null,512),[[f,w(e).Configuration.Email.email_password]])])]),t("div",ia,[t("div",oa,[t("label",na,[t("strong",null,[t("small",null,[i(p,{t:"Send From"})])])]),b(t("input",{id:"send_from","onUpdate:modelValue":r[5]||(r[5]=d=>w(e).Configuration.Email.send_from=d),type:"text",class:"form-control"},null,512),[[f,w(e).Configuration.Email.send_from]])])])])],32),c.value?(n(),l("hr",la)):_("",!0),c.value?(n(),l("div",da,[t("label",ra,[t("small",ua,[i(p,{t:"Send Test Email"})])]),t("form",{onSubmit:r[8]||(r[8]=d=>{d.preventDefault(),o()}),class:"input-group"},[b(t("input",{type:"email",class:"form-control rounded-start-3",id:"test_email",placeholder:"john@example.com","onUpdate:modelValue":r[7]||(r[7]=d=>h.value=d),disabled:u.value},null,8,ca),[[f,h.value]]),t("button",{class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-end-3",type:"submit",value:"Submit",disabled:h.value.length===0||u.value,id:"button-addon2"},[u.value?(n(),l("span",pa,r[12]||(r[12]=[t("span",{class:"visually-hidden"},"Loading...",-1)]))):(n(),l("i",ma)),i(p,{t:u.value?"Sending...":"Send"},null,8,["t"])],8,ha)],32)])):_("",!0),r[13]||(r[13]=t("hr",null,null,-1)),t("div",null,[t("label",ga,[t("small",ba,[i(p,{t:"Email Body Template"})])]),b(t("textarea",{class:"form-control rounded-3 font-monospace","onUpdate:modelValue":r[9]||(r[9]=d=>w(e).Configuration.Email.email_template=d),id:"email_template",style:{"min-height":"400px"}},null,512),[[f,w(e).Configuration.Email.email_template]])])])]))}},fa={name:"settings",methods:{ipV46RegexCheck:ot},components:{DashboardEmailSettings:_a,DashboardSettingsWireguardConfigurationAutostart:Ls,DashboardIPPortInput:Is,DashboardLanguage:hs,LocaleText:p,AccountSettingsMFA:Ze,DashboardAPIKeys:ze,DashboardSettingsInputIPAddressAndPort:ue,DashboardTheme:Zt,DashboardSettingsInputWireguardConfigurationPath:Ot,AccountSettingsInputPassword:Tt,AccountSettingsInputUsername:ht,PeersDefaultSettingsInput:it},setup(){return{dashboardConfigurationStore:y()}},data(){return{activeTab:"WGDashboard",tabs:[{id:"WGDashboard",title:"WGDashboard Settings"},{id:"Peers",title:"Peers Settings"},{id:"WireGuardConfiguration",title:"WireGuard Configuration Settings"}]}}},va={class:"mt-md-5 mt-3 text-body mb-3"},ya={class:"container-md d-flex flex-column gap-4"},wa={class:"nav nav-pills nav-justified align-items-center gap-2"},$a={class:"nav-item"},ka=["onClick"],xa={class:"my-2"},Da={key:0,class:"d-flex gap-3 flex-column"},Sa={key:1,class:"d-flex gap-3 flex-column"},Ia={class:"card rounded-3"},Ca={class:"card-header"},Pa={class:"my-2"},Aa={class:"card-body"},Ta={key:2,class:"d-flex gap-3 flex-column"},Va={class:"card rounded-3"},Ka={class:"card-header"},Fa={class:"my-2"},La={class:"card-body"},Ea={class:"row g-2"},Ma={class:"col-sm"},Ua={class:"col-sm"},Wa={class:"card"},Na={class:"card-header"},Ga={class:"my-2"},Ra={class:"card-body"},Ya={class:"card"},Ha={class:"card-header"},Ba={class:"my-2"},ja={class:"card-body d-flex flex-column gap-3"},za={class:"card"},Oa={class:"card-header"},qa={class:"my-2"},Qa={class:"card-body"};function Ja(s,e,c,h,u,g){const o=m("LocaleText"),a=m("DashboardSettingsInputWireguardConfigurationPath"),r=m("DashboardSettingsWireguardConfigurationAutostart"),d=m("PeersDefaultSettingsInput"),P=m("DashboardTheme"),W=m("DashboardLanguage"),N=m("DashboardIPPortInput"),G=m("AccountSettingsInputUsername"),R=m("AccountSettingsInputPassword"),Y=m("AccountSettingsMFA"),H=m("DashboardAPIKeys"),B=m("DashboardEmailSettings");return n(),l("div",va,[t("div",ya,[t("div",null,[t("ul",wa,[(n(!0),l(C,null,V(this.tabs,K=>(n(),l("li",$a,[t("a",{class:$(["nav-link rounded-3",{active:this.activeTab===K.id}]),onClick:Xa=>this.activeTab=K.id,role:"button"},[t("h6",xa,[i(o,{t:K.title},null,8,["t"])])],10,ka)]))),256))]),e[1]||(e[1]=t("hr",null,null,-1)),t("div",null,[i(U,{name:"fade2",mode:"out-in"},{default:F(()=>[u.activeTab==="WireGuardConfiguration"?(n(),l("div",Da,[i(a,{targetData:"wg_conf_path",title:"Configurations Directory",warning:!0,"warning-text":"Remember to remove / at the end of your path. e.g /etc/wireguard"}),i(r)])):u.activeTab==="Peers"?(n(),l("div",Sa,[t("div",Ia,[t("div",Ca,[t("h6",Pa,[i(o,{t:"Peer Default Settings"})])]),t("div",Aa,[t("div",null,[i(d,{targetData:"peer_global_dns",title:"DNS"}),i(d,{targetData:"peer_endpoint_allowed_ip",title:"Endpoint Allowed IPs"}),i(d,{targetData:"peer_mtu",title:"MTU"}),i(d,{targetData:"peer_keep_alive",title:"Persistent Keepalive"}),i(d,{targetData:"remote_endpoint",title:"Peer Remote Endpoint",warning:!0,warningText:"This will be changed globally, and will be apply to all peer's QR code and configuration file."})])])])])):u.activeTab==="WGDashboard"?(n(),l("div",Ta,[t("div",Va,[t("div",Ka,[t("h6",Fa,[i(o,{t:"Appearance"})])]),t("div",La,[t("div",Ea,[t("div",Ma,[i(P)]),t("div",Ua,[i(W)])])])]),t("div",Wa,[t("div",Na,[t("h6",Ga,[i(o,{t:"Dashboard IP Address & Listen Port"})])]),t("div",Ra,[i(N)])]),t("div",Ya,[t("div",Ha,[t("h6",Ba,[i(o,{t:"Account Settings"})])]),t("div",ja,[t("div",null,[i(G,{targetData:"username",title:"Username"})]),e[0]||(e[0]=t("hr",null,null,-1)),t("div",null,[i(R,{targetData:"password"})])])]),t("div",za,[t("div",Oa,[t("h6",qa,[i(o,{t:"Multi-Factor Authentication (MFA)"})])]),t("div",Qa,[this.dashboardConfigurationStore.getActiveCrossServer()?_("",!0):(n(),x(Y,{key:0}))])]),i(H),i(B)])):_("",!0)]),_:1})])])])])}const ai=k(fa,[["render",Ja]]);export{ai as default}; diff --git a/src/static/app/dist/assets/setup-YDQRO7o1.js b/src/static/app/dist/assets/setup-DY8wemWQ.js similarity index 96% rename from src/static/app/dist/assets/setup-YDQRO7o1.js rename to src/static/app/dist/assets/setup-DY8wemWQ.js index 85cc8a7..1aa620f 100644 --- a/src/static/app/dist/assets/setup-YDQRO7o1.js +++ b/src/static/app/dist/assets/setup-DY8wemWQ.js @@ -1 +1 @@ -import{_ as u,D as m,z as p,c as r,b as e,d as o,f as c,t as h,e as f,m as l,x as d,a as i,j as w}from"./index-7qLsecvh.js";import{L as g}from"./localeText-BguG5zGd.js";const b={name:"setup",components:{LocaleText:g},setup(){return{store:m()}},data(){return{setup:{username:"",newPassword:"",repeatNewPassword:"",enable_totp:!0},loading:!1,errorMessage:"",done:!1}},computed:{goodToSubmit(){return this.setup.username&&this.setup.newPassword.length>=8&&this.setup.repeatNewPassword.length>=8&&this.setup.newPassword===this.setup.repeatNewPassword}},methods:{submit(){this.loading=!0,p("/api/Welcome_Finish",this.setup,n=>{n.status?(this.done=!0,this.$router.push("/2FASetup")):(document.querySelectorAll("#createAccount input").forEach(s=>s.classList.add("is-invalid")),this.errorMessage=n.message,document.querySelector(".login-container-fluid").scrollTo({top:0,left:0,behavior:"smooth"})),this.loading=!1})}}},_=["data-bs-theme"],x={class:"m-auto text-body",style:{width:"500px"}},v={class:"dashboardLogo display-4"},y={class:"mb-5"},P={key:0,class:"alert alert-danger"},N={class:"d-flex flex-column gap-3"},k={id:"createAccount",class:"d-flex flex-column gap-2"},S={class:"form-group text-body"},T={for:"username",class:"mb-1 text-muted"},C={class:"form-group text-body"},L={for:"password",class:"mb-1 text-muted"},V={class:"form-group text-body"},$={for:"confirmPassword",class:"mb-1 text-muted"},q=["disabled"],A={key:0,class:"d-flex align-items-center w-100"},M={key:1,class:"d-flex align-items-center w-100"};function B(n,s,D,E,U,F){const t=w("LocaleText");return i(),r("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[e("div",x,[e("span",v,[o(t,{t:"Nice to meet you!"})]),e("p",y,[o(t,{t:"Please fill in the following fields to finish setup"}),s[4]||(s[4]=c(" 😊"))]),e("div",null,[e("h3",null,[o(t,{t:"Create an account"})]),this.errorMessage?(i(),r("div",P,h(this.errorMessage),1)):f("",!0),e("div",N,[e("form",k,[e("div",S,[e("label",T,[e("small",null,[o(t,{t:"Enter an username you like"})])]),l(e("input",{type:"text",autocomplete:"username","onUpdate:modelValue":s[0]||(s[0]=a=>this.setup.username=a),class:"form-control",id:"username",name:"username",required:""},null,512),[[d,this.setup.username]])]),e("div",C,[e("label",L,[e("small",null,[o(t,{t:"Enter a password"}),e("code",null,[o(t,{t:"(At least 8 characters and make sure is strong enough!)"})])])]),l(e("input",{type:"password",autocomplete:"new-password","onUpdate:modelValue":s[1]||(s[1]=a=>this.setup.newPassword=a),class:"form-control",id:"password",name:"password",required:""},null,512),[[d,this.setup.newPassword]])]),e("div",V,[e("label",$,[e("small",null,[o(t,{t:"Confirm password"})])]),l(e("input",{type:"password",autocomplete:"confirm-new-password","onUpdate:modelValue":s[2]||(s[2]=a=>this.setup.repeatNewPassword=a),class:"form-control",id:"confirmPassword",name:"confirmPassword",required:""},null,512),[[d,this.setup.repeatNewPassword]])])]),e("button",{class:"btn btn-dark btn-lg mb-5 d-flex btn-brand shadow align-items-center",ref:"signInBtn",disabled:!this.goodToSubmit||this.loading||this.done,onClick:s[3]||(s[3]=a=>this.submit())},[!this.loading&&!this.done?(i(),r("span",A,[o(t,{t:"Next"}),s[5]||(s[5]=e("i",{class:"bi bi-chevron-right ms-auto"},null,-1))])):(i(),r("span",M,[o(t,{t:"Saving..."}),s[6]||(s[6]=e("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},[e("span",{class:"visually-hidden"},"Loading...")],-1))]))],8,q)])])])],8,_)}const I=u(b,[["render",B]]);export{I as default}; +import{_ as u,D as m,z as p,c as r,b as e,d as o,f as c,t as h,e as f,m as l,x as d,a as i,j as w}from"./index-CgM9eUIs.js";import{L as g}from"./localeText-Dh33930I.js";const b={name:"setup",components:{LocaleText:g},setup(){return{store:m()}},data(){return{setup:{username:"",newPassword:"",repeatNewPassword:"",enable_totp:!0},loading:!1,errorMessage:"",done:!1}},computed:{goodToSubmit(){return this.setup.username&&this.setup.newPassword.length>=8&&this.setup.repeatNewPassword.length>=8&&this.setup.newPassword===this.setup.repeatNewPassword}},methods:{submit(){this.loading=!0,p("/api/Welcome_Finish",this.setup,n=>{n.status?(this.done=!0,this.$router.push("/2FASetup")):(document.querySelectorAll("#createAccount input").forEach(s=>s.classList.add("is-invalid")),this.errorMessage=n.message,document.querySelector(".login-container-fluid").scrollTo({top:0,left:0,behavior:"smooth"})),this.loading=!1})}}},_=["data-bs-theme"],x={class:"m-auto text-body",style:{width:"500px"}},v={class:"dashboardLogo display-4"},y={class:"mb-5"},P={key:0,class:"alert alert-danger"},N={class:"d-flex flex-column gap-3"},k={id:"createAccount",class:"d-flex flex-column gap-2"},S={class:"form-group text-body"},T={for:"username",class:"mb-1 text-muted"},C={class:"form-group text-body"},L={for:"password",class:"mb-1 text-muted"},V={class:"form-group text-body"},$={for:"confirmPassword",class:"mb-1 text-muted"},q=["disabled"],A={key:0,class:"d-flex align-items-center w-100"},M={key:1,class:"d-flex align-items-center w-100"};function B(n,s,D,E,U,F){const t=w("LocaleText");return i(),r("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[e("div",x,[e("span",v,[o(t,{t:"Nice to meet you!"})]),e("p",y,[o(t,{t:"Please fill in the following fields to finish setup"}),s[4]||(s[4]=c(" 😊"))]),e("div",null,[e("h3",null,[o(t,{t:"Create an account"})]),this.errorMessage?(i(),r("div",P,h(this.errorMessage),1)):f("",!0),e("div",N,[e("form",k,[e("div",S,[e("label",T,[e("small",null,[o(t,{t:"Enter an username you like"})])]),l(e("input",{type:"text",autocomplete:"username","onUpdate:modelValue":s[0]||(s[0]=a=>this.setup.username=a),class:"form-control",id:"username",name:"username",required:""},null,512),[[d,this.setup.username]])]),e("div",C,[e("label",L,[e("small",null,[o(t,{t:"Enter a password"}),e("code",null,[o(t,{t:"(At least 8 characters and make sure is strong enough!)"})])])]),l(e("input",{type:"password",autocomplete:"new-password","onUpdate:modelValue":s[1]||(s[1]=a=>this.setup.newPassword=a),class:"form-control",id:"password",name:"password",required:""},null,512),[[d,this.setup.newPassword]])]),e("div",V,[e("label",$,[e("small",null,[o(t,{t:"Confirm password"})])]),l(e("input",{type:"password",autocomplete:"confirm-new-password","onUpdate:modelValue":s[2]||(s[2]=a=>this.setup.repeatNewPassword=a),class:"form-control",id:"confirmPassword",name:"confirmPassword",required:""},null,512),[[d,this.setup.repeatNewPassword]])])]),e("button",{class:"btn btn-dark btn-lg mb-5 d-flex btn-brand shadow align-items-center",ref:"signInBtn",disabled:!this.goodToSubmit||this.loading||this.done,onClick:s[3]||(s[3]=a=>this.submit())},[!this.loading&&!this.done?(i(),r("span",A,[o(t,{t:"Next"}),s[5]||(s[5]=e("i",{class:"bi bi-chevron-right ms-auto"},null,-1))])):(i(),r("span",M,[o(t,{t:"Saving..."}),s[6]||(s[6]=e("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},[e("span",{class:"visually-hidden"},"Loading...")],-1))]))],8,q)])])])],8,_)}const I=u(b,[["render",B]]);export{I as default}; diff --git a/src/static/app/dist/assets/share-C08DucO0.js b/src/static/app/dist/assets/share-BLXg8Dsp.js similarity index 95% rename from src/static/app/dist/assets/share-C08DucO0.js rename to src/static/app/dist/assets/share-BLXg8Dsp.js index 5f4dff7..3a5f6f3 100644 --- a/src/static/app/dist/assets/share-C08DucO0.js +++ b/src/static/app/dist/assets/share-BLXg8Dsp.js @@ -1 +1 @@ -import{_,r,D as p,g as u,c as m,b as t,d as c,K as h,a as f,j as b}from"./index-7qLsecvh.js";import{b as v}from"./browser-CjSdxGTc.js";import{L as y}from"./localeText-BguG5zGd.js";const g={name:"share",components:{LocaleText:y},async setup(){const o=h(),e=r(!1),i=p(),n=r(""),s=r(void 0),l=r(new Blob);await u("/api/getDashboardTheme",{},d=>{n.value=d.data});const a=o.query.ShareID;return a===void 0||a.length===0?(s.value=void 0,e.value=!0):await u("/api/sharePeer/get",{ShareID:a},d=>{d.status?(s.value=d.data,l.value=new Blob([s.value.file],{type:"text/plain"})):s.value=void 0,e.value=!0}),{store:i,theme:n,peerConfiguration:s,blob:l}},mounted(){this.peerConfiguration&&v.toCanvas(document.querySelector("#qrcode"),this.peerConfiguration.file,o=>{o&&console.error(o)})},methods:{download(){const o=new Blob([this.peerConfiguration.file],{type:"text/plain"}),e=URL.createObjectURL(o),i=`${this.peerConfiguration.fileName}.conf`,n=document.createElement("a");n.href=e,n.download=i,n.click()}},computed:{getBlob(){return URL.createObjectURL(this.blob)}}},w=["data-bs-theme"],x={class:"m-auto text-body",style:{width:"500px"}},C={key:0,class:"text-center position-relative",style:{}},U={class:"position-absolute w-100 h-100 top-0 start-0 d-flex animate__animated animate__fadeInUp",style:{"animation-delay":"0.1s"}},I={class:"m-auto"},L={key:1,class:"d-flex align-items-center flex-column gap-3"},B={class:"h1 dashboardLogo text-center animate__animated animate__fadeInUp"},k={id:"qrcode",class:"rounded-3 shadow animate__animated animate__fadeInUp mb-3",ref:"qrcode"},D={class:"text-muted animate__animated animate__fadeInUp mb-1",style:{"animation-delay":"0.2s"}},R=["download","href"];function j(o,e,i,n,s,l){const a=b("LocaleText");return f(),m("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.theme},[t("div",x,[this.peerConfiguration?(f(),m("div",L,[t("div",B,[e[1]||(e[1]=t("h6",null,"WGDashboard",-1)),c(a,{t:"Scan QR Code with the WireGuard App to add peer"})]),t("canvas",k,null,512),t("p",D,[c(a,{t:"or click the button below to download the "}),e[2]||(e[2]=t("samp",null,".conf",-1)),c(a,{t:" file"})]),t("a",{download:this.peerConfiguration.fileName+".conf",href:l.getBlob,class:"btn btn-lg bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle animate__animated animate__fadeInUp shadow-sm",style:{"animation-delay":"0.25s"}},e[3]||(e[3]=[t("i",{class:"bi bi-download"},null,-1)]),8,R)])):(f(),m("div",C,[e[0]||(e[0]=t("div",{class:"animate__animated animate__fadeInUp"},[t("h1",{style:{"font-size":"20rem",filter:"blur(1rem)","animation-duration":"7s"},class:"animate__animated animate__flash animate__infinite"},[t("i",{class:"bi bi-file-binary"})])],-1)),t("div",U,[t("h3",I,[c(a,{t:"Oh no... This link is either expired or invalid."})])])]))])],8,w)}const N=_(g,[["render",j],["__scopeId","data-v-1b44aacd"]]);export{N as default}; +import{_,r,D as p,g as u,c as m,b as t,d as c,K as h,a as f,j as b}from"./index-CgM9eUIs.js";import{b as v}from"./browser-CjSdxGTc.js";import{L as y}from"./localeText-Dh33930I.js";const g={name:"share",components:{LocaleText:y},async setup(){const o=h(),e=r(!1),i=p(),n=r(""),s=r(void 0),l=r(new Blob);await u("/api/getDashboardTheme",{},d=>{n.value=d.data});const a=o.query.ShareID;return a===void 0||a.length===0?(s.value=void 0,e.value=!0):await u("/api/sharePeer/get",{ShareID:a},d=>{d.status?(s.value=d.data,l.value=new Blob([s.value.file],{type:"text/plain"})):s.value=void 0,e.value=!0}),{store:i,theme:n,peerConfiguration:s,blob:l}},mounted(){this.peerConfiguration&&v.toCanvas(document.querySelector("#qrcode"),this.peerConfiguration.file,o=>{o&&console.error(o)})},methods:{download(){const o=new Blob([this.peerConfiguration.file],{type:"text/plain"}),e=URL.createObjectURL(o),i=`${this.peerConfiguration.fileName}.conf`,n=document.createElement("a");n.href=e,n.download=i,n.click()}},computed:{getBlob(){return URL.createObjectURL(this.blob)}}},w=["data-bs-theme"],x={class:"m-auto text-body",style:{width:"500px"}},C={key:0,class:"text-center position-relative",style:{}},U={class:"position-absolute w-100 h-100 top-0 start-0 d-flex animate__animated animate__fadeInUp",style:{"animation-delay":"0.1s"}},I={class:"m-auto"},L={key:1,class:"d-flex align-items-center flex-column gap-3"},B={class:"h1 dashboardLogo text-center animate__animated animate__fadeInUp"},k={id:"qrcode",class:"rounded-3 shadow animate__animated animate__fadeInUp mb-3",ref:"qrcode"},D={class:"text-muted animate__animated animate__fadeInUp mb-1",style:{"animation-delay":"0.2s"}},R=["download","href"];function j(o,e,i,n,s,l){const a=b("LocaleText");return f(),m("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.theme},[t("div",x,[this.peerConfiguration?(f(),m("div",L,[t("div",B,[e[1]||(e[1]=t("h6",null,"WGDashboard",-1)),c(a,{t:"Scan QR Code with the WireGuard App to add peer"})]),t("canvas",k,null,512),t("p",D,[c(a,{t:"or click the button below to download the "}),e[2]||(e[2]=t("samp",null,".conf",-1)),c(a,{t:" file"})]),t("a",{download:this.peerConfiguration.fileName+".conf",href:l.getBlob,class:"btn btn-lg bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle animate__animated animate__fadeInUp shadow-sm",style:{"animation-delay":"0.25s"}},e[3]||(e[3]=[t("i",{class:"bi bi-download"},null,-1)]),8,R)])):(f(),m("div",C,[e[0]||(e[0]=t("div",{class:"animate__animated animate__fadeInUp"},[t("h1",{style:{"font-size":"20rem",filter:"blur(1rem)","animation-duration":"7s"},class:"animate__animated animate__flash animate__infinite"},[t("i",{class:"bi bi-file-binary"})])],-1)),t("div",U,[t("h3",I,[c(a,{t:"Oh no... This link is either expired or invalid."})])])]))])],8,w)}const N=_(g,[["render",j],["__scopeId","data-v-1b44aacd"]]);export{N as default}; diff --git a/src/static/app/dist/assets/signin-BapBm19L.js b/src/static/app/dist/assets/signin-Ce-ypchd.js similarity index 98% rename from src/static/app/dist/assets/signin-BapBm19L.js rename to src/static/app/dist/assets/signin-Ce-ypchd.js index 14ac447..9b15556 100644 --- a/src/static/app/dist/assets/signin-BapBm19L.js +++ b/src/static/app/dist/assets/signin-Ce-ypchd.js @@ -1 +1 @@ -import{_ as g,G as m,a as i,c as n,b as t,m as u,x as h,n as w,t as k,D as S,d as l,F as C,h as T,i as _,e as $,j as f,$ as E,g as x,z as M,v as V,f as D,w as A,k as R}from"./index-7qLsecvh.js";import{M as P}from"./message-B3dKoq3S.js";import{d as y}from"./dayjs.min-C341O-eN.js";import{L}from"./localeText-BguG5zGd.js";const U={name:"RemoteServer",props:{server:Object},data(){return{active:!1,startTime:void 0,endTime:void 0,errorMsg:"",refreshing:!1}},methods:{async handshake(){this.active=!1,this.server.host&&this.server.apiKey&&(this.refreshing=!0,this.startTime=void 0,this.endTime=void 0,this.startTime=y(),await fetch(`${this.server.host}/api/handshake`,{headers:{"content-type":"application/json","wg-dashboard-apikey":this.server.apiKey},method:"GET",signal:AbortSignal.timeout(5e3)}).then(s=>{if(s.status===200)return s.json();throw new Error(s.statusText)}).then(()=>{this.endTime=y(),this.active=!0}).catch(s=>{this.active=!1,this.errorMsg=s}),this.refreshing=!1)},async connect(){await fetch(`${this.server.host}/api/authenticate`,{headers:{"content-type":"application/json","wg-dashboard-apikey":this.server.apiKey},body:JSON.stringify({host:window.location.hostname}),method:"POST",signal:AbortSignal.timeout(5e3)}).then(s=>s.json()).then(s=>{this.$emit("setActiveServer"),this.$router.push("/")})}},mounted(){this.handshake()},computed:{getHandshakeTime(){return this.startTime&&this.endTime?`${y().subtract(this.startTime).millisecond()}ms`:this.refreshing?m("Pinging..."):this.errorMsg?this.errorMsg:"N/A"}}},q={class:"card rounded-3"},B={class:"card-body"},j={class:"d-flex gap-3 w-100 remoteServerContainer"},O={class:"d-flex gap-3 align-items-center flex-grow-1"},G={class:"d-flex gap-3 align-items-center flex-grow-1"},N={class:"d-flex gap-2 button-group"},K={class:"card-footer gap-2 d-flex align-items-center"},z={key:0,class:"spin ms-auto text-primary-emphasis"};function W(s,e,d,c,a,p){return i(),n("div",q,[t("div",B,[t("div",j,[t("div",O,[e[7]||(e[7]=t("i",{class:"bi bi-server"},null,-1)),u(t("input",{class:"form-control form-control-sm",onBlur:e[0]||(e[0]=o=>this.handshake()),"onUpdate:modelValue":e[1]||(e[1]=o=>this.server.host=o),type:"url"},null,544),[[h,this.server.host]])]),t("div",G,[e[8]||(e[8]=t("i",{class:"bi bi-key-fill"},null,-1)),u(t("input",{class:"form-control form-control-sm",onBlur:e[2]||(e[2]=o=>this.handshake()),"onUpdate:modelValue":e[3]||(e[3]=o=>this.server.apiKey=o),type:"text"},null,544),[[h,this.server.apiKey]])]),t("div",N,[t("button",{onClick:e[4]||(e[4]=o=>this.$emit("delete")),class:"ms-auto btn btn-sm bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle"},e[9]||(e[9]=[t("i",{class:"bi bi-trash"},null,-1)])),t("button",{onClick:e[5]||(e[5]=o=>this.connect()),class:w([{disabled:!this.active},"ms-auto btn btn-sm bg-success-subtle text-success-emphasis border-1 border-success-subtle"])},e[10]||(e[10]=[t("i",{class:"bi bi-arrow-right-circle"},null,-1)]),2)])])]),t("div",K,[t("span",{class:w(["dot ms-0 me-2",[this.active?"active":"inactive"]])},null,2),t("small",null,k(this.getHandshakeTime),1),this.refreshing?(i(),n("div",z,e[11]||(e[11]=[t("i",{class:"bi bi-arrow-clockwise"},null,-1)]))):(i(),n("a",{key:1,role:"button",onClick:e[6]||(e[6]=o=>this.handshake()),class:"text-primary-emphasis text-decoration-none ms-auto disabled"},e[12]||(e[12]=[t("i",{class:"bi bi-arrow-clockwise me"},null,-1)])))])])}const F=g(U,[["render",W],["__scopeId","data-v-ed7817c7"]]),H={name:"RemoteServerList",setup(){return{store:S()}},components:{LocaleText:L,RemoteServer:F}},J={class:"w-100 mt-3"},Z={class:"d-flex align-items-center mb-3"},Q={class:"mb-0"},X={class:"w-100 d-flex gap-3 flex-column p-3 border border-1 border-secondary-subtle rounded-3",style:{height:"400px","overflow-y":"scroll"}},Y={key:0,class:"text-muted m-auto"};function ee(s,e,d,c,a,p){const o=f("LocaleText"),v=f("RemoteServer");return i(),n("div",J,[t("div",Z,[t("h5",Q,[l(o,{t:"Server List"})]),t("button",{onClick:e[0]||(e[0]=b=>this.store.addCrossServerConfiguration()),class:"btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle shadow-sm ms-auto"},[e[1]||(e[1]=t("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),l(o,{t:"Server"})])]),t("div",X,[(i(!0),n(C,null,T(this.store.CrossServerConfiguration.ServerList,(b,r)=>(i(),_(v,{onSetActiveServer:I=>this.store.setActiveCrossServer(r),onDelete:I=>this.store.deleteCrossServerConfiguration(r),key:r,server:b},null,8,["onSetActiveServer","onDelete","server"]))),128)),Object.keys(this.store.CrossServerConfiguration.ServerList).length===0?(i(),n("h6",Y,[l(o,{t:"Click"}),e[2]||(e[2]=t("i",{class:"bi bi-plus-circle-fill mx-1"},null,-1)),l(o,{t:"to add your server"})])):$("",!0)])])}const te=g(H,[["render",ee]]),se={name:"signInInput",methods:{GetLocale:m},props:{id:"",data:"",type:"",placeholder:""},computed:{getLocaleText(){return m(this.placeholder)}}},oe=["type","id","name","placeholder"];function ie(s,e,d,c,a,p){return u((i(),n("input",{type:d.type,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data[this.id]=o),class:"form-control rounded-3",id:this.id,name:this.id,autocomplete:"on",placeholder:this.getLocaleText,required:""},null,8,oe)),[[E,this.data[this.id]]])}const re=g(se,[["render",ie]]),ne={name:"signInTOTP",methods:{GetLocale:m},props:{data:""},computed:{getLocaleText(){return m("OTP from your authenticator")}}},ae=["placeholder"];function le(s,e,d,c,a,p){return u((i(),n("input",{class:"form-control totp",required:"",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code",placeholder:this.getLocaleText,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data.totp=o)},null,8,ae)),[[h,this.data.totp]])}const de=g(ne,[["render",le]]),ue={name:"signin",components:{SignInTOTP:de,SignInInput:re,LocaleText:L,RemoteServerList:te,Message:P},async setup(){const s=S();let e="dark",d=!1,c;return s.IsElectronApp||await Promise.all([x("/api/getDashboardTheme",{},a=>{e=a.data}),x("/api/isTotpEnabled",{},a=>{d=a.data}),x("/api/getDashboardVersion",{},a=>{c=a.data})]),s.removeActiveCrossServer(),{store:s,theme:e,totpEnabled:d,version:c}},data(){return{data:{username:"",password:"",totp:""},loginError:!1,loginErrorMessage:"",loading:!1}},computed:{getMessages(){return this.store.Messages.filter(s=>s.show)},applyLocale(s){return m(s)},formValid(){return this.data.username&&this.data.password&&(this.totpEnabled&&this.data.totp||!this.totpEnabled)}},methods:{GetLocale:m,async auth(){this.formValid?(this.loading=!0,await M("/api/authenticate",this.data,s=>{s.status?(this.loginError=!1,this.$refs.signInBtn.classList.add("signedIn"),s.message?this.$router.push("/welcome"):this.store.Redirect!==void 0?this.$router.push(this.store.Redirect):this.$router.push("/")):(this.store.newMessage("Server",s.message,"danger"),document.querySelectorAll("input[required]").forEach(e=>{e.classList.remove("is-valid"),e.classList.add("is-invalid")}),this.loading=!1)})):document.querySelectorAll("input[required]").forEach(s=>{s.value.length===0?(s.classList.remove("is-valid"),s.classList.add("is-invalid")):(s.classList.remove("is-invalid"),s.classList.add("is-valid"))})}}},ce=["data-bs-theme"],me={class:"login-box m-auto"},he={class:"m-auto signInContainer",style:{width:"700px"}},pe={class:"mb-0 text-body"},fe={class:"form-floating mb-2"},ge=["disabled"],be={for:"floatingInput",class:"d-flex"},ve={class:"form-floating mb-2"},xe=["disabled"],ye={for:"floatingInput",class:"d-flex"},_e={key:0,class:"form-floating mb-2"},$e=["disabled"],we={for:"floatingInput",class:"d-flex"},ke=["disabled"],Se={key:0,class:"d-flex w-100"},Ce={key:1,class:"d-flex w-100 align-items-center"},Te={key:2,class:"d-flex mt-3"},Le={class:"form-check form-switch ms-auto"},Ie=["disabled"],Ee={class:"form-check-label",for:"flexSwitchCheckChecked"},Me={class:"text-muted pb-3 d-block w-100 text-center mt-3"},Ve={class:"messageCentre text-body position-absolute d-flex"};function De(s,e,d,c,a,p){const o=f("LocaleText"),v=f("RemoteServerList"),b=f("Message");return i(),n("div",{class:"container-fluid login-container-fluid d-flex main flex-column py-4 text-body h-100",style:{"overflow-y":"scroll"},"data-bs-theme":this.theme},[t("div",me,[t("div",he,[t("h4",pe,[l(o,{t:"Welcome to"})]),e[10]||(e[10]=t("span",{class:"dashboardLogo display-3"},[t("strong",null,"WGDashboard")],-1)),this.store.CrossServerConfiguration.Enable?(i(),_(v,{key:1})):(i(),n("form",{key:0,onSubmit:e[3]||(e[3]=r=>{r.preventDefault(),this.auth()}),class:"mt-3"},[t("div",fe,[u(t("input",{type:"text",required:"",disabled:a.loading,"onUpdate:modelValue":e[0]||(e[0]=r=>this.data.username=r),name:"username",autocomplete:"username",autofocus:"",class:"form-control rounded-3",id:"username",placeholder:"Username"},null,8,ge),[[h,this.data.username]]),t("label",be,[e[5]||(e[5]=t("i",{class:"bi bi-person-circle me-2"},null,-1)),l(o,{t:"Username"})])]),t("div",ve,[u(t("input",{type:"password",required:"",disabled:a.loading,autocomplete:"current-password","onUpdate:modelValue":e[1]||(e[1]=r=>this.data.password=r),class:"form-control rounded-3",id:"password",placeholder:"Password"},null,8,xe),[[h,this.data.password]]),t("label",ye,[e[6]||(e[6]=t("i",{class:"bi bi-key-fill me-2"},null,-1)),l(o,{t:"Password"})])]),this.totpEnabled?(i(),n("div",_e,[u(t("input",{type:"text",id:"totp",required:"",disabled:a.loading,placeholder:"totp","onUpdate:modelValue":e[2]||(e[2]=r=>this.data.totp=r),class:"form-control rounded-3",maxlength:"6",inputmode:"numeric",autocomplete:"one-time-code"},null,8,$e),[[h,this.data.totp]]),t("label",we,[e[7]||(e[7]=t("i",{class:"bi bi-lock-fill me-2"},null,-1)),l(o,{t:"OTP from your authenticator"})])])):$("",!0),t("button",{class:"btn btn-lg btn-dark ms-auto mt-5 w-100 d-flex btn-brand signInBtn rounded-3",disabled:this.loading||!this.formValid,ref:"signInBtn"},[this.loading?(i(),n("span",Ce,[l(o,{t:"Signing In..."}),e[9]||(e[9]=t("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},null,-1))])):(i(),n("span",Se,[l(o,{t:"Sign In"}),e[8]||(e[8]=t("i",{class:"ms-auto bi bi-chevron-right"},null,-1))]))],8,ke)],32)),this.store.IsElectronApp?$("",!0):(i(),n("div",Te,[t("div",Le,[u(t("input",{"onUpdate:modelValue":e[4]||(e[4]=r=>this.store.CrossServerConfiguration.Enable=r),disabled:a.loading,class:"form-check-input",type:"checkbox",role:"switch",id:"flexSwitchCheckChecked"},null,8,Ie),[[V,this.store.CrossServerConfiguration.Enable]]),t("label",Ee,[l(o,{t:"Access Remote Server"})])])]))])]),t("small",Me,[D(" WGDashboard "+k(this.version)+" | Developed with ❤️ by ",1),e[11]||(e[11]=t("a",{href:"https://github.com/donaldzou",target:"_blank"},[t("strong",null,"Donald Zou")],-1))]),t("div",Ve,[l(R,{name:"message",tag:"div",class:"position-relative flex-sm-grow-0 flex-grow-1 d-flex align-items-end ms-sm-auto flex-column gap-2"},{default:A(()=>[(i(!0),n(C,null,T(p.getMessages.slice().reverse(),r=>(i(),_(b,{message:r,key:r.id},null,8,["message"]))),128))]),_:1})])],8,ce)}const qe=g(ue,[["render",De],["__scopeId","data-v-80e20da4"]]);export{qe as default}; +import{_ as g,G as m,a as i,c as n,b as t,m as u,x as h,n as w,t as k,D as S,d as l,F as C,h as T,i as _,e as $,j as f,$ as E,g as x,z as M,v as V,f as D,w as A,k as R}from"./index-CgM9eUIs.js";import{M as P}from"./message-C8I98_6p.js";import{d as y}from"./dayjs.min-B2wceQaW.js";import{L}from"./localeText-Dh33930I.js";const U={name:"RemoteServer",props:{server:Object},data(){return{active:!1,startTime:void 0,endTime:void 0,errorMsg:"",refreshing:!1}},methods:{async handshake(){this.active=!1,this.server.host&&this.server.apiKey&&(this.refreshing=!0,this.startTime=void 0,this.endTime=void 0,this.startTime=y(),await fetch(`${this.server.host}/api/handshake`,{headers:{"content-type":"application/json","wg-dashboard-apikey":this.server.apiKey},method:"GET",signal:AbortSignal.timeout(5e3)}).then(s=>{if(s.status===200)return s.json();throw new Error(s.statusText)}).then(()=>{this.endTime=y(),this.active=!0}).catch(s=>{this.active=!1,this.errorMsg=s}),this.refreshing=!1)},async connect(){await fetch(`${this.server.host}/api/authenticate`,{headers:{"content-type":"application/json","wg-dashboard-apikey":this.server.apiKey},body:JSON.stringify({host:window.location.hostname}),method:"POST",signal:AbortSignal.timeout(5e3)}).then(s=>s.json()).then(s=>{this.$emit("setActiveServer"),this.$router.push("/")})}},mounted(){this.handshake()},computed:{getHandshakeTime(){return this.startTime&&this.endTime?`${y().subtract(this.startTime).millisecond()}ms`:this.refreshing?m("Pinging..."):this.errorMsg?this.errorMsg:"N/A"}}},q={class:"card rounded-3"},B={class:"card-body"},j={class:"d-flex gap-3 w-100 remoteServerContainer"},O={class:"d-flex gap-3 align-items-center flex-grow-1"},G={class:"d-flex gap-3 align-items-center flex-grow-1"},N={class:"d-flex gap-2 button-group"},K={class:"card-footer gap-2 d-flex align-items-center"},z={key:0,class:"spin ms-auto text-primary-emphasis"};function W(s,e,d,c,a,p){return i(),n("div",q,[t("div",B,[t("div",j,[t("div",O,[e[7]||(e[7]=t("i",{class:"bi bi-server"},null,-1)),u(t("input",{class:"form-control form-control-sm",onBlur:e[0]||(e[0]=o=>this.handshake()),"onUpdate:modelValue":e[1]||(e[1]=o=>this.server.host=o),type:"url"},null,544),[[h,this.server.host]])]),t("div",G,[e[8]||(e[8]=t("i",{class:"bi bi-key-fill"},null,-1)),u(t("input",{class:"form-control form-control-sm",onBlur:e[2]||(e[2]=o=>this.handshake()),"onUpdate:modelValue":e[3]||(e[3]=o=>this.server.apiKey=o),type:"text"},null,544),[[h,this.server.apiKey]])]),t("div",N,[t("button",{onClick:e[4]||(e[4]=o=>this.$emit("delete")),class:"ms-auto btn btn-sm bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle"},e[9]||(e[9]=[t("i",{class:"bi bi-trash"},null,-1)])),t("button",{onClick:e[5]||(e[5]=o=>this.connect()),class:w([{disabled:!this.active},"ms-auto btn btn-sm bg-success-subtle text-success-emphasis border-1 border-success-subtle"])},e[10]||(e[10]=[t("i",{class:"bi bi-arrow-right-circle"},null,-1)]),2)])])]),t("div",K,[t("span",{class:w(["dot ms-0 me-2",[this.active?"active":"inactive"]])},null,2),t("small",null,k(this.getHandshakeTime),1),this.refreshing?(i(),n("div",z,e[11]||(e[11]=[t("i",{class:"bi bi-arrow-clockwise"},null,-1)]))):(i(),n("a",{key:1,role:"button",onClick:e[6]||(e[6]=o=>this.handshake()),class:"text-primary-emphasis text-decoration-none ms-auto disabled"},e[12]||(e[12]=[t("i",{class:"bi bi-arrow-clockwise me"},null,-1)])))])])}const F=g(U,[["render",W],["__scopeId","data-v-ed7817c7"]]),H={name:"RemoteServerList",setup(){return{store:S()}},components:{LocaleText:L,RemoteServer:F}},J={class:"w-100 mt-3"},Z={class:"d-flex align-items-center mb-3"},Q={class:"mb-0"},X={class:"w-100 d-flex gap-3 flex-column p-3 border border-1 border-secondary-subtle rounded-3",style:{height:"400px","overflow-y":"scroll"}},Y={key:0,class:"text-muted m-auto"};function ee(s,e,d,c,a,p){const o=f("LocaleText"),v=f("RemoteServer");return i(),n("div",J,[t("div",Z,[t("h5",Q,[l(o,{t:"Server List"})]),t("button",{onClick:e[0]||(e[0]=b=>this.store.addCrossServerConfiguration()),class:"btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle shadow-sm ms-auto"},[e[1]||(e[1]=t("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),l(o,{t:"Server"})])]),t("div",X,[(i(!0),n(C,null,T(this.store.CrossServerConfiguration.ServerList,(b,r)=>(i(),_(v,{onSetActiveServer:I=>this.store.setActiveCrossServer(r),onDelete:I=>this.store.deleteCrossServerConfiguration(r),key:r,server:b},null,8,["onSetActiveServer","onDelete","server"]))),128)),Object.keys(this.store.CrossServerConfiguration.ServerList).length===0?(i(),n("h6",Y,[l(o,{t:"Click"}),e[2]||(e[2]=t("i",{class:"bi bi-plus-circle-fill mx-1"},null,-1)),l(o,{t:"to add your server"})])):$("",!0)])])}const te=g(H,[["render",ee]]),se={name:"signInInput",methods:{GetLocale:m},props:{id:"",data:"",type:"",placeholder:""},computed:{getLocaleText(){return m(this.placeholder)}}},oe=["type","id","name","placeholder"];function ie(s,e,d,c,a,p){return u((i(),n("input",{type:d.type,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data[this.id]=o),class:"form-control rounded-3",id:this.id,name:this.id,autocomplete:"on",placeholder:this.getLocaleText,required:""},null,8,oe)),[[E,this.data[this.id]]])}const re=g(se,[["render",ie]]),ne={name:"signInTOTP",methods:{GetLocale:m},props:{data:""},computed:{getLocaleText(){return m("OTP from your authenticator")}}},ae=["placeholder"];function le(s,e,d,c,a,p){return u((i(),n("input",{class:"form-control totp",required:"",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code",placeholder:this.getLocaleText,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data.totp=o)},null,8,ae)),[[h,this.data.totp]])}const de=g(ne,[["render",le]]),ue={name:"signin",components:{SignInTOTP:de,SignInInput:re,LocaleText:L,RemoteServerList:te,Message:P},async setup(){const s=S();let e="dark",d=!1,c;return s.IsElectronApp||await Promise.all([x("/api/getDashboardTheme",{},a=>{e=a.data}),x("/api/isTotpEnabled",{},a=>{d=a.data}),x("/api/getDashboardVersion",{},a=>{c=a.data})]),s.removeActiveCrossServer(),{store:s,theme:e,totpEnabled:d,version:c}},data(){return{data:{username:"",password:"",totp:""},loginError:!1,loginErrorMessage:"",loading:!1}},computed:{getMessages(){return this.store.Messages.filter(s=>s.show)},applyLocale(s){return m(s)},formValid(){return this.data.username&&this.data.password&&(this.totpEnabled&&this.data.totp||!this.totpEnabled)}},methods:{GetLocale:m,async auth(){this.formValid?(this.loading=!0,await M("/api/authenticate",this.data,s=>{s.status?(this.loginError=!1,this.$refs.signInBtn.classList.add("signedIn"),s.message?this.$router.push("/welcome"):this.store.Redirect!==void 0?this.$router.push(this.store.Redirect):this.$router.push("/")):(this.store.newMessage("Server",s.message,"danger"),document.querySelectorAll("input[required]").forEach(e=>{e.classList.remove("is-valid"),e.classList.add("is-invalid")}),this.loading=!1)})):document.querySelectorAll("input[required]").forEach(s=>{s.value.length===0?(s.classList.remove("is-valid"),s.classList.add("is-invalid")):(s.classList.remove("is-invalid"),s.classList.add("is-valid"))})}}},ce=["data-bs-theme"],me={class:"login-box m-auto"},he={class:"m-auto signInContainer",style:{width:"700px"}},pe={class:"mb-0 text-body"},fe={class:"form-floating mb-2"},ge=["disabled"],be={for:"floatingInput",class:"d-flex"},ve={class:"form-floating mb-2"},xe=["disabled"],ye={for:"floatingInput",class:"d-flex"},_e={key:0,class:"form-floating mb-2"},$e=["disabled"],we={for:"floatingInput",class:"d-flex"},ke=["disabled"],Se={key:0,class:"d-flex w-100"},Ce={key:1,class:"d-flex w-100 align-items-center"},Te={key:2,class:"d-flex mt-3"},Le={class:"form-check form-switch ms-auto"},Ie=["disabled"],Ee={class:"form-check-label",for:"flexSwitchCheckChecked"},Me={class:"text-muted pb-3 d-block w-100 text-center mt-3"},Ve={class:"messageCentre text-body position-absolute d-flex"};function De(s,e,d,c,a,p){const o=f("LocaleText"),v=f("RemoteServerList"),b=f("Message");return i(),n("div",{class:"container-fluid login-container-fluid d-flex main flex-column py-4 text-body h-100",style:{"overflow-y":"scroll"},"data-bs-theme":this.theme},[t("div",me,[t("div",he,[t("h4",pe,[l(o,{t:"Welcome to"})]),e[10]||(e[10]=t("span",{class:"dashboardLogo display-3"},[t("strong",null,"WGDashboard")],-1)),this.store.CrossServerConfiguration.Enable?(i(),_(v,{key:1})):(i(),n("form",{key:0,onSubmit:e[3]||(e[3]=r=>{r.preventDefault(),this.auth()}),class:"mt-3"},[t("div",fe,[u(t("input",{type:"text",required:"",disabled:a.loading,"onUpdate:modelValue":e[0]||(e[0]=r=>this.data.username=r),name:"username",autocomplete:"username",autofocus:"",class:"form-control rounded-3",id:"username",placeholder:"Username"},null,8,ge),[[h,this.data.username]]),t("label",be,[e[5]||(e[5]=t("i",{class:"bi bi-person-circle me-2"},null,-1)),l(o,{t:"Username"})])]),t("div",ve,[u(t("input",{type:"password",required:"",disabled:a.loading,autocomplete:"current-password","onUpdate:modelValue":e[1]||(e[1]=r=>this.data.password=r),class:"form-control rounded-3",id:"password",placeholder:"Password"},null,8,xe),[[h,this.data.password]]),t("label",ye,[e[6]||(e[6]=t("i",{class:"bi bi-key-fill me-2"},null,-1)),l(o,{t:"Password"})])]),this.totpEnabled?(i(),n("div",_e,[u(t("input",{type:"text",id:"totp",required:"",disabled:a.loading,placeholder:"totp","onUpdate:modelValue":e[2]||(e[2]=r=>this.data.totp=r),class:"form-control rounded-3",maxlength:"6",inputmode:"numeric",autocomplete:"one-time-code"},null,8,$e),[[h,this.data.totp]]),t("label",we,[e[7]||(e[7]=t("i",{class:"bi bi-lock-fill me-2"},null,-1)),l(o,{t:"OTP from your authenticator"})])])):$("",!0),t("button",{class:"btn btn-lg btn-dark ms-auto mt-5 w-100 d-flex btn-brand signInBtn rounded-3",disabled:this.loading||!this.formValid,ref:"signInBtn"},[this.loading?(i(),n("span",Ce,[l(o,{t:"Signing In..."}),e[9]||(e[9]=t("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},null,-1))])):(i(),n("span",Se,[l(o,{t:"Sign In"}),e[8]||(e[8]=t("i",{class:"ms-auto bi bi-chevron-right"},null,-1))]))],8,ke)],32)),this.store.IsElectronApp?$("",!0):(i(),n("div",Te,[t("div",Le,[u(t("input",{"onUpdate:modelValue":e[4]||(e[4]=r=>this.store.CrossServerConfiguration.Enable=r),disabled:a.loading,class:"form-check-input",type:"checkbox",role:"switch",id:"flexSwitchCheckChecked"},null,8,Ie),[[V,this.store.CrossServerConfiguration.Enable]]),t("label",Ee,[l(o,{t:"Access Remote Server"})])])]))])]),t("small",Me,[D(" WGDashboard "+k(this.version)+" | Developed with ❤️ by ",1),e[11]||(e[11]=t("a",{href:"https://github.com/donaldzou",target:"_blank"},[t("strong",null,"Donald Zou")],-1))]),t("div",Ve,[l(R,{name:"message",tag:"div",class:"position-relative flex-sm-grow-0 flex-grow-1 d-flex align-items-end ms-sm-auto flex-column gap-2"},{default:A(()=>[(i(!0),n(C,null,T(p.getMessages.slice().reverse(),r=>(i(),_(b,{message:r,key:r.id},null,8,["message"]))),128))]),_:1})])],8,ce)}const qe=g(ue,[["render",De],["__scopeId","data-v-80e20da4"]]);export{qe as default}; diff --git a/src/static/app/dist/assets/storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-0Ox3ogTv.js b/src/static/app/dist/assets/storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-D3--h2ZI.js similarity index 93% rename from src/static/app/dist/assets/storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-0Ox3ogTv.js rename to src/static/app/dist/assets/storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-D3--h2ZI.js index b6190da..1f5ba9b 100644 --- a/src/static/app/dist/assets/storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-0Ox3ogTv.js +++ b/src/static/app/dist/assets/storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-D3--h2ZI.js @@ -1 +1 @@ -import{_ as i,u as m,r as p,p as b,a as o,c as t,d as g,w as v,n as x,b as r,t as n,e as f,T as C,q as w}from"./index-7qLsecvh.js";const y={class:"text-muted me-2"},_={class:"fw-bold"},k={__name:"cpuCore",props:{core_number:Number,percentage:Number,align:Boolean,square:Boolean},setup(e){m(c=>({e901480c:u.value}));const l=e,s=p(!1),u=b(()=>l.square?"40px":"25px");return(c,a)=>(o(),t("div",{class:"flex-grow-1 square rounded-3 border position-relative p-2",onMouseenter:a[0]||(a[0]=d=>s.value=!0),onMouseleave:a[1]||(a[1]=d=>s.value=!1),style:w({"background-color":`rgb(13 110 253 / ${e.percentage*10}%)`})},[g(C,{name:"zoomReversed"},{default:v(()=>[s.value?(o(),t("div",{key:0,style:{"white-space":"nowrap"},class:x(["floatingLabel z-3 border position-absolute d-block p-1 px-2 bg-body text-body rounded-3 border shadow d-flex",[e.align?"end-0":"start-0"]])},[r("small",y," Core #"+n(e.core_number+1),1),r("small",_,n(e.percentage)+"% ",1)],2)):f("",!0)]),_:1})],36))}},B=i(k,[["__scopeId","data-v-70102637"]]);export{B as C}; +import{_ as i,u as m,r as p,p as b,a as o,c as t,d as g,w as v,n as x,b as r,t as n,e as f,T as C,q as w}from"./index-CgM9eUIs.js";const y={class:"text-muted me-2"},_={class:"fw-bold"},k={__name:"cpuCore",props:{core_number:Number,percentage:Number,align:Boolean,square:Boolean},setup(e){m(c=>({e901480c:u.value}));const l=e,s=p(!1),u=b(()=>l.square?"40px":"25px");return(c,a)=>(o(),t("div",{class:"flex-grow-1 square rounded-3 border position-relative p-2",onMouseenter:a[0]||(a[0]=d=>s.value=!0),onMouseleave:a[1]||(a[1]=d=>s.value=!1),style:w({"background-color":`rgb(13 110 253 / ${e.percentage*10}%)`})},[g(C,{name:"zoomReversed"},{default:v(()=>[s.value?(o(),t("div",{key:0,style:{"white-space":"nowrap"},class:x(["floatingLabel z-3 border position-absolute d-block p-1 px-2 bg-body text-body rounded-3 border shadow d-flex",[e.align?"end-0":"start-0"]])},[r("small",y," Core #"+n(e.core_number+1),1),r("small",_,n(e.percentage)+"% ",1)],2)):f("",!0)]),_:1})],36))}},B=i(k,[["__scopeId","data-v-70102637"]]);export{B as C}; diff --git a/src/static/app/dist/assets/systemStatus-BekSpxIb.js b/src/static/app/dist/assets/systemStatus-CmPtdgK9.js similarity index 96% rename from src/static/app/dist/assets/systemStatus-BekSpxIb.js rename to src/static/app/dist/assets/systemStatus-CmPtdgK9.js index 8d9228d..73d48aa 100644 --- a/src/static/app/dist/assets/systemStatus-BekSpxIb.js +++ b/src/static/app/dist/assets/systemStatus-CmPtdgK9.js @@ -1 +1 @@ -import{_ as E,a as l,c as o,b as e,t as i,D as T,p as _,o as H,s as W,r as p,g as q,d as n,q as h,F as b,h as v,A as N,w as O,k as $,f as x,e as g,i as C,G as y}from"./index-7qLsecvh.js";import{L as u}from"./localeText-BguG5zGd.js";import{C as A}from"./storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-0Ox3ogTv.js";import{C as F,L as z,B as J,a as K,b as Q,c as X,p as Y,d as Z,e as ee,f as se,P as te,i as ae,g as M}from"./index-CfW94M3m.js";import{d as le}from"./dayjs.min-C341O-eN.js";const oe={class:"mb-1 d-flex gap-5"},re={class:"title"},ne={class:"ms-auto"},ie={__name:"process",props:["process","cpu"],setup(m){return(w,s)=>(l(),o("div",oe,[e("small",re,[s[0]||(s[0]=e("i",{class:"bi bi-code-square me-2"},null,-1)),e("samp",null,i(m.process.command?m.process.command:m.process.name),1)]),e("small",ne,i(Math.round((m.process.percent+Number.EPSILON)*10)/10)+"% ",1)]))}},D=E(ie,[["__scopeId","data-v-ffe5ad8f"]]),ce={class:"text-body row g-2 mb-2"},de={class:"col-sm-6"},ue={class:"card rounded-3 h-100 shadow"},_e={class:"card-body p-4"},pe={class:"d-flex flex-column gap-3"},he={class:"d-flex flex-column gap-3",style:{height:"130px"}},me={class:"d-flex align-items-center"},be={class:"text-muted mb-0"},ve={class:"ms-auto mb-0"},ge={key:0},ye={key:1,class:"spinner-border"},fe={class:"progress",role:"progressbar",style:{height:"10px"}},xe={class:"d-flex gap-1"},we={class:"d-flex align-items-center"},ke={class:"mb-0"},Ne={class:"mb-0 ms-auto text-muted"},Ce={class:"position-relative"},Me={class:"col-sm-6"},Se={class:"card rounded-3 h-100 shadow"},Ie={class:"card-body p-4"},Pe={class:"d-flex flex-column gap-3"},Ue={class:"d-flex flex-column gap-3",style:{height:"130px"}},Le={class:"d-flex align-items-center"},Be={class:"text-muted"},Oe={class:"ms-auto"},$e={key:0},De={key:1,class:"spinner-border"},Ee={class:"progress",role:"progressbar",style:{height:"10px"}},Ve={class:"d-flex align-items-center"},Re={class:"mb-0 ms-auto"},Ge={class:"progress",role:"progressbar",style:{height:"10px"}},je={class:"d-flex align-items-center"},Te={class:"mb-0"},He={class:"mb-0 ms-auto text-muted"},We={class:"position-relative"},qe={class:"col-sm-12"},Ae={class:"card rounded-3 h-100 shadow"},Fe={class:"card-body p-4 d-flex gap-3 flex-column"},ze={class:"d-flex align-items-center gap-3"},Je={class:"text-muted mb-0"},Ke={class:"ms-auto mb-0"},Qe={key:0},Xe={key:1,class:"spinner-border"},Ye={key:0,class:"mb-0 text-end"},Ze={class:"text-info"},es={class:"text-warning"},ss={key:0,class:"row g-3"},ts={class:"col-sm-6 fadeIn"},as={class:"d-flex mb-2"},ls={class:"mb-0"},os={class:"mb-0 ms-auto d-flex gap-2"},rs={class:"text-info"},ns={class:"text-warning"},is={class:"progress",role:"progressbar",style:{height:"10px"}},cs={class:"col-sm-12"},ds={class:"card rounded-3 h-100 shadow"},us={class:"card-body p-4 d-flex gap-3 flex-column"},_s={class:"d-flex align-items-center"},ps={class:"text-muted mb-0"},hs={class:"ms-auto mb-0"},ms={key:0},bs={key:1,class:"spinner-border"},vs={class:"row g-3"},gs={class:"col-sm-6 fadeIn"},ys={class:"d-flex mb-2"},fs={class:"mb-0"},xs={class:"mb-0 ms-auto d-flex gap-2"},ws={class:"text-success"},ks={class:"progress",role:"progressbar",style:{height:"20px"}},Ns={__name:"systemStatus",setup(m){const w=T(),s=_(()=>w.SystemStatus);let S=null;F.register(z,J,K,Q,X,Y,Z,ee,se,te,ae),H(()=>{L(),S=setInterval(()=>{L()},5e3)}),W(()=>{clearInterval(S)});const f=p([]),I=p([]),P=p([]),U=p([]),c=p({bytes_recv:[],bytes_sent:[]}),d=p({bytes_recv:[],bytes_sent:[]}),L=()=>{q("/api/systemStatus",{},r=>{if(f.value.push(le().format("HH:mm:ss A")),w.SystemStatus=r.data,I.value.push(r.data.CPU.cpu_percent),P.value.push(r.data.Memory.VirtualMemory.percent),U.value.push(r.data.Memory.SwapMemory.percent),c.value.bytes_recv.push(Object.values(r.data.NetworkInterfaces).map(t=>t.bytes_recv).reduce((t,a)=>t+a)),c.value.bytes_sent.push(Object.values(r.data.NetworkInterfaces).map(t=>t.bytes_sent).reduce((t,a)=>t+a)),c.value.bytes_recv.length===1&&c.value.bytes_sent.length===1)d.value.bytes_recv.push(0),d.value.bytes_sent.push(0);else{let t=c.value.bytes_recv[c.value.bytes_recv.length-1]-c.value.bytes_recv[c.value.bytes_recv.length-2],a=c.value.bytes_sent[c.value.bytes_sent.length-1]-c.value.bytes_sent[c.value.bytes_sent.length-2];d.value.bytes_recv.push(Math.round((t/1024e3+Number.EPSILON)*1e4)/1e4),d.value.bytes_sent.push(Math.round((a/1024e3+Number.EPSILON)*1e4)/1e4)}})},B=_(()=>({responsive:!0,plugins:{legend:{display:!0},tooltip:{callbacks:{label:r=>`${r.formattedValue}%`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(r,t)=>`${r}%`},grid:{display:!1}}}})),V=_(()=>({responsive:!0,plugins:{legend:{display:!0},tooltip:{callbacks:{label:r=>`${r.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(r,t)=>`${r} MB/s`},grid:{display:!1}}}})),R=_(()=>({labels:[...f.value],datasets:[{label:y("CPU Usage"),data:[...I.value],fill:"start",backgroundColor:"#0d6efd90",borderColor:"#0d6efd",tension:0,pointRadius:2,borderWidth:1}]})),G=_(()=>({labels:[...f.value],datasets:[{label:y("Memory Usage"),data:[...P.value],fill:1,borderColor:"#0dcaf0",backgroundColor:"#0dcaf090",tension:0,pointRadius:2,borderWidth:1},{label:y("Swap Memory Usage"),data:[...U.value],fill:"start",backgroundColor:"#ffc10790",borderColor:"#ffc107",tension:0,pointRadius:2,borderWidth:1}]})),j=_(()=>({labels:[...f.value],datasets:[{label:y("Real Time Received Data Usage"),data:[...d.value.bytes_recv],fill:"origin",borderColor:"#0dcaf0",backgroundColor:"#0dcaf090",tension:0,pointRadius:2,borderWidth:1},{label:y("Real Time Sent Data Usage"),data:[...d.value.bytes_sent],fill:"origin",backgroundColor:"#ffc10790",borderColor:"#ffc107",tension:0,pointRadius:2,borderWidth:1}]}));return(r,t)=>(l(),o("div",ce,[e("div",de,[e("div",ue,[e("div",_e,[e("div",pe,[e("div",he,[e("div",me,[e("h3",be,[t[0]||(t[0]=e("i",{class:"bi bi-cpu-fill me-2"},null,-1)),n(u,{t:"CPU"})]),e("h3",ve,[s.value?(l(),o("span",ge,i(s.value.CPU.cpu_percent)+"% ",1)):(l(),o("span",ye))])]),e("div",fe,[e("div",{class:"progress-bar",style:h({width:`${s.value?.CPU.cpu_percent}%`})},null,4)]),e("div",xe,[(l(!0),o(b,null,v(s.value?.CPU.cpu_percent_per_cpu,(a,k)=>(l(),C(A,{square:!0,key:k,align:k+1>Math.round(s.value?.CPU.cpu_percent_per_cpu.length/2),core_number:k,percentage:a},null,8,["align","core_number","percentage"]))),128))])]),n(N(M),{options:B.value,data:R.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"]),e("div",we,[e("h5",ke,[n(u,{t:"Processes"})]),e("h6",Ne,[e("small",null,[n(u,{t:"CPU Usage"})])])]),t[1]||(t[1]=e("hr",{class:"my-1"},null,-1)),e("div",Ce,[n($,{name:"process"},{default:O(()=>[(l(!0),o(b,null,v(s.value?.Processes.cpu_top_10.slice(0,10),a=>(l(),C(D,{key:a.pid,cpu:!0,process:a},null,8,["process"]))),128))]),_:1})])])])])]),e("div",Me,[e("div",Se,[e("div",Ie,[e("div",Pe,[e("div",Ue,[e("div",Le,[e("h3",Be,[t[2]||(t[2]=e("i",{class:"bi bi-memory me-2"},null,-1)),n(u,{t:"Memory"})]),e("h3",Oe,[s.value?(l(),o("span",$e,i(s.value?.Memory.VirtualMemory.percent)+"% ",1)):(l(),o("span",De))])]),e("div",Ee,[e("div",{class:"progress-bar bg-info",style:h({width:`${s.value?.Memory.VirtualMemory.percent}%`})},null,4)]),e("div",Ve,[t[3]||(t[3]=e("h6",{class:"mb-0"},"Swap Memory",-1)),e("h6",Re,i(s.value?.Memory.SwapMemory.percent)+"%",1)]),e("div",Ge,[e("div",{class:"progress-bar bg-info-subtle",style:h({width:`${s.value?.Memory.SwapMemory.percent}%`})},null,4)])]),n(N(M),{options:B.value,data:G.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"]),e("div",je,[e("h5",Te,[n(u,{t:"Processes"})]),e("h6",He,[e("small",null,[n(u,{t:"Memory Usage"})])])]),t[4]||(t[4]=e("hr",{class:"my-1"},null,-1)),e("div",We,[n($,{name:"process"},{default:O(()=>[(l(!0),o(b,null,v(s.value?.Processes.memory_top_10.slice(0,10),a=>(l(),C(D,{key:a.pid,process:a},null,8,["process"]))),128))]),_:1})])])])])]),e("div",qe,[e("div",Ae,[e("div",Fe,[e("div",ze,[e("h3",Je,[t[5]||(t[5]=e("i",{class:"bi bi-ethernet me-2"},null,-1)),n(u,{t:"Network"})]),e("h3",Ke,[s.value?(l(),o("span",Qe,[n(u,{t:Object.keys(s.value.NetworkInterfaces).length+" Interface"+(Object.keys(s.value.NetworkInterfaces).length>1?"s":"")},null,8,["t"])])):(l(),o("span",Xe))])]),e("div",null,[s.value?(l(),o("h5",Ye,[e("span",Ze,[t[6]||(t[6]=e("i",{class:"bi bi-arrow-down"},null,-1)),x(" "+i(d.value.bytes_recv[d.value.bytes_recv.length-1])+" MB/s ",1)]),e("span",es,[t[7]||(t[7]=e("i",{class:"bi bi-arrow-up"},null,-1)),x(" "+i(d.value.bytes_sent[d.value.bytes_sent.length-1])+" MB/s ",1)])])):g("",!0)]),n(N(M),{options:V.value,data:j.value,style:{width:"100%",height:"300px","max-height":"300px"}},null,8,["options","data"]),s.value?(l(),o("div",ss,[(l(!0),o(b,null,v(Object.keys(s.value.NetworkInterfaces).sort(),a=>(l(),o("div",ts,[e("div",as,[e("h6",ls,[e("samp",null,i(a),1)]),e("h6",os,[e("span",rs,[t[8]||(t[8]=e("i",{class:"bi bi-arrow-down"},null,-1)),x(" "+i(Math.round((s.value.NetworkInterfaces[a].bytes_recv/1024e6+Number.EPSILON)*1e4)/1e4)+" GB ",1)]),e("span",ns,[t[9]||(t[9]=e("i",{class:"bi bi-arrow-up"},null,-1)),x(" "+i(Math.round((s.value.NetworkInterfaces[a].bytes_sent/1024e6+Number.EPSILON)*1e4)/1e4)+" GB ",1)])])]),e("div",is,[s.value.NetworkInterfaces[a].bytes_recv>0?(l(),o("div",{key:0,class:"progress-bar bg-info",style:h({width:`${s.value.NetworkInterfaces[a].bytes_recv/(s.value.NetworkInterfaces[a].bytes_sent+s.value.NetworkInterfaces[a].bytes_recv)*100}%`})},null,4)):g("",!0),s.value.NetworkInterfaces[a].bytes_sent>0?(l(),o("div",{key:1,class:"progress-bar bg-warning",style:h({width:`${s.value.NetworkInterfaces[a].bytes_sent/(s.value.NetworkInterfaces[a].bytes_sent+s.value.NetworkInterfaces[a].bytes_recv)*100}%`})},null,4)):g("",!0)])]))),256))])):g("",!0)])])]),e("div",cs,[e("div",ds,[e("div",us,[e("div",_s,[e("h3",ps,[t[10]||(t[10]=e("i",{class:"bi bi-device-ssd-fill me-2"},null,-1)),n(u,{t:"Storage"})]),e("h3",hs,[s.value?(l(),o("span",ms,[n(u,{t:s.value.Disks.length+" Partition"+(s.value.Disks.length>1?"s":"")},null,8,["t"])])):(l(),o("span",bs))])]),e("div",vs,[s.value?(l(!0),o(b,{key:0},v(s.value.Disks,a=>(l(),o("div",gs,[e("div",ys,[e("h6",fs,[e("samp",null,i(a.mountPoint),1)]),e("h6",xs,[e("span",ws,i(Math.round((a.used/1024e6+Number.EPSILON)*100)/100)+" / "+i(Math.round((a.total/1024e6+Number.EPSILON)*100)/100)+" GB Used ",1)])]),e("div",ks,[e("div",{class:"progress-bar bg-success",style:h({width:`${a.percent}%`})},i(a.percent)+"% ",5)])]))),256)):g("",!0)])])])])]))}},Us=E(Ns,[["__scopeId","data-v-0cfce7b0"]]);export{Us as default}; +import{_ as E,a as l,c as o,b as e,t as i,D as T,p as _,o as H,s as W,r as p,g as q,d as n,q as h,F as b,h as v,A as N,w as O,k as $,f as x,e as g,i as C,G as y}from"./index-CgM9eUIs.js";import{L as u}from"./localeText-Dh33930I.js";import{C as A}from"./storageMount.vue_vue_type_style_index_0_scoped_a382214a_lang-D3--h2ZI.js";import{C as F,L as z,B as J,a as K,b as Q,c as X,p as Y,d as Z,e as ee,f as se,P as te,i as ae,g as M}from"./index-z-53TFlU.js";import{d as le}from"./dayjs.min-B2wceQaW.js";const oe={class:"mb-1 d-flex gap-5"},re={class:"title"},ne={class:"ms-auto"},ie={__name:"process",props:["process","cpu"],setup(m){return(w,s)=>(l(),o("div",oe,[e("small",re,[s[0]||(s[0]=e("i",{class:"bi bi-code-square me-2"},null,-1)),e("samp",null,i(m.process.command?m.process.command:m.process.name),1)]),e("small",ne,i(Math.round((m.process.percent+Number.EPSILON)*10)/10)+"% ",1)]))}},D=E(ie,[["__scopeId","data-v-ffe5ad8f"]]),ce={class:"text-body row g-2 mb-2"},de={class:"col-sm-6"},ue={class:"card rounded-3 h-100 shadow"},_e={class:"card-body p-4"},pe={class:"d-flex flex-column gap-3"},he={class:"d-flex flex-column gap-3",style:{height:"130px"}},me={class:"d-flex align-items-center"},be={class:"text-muted mb-0"},ve={class:"ms-auto mb-0"},ge={key:0},ye={key:1,class:"spinner-border"},fe={class:"progress",role:"progressbar",style:{height:"10px"}},xe={class:"d-flex gap-1"},we={class:"d-flex align-items-center"},ke={class:"mb-0"},Ne={class:"mb-0 ms-auto text-muted"},Ce={class:"position-relative"},Me={class:"col-sm-6"},Se={class:"card rounded-3 h-100 shadow"},Ie={class:"card-body p-4"},Pe={class:"d-flex flex-column gap-3"},Ue={class:"d-flex flex-column gap-3",style:{height:"130px"}},Le={class:"d-flex align-items-center"},Be={class:"text-muted"},Oe={class:"ms-auto"},$e={key:0},De={key:1,class:"spinner-border"},Ee={class:"progress",role:"progressbar",style:{height:"10px"}},Ve={class:"d-flex align-items-center"},Re={class:"mb-0 ms-auto"},Ge={class:"progress",role:"progressbar",style:{height:"10px"}},je={class:"d-flex align-items-center"},Te={class:"mb-0"},He={class:"mb-0 ms-auto text-muted"},We={class:"position-relative"},qe={class:"col-sm-12"},Ae={class:"card rounded-3 h-100 shadow"},Fe={class:"card-body p-4 d-flex gap-3 flex-column"},ze={class:"d-flex align-items-center gap-3"},Je={class:"text-muted mb-0"},Ke={class:"ms-auto mb-0"},Qe={key:0},Xe={key:1,class:"spinner-border"},Ye={key:0,class:"mb-0 text-end"},Ze={class:"text-info"},es={class:"text-warning"},ss={key:0,class:"row g-3"},ts={class:"col-sm-6 fadeIn"},as={class:"d-flex mb-2"},ls={class:"mb-0"},os={class:"mb-0 ms-auto d-flex gap-2"},rs={class:"text-info"},ns={class:"text-warning"},is={class:"progress",role:"progressbar",style:{height:"10px"}},cs={class:"col-sm-12"},ds={class:"card rounded-3 h-100 shadow"},us={class:"card-body p-4 d-flex gap-3 flex-column"},_s={class:"d-flex align-items-center"},ps={class:"text-muted mb-0"},hs={class:"ms-auto mb-0"},ms={key:0},bs={key:1,class:"spinner-border"},vs={class:"row g-3"},gs={class:"col-sm-6 fadeIn"},ys={class:"d-flex mb-2"},fs={class:"mb-0"},xs={class:"mb-0 ms-auto d-flex gap-2"},ws={class:"text-success"},ks={class:"progress",role:"progressbar",style:{height:"20px"}},Ns={__name:"systemStatus",setup(m){const w=T(),s=_(()=>w.SystemStatus);let S=null;F.register(z,J,K,Q,X,Y,Z,ee,se,te,ae),H(()=>{L(),S=setInterval(()=>{L()},5e3)}),W(()=>{clearInterval(S)});const f=p([]),I=p([]),P=p([]),U=p([]),c=p({bytes_recv:[],bytes_sent:[]}),d=p({bytes_recv:[],bytes_sent:[]}),L=()=>{q("/api/systemStatus",{},r=>{if(f.value.push(le().format("HH:mm:ss A")),w.SystemStatus=r.data,I.value.push(r.data.CPU.cpu_percent),P.value.push(r.data.Memory.VirtualMemory.percent),U.value.push(r.data.Memory.SwapMemory.percent),c.value.bytes_recv.push(Object.values(r.data.NetworkInterfaces).map(t=>t.bytes_recv).reduce((t,a)=>t+a)),c.value.bytes_sent.push(Object.values(r.data.NetworkInterfaces).map(t=>t.bytes_sent).reduce((t,a)=>t+a)),c.value.bytes_recv.length===1&&c.value.bytes_sent.length===1)d.value.bytes_recv.push(0),d.value.bytes_sent.push(0);else{let t=c.value.bytes_recv[c.value.bytes_recv.length-1]-c.value.bytes_recv[c.value.bytes_recv.length-2],a=c.value.bytes_sent[c.value.bytes_sent.length-1]-c.value.bytes_sent[c.value.bytes_sent.length-2];d.value.bytes_recv.push(Math.round((t/1024e3+Number.EPSILON)*1e4)/1e4),d.value.bytes_sent.push(Math.round((a/1024e3+Number.EPSILON)*1e4)/1e4)}})},B=_(()=>({responsive:!0,plugins:{legend:{display:!0},tooltip:{callbacks:{label:r=>`${r.formattedValue}%`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(r,t)=>`${r}%`},grid:{display:!1}}}})),V=_(()=>({responsive:!0,plugins:{legend:{display:!0},tooltip:{callbacks:{label:r=>`${r.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(r,t)=>`${r} MB/s`},grid:{display:!1}}}})),R=_(()=>({labels:[...f.value],datasets:[{label:y("CPU Usage"),data:[...I.value],fill:"start",backgroundColor:"#0d6efd90",borderColor:"#0d6efd",tension:0,pointRadius:2,borderWidth:1}]})),G=_(()=>({labels:[...f.value],datasets:[{label:y("Memory Usage"),data:[...P.value],fill:1,borderColor:"#0dcaf0",backgroundColor:"#0dcaf090",tension:0,pointRadius:2,borderWidth:1},{label:y("Swap Memory Usage"),data:[...U.value],fill:"start",backgroundColor:"#ffc10790",borderColor:"#ffc107",tension:0,pointRadius:2,borderWidth:1}]})),j=_(()=>({labels:[...f.value],datasets:[{label:y("Real Time Received Data Usage"),data:[...d.value.bytes_recv],fill:"origin",borderColor:"#0dcaf0",backgroundColor:"#0dcaf090",tension:0,pointRadius:2,borderWidth:1},{label:y("Real Time Sent Data Usage"),data:[...d.value.bytes_sent],fill:"origin",backgroundColor:"#ffc10790",borderColor:"#ffc107",tension:0,pointRadius:2,borderWidth:1}]}));return(r,t)=>(l(),o("div",ce,[e("div",de,[e("div",ue,[e("div",_e,[e("div",pe,[e("div",he,[e("div",me,[e("h3",be,[t[0]||(t[0]=e("i",{class:"bi bi-cpu-fill me-2"},null,-1)),n(u,{t:"CPU"})]),e("h3",ve,[s.value?(l(),o("span",ge,i(s.value.CPU.cpu_percent)+"% ",1)):(l(),o("span",ye))])]),e("div",fe,[e("div",{class:"progress-bar",style:h({width:`${s.value?.CPU.cpu_percent}%`})},null,4)]),e("div",xe,[(l(!0),o(b,null,v(s.value?.CPU.cpu_percent_per_cpu,(a,k)=>(l(),C(A,{square:!0,key:k,align:k+1>Math.round(s.value?.CPU.cpu_percent_per_cpu.length/2),core_number:k,percentage:a},null,8,["align","core_number","percentage"]))),128))])]),n(N(M),{options:B.value,data:R.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"]),e("div",we,[e("h5",ke,[n(u,{t:"Processes"})]),e("h6",Ne,[e("small",null,[n(u,{t:"CPU Usage"})])])]),t[1]||(t[1]=e("hr",{class:"my-1"},null,-1)),e("div",Ce,[n($,{name:"process"},{default:O(()=>[(l(!0),o(b,null,v(s.value?.Processes.cpu_top_10.slice(0,10),a=>(l(),C(D,{key:a.pid,cpu:!0,process:a},null,8,["process"]))),128))]),_:1})])])])])]),e("div",Me,[e("div",Se,[e("div",Ie,[e("div",Pe,[e("div",Ue,[e("div",Le,[e("h3",Be,[t[2]||(t[2]=e("i",{class:"bi bi-memory me-2"},null,-1)),n(u,{t:"Memory"})]),e("h3",Oe,[s.value?(l(),o("span",$e,i(s.value?.Memory.VirtualMemory.percent)+"% ",1)):(l(),o("span",De))])]),e("div",Ee,[e("div",{class:"progress-bar bg-info",style:h({width:`${s.value?.Memory.VirtualMemory.percent}%`})},null,4)]),e("div",Ve,[t[3]||(t[3]=e("h6",{class:"mb-0"},"Swap Memory",-1)),e("h6",Re,i(s.value?.Memory.SwapMemory.percent)+"%",1)]),e("div",Ge,[e("div",{class:"progress-bar bg-info-subtle",style:h({width:`${s.value?.Memory.SwapMemory.percent}%`})},null,4)])]),n(N(M),{options:B.value,data:G.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"]),e("div",je,[e("h5",Te,[n(u,{t:"Processes"})]),e("h6",He,[e("small",null,[n(u,{t:"Memory Usage"})])])]),t[4]||(t[4]=e("hr",{class:"my-1"},null,-1)),e("div",We,[n($,{name:"process"},{default:O(()=>[(l(!0),o(b,null,v(s.value?.Processes.memory_top_10.slice(0,10),a=>(l(),C(D,{key:a.pid,process:a},null,8,["process"]))),128))]),_:1})])])])])]),e("div",qe,[e("div",Ae,[e("div",Fe,[e("div",ze,[e("h3",Je,[t[5]||(t[5]=e("i",{class:"bi bi-ethernet me-2"},null,-1)),n(u,{t:"Network"})]),e("h3",Ke,[s.value?(l(),o("span",Qe,[n(u,{t:Object.keys(s.value.NetworkInterfaces).length+" Interface"+(Object.keys(s.value.NetworkInterfaces).length>1?"s":"")},null,8,["t"])])):(l(),o("span",Xe))])]),e("div",null,[s.value?(l(),o("h5",Ye,[e("span",Ze,[t[6]||(t[6]=e("i",{class:"bi bi-arrow-down"},null,-1)),x(" "+i(d.value.bytes_recv[d.value.bytes_recv.length-1])+" MB/s ",1)]),e("span",es,[t[7]||(t[7]=e("i",{class:"bi bi-arrow-up"},null,-1)),x(" "+i(d.value.bytes_sent[d.value.bytes_sent.length-1])+" MB/s ",1)])])):g("",!0)]),n(N(M),{options:V.value,data:j.value,style:{width:"100%",height:"300px","max-height":"300px"}},null,8,["options","data"]),s.value?(l(),o("div",ss,[(l(!0),o(b,null,v(Object.keys(s.value.NetworkInterfaces).sort(),a=>(l(),o("div",ts,[e("div",as,[e("h6",ls,[e("samp",null,i(a),1)]),e("h6",os,[e("span",rs,[t[8]||(t[8]=e("i",{class:"bi bi-arrow-down"},null,-1)),x(" "+i(Math.round((s.value.NetworkInterfaces[a].bytes_recv/1024e6+Number.EPSILON)*1e4)/1e4)+" GB ",1)]),e("span",ns,[t[9]||(t[9]=e("i",{class:"bi bi-arrow-up"},null,-1)),x(" "+i(Math.round((s.value.NetworkInterfaces[a].bytes_sent/1024e6+Number.EPSILON)*1e4)/1e4)+" GB ",1)])])]),e("div",is,[s.value.NetworkInterfaces[a].bytes_recv>0?(l(),o("div",{key:0,class:"progress-bar bg-info",style:h({width:`${s.value.NetworkInterfaces[a].bytes_recv/(s.value.NetworkInterfaces[a].bytes_sent+s.value.NetworkInterfaces[a].bytes_recv)*100}%`})},null,4)):g("",!0),s.value.NetworkInterfaces[a].bytes_sent>0?(l(),o("div",{key:1,class:"progress-bar bg-warning",style:h({width:`${s.value.NetworkInterfaces[a].bytes_sent/(s.value.NetworkInterfaces[a].bytes_sent+s.value.NetworkInterfaces[a].bytes_recv)*100}%`})},null,4)):g("",!0)])]))),256))])):g("",!0)])])]),e("div",cs,[e("div",ds,[e("div",us,[e("div",_s,[e("h3",ps,[t[10]||(t[10]=e("i",{class:"bi bi-device-ssd-fill me-2"},null,-1)),n(u,{t:"Storage"})]),e("h3",hs,[s.value?(l(),o("span",ms,[n(u,{t:s.value.Disks.length+" Partition"+(s.value.Disks.length>1?"s":"")},null,8,["t"])])):(l(),o("span",bs))])]),e("div",vs,[s.value?(l(!0),o(b,{key:0},v(s.value.Disks,a=>(l(),o("div",gs,[e("div",ys,[e("h6",fs,[e("samp",null,i(a.mountPoint),1)]),e("h6",xs,[e("span",ws,i(Math.round((a.used/1024e6+Number.EPSILON)*100)/100)+" / "+i(Math.round((a.total/1024e6+Number.EPSILON)*100)/100)+" GB Used ",1)])]),e("div",ks,[e("div",{class:"progress-bar bg-success",style:h({width:`${a.percent}%`})},i(a.percent)+"% ",5)])]))),256)):g("",!0)])])])])]))}},Us=E(Ns,[["__scopeId","data-v-0cfce7b0"]]);export{Us as default}; diff --git a/src/static/app/dist/assets/totp-BVPXbklw.js b/src/static/app/dist/assets/totp-Dj5ZBaPC.js similarity index 96% rename from src/static/app/dist/assets/totp-BVPXbklw.js rename to src/static/app/dist/assets/totp-Dj5ZBaPC.js index 98e6979..29d976f 100644 --- a/src/static/app/dist/assets/totp-BVPXbklw.js +++ b/src/static/app/dist/assets/totp-Dj5ZBaPC.js @@ -1 +1 @@ -import{_ as h,D as m,g as p,z as f,c as b,b as t,d as i,t as _,m as v,x as g,i as d,w as r,j as c,a as n}from"./index-7qLsecvh.js";import{b as x}from"./browser-CjSdxGTc.js";import{L as y}from"./localeText-BguG5zGd.js";const T={name:"totp",components:{LocaleText:y},async setup(){const s=m();let e="";return await p("/api/Welcome_GetTotpLink",{},a=>{a.status&&(e=a.data)}),{l:e,store:s}},mounted(){this.l&&x.toCanvas(document.getElementById("qrcode"),this.l,function(s){})},data(){return{totp:"",totpInvalidMessage:"",verified:!1}},methods:{validateTotp(){}},watch:{totp(s){const e=document.querySelector("#totp");e.classList.remove("is-invalid","is-valid"),s.length===6&&(console.log(s),/[0-9]{6}/.test(s)?f("/api/Welcome_VerifyTotpLink",{totp:s},a=>{a.status?(this.verified=!0,e.classList.add("is-valid"),this.$emit("verified")):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP does not match.")}):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP can only contain numbers"))}}},k=["data-bs-theme"],w={class:"m-auto text-body",style:{width:"500px"}},L={class:"d-flex flex-column"},M={class:"dashboardLogo display-4"},C={class:"mb-2"},P={class:"text-muted"},I={class:"p-3 bg-body-secondary rounded-3 border mb-3"},O={class:"text-muted mb-0"},B=["href"],$={style:{"line-break":"anywhere"}},D={for:"totp",class:"mb-2"},S={class:"text-muted"},q={class:"form-group mb-2"},A=["disabled"],E={class:"invalid-feedback"},F={class:"valid-feedback"},R={class:"d-flex gap-3 mt-5 flex-column"};function G(s,e,a,N,W,j){const o=c("LocaleText"),l=c("RouterLink");return n(),b("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[t("div",w,[t("div",L,[t("div",null,[t("h1",M,[i(o,{t:"Multi-Factor Authentication (MFA)"})]),t("p",C,[t("small",P,[i(o,{t:"1. Please scan the following QR Code to generate TOTP with your choice of authenticator"})])]),e[1]||(e[1]=t("canvas",{id:"qrcode",class:"rounded-3 mb-2"},null,-1)),t("div",I,[t("p",O,[t("small",null,[i(o,{t:"Or you can click the link below:"})])]),t("a",{href:this.l},[t("code",$,_(this.l),1)],8,B)]),t("label",D,[t("small",S,[i(o,{t:"2. Enter the TOTP generated by your authenticator to verify"})])]),t("div",q,[v(t("input",{class:"form-control text-center totp",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code","onUpdate:modelValue":e[0]||(e[0]=u=>this.totp=u),disabled:this.verified},null,8,A),[[g,this.totp]]),t("div",E,[i(o,{t:this.totpInvalidMessage},null,8,["t"])]),t("div",F,[i(o,{t:"TOTP verified!"})])])]),e[4]||(e[4]=t("hr",null,null,-1)),t("div",R,[this.verified?(n(),d(l,{key:1,to:"/",class:"btn btn-dark btn-lg d-flex btn-brand shadow align-items-center flex-grow-1 rounded-3"},{default:r(()=>[i(o,{t:"Complete"}),e[3]||(e[3]=t("i",{class:"bi bi-chevron-right ms-auto"},null,-1))]),_:1})):(n(),d(l,{key:0,to:"/",class:"btn bg-secondary-subtle text-secondary-emphasis rounded-3 flex-grow-1 btn-lg border-1 border-secondary-subtle shadow d-flex"},{default:r(()=>[i(o,{t:"I don't need MFA"}),e[2]||(e[2]=t("i",{class:"bi bi-chevron-right ms-auto"},null,-1))]),_:1}))])])])],8,k)}const V=h(T,[["render",G]]);export{V as default}; +import{_ as h,D as m,g as p,z as f,c as b,b as t,d as i,t as _,m as v,x as g,i as d,w as r,j as c,a as n}from"./index-CgM9eUIs.js";import{b as x}from"./browser-CjSdxGTc.js";import{L as y}from"./localeText-Dh33930I.js";const T={name:"totp",components:{LocaleText:y},async setup(){const s=m();let e="";return await p("/api/Welcome_GetTotpLink",{},a=>{a.status&&(e=a.data)}),{l:e,store:s}},mounted(){this.l&&x.toCanvas(document.getElementById("qrcode"),this.l,function(s){})},data(){return{totp:"",totpInvalidMessage:"",verified:!1}},methods:{validateTotp(){}},watch:{totp(s){const e=document.querySelector("#totp");e.classList.remove("is-invalid","is-valid"),s.length===6&&(console.log(s),/[0-9]{6}/.test(s)?f("/api/Welcome_VerifyTotpLink",{totp:s},a=>{a.status?(this.verified=!0,e.classList.add("is-valid"),this.$emit("verified")):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP does not match.")}):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP can only contain numbers"))}}},k=["data-bs-theme"],w={class:"m-auto text-body",style:{width:"500px"}},L={class:"d-flex flex-column"},M={class:"dashboardLogo display-4"},C={class:"mb-2"},P={class:"text-muted"},I={class:"p-3 bg-body-secondary rounded-3 border mb-3"},O={class:"text-muted mb-0"},B=["href"],$={style:{"line-break":"anywhere"}},D={for:"totp",class:"mb-2"},S={class:"text-muted"},q={class:"form-group mb-2"},A=["disabled"],E={class:"invalid-feedback"},F={class:"valid-feedback"},R={class:"d-flex gap-3 mt-5 flex-column"};function G(s,e,a,N,W,j){const o=c("LocaleText"),l=c("RouterLink");return n(),b("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[t("div",w,[t("div",L,[t("div",null,[t("h1",M,[i(o,{t:"Multi-Factor Authentication (MFA)"})]),t("p",C,[t("small",P,[i(o,{t:"1. Please scan the following QR Code to generate TOTP with your choice of authenticator"})])]),e[1]||(e[1]=t("canvas",{id:"qrcode",class:"rounded-3 mb-2"},null,-1)),t("div",I,[t("p",O,[t("small",null,[i(o,{t:"Or you can click the link below:"})])]),t("a",{href:this.l},[t("code",$,_(this.l),1)],8,B)]),t("label",D,[t("small",S,[i(o,{t:"2. Enter the TOTP generated by your authenticator to verify"})])]),t("div",q,[v(t("input",{class:"form-control text-center totp",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code","onUpdate:modelValue":e[0]||(e[0]=u=>this.totp=u),disabled:this.verified},null,8,A),[[g,this.totp]]),t("div",E,[i(o,{t:this.totpInvalidMessage},null,8,["t"])]),t("div",F,[i(o,{t:"TOTP verified!"})])])]),e[4]||(e[4]=t("hr",null,null,-1)),t("div",R,[this.verified?(n(),d(l,{key:1,to:"/",class:"btn btn-dark btn-lg d-flex btn-brand shadow align-items-center flex-grow-1 rounded-3"},{default:r(()=>[i(o,{t:"Complete"}),e[3]||(e[3]=t("i",{class:"bi bi-chevron-right ms-auto"},null,-1))]),_:1})):(n(),d(l,{key:0,to:"/",class:"btn bg-secondary-subtle text-secondary-emphasis rounded-3 flex-grow-1 btn-lg border-1 border-secondary-subtle shadow d-flex"},{default:r(()=>[i(o,{t:"I don't need MFA"}),e[2]||(e[2]=t("i",{class:"bi bi-chevron-right ms-auto"},null,-1))]),_:1}))])])])],8,k)}const V=h(T,[["render",G]]);export{V as default}; diff --git a/src/static/app/dist/assets/traceroute-CLD_BSNv.js b/src/static/app/dist/assets/traceroute-CLD_BSNv.js new file mode 100644 index 0000000..fa5fe6c --- /dev/null +++ b/src/static/app/dist/assets/traceroute-CLD_BSNv.js @@ -0,0 +1 @@ +import{_ as x,D as b,r as p,y as v,g as k,c as l,b as t,d as o,m as y,x as T,C as A,w as _,T as w,k as R,e as h,j as f,a as r,f as S,F as C,h as L,t as i}from"./index-CgM9eUIs.js";import{O as M,a as O,l as V}from"./osmapSocket-CJmzPMGM.js";import{L as $}from"./localeText-Dh33930I.js";const D={name:"traceroute",components:{OsmapSocket:M,LocaleText:$,OSMap:O},data(){return{ipAddress:void 0}},setup(){const n=b();let e,c=p(!1);const u=p([]);try{e=V(),e.connect(),console.info("Successfully connected to socket.io")}catch{console.assert("Failed to connect socket.io")}return e.on("tracerouteResponse",(...m)=>{let d=m[0];d.status&&c.value?(console.log(d.data),d.data.id=v().toString(),u.value.push(d.data)):(n.newMessage("Server",d.message,"danger"),c.value=!1)}),e.on("tracerouteResponseEnd",()=>{c.value=!1}),{store:n,sio:e,tracerouteResult:u,tracing:c}},methods:{execute(){this.ipAddress&&(this.tracing=!0,this.tracerouteResult=void 0,k("/api/traceroute/execute",{ipAddress:this.ipAddress},n=>{n.status?this.tracerouteResult=n.data:this.store.newMessage("Server",n.message,"danger"),this.tracing=!1}))},executeSocket(){this.ipAddress&&this.sio.connected&&(this.tracerouteResult=[],this.tracing=!0,this.sio.emit("traceroute",{ipAddress:this.ipAddress}))}}},N={class:"mt-md-5 mt-3 text-body"},B={class:"container-md"},E={class:"mb-3 text-body"},F={class:"d-flex gap-2 mb-3 flex-column"},G={class:"flex-grow-1"},I={class:"mb-1 text-muted",for:"ipAddress"},H=["disabled"],K=["disabled"],P={key:0,class:"d-block"},j={key:1,class:"d-block"},U={class:"position-relative"},q={key:"table",class:"w-100 mt-2"},z={class:"table table-sm rounded-3 w-100"},J={scope:"col"},Q={scope:"col"},W={scope:"col"},X={scope:"col"},Y={scope:"col"},Z={scope:"col"},tt={key:0},et={key:0},st={colspan:"6",class:"text-muted text-center"};function ot(n,e,c,u,m,d){const a=f("LocaleText"),g=f("OsmapSocket");return r(),l("div",N,[t("div",B,[t("h3",E,[o(a,{t:"Traceroute"})]),t("div",F,[t("div",G,[t("label",I,[t("small",null,[o(a,{t:"Enter IP Address / Hostname"})])]),y(t("input",{disabled:this.tracing,id:"ipAddress",class:"form-control rounded-3","onUpdate:modelValue":e[0]||(e[0]=s=>this.ipAddress=s),onKeyup:e[1]||(e[1]=A(s=>this.execute(),["enter"])),type:"text"},null,40,H),[[T,this.ipAddress]])]),t("button",{class:"btn btn-primary rounded-3 position-relative flex-grow-1",disabled:this.tracing||!this.ipAddress,onClick:e[2]||(e[2]=s=>this.executeSocket())},[o(w,{name:"slide"},{default:_(()=>[this.tracing?(r(),l("span",j,e[4]||(e[4]=[t("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1),t("span",{class:"visually-hidden",role:"status"},"Loading...",-1)]))):(r(),l("span",P,e[3]||(e[3]=[t("i",{class:"bi bi-person-walking me-2"},null,-1),S("Trace! ")])))]),_:1})],8,K)]),t("div",U,[o(g,{d:this.tracerouteResult,type:"traceroute"},null,8,["d"]),t("div",q,[t("table",z,[t("thead",null,[t("tr",null,[t("th",J,[o(a,{t:"Hop"})]),t("th",Q,[o(a,{t:"IP Address"})]),t("th",W,[o(a,{t:"Average RTT (ms)"})]),t("th",X,[o(a,{t:"Min RTT (ms)"})]),t("th",Y,[o(a,{t:"Max RTT (ms)"})]),t("th",Z,[o(a,{t:"Geolocation"})])])]),t("tbody",null,[o(R,{name:"ping"},{default:_(()=>[(r(!0),l(C,null,L(this.tracerouteResult,s=>(r(),l("tr",{key:s.id},[t("td",null,[t("small",null,i(s.hop),1)]),t("td",null,[t("small",null,i(s.ip),1)]),t("td",null,[t("small",null,i(s.avg_rtt),1)]),t("td",null,[t("small",null,i(s.min_rtt),1)]),t("td",null,[t("small",null,i(s.max_rtt),1)]),t("td",null,[s.geo&&s.geo.status==="success"?(r(),l("span",tt,[t("small",null,i(s.geo.city)+", "+i(s.geo.country),1)])):h("",!0)])]))),128))]),_:1}),u.tracerouteResult.length===0?(r(),l("tr",et,[t("td",st,[t("small",null,[o(a,{t:"Traceroute results will show here"})])])])):h("",!0)])])])])])])}const rt=x(D,[["render",ot],["__scopeId","data-v-229344ca"]]);export{rt as default}; diff --git a/src/static/app/dist/assets/traceroute-DH1nb6XH.css b/src/static/app/dist/assets/traceroute-DH1nb6XH.css deleted file mode 100644 index 3bd3160..0000000 --- a/src/static/app/dist/assets/traceroute-DH1nb6XH.css +++ /dev/null @@ -1 +0,0 @@ -.pingPlaceholder[data-v-3e75b4d4]{width:100%;height:40px}.ping-move[data-v-3e75b4d4],.ping-enter-active[data-v-3e75b4d4],.ping-leave-active[data-v-3e75b4d4]{transition:all .4s cubic-bezier(.82,.58,.17,.9)}.ping-leave-active[data-v-3e75b4d4]{position:absolute;width:100%}.ping-enter-from[data-v-3e75b4d4],.ping-leave-to[data-v-3e75b4d4]{opacity:0;filter:blur(3px)}.ping-leave-active[data-v-3e75b4d4]{position:absolute}table th[data-v-3e75b4d4],table td[data-v-3e75b4d4]{padding:.5rem}.table[data-v-3e75b4d4]>:not(caption)>*>*{background-color:transparent!important} diff --git a/src/static/app/dist/assets/traceroute-Dc3TIsZW.js b/src/static/app/dist/assets/traceroute-Dc3TIsZW.js deleted file mode 100644 index bbe5e2d..0000000 --- a/src/static/app/dist/assets/traceroute-Dc3TIsZW.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as h,W as g,g as b,c as o,b as t,d as n,m as y,x as f,H as x,w as r,T as c,a as l,f as v,F as u,h as m,n as T,q as k,t as i,j as _}from"./index-7qLsecvh.js";import{e as A}from"./osmap-CVrWGfN8.js";import{L as w}from"./localeText-BguG5zGd.js";const R={name:"traceroute",components:{LocaleText:w,OSMap:A},data(){return{tracing:!1,ipAddress:void 0,tracerouteResult:void 0}},setup(){return{store:g()}},methods:{execute(){this.ipAddress&&(this.tracing=!0,this.tracerouteResult=void 0,b("/api/traceroute/execute",{ipAddress:this.ipAddress},d=>{d.status?this.tracerouteResult=d.data:this.store.newMessage("Server",d.message,"danger"),this.tracing=!1}))}}},M={class:"mt-md-5 mt-3 text-body"},S={class:"container-md"},$={class:"mb-3 text-body"},L={class:"d-flex gap-2 mb-3 flex-column"},C={class:"flex-grow-1"},P={class:"mb-1 text-muted",for:"ipAddress"},V=["disabled"],B=["disabled"],H={key:0,class:"d-block"},I={key:1,class:"d-block"},N={class:"position-relative"},O={key:"pingPlaceholder"},z={key:1},D={key:"table",class:"w-100 mt-2"},E={class:"table table-sm rounded-3 w-100"},F={scope:"col"},G={scope:"col"},K={scope:"col"},W={scope:"col"},j={scope:"col"},q={scope:"col"},U={key:0},J={key:1};function Q(d,s,X,Y,Z,tt){const a=_("LocaleText"),p=_("OSMap");return l(),o("div",M,[t("div",S,[t("h3",$,[n(a,{t:"Traceroute"})]),t("div",L,[t("div",C,[t("label",P,[t("small",null,[n(a,{t:"Enter IP Address / Hostname"})])]),y(t("input",{disabled:this.tracing,id:"ipAddress",class:"form-control rounded-3","onUpdate:modelValue":s[0]||(s[0]=e=>this.ipAddress=e),onKeyup:s[1]||(s[1]=x(e=>this.execute(),["enter"])),type:"text"},null,40,V),[[f,this.ipAddress]])]),t("button",{class:"btn btn-primary rounded-3 position-relative flex-grow-1",disabled:this.tracing||!this.ipAddress,onClick:s[2]||(s[2]=e=>this.execute())},[n(c,{name:"slide"},{default:r(()=>[this.tracing?(l(),o("span",I,s[4]||(s[4]=[t("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1),t("span",{class:"visually-hidden",role:"status"},"Loading...",-1)]))):(l(),o("span",H,s[3]||(s[3]=[t("i",{class:"bi bi-person-walking me-2"},null,-1),v("Trace! ")])))]),_:1})],8,B)]),t("div",N,[n(c,{name:"ping"},{default:r(()=>[this.tracerouteResult?(l(),o("div",z,[n(p,{d:this.tracerouteResult,type:"traceroute"},null,8,["d"]),t("div",D,[t("table",E,[t("thead",null,[t("tr",null,[t("th",F,[n(a,{t:"Hop"})]),t("th",G,[n(a,{t:"IP Address"})]),t("th",K,[n(a,{t:"Average RTT (ms)"})]),t("th",W,[n(a,{t:"Min RTT (ms)"})]),t("th",j,[n(a,{t:"Max RTT (ms)"})]),t("th",q,[n(a,{t:"Geolocation"})])])]),t("tbody",null,[(l(!0),o(u,null,m(this.tracerouteResult,(e,et)=>(l(),o("tr",null,[t("td",null,[t("small",null,i(e.hop),1)]),t("td",null,[t("small",null,[t("samp",null,i(e.ip),1)])]),t("td",null,[t("small",null,[t("samp",null,i(e.avg_rtt),1)])]),t("td",null,[t("small",null,[t("samp",null,i(e.min_rtt),1)])]),t("td",null,[t("small",null,[t("samp",null,i(e.max_rtt),1)])]),t("td",null,[e.geo.city&&e.geo.country?(l(),o("span",U,[t("small",null,i(e.geo.city)+", "+i(e.geo.country),1)])):(l(),o("span",J," - "))])]))),256))])])])])):(l(),o("div",O,[s[5]||(s[5]=t("div",{class:"pingPlaceholder bg-body-secondary rounded-3 mb-3",style:{height:"300px !important"}},null,-1)),(l(),o(u,null,m(5,e=>t("div",{class:T(["pingPlaceholder bg-body-secondary rounded-3 mb-3",{"animate__animated animate__flash animate__slower animate__infinite":this.tracing}]),style:k({"animation-delay":`${e*.05}s`})},null,6)),64))]))]),_:1})])])])}const lt=h(R,[["render",Q],["__scopeId","data-v-3e75b4d4"]]);export{lt as default}; diff --git a/src/static/app/dist/assets/traceroute-UMAnhO0_.css b/src/static/app/dist/assets/traceroute-UMAnhO0_.css new file mode 100644 index 0000000..4366213 --- /dev/null +++ b/src/static/app/dist/assets/traceroute-UMAnhO0_.css @@ -0,0 +1 @@ +.pingPlaceholder[data-v-229344ca]{width:100%;height:40px}.ping-move[data-v-229344ca],.ping-enter-active[data-v-229344ca],.ping-leave-active[data-v-229344ca]{transition:all .4s cubic-bezier(.82,.58,.17,.9)}.ping-leave-active[data-v-229344ca]{position:absolute;width:100%}.ping-enter-from[data-v-229344ca],.ping-leave-to[data-v-229344ca]{opacity:0;filter:blur(3px)}.ping-leave-active[data-v-229344ca]{position:absolute}table th[data-v-229344ca],table td[data-v-229344ca]{padding:.5rem}.table[data-v-229344ca]>:not(caption)>*>*{background-color:transparent!important} diff --git a/src/static/app/dist/assets/vue-datepicker-v4St2bKM.js b/src/static/app/dist/assets/vue-datepicker-D7WdryeM.js similarity index 99% rename from src/static/app/dist/assets/vue-datepicker-v4St2bKM.js rename to src/static/app/dist/assets/vue-datepicker-D7WdryeM.js index f20cfac..920434f 100644 --- a/src/static/app/dist/assets/vue-datepicker-v4St2bKM.js +++ b/src/static/app/dist/assets/vue-datepicker-D7WdryeM.js @@ -1 +1 @@ -import{I as ha,r as Z,P as ze,a6 as qt,a7 as ca,o as Ke,Y as it,V as Ca,E as ct,p as G,a as P,c as W,d as ot,a8 as je,h as Ye,w as _e,a9 as ue,aa as We,ab as at,A as d,ac as Qe,ad as Pn,i as De,T as ta,e as j,l as Oa,ae as Br,n as ke,b as ye,F as we,q as dt,a4 as va,t as Ge,R as Nr,af as An,ag as Lr,f as Dt,ah as Hr,m as Ma,ai as Da,H as Vr,L as Fr,M as qr}from"./index-7qLsecvh.js";function ve(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Te(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function mt(e,t){const n=ve(e);return isNaN(t)?Te(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function ft(e,t){const n=ve(e);if(isNaN(t))return Te(e,NaN);if(!t)return n;const a=n.getDate(),r=Te(e,n.getTime());r.setMonth(n.getMonth()+t+1,0);const l=r.getDate();return a>=l?r:(n.setFullYear(r.getFullYear(),r.getMonth(),a),n)}function Xn(e,t){const{years:n=0,months:a=0,weeks:r=0,days:l=0,hours:i=0,minutes:p=0,seconds:c=0}=t,C=ve(e),m=a||n?ft(C,a+n*12):C,v=l||r?mt(m,l+r*7):m,h=p+i*60,Y=(c+h*60)*1e3;return Te(e,v.getTime()+Y)}function Wr(e,t){const n=+ve(e);return Te(e,n+t)}const Gn=6048e5,Qr=864e5,zr=6e4,jn=36e5,Ur=1e3;function Xr(e,t){return Wr(e,t*jn)}let Gr={};function Wt(){return Gr}function ht(e,t){const n=Wt(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ve(e),l=r.getDay(),i=(l=r.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Cn(e){const t=ve(e);return t.setHours(0,0,0,0),t}function Ta(e){const t=ve(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Jn(e,t){const n=Cn(e),a=Cn(t),r=+n-Ta(n),l=+a-Ta(a);return Math.round((r-l)/Qr)}function jr(e){const t=Kn(e),n=Te(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Gt(n)}function Kr(e,t){const n=t*3;return ft(e,n)}function un(e,t){return ft(e,t*12)}function On(e,t){const n=ve(e),a=ve(t),r=n.getTime()-a.getTime();return r<0?-1:r>0?1:r}function Zn(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ua(e){if(!Zn(e)&&typeof e!="number")return!1;const t=ve(e);return!isNaN(Number(t))}function $n(e){const t=ve(e);return Math.trunc(t.getMonth()/3)+1}function Jr(e,t){const n=ve(e),a=ve(t);return n.getFullYear()-a.getFullYear()}function Zr(e,t){const n=ve(e),a=ve(t),r=On(n,a),l=Math.abs(Jr(n,a));n.setFullYear(1584),a.setFullYear(1584);const i=On(n,a)===-r,p=r*(l-+i);return p===0?0:p}function er(e,t){const n=ve(e.start),a=ve(e.end);let r=+n>+a;const l=r?+n:+a,i=r?a:n;i.setHours(0,0,0,0);let p=1;const c=[];for(;+i<=l;)c.push(ve(i)),i.setDate(i.getDate()+p),i.setHours(0,0,0,0);return r?c.reverse():c}function Ht(e){const t=ve(e),n=t.getMonth(),a=n-n%3;return t.setMonth(a,1),t.setHours(0,0,0,0),t}function el(e,t){const n=ve(e.start),a=ve(e.end);let r=+n>+a;const l=r?+Ht(n):+Ht(a);let i=Ht(r?a:n),p=1;const c=[];for(;+i<=l;)c.push(ve(i)),i=Kr(i,p);return r?c.reverse():c}function tl(e){const t=ve(e);return t.setDate(1),t.setHours(0,0,0,0),t}function tr(e){const t=ve(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}function ma(e){const t=ve(e),n=Te(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ar(e,t){const n=Wt(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ve(e),l=r.getDay(),i=(l{let a;const r=al[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function Wa(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const rl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ll={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ol={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},il={date:Wa({formats:rl,defaultWidth:"full"}),time:Wa({formats:ll,defaultWidth:"full"}),dateTime:Wa({formats:ol,defaultWidth:"full"})},sl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ul=(e,t,n,a)=>sl[e];function oa(e){return(t,n)=>{const a=n?.context?String(n.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,p=n?.width?String(n.width):i;r=e.formattingValues[p]||e.formattingValues[i]}else{const i=e.defaultWidth,p=n?.width?String(n.width):e.defaultWidth;r=e.values[p]||e.values[i]}const l=e.argumentCallback?e.argumentCallback(t):t;return r[l]}}const dl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},cl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},vl={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ml={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},pl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hl=(e,t)=>{const n=Number(e),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yl={ordinalNumber:hl,era:oa({values:dl,defaultWidth:"wide"}),quarter:oa({values:cl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:oa({values:vl,defaultWidth:"wide"}),day:oa({values:ml,defaultWidth:"wide"}),dayPeriod:oa({values:pl,defaultWidth:"wide",formattingValues:fl,defaultFormattingWidth:"wide"})};function ia(e){return(t,n={})=>{const a=n.width,r=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],l=t.match(r);if(!l)return null;const i=l[0],p=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(p)?bl(p,v=>v.test(i)):gl(p,v=>v.test(i));let C;C=e.valueCallback?e.valueCallback(c):c,C=n.valueCallback?n.valueCallback(C):C;const m=t.slice(i.length);return{value:C,rest:m}}}function gl(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function bl(e,t){for(let n=0;n{const a=t.match(e.matchPattern);if(!a)return null;const r=a[0],l=t.match(e.parsePattern);if(!l)return null;let i=e.valueCallback?e.valueCallback(l[0]):l[0];i=n.valueCallback?n.valueCallback(i):i;const p=t.slice(r.length);return{value:i,rest:p}}}const _l=/^(\d+)(th|st|nd|rd)?/i,kl=/\d+/i,xl={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ml={any:[/^b/i,/^(a|c)/i]},Dl={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tl={any:[/1/i,/2/i,/3/i,/4/i]},Pl={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Al={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Cl={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ol={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$l={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Yl={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Sl={ordinalNumber:wl({matchPattern:_l,parsePattern:kl,valueCallback:e=>parseInt(e,10)}),era:ia({matchPatterns:xl,defaultMatchWidth:"wide",parsePatterns:Ml,defaultParseWidth:"any"}),quarter:ia({matchPatterns:Dl,defaultMatchWidth:"wide",parsePatterns:Tl,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ia({matchPatterns:Pl,defaultMatchWidth:"wide",parsePatterns:Al,defaultParseWidth:"any"}),day:ia({matchPatterns:Cl,defaultMatchWidth:"wide",parsePatterns:Ol,defaultParseWidth:"any"}),dayPeriod:ia({matchPatterns:$l,defaultMatchWidth:"any",parsePatterns:Yl,defaultParseWidth:"any"})},nr={code:"en-US",formatDistance:nl,formatLong:il,formatRelative:ul,localize:yl,match:Sl,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Rl(e){const t=ve(e);return Jn(t,ma(t))+1}function dn(e){const t=ve(e),n=+Gt(t)-+jr(t);return Math.round(n/Gn)+1}function cn(e,t){const n=ve(e),a=n.getFullYear(),r=Wt(),l=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=Te(e,0);i.setFullYear(a+1,0,l),i.setHours(0,0,0,0);const p=ht(i,t),c=Te(e,0);c.setFullYear(a,0,l),c.setHours(0,0,0,0);const C=ht(c,t);return n.getTime()>=p.getTime()?a+1:n.getTime()>=C.getTime()?a:a-1}function Il(e,t){const n=Wt(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=cn(e,t),l=Te(e,0);return l.setFullYear(r,0,a),l.setHours(0,0,0,0),ht(l,t)}function vn(e,t){const n=ve(e),a=+ht(n,t)-+Il(n,t);return Math.round(a/Gn)+1}function Ae(e,t){const n=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return n+a}const Ct={y(e,t){const n=e.getFullYear(),a=n>0?n:1-n;return Ae(t==="yy"?a%100:a,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ae(n+1,2)},d(e,t){return Ae(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ae(e.getHours()%12||12,t.length)},H(e,t){return Ae(e.getHours(),t.length)},m(e,t){return Ae(e.getMinutes(),t.length)},s(e,t){return Ae(e.getSeconds(),t.length)},S(e,t){const n=t.length,a=e.getMilliseconds(),r=Math.trunc(a*Math.pow(10,n-3));return Ae(r,t.length)}},Qt={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sn={G:function(e,t,n){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const a=e.getFullYear(),r=a>0?a:1-a;return n.ordinalNumber(r,{unit:"year"})}return Ct.y(e,t)},Y:function(e,t,n,a){const r=cn(e,a),l=r>0?r:1-r;if(t==="YY"){const i=l%100;return Ae(i,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):Ae(l,t.length)},R:function(e,t){const n=Kn(e);return Ae(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ae(n,t.length)},Q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Ae(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Ae(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){const a=e.getMonth();switch(t){case"M":case"MM":return Ct.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return Ae(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,n,a){const r=vn(e,a);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Ae(r,t.length)},I:function(e,t,n){const a=dn(e);return t==="Io"?n.ordinalNumber(a,{unit:"week"}):Ae(a,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ct.d(e,t)},D:function(e,t,n){const a=Rl(e);return t==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):Ae(a,t.length)},E:function(e,t,n){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});case"EEEE":default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){const r=e.getDay(),l=(r-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return Ae(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){const r=e.getDay(),l=(r-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return Ae(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const a=e.getDay(),r=a===0?7:a;switch(t){case"i":return String(r);case"ii":return Ae(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const a=e.getHours();let r;switch(a===12?r=Qt.noon:a===0?r=Qt.midnight:r=a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const a=e.getHours();let r;switch(a>=17?r=Qt.evening:a>=12?r=Qt.afternoon:a>=4?r=Qt.morning:r=Qt.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return Ct.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ct.H(e,t)},K:function(e,t,n){const a=e.getHours()%12;return t==="Ko"?n.ordinalNumber(a,{unit:"hour"}):Ae(a,t.length)},k:function(e,t,n){let a=e.getHours();return a===0&&(a=24),t==="ko"?n.ordinalNumber(a,{unit:"hour"}):Ae(a,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ct.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ct.s(e,t)},S:function(e,t){return Ct.S(e,t)},X:function(e,t,n){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return In(a);case"XXXX":case"XX":return Nt(a);case"XXXXX":case"XXX":default:return Nt(a,":")}},x:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"x":return In(a);case"xxxx":case"xx":return Nt(a);case"xxxxx":case"xxx":default:return Nt(a,":")}},O:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Rn(a,":");case"OOOO":default:return"GMT"+Nt(a,":")}},z:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Rn(a,":");case"zzzz":default:return"GMT"+Nt(a,":")}},t:function(e,t,n){const a=Math.trunc(e.getTime()/1e3);return Ae(a,t.length)},T:function(e,t,n){const a=e.getTime();return Ae(a,t.length)}};function Rn(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),r=Math.trunc(a/60),l=a%60;return l===0?n+String(r):n+String(r)+t+Ae(l,2)}function In(e,t){return e%60===0?(e>0?"-":"+")+Ae(Math.abs(e)/60,2):Nt(e,t)}function Nt(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),r=Ae(Math.trunc(a/60),2),l=Ae(a%60,2);return n+r+t+l}const En=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},rr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},El=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],a=n[1],r=n[2];if(!r)return En(e,t);let l;switch(a){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",En(a,t)).replace("{{time}}",rr(r,t))},an={p:rr,P:El},Bl=/^D+$/,Nl=/^Y+$/,Ll=["D","DD","YY","YYYY"];function lr(e){return Bl.test(e)}function or(e){return Nl.test(e)}function nn(e,t,n){const a=Hl(e,t,n);if(console.warn(a),Ll.includes(e))throw new RangeError(a)}function Hl(e,t,n){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ql=/^'([^]*?)'?$/,Wl=/''/g,Ql=/[a-zA-Z]/;function kt(e,t,n){const a=Wt(),r=n?.locale??a.locale??nr,l=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,p=ve(e);if(!ua(p))throw new RangeError("Invalid time value");let c=t.match(Fl).map(m=>{const v=m[0];if(v==="p"||v==="P"){const h=an[v];return h(m,r.formatLong)}return m}).join("").match(Vl).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const v=m[0];if(v==="'")return{isToken:!1,value:zl(m)};if(Sn[v])return{isToken:!0,value:m};if(v.match(Ql))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:m}});r.localize.preprocessor&&(c=r.localize.preprocessor(p,c));const C={firstWeekContainsDate:l,weekStartsOn:i,locale:r};return c.map(m=>{if(!m.isToken)return m.value;const v=m.value;(!n?.useAdditionalWeekYearTokens&&or(v)||!n?.useAdditionalDayOfYearTokens&&lr(v))&&nn(v,t,String(e));const h=Sn[v[0]];return h(p,v,r.localize,C)}).join("")}function zl(e){const t=e.match(ql);return t?t[1].replace(Wl,"'"):e}function Ul(e){return ve(e).getDay()}function Xl(e){const t=ve(e),n=t.getFullYear(),a=t.getMonth(),r=Te(e,0);return r.setFullYear(n,a+1,0),r.setHours(0,0,0,0),r.getDate()}function Gl(){return Object.assign({},Wt())}function Tt(e){return ve(e).getHours()}function jl(e){let n=ve(e).getDay();return n===0&&(n=7),n}function Rt(e){return ve(e).getMinutes()}function xe(e){return ve(e).getMonth()}function jt(e){return ve(e).getSeconds()}function he(e){return ve(e).getFullYear()}function Kt(e,t){const n=ve(e),a=ve(t);return n.getTime()>a.getTime()}function pa(e,t){const n=ve(e),a=ve(t);return+n<+a}function Xt(e,t){const n=ve(e),a=ve(t);return+n==+a}function Kl(e,t){const n=t instanceof Date?Te(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const Jl=10;class ir{subPriority=0;validate(t,n){return!0}}class Zl extends ir{constructor(t,n,a,r,l){super(),this.value=t,this.validateValue=n,this.setValue=a,this.priority=r,l&&(this.subPriority=l)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,a){return this.setValue(t,n,this.value,a)}}class eo extends ir{priority=Jl;subPriority=-1;set(t,n){return n.timestampIsSet?t:Te(t,Kl(t,Date))}}class Pe{run(t,n,a,r){const l=this.parse(t,n,a,r);return l?{setter:new Zl(l.value,this.validate,this.set,this.priority,this.subPriority),rest:l.rest}:null}validate(t,n,a){return!0}}class to extends Pe{priority=140;parse(t,n,a){switch(n){case"G":case"GG":case"GGG":return a.era(t,{width:"abbreviated"})||a.era(t,{width:"narrow"});case"GGGGG":return a.era(t,{width:"narrow"});case"GGGG":default:return a.era(t,{width:"wide"})||a.era(t,{width:"abbreviated"})||a.era(t,{width:"narrow"})}}set(t,n,a){return n.era=a,t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const Le={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},bt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function He(e,t){return e&&{value:t(e.value),rest:e.rest}}function Re(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function wt(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const a=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,l=n[3]?parseInt(n[3],10):0,i=n[5]?parseInt(n[5],10):0;return{value:a*(r*jn+l*zr+i*Ur),rest:t.slice(n[0].length)}}function sr(e){return Re(Le.anyDigitsSigned,e)}function Ee(e,t){switch(e){case 1:return Re(Le.singleDigit,t);case 2:return Re(Le.twoDigits,t);case 3:return Re(Le.threeDigits,t);case 4:return Re(Le.fourDigits,t);default:return Re(new RegExp("^\\d{1,"+e+"}"),t)}}function Pa(e,t){switch(e){case 1:return Re(Le.singleDigitSigned,t);case 2:return Re(Le.twoDigitsSigned,t);case 3:return Re(Le.threeDigitsSigned,t);case 4:return Re(Le.fourDigitsSigned,t);default:return Re(new RegExp("^-?\\d{1,"+e+"}"),t)}}function mn(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function ur(e,t){const n=t>0,a=n?t:1-t;let r;if(a<=50)r=e||100;else{const l=a+50,i=Math.trunc(l/100)*100,p=e>=l%100;r=e+i-(p?100:0)}return n?r:1-r}function dr(e){return e%400===0||e%4===0&&e%100!==0}class ao extends Pe{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,a){const r=l=>({year:l,isTwoDigitYear:n==="yy"});switch(n){case"y":return He(Ee(4,t),r);case"yo":return He(a.ordinalNumber(t,{unit:"year"}),r);default:return He(Ee(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,a){const r=t.getFullYear();if(a.isTwoDigitYear){const i=ur(a.year,r);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const l=!("era"in n)||n.era===1?a.year:1-a.year;return t.setFullYear(l,0,1),t.setHours(0,0,0,0),t}}class no extends Pe{priority=130;parse(t,n,a){const r=l=>({year:l,isTwoDigitYear:n==="YY"});switch(n){case"Y":return He(Ee(4,t),r);case"Yo":return He(a.ordinalNumber(t,{unit:"year"}),r);default:return He(Ee(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,a,r){const l=cn(t,r);if(a.isTwoDigitYear){const p=ur(a.year,l);return t.setFullYear(p,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),ht(t,r)}const i=!("era"in n)||n.era===1?a.year:1-a.year;return t.setFullYear(i,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),ht(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ro extends Pe{priority=130;parse(t,n){return Pa(n==="R"?4:n.length,t)}set(t,n,a){const r=Te(t,0);return r.setFullYear(a,0,4),r.setHours(0,0,0,0),Gt(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class lo extends Pe{priority=130;parse(t,n){return Pa(n==="u"?4:n.length,t)}set(t,n,a){return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class oo extends Pe{priority=120;parse(t,n,a){switch(n){case"Q":case"QQ":return Ee(n.length,t);case"Qo":return a.ordinalNumber(t,{unit:"quarter"});case"QQQ":return a.quarter(t,{width:"abbreviated",context:"formatting"})||a.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(t,{width:"wide",context:"formatting"})||a.quarter(t,{width:"abbreviated",context:"formatting"})||a.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,a){return t.setMonth((a-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class io extends Pe{priority=120;parse(t,n,a){switch(n){case"q":case"qq":return Ee(n.length,t);case"qo":return a.ordinalNumber(t,{unit:"quarter"});case"qqq":return a.quarter(t,{width:"abbreviated",context:"standalone"})||a.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(t,{width:"wide",context:"standalone"})||a.quarter(t,{width:"abbreviated",context:"standalone"})||a.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,a){return t.setMonth((a-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class so extends Pe{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,a){const r=l=>l-1;switch(n){case"M":return He(Re(Le.month,t),r);case"MM":return He(Ee(2,t),r);case"Mo":return He(a.ordinalNumber(t,{unit:"month"}),r);case"MMM":return a.month(t,{width:"abbreviated",context:"formatting"})||a.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(t,{width:"wide",context:"formatting"})||a.month(t,{width:"abbreviated",context:"formatting"})||a.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.setMonth(a,1),t.setHours(0,0,0,0),t}}class uo extends Pe{priority=110;parse(t,n,a){const r=l=>l-1;switch(n){case"L":return He(Re(Le.month,t),r);case"LL":return He(Ee(2,t),r);case"Lo":return He(a.ordinalNumber(t,{unit:"month"}),r);case"LLL":return a.month(t,{width:"abbreviated",context:"standalone"})||a.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(t,{width:"wide",context:"standalone"})||a.month(t,{width:"abbreviated",context:"standalone"})||a.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.setMonth(a,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function co(e,t,n){const a=ve(e),r=vn(a,n)-t;return a.setDate(a.getDate()-r*7),a}class vo extends Pe{priority=100;parse(t,n,a){switch(n){case"w":return Re(Le.week,t);case"wo":return a.ordinalNumber(t,{unit:"week"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,a,r){return ht(co(t,a,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function mo(e,t){const n=ve(e),a=dn(n)-t;return n.setDate(n.getDate()-a*7),n}class po extends Pe{priority=100;parse(t,n,a){switch(n){case"I":return Re(Le.week,t);case"Io":return a.ordinalNumber(t,{unit:"week"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,a){return Gt(mo(t,a))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const fo=[31,28,31,30,31,30,31,31,30,31,30,31],ho=[31,29,31,30,31,30,31,31,30,31,30,31];class yo extends Pe{priority=90;subPriority=1;parse(t,n,a){switch(n){case"d":return Re(Le.date,t);case"do":return a.ordinalNumber(t,{unit:"date"});default:return Ee(n.length,t)}}validate(t,n){const a=t.getFullYear(),r=dr(a),l=t.getMonth();return r?n>=1&&n<=ho[l]:n>=1&&n<=fo[l]}set(t,n,a){return t.setDate(a),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class go extends Pe{priority=90;subpriority=1;parse(t,n,a){switch(n){case"D":case"DD":return Re(Le.dayOfYear,t);case"Do":return a.ordinalNumber(t,{unit:"date"});default:return Ee(n.length,t)}}validate(t,n){const a=t.getFullYear();return dr(a)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,a){return t.setMonth(0,a),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function pn(e,t,n){const a=Wt(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,l=ve(e),i=l.getDay(),c=(t%7+7)%7,C=7-r,m=t<0||t>6?t-(i+C)%7:(c+C)%7-(i+C)%7;return mt(l,m)}class bo extends Pe{priority=90;parse(t,n,a){switch(n){case"E":case"EE":case"EEE":return a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class wo extends Pe{priority=90;parse(t,n,a,r){const l=i=>{const p=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+p};switch(n){case"e":case"ee":return He(Ee(n.length,t),l);case"eo":return He(a.ordinalNumber(t,{unit:"day"}),l);case"eee":return a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"eeeee":return a.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class _o extends Pe{priority=90;parse(t,n,a,r){const l=i=>{const p=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+p};switch(n){case"c":case"cc":return He(Ee(n.length,t),l);case"co":return He(a.ordinalNumber(t,{unit:"day"}),l);case"ccc":return a.day(t,{width:"abbreviated",context:"standalone"})||a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"});case"ccccc":return a.day(t,{width:"narrow",context:"standalone"});case"cccccc":return a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(t,{width:"wide",context:"standalone"})||a.day(t,{width:"abbreviated",context:"standalone"})||a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function ko(e,t){const n=ve(e),a=jl(n),r=t-a;return mt(n,r)}class xo extends Pe{priority=90;parse(t,n,a){const r=l=>l===0?7:l;switch(n){case"i":case"ii":return Ee(n.length,t);case"io":return a.ordinalNumber(t,{unit:"day"});case"iii":return He(a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return He(a.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return He(a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r);case"iiii":default:return He(a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,n){return n>=1&&n<=7}set(t,n,a){return t=ko(t,a),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Mo extends Pe{priority=80;parse(t,n,a){switch(n){case"a":case"aa":case"aaa":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class Do extends Pe{priority=80;parse(t,n,a){switch(n){case"b":case"bb":case"bbb":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class To extends Pe{priority=80;parse(t,n,a){switch(n){case"B":case"BB":case"BBB":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class Po extends Pe{priority=70;parse(t,n,a){switch(n){case"h":return Re(Le.hour12h,t);case"ho":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,a){const r=t.getHours()>=12;return r&&a<12?t.setHours(a+12,0,0,0):!r&&a===12?t.setHours(0,0,0,0):t.setHours(a,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class Ao extends Pe{priority=70;parse(t,n,a){switch(n){case"H":return Re(Le.hour23h,t);case"Ho":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,a){return t.setHours(a,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class Co extends Pe{priority=70;parse(t,n,a){switch(n){case"K":return Re(Le.hour11h,t);case"Ko":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.getHours()>=12&&a<12?t.setHours(a+12,0,0,0):t.setHours(a,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Oo extends Pe{priority=70;parse(t,n,a){switch(n){case"k":return Re(Le.hour24h,t);case"ko":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,a){const r=a<=24?a%24:a;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class $o extends Pe{priority=60;parse(t,n,a){switch(n){case"m":return Re(Le.minute,t);case"mo":return a.ordinalNumber(t,{unit:"minute"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,a){return t.setMinutes(a,0,0),t}incompatibleTokens=["t","T"]}class Yo extends Pe{priority=50;parse(t,n,a){switch(n){case"s":return Re(Le.second,t);case"so":return a.ordinalNumber(t,{unit:"second"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,a){return t.setSeconds(a,0),t}incompatibleTokens=["t","T"]}class So extends Pe{priority=30;parse(t,n){const a=r=>Math.trunc(r*Math.pow(10,-n.length+3));return He(Ee(n.length,t),a)}set(t,n,a){return t.setMilliseconds(a),t}incompatibleTokens=["t","T"]}class Ro extends Pe{priority=10;parse(t,n){switch(n){case"X":return wt(bt.basicOptionalMinutes,t);case"XX":return wt(bt.basic,t);case"XXXX":return wt(bt.basicOptionalSeconds,t);case"XXXXX":return wt(bt.extendedOptionalSeconds,t);case"XXX":default:return wt(bt.extended,t)}}set(t,n,a){return n.timestampIsSet?t:Te(t,t.getTime()-Ta(t)-a)}incompatibleTokens=["t","T","x"]}class Io extends Pe{priority=10;parse(t,n){switch(n){case"x":return wt(bt.basicOptionalMinutes,t);case"xx":return wt(bt.basic,t);case"xxxx":return wt(bt.basicOptionalSeconds,t);case"xxxxx":return wt(bt.extendedOptionalSeconds,t);case"xxx":default:return wt(bt.extended,t)}}set(t,n,a){return n.timestampIsSet?t:Te(t,t.getTime()-Ta(t)-a)}incompatibleTokens=["t","T","X"]}class Eo extends Pe{priority=40;parse(t){return sr(t)}set(t,n,a){return[Te(t,a*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Bo extends Pe{priority=20;parse(t){return sr(t)}set(t,n,a){return[Te(t,a),{timestampIsSet:!0}]}incompatibleTokens="*"}const No={G:new to,y:new ao,Y:new no,R:new ro,u:new lo,Q:new oo,q:new io,M:new so,L:new uo,w:new vo,I:new po,d:new yo,D:new go,E:new bo,e:new wo,c:new _o,i:new xo,a:new Mo,b:new Do,B:new To,h:new Po,H:new Ao,K:new Co,k:new Oo,m:new $o,s:new Yo,S:new So,X:new Ro,x:new Io,t:new Eo,T:new Bo},Lo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ho=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vo=/^'([^]*?)'?$/,Fo=/''/g,qo=/\S/,Wo=/[a-zA-Z]/;function rn(e,t,n,a){const r=Gl(),l=a?.locale??r.locale??nr,i=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,p=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0;if(t==="")return e===""?ve(n):Te(n,NaN);const c={firstWeekContainsDate:i,weekStartsOn:p,locale:l},C=[new eo],m=t.match(Ho).map(f=>{const S=f[0];if(S in an){const I=an[S];return I(f,l.formatLong)}return f}).join("").match(Lo),v=[];for(let f of m){!a?.useAdditionalWeekYearTokens&&or(f)&&nn(f,t,e),!a?.useAdditionalDayOfYearTokens&&lr(f)&&nn(f,t,e);const S=f[0],I=No[S];if(I){const{incompatibleTokens:U}=I;if(Array.isArray(U)){const q=v.find(ae=>U.includes(ae.token)||ae.token===S);if(q)throw new RangeError(`The format string mustn't contain \`${q.fullToken}\` and \`${f}\` at the same time`)}else if(I.incompatibleTokens==="*"&&v.length>0)throw new RangeError(`The format string mustn't contain \`${f}\` and any other token at the same time`);v.push({token:S,fullToken:f});const A=I.run(e,f,l.match,c);if(!A)return Te(n,NaN);C.push(A.setter),e=A.rest}else{if(S.match(Wo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");if(f==="''"?f="'":S==="'"&&(f=Qo(f)),e.indexOf(f)===0)e=e.slice(f.length);else return Te(n,NaN)}}if(e.length>0&&qo.test(e))return Te(n,NaN);const h=C.map(f=>f.priority).sort((f,S)=>S-f).filter((f,S,I)=>I.indexOf(f)===S).map(f=>C.filter(S=>S.priority===f).sort((S,I)=>I.subPriority-S.subPriority)).map(f=>f[0]);let k=ve(n);if(isNaN(k.getTime()))return Te(n,NaN);const Y={};for(const f of h){if(!f.validate(k,c))return Te(n,NaN);const S=f.set(k,Y,c);Array.isArray(S)?(k=S[0],Object.assign(Y,S[1])):k=S}return Te(n,k)}function Qo(e){return e.match(Vo)[1].replace(Fo,"'")}function Bn(e,t){const n=Ht(e),a=Ht(t);return+n==+a}function zo(e,t){return mt(e,-t)}function cr(e,t){const n=ve(e),a=n.getFullYear(),r=n.getDate(),l=Te(e,0);l.setFullYear(a,t,15),l.setHours(0,0,0,0);const i=Xl(l);return n.setMonth(t,Math.min(r,i)),n}function Ce(e,t){let n=ve(e);return isNaN(+n)?Te(e,NaN):(t.year!=null&&n.setFullYear(t.year),t.month!=null&&(n=cr(n,t.month)),t.date!=null&&n.setDate(t.date),t.hours!=null&&n.setHours(t.hours),t.minutes!=null&&n.setMinutes(t.minutes),t.seconds!=null&&n.setSeconds(t.seconds),t.milliseconds!=null&&n.setMilliseconds(t.milliseconds),n)}function Uo(e,t){const n=ve(e);return n.setHours(t),n}function vr(e,t){const n=ve(e);return n.setMilliseconds(t),n}function Xo(e,t){const n=ve(e);return n.setMinutes(t),n}function mr(e,t){const n=ve(e);return n.setSeconds(t),n}function _t(e,t){const n=ve(e);return isNaN(+n)?Te(e,NaN):(n.setFullYear(t),n)}function Jt(e,t){return ft(e,-t)}function Go(e,t){const{years:n=0,months:a=0,weeks:r=0,days:l=0,hours:i=0,minutes:p=0,seconds:c=0}=t,C=Jt(e,a+n*12),m=zo(C,l+r*7),v=p+i*60,k=(c+v*60)*1e3;return Te(e,m.getTime()-k)}function pr(e,t){return un(e,-t)}function aa(){const e=Lr();return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img",...e},[ye("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),ye("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),ye("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),ye("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}aa.compatConfig={MODE:3};function fr(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),ye("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}fr.compatConfig={MODE:3};function fn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}fn.compatConfig={MODE:3};function hn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}hn.compatConfig={MODE:3};function yn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),ye("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}yn.compatConfig={MODE:3};function gn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}gn.compatConfig={MODE:3};function bn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}bn.compatConfig={MODE:3};const nt=(e,t)=>t?new Date(e.toLocaleString("en-US",{timeZone:t})):new Date(e),wn=(e,t,n)=>ln(e,t,n)||Q(),jo=(e,t,n)=>{const a=t.dateInTz?nt(new Date(e),t.dateInTz):Q(e);return n?tt(a,!0):a},ln=(e,t,n)=>{if(!e)return null;const a=n?tt(Q(e),!0):Q(e);return t?t.exactMatch?jo(e,t,n):nt(a,t.timezone):a},Ko=e=>{if(!e)return 0;const t=new Date,n=new Date(t.toLocaleString("en-US",{timeZone:"UTC"})),a=new Date(t.toLocaleString("en-US",{timeZone:e})),r=a.getTimezoneOffset()/60;return(+n-+a)/(1e3*60*60)-r};var vt=(e=>(e.month="month",e.year="year",e))(vt||{}),Lt=(e=>(e.top="top",e.bottom="bottom",e))(Lt||{}),Vt=(e=>(e.header="header",e.calendar="calendar",e.timePicker="timePicker",e))(Vt||{}),Xe=(e=>(e.month="month",e.year="year",e.calendar="calendar",e.time="time",e.minutes="minutes",e.hours="hours",e.seconds="seconds",e))(Xe||{});const Jo=["timestamp","date","iso"];var Ze=(e=>(e.up="up",e.down="down",e.left="left",e.right="right",e))(Ze||{}),$e=(e=>(e.arrowUp="ArrowUp",e.arrowDown="ArrowDown",e.arrowLeft="ArrowLeft",e.arrowRight="ArrowRight",e.enter="Enter",e.space=" ",e.esc="Escape",e.tab="Tab",e.home="Home",e.end="End",e.pageUp="PageUp",e.pageDown="PageDown",e))($e||{});function Nn(e){return t=>new Intl.DateTimeFormat(e,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${t}T00:00:00+00:00`)).slice(0,2)}function Zo(e){return t=>kt(nt(new Date(`2017-01-0${t}T00:00:00+00:00`),"UTC"),"EEEEEE",{locale:e})}const ei=(e,t,n)=>{const a=[1,2,3,4,5,6,7];let r;if(e!==null)try{r=a.map(Zo(e))}catch{r=a.map(Nn(t))}else r=a.map(Nn(t));const l=r.slice(0,n),i=r.slice(n+1,r.length);return[r[n]].concat(...i).concat(...l)},_n=(e,t,n)=>{const a=[];for(let r=+e[0];r<=+e[1];r++)a.push({value:+r,text:br(r,t)});return n?a.reverse():a},hr=(e,t,n)=>{const a=[1,2,3,4,5,6,7,8,9,10,11,12].map(l=>{const i=l<10?`0${l}`:l;return new Date(`2017-${i}-01T00:00:00+00:00`)});if(e!==null)try{const l=n==="long"?"LLLL":"LLL";return a.map((i,p)=>{const c=kt(nt(i,"UTC"),l,{locale:e});return{text:c.charAt(0).toUpperCase()+c.substring(1),value:p}})}catch{}const r=new Intl.DateTimeFormat(t,{month:n,timeZone:"UTC"});return a.map((l,i)=>{const p=r.format(l);return{text:p.charAt(0).toUpperCase()+p.substring(1),value:i}})},ti=e=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][e],Fe=e=>{const t=d(e);return t!=null&&t.$el?t?.$el:t},ai=e=>({type:"dot",...e??{}}),yr=e=>Array.isArray(e)?!!e[0]&&!!e[1]:!1,kn={prop:e=>`"${e}" prop must be enabled!`,dateArr:e=>`You need to use array as "model-value" binding in order to support "${e}"`},qe=e=>e,Ln=e=>e===0?e:!e||isNaN(+e)?null:+e,Hn=e=>e===null,gr=e=>{if(e)return[...e.querySelectorAll("input, button, select, textarea, a[href]")][0]},ni=e=>{const t=[],n=a=>a.filter(r=>r);for(let a=0;a{const a=n!=null,r=t!=null;if(!a&&!r)return!1;const l=+n,i=+t;return a&&r?+e>l||+el:r?+eni(e).map(n=>n.map(a=>{const{active:r,disabled:l,isBetween:i,highlighted:p}=t(a);return{...a,active:r,disabled:l,className:{dp__overlay_cell_active:r,dp__overlay_cell:!r,dp__overlay_cell_disabled:l,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:l&&r,dp__cell_in_between:i,"dp--highlighted":p}}})),Yt=(e,t,n=!1)=>{e&&t.allowStopPropagation&&(n&&e.stopImmediatePropagation(),e.stopPropagation())},ri=()=>["a[href]","area[href]","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","[tabindex]:not([tabindex='-1'])","[data-datepicker-instance]"].join(", ");function li(e,t){let n=[...document.querySelectorAll(ri())];n=n.filter(r=>!e.contains(r)||r.hasAttribute("data-datepicker-instance"));const a=n.indexOf(e);if(a>=0&&(t?a-1>=0:a+1<=n.length))return n[a+(t?-1:1)]}const on=(e,t)=>e?.querySelector(`[data-dp-element="${t}"]`),br=(e,t)=>new Intl.NumberFormat(t,{useGrouping:!1,style:"decimal"}).format(e),xn=e=>kt(e,"dd-MM-yyyy"),Qa=e=>Array.isArray(e),Aa=(e,t)=>t.get(xn(e)),oi=(e,t)=>e?t?t instanceof Map?!!Aa(e,t):t(Q(e)):!1:!0,et=(e,t,n=!1,a)=>{if(e.key===$e.enter||e.key===$e.space)return n&&e.preventDefault(),t();if(a)return a(e)},Vn=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].some(e=>navigator.userAgent.includes(e))||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Fn=(e,t,n,a,r,l)=>{const i=rn(e,t.slice(0,e.length),new Date,{locale:l});return ua(i)&&Zn(i)?a||r?i:Ce(i,{hours:+n.hours,minutes:+n?.minutes,seconds:+n?.seconds,milliseconds:0}):null},ii=(e,t,n,a,r,l)=>{const i=Array.isArray(n)?n[0]:n;if(typeof t=="string")return Fn(e,t,i,a,r,l);if(Array.isArray(t)){let p=null;for(const c of t)if(p=Fn(e,c,i,a,r,l),p)break;return p}return typeof t=="function"?t(e):null},Q=e=>e?new Date(e):new Date,si=(e,t,n)=>{if(t){const r=(e.getMonth()+1).toString().padStart(2,"0"),l=e.getDate().toString().padStart(2,"0"),i=e.getHours().toString().padStart(2,"0"),p=e.getMinutes().toString().padStart(2,"0"),c=n?e.getSeconds().toString().padStart(2,"0"):"00";return`${e.getFullYear()}-${r}-${l}T${i}:${p}:${c}.000Z`}const a=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return new Date(a).toISOString()},tt=(e,t)=>{const n=Q(JSON.parse(JSON.stringify(e))),a=Ce(n,{hours:0,minutes:0,seconds:0,milliseconds:0});return t?tl(a):a},St=(e,t,n,a)=>{let r=e?Q(e):Q();return(t||t===0)&&(r=Uo(r,+t)),(n||n===0)&&(r=Xo(r,+n)),(a||a===0)&&(r=mr(r,+a)),vr(r,0)},Ie=(e,t)=>!e||!t?!1:pa(tt(e),tt(t)),Me=(e,t)=>!e||!t?!1:Xt(tt(e),tt(t)),Ne=(e,t)=>!e||!t?!1:Kt(tt(e),tt(t)),$a=(e,t,n)=>e!=null&&e[0]&&e!=null&&e[1]?Ne(n,e[0])&&Ie(n,e[1]):e!=null&&e[0]&&t?Ne(n,e[0])&&Ie(n,t)||Ie(n,e[0])&&Ne(n,t):!1,pt=e=>{const t=Ce(new Date(e),{date:1});return tt(t)},za=(e,t,n)=>t&&(n||n===0)?Object.fromEntries(["hours","minutes","seconds"].map(a=>a===t?[a,n]:[a,isNaN(+e[a])?void 0:+e[a]])):{hours:isNaN(+e.hours)?void 0:+e.hours,minutes:isNaN(+e.minutes)?void 0:+e.minutes,seconds:isNaN(+e.seconds)?void 0:+e.seconds},Ft=e=>({hours:Tt(e),minutes:Rt(e),seconds:jt(e)}),wr=(e,t)=>{if(t){const n=he(Q(t));if(n>e)return 12;if(n===e)return xe(Q(t))}},_r=(e,t)=>{if(t){const n=he(Q(t));return n{if(e)return he(Q(e))},kr=(e,t)=>{const n=Ne(e,t)?t:e,a=Ne(t,e)?t:e;return er({start:n,end:a})},ui=e=>{const t=ft(e,1);return{month:xe(t),year:he(t)}},xt=(e,t)=>{const n=ht(e,{weekStartsOn:+t}),a=ar(e,{weekStartsOn:+t});return[n,a]},xr=(e,t)=>{const n={hours:Tt(Q()),minutes:Rt(Q()),seconds:t?jt(Q()):0};return Object.assign(n,e)},$t=(e,t,n)=>[Ce(Q(e),{date:1}),Ce(Q(),{month:t,year:n,date:1})],Mt=(e,t,n)=>{let a=e?Q(e):Q();return(t||t===0)&&(a=cr(a,t)),n&&(a=_t(a,n)),a},Mr=(e,t,n,a,r)=>{if(!a||r&&!t||!r&&!n)return!1;const l=r?ft(e,1):Jt(e,1),i=[xe(l),he(l)];return r?!ci(...i,t):!di(...i,n)},di=(e,t,n)=>Ie(...$t(n,e,t))||Me(...$t(n,e,t)),ci=(e,t,n)=>Ne(...$t(n,e,t))||Me(...$t(n,e,t)),Dr=(e,t,n,a,r,l,i)=>{if(typeof t=="function"&&!i)return t(e);const p=n?{locale:n}:void 0;return Array.isArray(e)?`${kt(e[0],l,p)}${r&&!e[1]?"":a}${e[1]?kt(e[1],l,p):""}`:kt(e,l,p)},zt=e=>{if(e)return null;throw new Error(kn.prop("partial-range"))},ka=(e,t)=>{if(t)return e();throw new Error(kn.prop("range"))},sn=e=>Array.isArray(e)?ua(e[0])&&(e[1]?ua(e[1]):!0):e?ua(e):!1,vi=(e,t)=>Ce(t??Q(),{hours:+e.hours||0,minutes:+e.minutes||0,seconds:+e.seconds||0}),Ua=(e,t,n,a)=>{if(!e)return!0;if(a){const r=n==="max"?pa(e,t):Kt(e,t),l={seconds:0,milliseconds:0};return r||Xt(Ce(e,l),Ce(t,l))}return n==="max"?e.getTime()<=t.getTime():e.getTime()>=t.getTime()},Xa=(e,t,n)=>e?vi(e,t):Q(n??t),qn=(e,t,n,a,r)=>{if(Array.isArray(a)){const i=Xa(e,a[0],t),p=Xa(e,a[1],t);return Ua(a[0],i,n,!!t)&&Ua(a[1],p,n,!!t)&&r}const l=Xa(e,a,t);return Ua(a,l,n,!!t)&&r},Ga=e=>Ce(Q(),Ft(e)),mi=(e,t)=>e instanceof Map?Array.from(e.values()).filter(n=>he(Q(n))===t).map(n=>xe(n)):[],Tr=(e,t,n)=>typeof e=="function"?e({month:t,year:n}):!!e.months.find(a=>a.month===t&&a.year===n),Mn=(e,t)=>typeof e=="function"?e(t):e.years.includes(t),Pr=e=>kt(e,"yyyy-MM-dd"),sa=ha({menuFocused:!1,shiftKeyInMenu:!1}),Ar=()=>{const e=n=>{sa.menuFocused=n},t=n=>{sa.shiftKeyInMenu!==n&&(sa.shiftKeyInMenu=n)};return{control:G(()=>({shiftKeyInMenu:sa.shiftKeyInMenu,menuFocused:sa.menuFocused})),setMenuFocused:e,setShiftKey:t}},Oe=ha({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),ja=Z(null),xa=Z(!1),Ka=Z(!1),Ja=Z(!1),Za=Z(!1),Ue=Z(0),Be=Z(0),It=()=>{const e=G(()=>xa.value?[...Oe.selectionGrid,Oe.actionRow].filter(v=>v.length):Ka.value?[...Oe.timePicker[0],...Oe.timePicker[1],Za.value?[]:[ja.value],Oe.actionRow].filter(v=>v.length):Ja.value?[...Oe.monthPicker,Oe.actionRow]:[Oe.monthYear,...Oe.calendar,Oe.time,Oe.actionRow].filter(v=>v.length)),t=v=>{Ue.value=v?Ue.value+1:Ue.value-1;let h=null;e.value[Be.value]&&(h=e.value[Be.value][Ue.value]),!h&&e.value[Be.value+(v?1:-1)]?(Be.value=Be.value+(v?1:-1),Ue.value=v?0:e.value[Be.value].length-1):h||(Ue.value=v?Ue.value-1:Ue.value+1)},n=v=>{Be.value===0&&!v||Be.value===e.value.length&&v||(Be.value=v?Be.value+1:Be.value-1,e.value[Be.value]?e.value[Be.value]&&!e.value[Be.value][Ue.value]&&Ue.value!==0&&(Ue.value=e.value[Be.value].length-1):Be.value=v?Be.value-1:Be.value+1)},a=v=>{let h=null;e.value[Be.value]&&(h=e.value[Be.value][Ue.value]),h?h.focus({preventScroll:!xa.value}):Ue.value=v?Ue.value-1:Ue.value+1},r=()=>{t(!0),a(!0)},l=()=>{t(!1),a(!1)},i=()=>{n(!1),a(!0)},p=()=>{n(!0),a(!0)},c=(v,h)=>{Oe[h]=v},C=(v,h)=>{Oe[h]=v},m=()=>{Ue.value=0,Be.value=0};return{buildMatrix:c,buildMultiLevelMatrix:C,setTimePickerBackRef:v=>{ja.value=v},setSelectionGrid:v=>{xa.value=v,m(),v||(Oe.selectionGrid=[])},setTimePicker:(v,h=!1)=>{Ka.value=v,Za.value=h,m(),v||(Oe.timePicker[0]=[],Oe.timePicker[1]=[])},setTimePickerElements:(v,h=0)=>{Oe.timePicker[h]=v},arrowRight:r,arrowLeft:l,arrowUp:i,arrowDown:p,clearArrowNav:()=>{Oe.monthYear=[],Oe.calendar=[],Oe.time=[],Oe.actionRow=[],Oe.selectionGrid=[],Oe.timePicker[0]=[],Oe.timePicker[1]=[],xa.value=!1,Ka.value=!1,Za.value=!1,Ja.value=!1,m(),ja.value=null},setMonthPicker:v=>{Ja.value=v,m()},refSets:Oe}},Wn=e=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...e??{}}),pi=e=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:t=>`Increment ${t}`,decrementValue:t=>`Decrement ${t}`,openTpOverlay:t=>`Open ${t} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:void 0,weekDay:void 0,clearInput:"Clear value",calendarIcon:"Calendar icon",timePicker:"Time picker",monthPicker:t=>`Month picker${t?" overlay":""}`,yearPicker:t=>`Year picker${t?" overlay":""}`,timeOverlay:t=>`${t} overlay`,...e??{}}),Qn=e=>e?typeof e=="boolean"?e?2:0:+e>=2?+e:2:0,fi=e=>{const t=typeof e=="object"&&e,n={static:!0,solo:!1};if(!e)return{...n,count:Qn(!1)};const a=t?e:{},r=t?a.count??!0:e,l=Qn(r);return Object.assign(n,a,{count:l})},hi=(e,t,n)=>e||(typeof n=="string"?n:t),yi=e=>typeof e=="boolean"?e?Wn({}):!1:Wn(e),gi=e=>{const t={enterSubmit:!0,tabSubmit:!0,openMenu:"open",selectOnFocus:!1,rangeSeparator:" - "};return typeof e=="object"?{...t,...e??{},enabled:!0}:{...t,enabled:e}},bi=e=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...e??{}}),wi=e=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...e??{}}),_i=e=>{const t={input:!1};return typeof e=="object"?{...t,...e??{},enabled:!0}:{enabled:e,...t}},ki=e=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,tabOutClosesMenu:!0,arrowLeft:void 0,keepViewOnOffsetClick:!1,timeArrowHoldThreshold:0,shadowDom:!1,...e??{}}),xi=e=>{const t={dates:Array.isArray(e)?e.map(n=>Q(n)):[],years:[],months:[],quarters:[],weeks:[],weekdays:[],options:{highlightDisabled:!1}};return typeof e=="function"?e:{...t,...e??{}}},Mi=e=>typeof e=="object"?{type:e?.type??"local",hideOnOffsetDates:e?.hideOnOffsetDates??!1}:{type:e,hideOnOffsetDates:!1},Di=e=>{const t={noDisabledRange:!1,showLastInRange:!0,minMaxRawRange:!1,partialRange:!0,disableTimeRangeValidation:!1,maxRange:void 0,minRange:void 0,autoRange:void 0,fixedStart:!1,fixedEnd:!1};return typeof e=="object"?{enabled:!0,...t,...e}:{enabled:e,...t}},Ti=e=>e?typeof e=="string"?{timezone:e,exactMatch:!1,dateInTz:void 0,emitTimezone:void 0,convertModel:!0}:{timezone:e.timezone,exactMatch:e.exactMatch??!1,dateInTz:e.dateInTz??void 0,emitTimezone:e.emitTimezone??void 0,convertModel:e.convertModel??!0}:{timezone:void 0,exactMatch:!1,emitTimezone:void 0},en=(e,t,n)=>new Map(e.map(a=>{const r=wn(a,t,n);return[xn(r),r]})),Pi=(e,t)=>e.length?new Map(e.map(n=>{const a=wn(n.date,t);return[xn(a),n]})):null,Ai=e=>{var t;return{minDate:ln(e.minDate,e.timezone,e.isSpecific),maxDate:ln(e.maxDate,e.timezone,e.isSpecific),disabledDates:Qa(e.disabledDates)?en(e.disabledDates,e.timezone,e.isSpecific):e.disabledDates,allowedDates:Qa(e.allowedDates)?en(e.allowedDates,e.timezone,e.isSpecific):null,highlight:typeof e.highlight=="object"&&Qa((t=e.highlight)==null?void 0:t.dates)?en(e.highlight.dates,e.timezone):e.highlight,markers:Pi(e.markers,e.timezone)}},Ci=e=>typeof e=="boolean"?{enabled:e,dragSelect:!0,limit:null}:{enabled:!!e,limit:e.limit?+e.limit:null,dragSelect:e.dragSelect??!0},Oi=e=>({...Object.fromEntries(Object.keys(e).map(t=>{const n=t,a=e[n],r=typeof e[n]=="string"?{[a]:!0}:Object.fromEntries(a.map(l=>[l,!0]));return[t,r]}))}),Se=e=>{const t=()=>{const E=e.enableSeconds?":ss":"",B=e.enableMinutes?":mm":"";return e.is24?`HH${B}${E}`:`hh${B}${E} aa`},n=()=>{var E;return e.format?e.format:e.monthPicker?"MM/yyyy":e.timePicker?t():e.weekPicker?`${((E=S.value)==null?void 0:E.type)==="iso"?"RR":"ww"}-yyyy`:e.yearPicker?"yyyy":e.quarterPicker?"QQQ/yyyy":e.enableTimePicker?`MM/dd/yyyy, ${t()}`:"MM/dd/yyyy"},a=E=>xr(E,e.enableSeconds),r=()=>q.value.enabled?e.startTime&&Array.isArray(e.startTime)?[a(e.startTime[0]),a(e.startTime[1])]:null:e.startTime&&!Array.isArray(e.startTime)?a(e.startTime):null,l=G(()=>fi(e.multiCalendars)),i=G(()=>r()),p=G(()=>pi(e.ariaLabels)),c=G(()=>bi(e.filters)),C=G(()=>yi(e.transitions)),m=G(()=>wi(e.actionRow)),v=G(()=>hi(e.previewFormat,e.format,n())),h=G(()=>gi(e.textInput)),k=G(()=>_i(e.inline)),Y=G(()=>ki(e.config)),f=G(()=>xi(e.highlight)),S=G(()=>Mi(e.weekNumbers)),I=G(()=>Ti(e.timezone)),U=G(()=>Ci(e.multiDates)),A=G(()=>Ai({minDate:e.minDate,maxDate:e.maxDate,disabledDates:e.disabledDates,allowedDates:e.allowedDates,highlight:f.value,markers:e.markers,timezone:I.value,isSpecific:e.monthPicker||e.yearPicker||e.quarterPicker})),q=G(()=>Di(e.range)),ae=G(()=>Oi(e.ui));return{defaultedTransitions:C,defaultedMultiCalendars:l,defaultedStartTime:i,defaultedAriaLabels:p,defaultedFilters:c,defaultedActionRow:m,defaultedPreviewFormat:v,defaultedTextInput:h,defaultedInline:k,defaultedConfig:Y,defaultedHighlight:f,defaultedWeekNumbers:S,defaultedRange:q,propDates:A,defaultedTz:I,defaultedMultiDates:U,defaultedUI:ae,getDefaultPattern:n,getDefaultStartTime:r}},$i=(e,t,n)=>{const a=Z(),{defaultedTextInput:r,defaultedRange:l,defaultedTz:i,defaultedMultiDates:p,getDefaultPattern:c}=Se(t),C=Z(""),m=ca(t,"format"),v=ca(t,"formatLocale");ct(a,()=>{typeof t.onInternalModelChange=="function"&&e("internal-model-change",a.value,z(!0))},{deep:!0}),ct(l,(u,le)=>{u.enabled!==le.enabled&&(a.value=null)}),ct(m,()=>{re()});const h=u=>i.value.timezone&&i.value.convertModel?nt(u,i.value.timezone):u,k=u=>{if(i.value.timezone&&i.value.convertModel){const le=Ko(i.value.timezone);return Xr(u,le)}return u},Y=(u,le,fe=!1)=>Dr(u,t.format,t.formatLocale,r.value.rangeSeparator,t.modelAuto,le??c(),fe),f=u=>u?t.modelType?b(u):{hours:Tt(u),minutes:Rt(u),seconds:t.enableSeconds?jt(u):0}:null,S=u=>t.modelType?b(u):{month:xe(u),year:he(u)},I=u=>Array.isArray(u)?p.value.enabled?u.map(le=>U(le,_t(Q(),le))):ka(()=>[_t(Q(),u[0]),u[1]?_t(Q(),u[1]):zt(l.value.partialRange)],l.value.enabled):_t(Q(),+u),U=(u,le)=>(typeof u=="string"||typeof u=="number")&&t.modelType?R(u):le,A=u=>Array.isArray(u)?[U(u[0],St(null,+u[0].hours,+u[0].minutes,u[0].seconds)),U(u[1],St(null,+u[1].hours,+u[1].minutes,u[1].seconds))]:U(u,St(null,u.hours,u.minutes,u.seconds)),q=u=>{const le=Ce(Q(),{date:1});return Array.isArray(u)?p.value.enabled?u.map(fe=>U(fe,Mt(le,+fe.month,+fe.year))):ka(()=>[U(u[0],Mt(le,+u[0].month,+u[0].year)),U(u[1],u[1]?Mt(le,+u[1].month,+u[1].year):zt(l.value.partialRange))],l.value.enabled):U(u,Mt(le,+u.month,+u.year))},ae=u=>{if(Array.isArray(u))return u.map(le=>R(le));throw new Error(kn.dateArr("multi-dates"))},E=u=>{if(Array.isArray(u)&&l.value.enabled){const le=u[0],fe=u[1];return[Q(Array.isArray(le)?le[0]:null),Array.isArray(fe)&&fe.length?Q(fe[0]):null]}return Q(u[0])},B=u=>t.modelAuto?Array.isArray(u)?[R(u[0]),R(u[1])]:t.autoApply?[R(u)]:[R(u),null]:Array.isArray(u)?ka(()=>u[1]?[R(u[0]),u[1]?R(u[1]):zt(l.value.partialRange)]:[R(u[0])],l.value.enabled):R(u),ne=()=>{Array.isArray(a.value)&&l.value.enabled&&a.value.length===1&&a.value.push(zt(l.value.partialRange))},F=()=>{const u=a.value;return[b(u[0]),u[1]?b(u[1]):zt(l.value.partialRange)]},N=()=>a.value[1]?F():b(qe(a.value[0])),ie=()=>(a.value||[]).map(u=>b(u)),ce=(u=!1)=>(u||ne(),t.modelAuto?N():p.value.enabled?ie():Array.isArray(a.value)?ka(()=>F(),l.value.enabled):b(qe(a.value))),pe=u=>!u||Array.isArray(u)&&!u.length?null:t.timePicker?A(qe(u)):t.monthPicker?q(qe(u)):t.yearPicker?I(qe(u)):p.value.enabled?ae(qe(u)):t.weekPicker?E(qe(u)):B(qe(u)),g=u=>{const le=pe(u);sn(qe(le))?(a.value=qe(le),re()):(a.value=null,C.value="")},D=()=>{const u=le=>kt(le,r.value.format);return`${u(a.value[0])} ${r.value.rangeSeparator} ${a.value[1]?u(a.value[1]):""}`},y=()=>n.value&&a.value?Array.isArray(a.value)?D():kt(a.value,r.value.format):Y(a.value),H=()=>a.value?p.value.enabled?a.value.map(u=>Y(u)).join("; "):r.value.enabled&&typeof r.value.format=="string"?y():Y(a.value):"",re=()=>{!t.format||typeof t.format=="string"||r.value.enabled&&typeof r.value.format=="string"?C.value=H():C.value=t.format(a.value)},R=u=>{if(t.utc){const le=new Date(u);return t.utc==="preserve"?new Date(le.getTime()+le.getTimezoneOffset()*6e4):le}return t.modelType?Jo.includes(t.modelType)?h(new Date(u)):t.modelType==="format"&&(typeof t.format=="string"||!t.format)?h(rn(u,c(),new Date,{locale:v.value})):h(rn(u,t.modelType,new Date,{locale:v.value})):h(new Date(u))},b=u=>u?t.utc?si(u,t.utc==="preserve",t.enableSeconds):t.modelType?t.modelType==="timestamp"?+k(u):t.modelType==="iso"?k(u).toISOString():t.modelType==="format"&&(typeof t.format=="string"||!t.format)?Y(k(u)):Y(k(u),t.modelType,!0):k(u):"",oe=(u,le=!1,fe=!1)=>{if(fe)return u;if(e("update:model-value",u),i.value.emitTimezone&&le){const Ve=Array.isArray(u)?u.map(T=>nt(qe(T),i.value.emitTimezone)):nt(qe(u),i.value.emitTimezone);e("update:model-timezone-value",Ve)}},V=u=>Array.isArray(a.value)?p.value.enabled?a.value.map(le=>u(le)):[u(a.value[0]),a.value[1]?u(a.value[1]):zt(l.value.partialRange)]:u(qe(a.value)),M=()=>{if(Array.isArray(a.value)){const u=xt(a.value[0],t.weekStart),le=a.value[1]?xt(a.value[1],t.weekStart):[];return[u.map(fe=>Q(fe)),le.map(fe=>Q(fe))]}return xt(a.value,t.weekStart).map(u=>Q(u))},o=(u,le)=>oe(qe(V(u)),!1,le),w=u=>{const le=M();return u?le:e("update:model-value",M())},z=(u=!1)=>(u||re(),t.monthPicker?o(S,u):t.timePicker?o(f,u):t.yearPicker?o(he,u):t.weekPicker?w(u):oe(ce(u),!0,u));return{inputValue:C,internalModelValue:a,checkBeforeEmit:()=>a.value?l.value.enabled?l.value.partialRange?a.value.length>=1:a.value.length===2:!!a.value:!1,parseExternalModelValue:g,formatInputValue:re,emitModelValue:z}},Yi=(e,t)=>{const{defaultedFilters:n,propDates:a}=Se(e),{validateMonthYearInRange:r}=Et(e),l=(m,v)=>{let h=m;return n.value.months.includes(xe(h))?(h=v?ft(m,1):Jt(m,1),l(h,v)):h},i=(m,v)=>{let h=m;return n.value.years.includes(he(h))?(h=v?un(m,1):pr(m,1),i(h,v)):h},p=(m,v=!1)=>{const h=Ce(Q(),{month:e.month,year:e.year});let k=m?ft(h,1):Jt(h,1);e.disableYearSelect&&(k=_t(k,e.year));let Y=xe(k),f=he(k);n.value.months.includes(Y)&&(k=l(k,m),Y=xe(k),f=he(k)),n.value.years.includes(f)&&(k=i(k,m),f=he(k)),r(Y,f,m,e.preventMinMaxNavigation)&&c(Y,f,v)},c=(m,v,h)=>{t("update-month-year",{month:m,year:v,fromNav:h})},C=G(()=>m=>Mr(Ce(Q(),{month:e.month,year:e.year}),a.value.maxDate,a.value.minDate,e.preventMinMaxNavigation,m));return{handleMonthYearChange:p,isDisabled:C,updateMonthYear:c}},Ya={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:Boolean,default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:[String,Object],default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},highlight:{type:[Function,Object],default:null},teleport:{type:[Boolean,String,Object],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function,Object],default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:[Object,Boolean],default:!1},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:[Boolean,Object],default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1},yearFirst:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},onInternalModelChange:{type:[Function,Object],default:null},enableMinutes:{type:Boolean,default:!0},ui:{type:Object,default:()=>({})}},yt={...Ya,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},menuWrapRef:{type:Object,default:null},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},Si=["title"],Ri=["disabled"],Ii=ze({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...yt},emits:["close-picker","select-date","select-now","invalid-select"],setup(e,{emit:t}){const n=t,a=e,{defaultedActionRow:r,defaultedPreviewFormat:l,defaultedMultiCalendars:i,defaultedTextInput:p,defaultedInline:c,defaultedRange:C,defaultedMultiDates:m}=Se(a),{isTimeValid:v,isMonthValid:h}=Et(a),{buildMatrix:k}=It(),Y=Z(null),f=Z(null),S=Z(!1),I=Z({}),U=Z(null),A=Z(null);Ke(()=>{a.arrowNavigation&&k([Fe(Y),Fe(f)],"actionRow"),q(),window.addEventListener("resize",q)}),Ca(()=>{window.removeEventListener("resize",q)});const q=()=>{S.value=!1,setTimeout(()=>{var g,D;const y=(g=U.value)==null?void 0:g.getBoundingClientRect(),H=(D=A.value)==null?void 0:D.getBoundingClientRect();y&&H&&(I.value.maxWidth=`${H.width-y.width-20}px`),S.value=!0},0)},ae=G(()=>C.value.enabled&&!C.value.partialRange&&a.internalModelValue?a.internalModelValue.length===2:!0),E=G(()=>!v.value(a.internalModelValue)||!h.value(a.internalModelValue)||!ae.value),B=()=>{const g=l.value;return a.timePicker||a.monthPicker,g(qe(a.internalModelValue))},ne=()=>{const g=a.internalModelValue;return i.value.count>0?`${F(g[0])} - ${F(g[1])}`:[F(g[0]),F(g[1])]},F=g=>Dr(g,l.value,a.formatLocale,p.value.rangeSeparator,a.modelAuto,l.value),N=G(()=>!a.internalModelValue||!a.menuMount?"":typeof l.value=="string"?Array.isArray(a.internalModelValue)?a.internalModelValue.length===2&&a.internalModelValue[1]?ne():m.value.enabled?a.internalModelValue.map(g=>`${F(g)}`):a.modelAuto?`${F(a.internalModelValue[0])}`:`${F(a.internalModelValue[0])} -`:F(a.internalModelValue):B()),ie=()=>m.value.enabled?"; ":" - ",ce=G(()=>Array.isArray(N.value)?N.value.join(ie()):N.value),pe=()=>{v.value(a.internalModelValue)&&h.value(a.internalModelValue)&&ae.value?n("select-date"):n("invalid-select")};return(g,D)=>(P(),W("div",{ref_key:"actionRowRef",ref:A,class:"dp__action_row"},[g.$slots["action-row"]?ue(g.$slots,"action-row",We(Qe({key:0},{internalModelValue:g.internalModelValue,disabled:E.value,selectDate:()=>g.$emit("select-date"),closePicker:()=>g.$emit("close-picker")}))):(P(),W(we,{key:1},[d(r).showPreview?(P(),W("div",{key:0,class:"dp__selection_preview",title:ce.value,style:dt(I.value)},[g.$slots["action-preview"]&&S.value?ue(g.$slots,"action-preview",{key:0,value:g.internalModelValue}):j("",!0),!g.$slots["action-preview"]&&S.value?(P(),W(we,{key:1},[Dt(Ge(ce.value),1)],64)):j("",!0)],12,Si)):j("",!0),ye("div",{ref_key:"actionBtnContainer",ref:U,class:"dp__action_buttons","data-dp-element":"action-row"},[g.$slots["action-buttons"]?ue(g.$slots,"action-buttons",{key:0,value:g.internalModelValue}):j("",!0),g.$slots["action-buttons"]?j("",!0):(P(),W(we,{key:1},[!d(c).enabled&&d(r).showCancel?(P(),W("button",{key:0,ref_key:"cancelButtonRef",ref:Y,type:"button",class:"dp__action_button dp__action_cancel",onClick:D[0]||(D[0]=y=>g.$emit("close-picker")),onKeydown:D[1]||(D[1]=y=>d(et)(y,()=>g.$emit("close-picker")))},Ge(g.cancelText),545)):j("",!0),d(r).showNow?(P(),W("button",{key:1,type:"button",class:"dp__action_button dp__action_cancel",onClick:D[2]||(D[2]=y=>g.$emit("select-now")),onKeydown:D[3]||(D[3]=y=>d(et)(y,()=>g.$emit("select-now")))},Ge(g.nowButtonLabel),33)):j("",!0),d(r).showSelect?(P(),W("button",{key:2,ref_key:"selectButtonRef",ref:f,type:"button",class:"dp__action_button dp__action_select",disabled:E.value,"data-test":"select-button",onKeydown:D[4]||(D[4]=y=>d(et)(y,()=>pe())),onClick:pe},Ge(g.selectText),41,Ri)):j("",!0)],64))],512)],64))],512))}}),Ei=["role","aria-label","tabindex"],Bi={class:"dp__selection_grid_header"},Ni=["aria-selected","aria-disabled","data-test","onClick","onKeydown","onMouseover"],Li=["aria-label"],ya=ze({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean},focusValue:{},menuWrapRef:{},ariaLabels:{},overlayLabel:{}},emits:["selected","toggle","reset-flow","hover-value"],setup(e,{expose:t,emit:n}){const{setSelectionGrid:a,buildMultiLevelMatrix:r,setMonthPicker:l}=It(),i=n,p=e,{defaultedAriaLabels:c,defaultedTextInput:C,defaultedConfig:m}=Se(p),{hideNavigationButtons:v}=Ia(),h=Z(!1),k=Z(null),Y=Z(null),f=Z([]),S=Z(),I=Z(null),U=Z(0),A=Z(null);Hr(()=>{k.value=null}),Ke(()=>{it().then(()=>ie()),p.noOverlayFocus||ae(),q(!0)}),Ca(()=>q(!1));const q=V=>{var M;p.arrowNavigation&&((M=p.headerRefs)!=null&&M.length?l(V):a(V))},ae=()=>{var V;const M=Fe(Y);M&&(C.value.enabled||(k.value?(V=k.value)==null||V.focus({preventScroll:!0}):M.focus({preventScroll:!0})),h.value=M.clientHeight({dp__overlay:!0,"dp--overlay-absolute":!p.useRelative,"dp--overlay-relative":p.useRelative})),B=G(()=>p.useRelative?{height:`${p.height}px`,width:"var(--dp-menu-min-width)"}:void 0),ne=G(()=>({dp__overlay_col:!0})),F=G(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:h.value,dp__button_bottom:p.isLast})),N=G(()=>{var V,M;return{dp__overlay_container:!0,dp__container_flex:((V=p.items)==null?void 0:V.length)<=6,dp__container_block:((M=p.items)==null?void 0:M.length)>6}});ct(()=>p.items,()=>ie(!1),{deep:!0});const ie=(V=!0)=>{it().then(()=>{const M=Fe(k),o=Fe(Y),w=Fe(I),z=Fe(A),u=w?w.getBoundingClientRect().height:0;o&&(o.getBoundingClientRect().height?U.value=o.getBoundingClientRect().height-u:U.value=m.value.modeHeight-u),M&&z&&V&&(z.scrollTop=M.offsetTop-z.offsetTop-(U.value/2-M.getBoundingClientRect().height)-u)})},ce=V=>{V.disabled||i("selected",V.value)},pe=()=>{i("toggle"),i("reset-flow")},g=()=>{p.escClose&&pe()},D=(V,M,o,w)=>{V&&((M.active||M.value===p.focusValue)&&(k.value=V),p.arrowNavigation&&(Array.isArray(f.value[o])?f.value[o][w]=V:f.value[o]=[V],y()))},y=()=>{var V,M;const o=(V=p.headerRefs)!=null&&V.length?[p.headerRefs].concat(f.value):f.value.concat([p.skipButtonRef?[]:[I.value]]);r(qe(o),(M=p.headerRefs)!=null&&M.length?"monthPicker":"selectionGrid")},H=V=>{p.arrowNavigation||Yt(V,m.value,!0)},re=V=>{S.value=V,i("hover-value",V)},R=()=>{if(pe(),!p.isLast){const V=on(p.menuWrapRef??null,"action-row");if(V){const M=gr(V);M?.focus()}}},b=V=>{switch(V.key){case $e.esc:return g();case $e.arrowLeft:return H(V);case $e.arrowRight:return H(V);case $e.arrowUp:return H(V);case $e.arrowDown:return H(V);default:return}},oe=V=>{if(V.key===$e.enter)return pe();if(V.key===$e.tab)return R()};return t({focusGrid:ae}),(V,M)=>{var o;return P(),W("div",{ref_key:"gridWrapRef",ref:Y,class:ke(E.value),style:dt(B.value),role:V.useRelative?void 0:"dialog","aria-label":V.overlayLabel,tabindex:V.useRelative?void 0:"0",onKeydown:b,onClick:M[0]||(M[0]=va(()=>{},["prevent"]))},[ye("div",{ref_key:"containerRef",ref:A,class:ke(N.value),style:dt({"--dp-overlay-height":`${U.value}px`}),role:"grid"},[ye("div",Bi,[ue(V.$slots,"header")]),V.$slots.overlay?ue(V.$slots,"overlay",{key:0}):(P(!0),W(we,{key:1},Ye(V.items,(w,z)=>(P(),W("div",{key:z,class:ke(["dp__overlay_row",{dp__flex_row:V.items.length>=3}]),role:"row"},[(P(!0),W(we,null,Ye(w,(u,le)=>(P(),W("div",{key:u.value,ref_for:!0,ref:fe=>D(fe,u,z,le),role:"gridcell",class:ke(ne.value),"aria-selected":u.active||void 0,"aria-disabled":u.disabled||void 0,tabindex:"0","data-test":u.text,onClick:va(fe=>ce(u),["prevent"]),onKeydown:fe=>d(et)(fe,()=>ce(u),!0),onMouseover:fe=>re(u.value)},[ye("div",{class:ke(u.className)},[V.$slots.item?ue(V.$slots,"item",{key:0,item:u}):j("",!0),V.$slots.item?j("",!0):(P(),W(we,{key:1},[Dt(Ge(u.text),1)],64))],2)],42,Ni))),128))],2))),128))],6),V.$slots["button-icon"]?Ma((P(),W("button",{key:0,ref_key:"toggleButton",ref:I,type:"button","aria-label":(o=d(c))==null?void 0:o.toggleOverlay,class:ke(F.value),tabindex:"0",onClick:pe,onKeydown:oe},[ue(V.$slots,"button-icon")],42,Li)),[[Da,!d(v)(V.hideNavigation,V.type)]]):j("",!0)],46,Ei)}}}),Sa=ze({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean},collapse:{type:Boolean}},setup(e){const t=e,n=G(()=>t.multiCalendars>0?[...Array(t.multiCalendars).keys()]:[0]),a=G(()=>({dp__instance_calendar:t.multiCalendars>0}));return(r,l)=>(P(),W("div",{class:ke({dp__menu_inner:!r.stretch,"dp--menu--inner-stretched":r.stretch,dp__flex_display:r.multiCalendars>0,"dp--flex-display-collapsed":r.collapse})},[(P(!0),W(we,null,Ye(n.value,(i,p)=>(P(),W("div",{key:i,class:ke(a.value)},[ue(r.$slots,"default",{instance:i,index:p})],2))),128))],2))}}),Hi=["data-dp-element","aria-label","aria-disabled"],da=ze({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},elName:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(e,{emit:t}){const n=t,a=Z(null);return Ke(()=>n("set-ref",a)),(r,l)=>(P(),W("button",{ref_key:"elRef",ref:a,type:"button","data-dp-element":r.elName,class:"dp__btn dp--arrow-btn-nav",tabindex:"0","aria-label":r.ariaLabel,"aria-disabled":r.disabled||void 0,onClick:l[0]||(l[0]=i=>r.$emit("activate")),onKeydown:l[1]||(l[1]=i=>d(et)(i,()=>r.$emit("activate"),!0))},[ye("span",{class:ke(["dp__inner_nav",{dp__inner_nav_disabled:r.disabled}])},[ue(r.$slots,"default")],2)],40,Hi))}}),Vi=["aria-label","data-test"],Cr=ze({__name:"YearModePicker",props:{...yt,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(e,{emit:t}){const n=t,a=e,{showRightIcon:r,showLeftIcon:l}=Ia(),{defaultedConfig:i,defaultedMultiCalendars:p,defaultedAriaLabels:c,defaultedTransitions:C,defaultedUI:m}=Se(a),{showTransition:v,transitionName:h}=ga(C),k=Z(!1),Y=(I=!1,U)=>{k.value=!k.value,n("toggle-year-picker",{flow:I,show:U})},f=I=>{k.value=!1,n("year-select",I)},S=(I=!1)=>{n("handle-year",I)};return(I,U)=>{var A,q,ae,E,B;return P(),W(we,null,[ye("div",{class:ke(["dp--year-mode-picker",{"dp--hidden-el":k.value}])},[d(l)(d(p),e.instance)?(P(),De(da,{key:0,ref:"mpPrevIconRef","aria-label":(A=d(c))==null?void 0:A.prevYear,disabled:e.isDisabled(!1),class:ke((q=d(m))==null?void 0:q.navBtnPrev),onActivate:U[0]||(U[0]=ne=>S(!1))},{default:_e(()=>[I.$slots["arrow-left"]?ue(I.$slots,"arrow-left",{key:0}):j("",!0),I.$slots["arrow-left"]?j("",!0):(P(),De(d(fn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),ye("button",{ref:"mpYearButtonRef",class:"dp__btn dp--year-select",type:"button","aria-label":`${e.year}-${(ae=d(c))==null?void 0:ae.openYearsOverlay}`,"data-test":`year-mode-btn-${e.instance}`,onClick:U[1]||(U[1]=()=>Y(!1)),onKeydown:U[2]||(U[2]=Vr(()=>Y(!1),["enter"]))},[I.$slots.year?ue(I.$slots,"year",{key:0,year:e.year}):j("",!0),I.$slots.year?j("",!0):(P(),W(we,{key:1},[Dt(Ge(e.year),1)],64))],40,Vi),d(r)(d(p),e.instance)?(P(),De(da,{key:1,ref:"mpNextIconRef","aria-label":(E=d(c))==null?void 0:E.nextYear,disabled:e.isDisabled(!0),class:ke((B=d(m))==null?void 0:B.navBtnNext),onActivate:U[3]||(U[3]=ne=>S(!0))},{default:_e(()=>[I.$slots["arrow-right"]?ue(I.$slots,"arrow-right",{key:0}):j("",!0),I.$slots["arrow-right"]?j("",!0):(P(),De(d(hn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0)],2),ot(ta,{name:d(h)(e.showYearPicker),css:d(v)},{default:_e(()=>{var ne,F;return[e.showYearPicker?(P(),De(ya,{key:0,items:e.items,"text-input":I.textInput,"esc-close":I.escClose,config:I.config,"is-last":I.autoApply&&!d(i).keepActionRow,"hide-navigation":I.hideNavigation,"aria-labels":I.ariaLabels,"overlay-label":(F=(ne=d(c))==null?void 0:ne.yearPicker)==null?void 0:F.call(ne,!0),type:"year",onToggle:Y,onSelected:U[4]||(U[4]=N=>f(N))},je({"button-icon":_e(()=>[I.$slots["calendar-icon"]?ue(I.$slots,"calendar-icon",{key:0}):j("",!0),I.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))]),_:2},[I.$slots["year-overlay-value"]?{name:"item",fn:_e(({item:N})=>[ue(I.$slots,"year-overlay-value",{text:N.text,value:N.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last","hide-navigation","aria-labels","overlay-label"])):j("",!0)]}),_:3},8,["name","css"])],64)}}}),Dn=(e,t,n)=>{if(t.value&&Array.isArray(t.value))if(t.value.some(a=>Me(e,a))){const a=t.value.filter(r=>!Me(r,e));t.value=a.length?a:null}else(n&&+n>t.value.length||!n)&&t.value.push(e);else t.value=[e]},Tn=(e,t,n)=>{let a=e.value?e.value.slice():[];return a.length===2&&a[1]!==null&&(a=[]),a.length?Ie(t,a[0])?(a.unshift(t),n("range-start",a[0]),n("range-start",a[1])):(a[1]=t,n("range-end",t)):(a=[t],n("range-start",t)),a},Ra=(e,t,n,a)=>{e&&(e[0]&&e[1]&&n&&t("auto-apply"),e[0]&&!e[1]&&a&&n&&t("auto-apply"))},Or=e=>{Array.isArray(e.value)&&e.value.length<=2&&e.range?e.modelValue.value=e.value.map(t=>nt(Q(t),e.timezone)):Array.isArray(e.value)||(e.modelValue.value=nt(Q(e.value),e.timezone))},$r=(e,t,n,a)=>Array.isArray(t.value)&&(t.value.length===2||t.value.length===1&&a.value.partialRange)?a.value.fixedStart&&(Ne(e,t.value[0])||Me(e,t.value[0]))?[t.value[0],e]:a.value.fixedEnd&&(Ie(e,t.value[1])||Me(e,t.value[1]))?[e,t.value[1]]:(n("invalid-fixed-range",e),t.value):[],Yr=({multiCalendars:e,range:t,highlight:n,propDates:a,calendars:r,modelValue:l,props:i,filters:p,year:c,month:C,emit:m})=>{const v=G(()=>_n(i.yearRange,i.locale,i.reverseYears)),h=Z([!1]),k=G(()=>(N,ie)=>{const ce=Ce(pt(new Date),{month:C.value(N),year:c.value(N)}),pe=ie?tr(ce):ma(ce);return Mr(pe,a.value.maxDate,a.value.minDate,i.preventMinMaxNavigation,ie)}),Y=()=>Array.isArray(l.value)&&e.value.solo&&l.value[1],f=()=>{for(let N=0;N{if(!N)return f();const ie=Ce(Q(),r.value[N]);return r.value[0].year=he(pr(ie,e.value.count-1)),f()},I=(N,ie)=>{const ce=Zr(ie,N);return t.value.showLastInRange&&ce>1?ie:N},U=N=>i.focusStartDate||e.value.solo?N[0]:N[1]?I(N[0],N[1]):N[0],A=()=>{if(l.value){const N=Array.isArray(l.value)?U(l.value):l.value;r.value[0]={month:xe(N),year:he(N)}}},q=()=>{A(),e.value.count&&f()};ct(l,(N,ie)=>{i.isTextInputDate&&JSON.stringify(N??{})!==JSON.stringify(ie??{})&&q()}),Ke(()=>{q()});const ae=(N,ie)=>{r.value[ie].year=N,m("update-month-year",{instance:ie,year:N,month:r.value[ie].month}),e.value.count&&!e.value.solo&&S(ie)},E=G(()=>N=>Zt(v.value,ie=>{var ce;const pe=c.value(N)===ie.value,g=fa(ie.value,ea(a.value.minDate),ea(a.value.maxDate))||((ce=p.value.years)==null?void 0:ce.includes(c.value(N))),D=Mn(n.value,ie.value);return{active:pe,disabled:g,highlighted:D}})),B=(N,ie)=>{ae(N,ie),F(ie)},ne=(N,ie=!1)=>{if(!k.value(N,ie)){const ce=ie?c.value(N)+1:c.value(N)-1;ae(ce,N)}},F=(N,ie=!1,ce)=>{ie||m("reset-flow"),ce!==void 0?h.value[N]=ce:h.value[N]=!h.value[N],h.value[N]?m("overlay-toggle",{open:!0,overlay:Xe.year}):(m("overlay-closed"),m("overlay-toggle",{open:!1,overlay:Xe.year}))};return{isDisabled:k,groupedYears:E,showYearPicker:h,selectYear:ae,toggleYearPicker:F,handleYearSelect:B,handleYear:ne}},Fi=(e,t)=>{const{defaultedMultiCalendars:n,defaultedAriaLabels:a,defaultedTransitions:r,defaultedConfig:l,defaultedRange:i,defaultedHighlight:p,propDates:c,defaultedTz:C,defaultedFilters:m,defaultedMultiDates:v}=Se(e),h=()=>{e.isTextInputDate&&q(he(Q(e.startDate)),0)},{modelValue:k,year:Y,month:f,calendars:S}=ba(e,t,h),I=G(()=>hr(e.formatLocale,e.locale,e.monthNameFormat)),U=Z(null),{checkMinMaxRange:A}=Et(e),{selectYear:q,groupedYears:ae,showYearPicker:E,toggleYearPicker:B,handleYearSelect:ne,handleYear:F,isDisabled:N}=Yr({modelValue:k,multiCalendars:n,range:i,highlight:p,calendars:S,year:Y,propDates:c,month:f,filters:m,props:e,emit:t});Ke(()=>{e.startDate&&(k.value&&e.focusStartDate||!k.value)&&q(he(Q(e.startDate)),0)});const ie=o=>o?{month:xe(o),year:he(o)}:{month:null,year:null},ce=()=>k.value?Array.isArray(k.value)?k.value.map(o=>ie(o)):ie(k.value):ie(),pe=(o,w)=>{const z=S.value[o],u=ce();return Array.isArray(u)?u.some(le=>le.year===z?.year&&le.month===w):z?.year===u.year&&w===u.month},g=(o,w,z)=>{var u,le;const fe=ce();return Array.isArray(fe)?Y.value(w)===((u=fe[z])==null?void 0:u.year)&&o===((le=fe[z])==null?void 0:le.month):!1},D=(o,w)=>{if(i.value.enabled){const z=ce();if(Array.isArray(k.value)&&Array.isArray(z)){const u=g(o,w,0)||g(o,w,1),le=Mt(pt(Q()),o,Y.value(w));return $a(k.value,U.value,le)&&!u}return!1}return!1},y=G(()=>o=>Zt(I.value,w=>{var z;const u=pe(o,w.value),le=fa(w.value,wr(Y.value(o),c.value.minDate),_r(Y.value(o),c.value.maxDate))||mi(c.value.disabledDates,Y.value(o)).includes(w.value)||((z=m.value.months)==null?void 0:z.includes(w.value)),fe=D(w.value,o),Ve=Tr(p.value,w.value,Y.value(o));return{active:u,disabled:le,isBetween:fe,highlighted:Ve}})),H=(o,w)=>Mt(pt(Q()),o,Y.value(w)),re=(o,w)=>{const z=k.value?k.value:pt(new Date);k.value=Mt(z,o,Y.value(w)),t("auto-apply"),t("update-flow-step")},R=(o,w)=>{const z=H(o,w);i.value.fixedEnd||i.value.fixedStart?k.value=$r(z,k,t,i):k.value?A(z,k.value)&&(k.value=Tn(k,H(o,w),t)):k.value=[H(o,w)],it().then(()=>{Ra(k.value,t,e.autoApply,e.modelAuto)})},b=(o,w)=>{Dn(H(o,w),k,v.value.limit),t("auto-apply",!0)},oe=(o,w)=>(S.value[w].month=o,M(w,S.value[w].year,o),v.value.enabled?b(o,w):i.value.enabled?R(o,w):re(o,w)),V=(o,w)=>{q(o,w),M(w,o,null)},M=(o,w,z)=>{let u=z;if(!u&&u!==0){const le=ce();u=Array.isArray(le)?le[o].month:le.month}t("update-month-year",{instance:o,year:w,month:u})};return{groupedMonths:y,groupedYears:ae,year:Y,isDisabled:N,defaultedMultiCalendars:n,defaultedAriaLabels:a,defaultedTransitions:r,defaultedConfig:l,showYearPicker:E,modelValue:k,presetDate:(o,w)=>{Or({value:o,modelValue:k,range:i.value.enabled,timezone:w?void 0:C.value.timezone}),t("auto-apply")},setHoverDate:(o,w)=>{U.value=H(o,w)},selectMonth:oe,selectYear:V,toggleYearPicker:B,handleYearSelect:ne,handleYear:F,getModelMonthYear:ce}},qi=ze({compatConfig:{MODE:3},__name:"MonthPicker",props:{...yt},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year","update-flow-step","mount","invalid-fixed-range","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=qt(),l=lt(r,"yearMode"),i=e;Ke(()=>{i.shadow||a("mount",null)});const{groupedMonths:p,groupedYears:c,year:C,isDisabled:m,defaultedMultiCalendars:v,defaultedConfig:h,showYearPicker:k,modelValue:Y,presetDate:f,setHoverDate:S,selectMonth:I,selectYear:U,toggleYearPicker:A,handleYearSelect:q,handleYear:ae,getModelMonthYear:E}=Fi(i,a);return t({getSidebarProps:()=>({modelValue:Y,year:C,getModelMonthYear:E,selectMonth:I,selectYear:U,handleYear:ae}),presetDate:f,toggleYearPicker:B=>A(0,B)}),(B,ne)=>(P(),De(Sa,{"multi-calendars":d(v).count,collapse:B.collapse,stretch:""},{default:_e(({instance:F})=>[B.$slots["top-extra"]?ue(B.$slots,"top-extra",{key:0,value:B.internalModelValue}):j("",!0),B.$slots["month-year"]?ue(B.$slots,"month-year",We(Qe({key:1},{year:d(C),months:d(p)(F),years:d(c)(F),selectMonth:d(I),selectYear:d(U),instance:F}))):(P(),De(ya,{key:2,items:d(p)(F),"arrow-navigation":B.arrowNavigation,"is-last":B.autoApply&&!d(h).keepActionRow,"esc-close":B.escClose,height:d(h).modeHeight,config:B.config,"no-overlay-focus":!!(B.noOverlayFocus||B.textInput),"use-relative":"",type:"month",onSelected:N=>d(I)(N,F),onHoverValue:N=>d(S)(N,F)},je({header:_e(()=>[ot(Cr,Qe(B.$props,{items:d(c)(F),instance:F,"show-year-picker":d(k)[F],year:d(C)(F),"is-disabled":N=>d(m)(F,N),onHandleYear:N=>d(ae)(F,N),onYearSelect:N=>d(q)(N,F),onToggleYearPicker:N=>d(A)(F,N?.flow,N?.show)}),je({_:2},[Ye(d(l),(N,ie)=>({name:N,fn:_e(ce=>[ue(B.$slots,N,We(at(ce)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},[B.$slots["month-overlay-value"]?{name:"item",fn:_e(({item:N})=>[ue(B.$slots,"month-overlay-value",{text:N.text,value:N.value})]),key:"0"}:void 0]),1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars","collapse"]))}}),Wi=(e,t)=>{const n=()=>{e.isTextInputDate&&(m.value=he(Q(e.startDate)))},{modelValue:a}=ba(e,t,n),r=Z(null),{defaultedHighlight:l,defaultedMultiDates:i,defaultedFilters:p,defaultedRange:c,propDates:C}=Se(e),m=Z();Ke(()=>{e.startDate&&(a.value&&e.focusStartDate||!a.value)&&(m.value=he(Q(e.startDate)))});const v=f=>Array.isArray(a.value)?a.value.some(S=>he(S)===f):a.value?he(a.value)===f:!1,h=f=>c.value.enabled&&Array.isArray(a.value)?$a(a.value,r.value,Y(f)):!1,k=G(()=>Zt(_n(e.yearRange,e.locale,e.reverseYears),f=>{const S=v(f.value),I=fa(f.value,ea(C.value.minDate),ea(C.value.maxDate))||p.value.years.includes(f.value),U=h(f.value)&&!S,A=Mn(l.value,f.value);return{active:S,disabled:I,isBetween:U,highlighted:A}})),Y=f=>_t(pt(ma(new Date)),f);return{groupedYears:k,modelValue:a,focusYear:m,setHoverValue:f=>{r.value=_t(pt(new Date),f)},selectYear:f=>{var S;if(t("update-month-year",{instance:0,year:f}),i.value.enabled)return a.value?Array.isArray(a.value)&&(((S=a.value)==null?void 0:S.map(I=>he(I))).includes(f)?a.value=a.value.filter(I=>he(I)!==f):a.value.push(_t(tt(Q()),f))):a.value=[_t(tt(ma(Q())),f)],t("auto-apply",!0);c.value.enabled?(a.value=Tn(a,Y(f),t),it().then(()=>{Ra(a.value,t,e.autoApply,e.modelAuto)})):(a.value=Y(f),t("auto-apply"))}}},Qi=ze({compatConfig:{MODE:3},__name:"YearPicker",props:{...yt},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply","update-month-year"],setup(e,{expose:t,emit:n}){const a=n,r=e,{groupedYears:l,modelValue:i,focusYear:p,selectYear:c,setHoverValue:C}=Wi(r,a),{defaultedConfig:m}=Se(r);return t({getSidebarProps:()=>({modelValue:i,selectYear:c})}),(v,h)=>(P(),W("div",null,[v.$slots["top-extra"]?ue(v.$slots,"top-extra",{key:0,value:v.internalModelValue}):j("",!0),v.$slots["month-year"]?ue(v.$slots,"month-year",We(Qe({key:1},{years:d(l),selectYear:d(c)}))):(P(),De(ya,{key:2,items:d(l),"is-last":v.autoApply&&!d(m).keepActionRow,height:d(m).modeHeight,config:v.config,"no-overlay-focus":!!(v.noOverlayFocus||v.textInput),"focus-value":d(p),type:"year","use-relative":"",onSelected:d(c),onHoverValue:d(C)},je({_:2},[v.$slots["year-overlay-value"]?{name:"item",fn:_e(({item:k})=>[ue(v.$slots,"year-overlay-value",{text:k.text,value:k.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","focus-value","onSelected","onHoverValue"]))]))}}),zi={key:0,class:"dp__time_input"},Ui=["data-test","aria-label","onKeydown","onClick","onMousedown"],Xi=["aria-label","disabled","data-test","onKeydown","onClick"],Gi=["data-test","aria-label","onKeydown","onClick","onMousedown"],ji={key:0},Ki=["aria-label"],Ji=ze({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...yt},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","overlay-opened","am-pm-change"],setup(e,{expose:t,emit:n}){const a=n,r=e,{setTimePickerElements:l,setTimePickerBackRef:i}=It(),{defaultedAriaLabels:p,defaultedTransitions:c,defaultedFilters:C,defaultedConfig:m,defaultedRange:v}=Se(r),{transitionName:h,showTransition:k}=ga(c),Y=ha({hours:!1,minutes:!1,seconds:!1}),f=Z("AM"),S=Z(null),I=Z([]),U=Z(),A=Z(!1);Ke(()=>{a("mounted")});const q=s=>Ce(new Date,{hours:s.hours,minutes:s.minutes,seconds:r.enableSeconds?s.seconds:0,milliseconds:0}),ae=G(()=>s=>H(s,r[s])||B(s,r[s])),E=G(()=>({hours:r.hours,minutes:r.minutes,seconds:r.seconds})),B=(s,L)=>v.value.enabled&&!v.value.disableTimeRangeValidation?!r.validateTime(s,L):!1,ne=(s,L)=>{if(v.value.enabled&&!v.value.disableTimeRangeValidation){const J=L?+r[`${s}Increment`]:-+r[`${s}Increment`],$=r[s]+J;return!r.validateTime(s,$)}return!1},F=G(()=>s=>!V(+r[s]+ +r[`${s}Increment`],s)||ne(s,!0)),N=G(()=>s=>!V(+r[s]-+r[`${s}Increment`],s)||ne(s,!1)),ie=(s,L)=>Xn(Ce(Q(),s),L),ce=(s,L)=>Go(Ce(Q(),s),L),pe=G(()=>({dp__time_col:!0,dp__time_col_block:!r.timePickerInline,dp__time_col_reg_block:!r.enableSeconds&&r.is24&&!r.timePickerInline,dp__time_col_reg_inline:!r.enableSeconds&&r.is24&&r.timePickerInline,dp__time_col_reg_with_button:!r.enableSeconds&&!r.is24,dp__time_col_sec:r.enableSeconds&&r.is24,dp__time_col_sec_with_button:r.enableSeconds&&!r.is24})),g=G(()=>{const s=[{type:"hours"}];return r.enableMinutes&&s.push({type:"",separator:!0},{type:"minutes"}),r.enableSeconds&&s.push({type:"",separator:!0},{type:"seconds"}),s}),D=G(()=>g.value.filter(s=>!s.separator)),y=G(()=>s=>{if(s==="hours"){const L=le(+r.hours);return{text:L<10?`0${L}`:`${L}`,value:L}}return{text:r[s]<10?`0${r[s]}`:`${r[s]}`,value:r[s]}}),H=(s,L)=>{var J;if(!r.disabledTimesConfig)return!1;const $=r.disabledTimesConfig(r.order,s==="hours"?L:void 0);return $[s]?!!((J=$[s])!=null&&J.includes(L)):!0},re=(s,L)=>L!=="hours"||f.value==="AM"?s:s+12,R=s=>{const L=r.is24?24:12,J=s==="hours"?L:60,$=+r[`${s}GridIncrement`],ge=s==="hours"&&!r.is24?$:0,x=[];for(let X=ge;X({active:!1,disabled:C.value.times[s].includes(X.value)||!V(X.value,s)||H(s,X.value)||B(s,X.value)}))},b=s=>s>=0?s:59,oe=s=>s>=0?s:23,V=(s,L)=>{const J=r.minTime?q(za(r.minTime)):null,$=r.maxTime?q(za(r.maxTime)):null,ge=q(za(E.value,L,L==="minutes"||L==="seconds"?b(s):oe(s)));return J&&$?(pa(ge,$)||Xt(ge,$))&&(Kt(ge,J)||Xt(ge,J)):J?Kt(ge,J)||Xt(ge,J):$?pa(ge,$)||Xt(ge,$):!0},M=s=>r[`no${s[0].toUpperCase()+s.slice(1)}Overlay`],o=s=>{M(s)||(Y[s]=!Y[s],Y[s]?(A.value=!0,a("overlay-opened",s)):(A.value=!1,a("overlay-closed",s)))},w=s=>s==="hours"?Tt:s==="minutes"?Rt:jt,z=()=>{U.value&&clearTimeout(U.value)},u=(s,L=!0,J)=>{const $=L?ie:ce,ge=L?+r[`${s}Increment`]:-+r[`${s}Increment`];V(+r[s]+ge,s)&&a(`update:${s}`,w(s)($({[s]:+r[s]},{[s]:+r[`${s}Increment`]}))),!(J!=null&&J.keyboard)&&m.value.timeArrowHoldThreshold&&(U.value=setTimeout(()=>{u(s,L)},m.value.timeArrowHoldThreshold))},le=s=>r.is24?s:(s>=12?f.value="PM":f.value="AM",ti(s)),fe=()=>{f.value==="PM"?(f.value="AM",a("update:hours",r.hours-12)):(f.value="PM",a("update:hours",r.hours+12)),a("am-pm-change",f.value)},Ve=s=>{Y[s]=!0},T=(s,L,J)=>{if(s&&r.arrowNavigation){Array.isArray(I.value[L])?I.value[L][J]=s:I.value[L]=[s];const $=I.value.reduce((ge,x)=>x.map((X,de)=>[...ge[de]||[],x[de]]),[]);i(r.closeTimePickerBtn),S.value&&($[1]=$[1].concat(S.value)),l($,r.order)}},K=(s,L)=>(o(s),a(`update:${s}`,L));return t({openChildCmp:Ve}),(s,L)=>{var J;return s.disabled?j("",!0):(P(),W("div",zi,[(P(!0),W(we,null,Ye(g.value,($,ge)=>{var x,X,de;return P(),W("div",{key:ge,class:ke(pe.value)},[$.separator?(P(),W(we,{key:0},[A.value?j("",!0):(P(),W(we,{key:0},[Dt(":")],64))],64)):(P(),W(we,{key:1},[ye("button",{ref_for:!0,ref:be=>T(be,ge,0),type:"button",class:ke({dp__btn:!0,dp__inc_dec_button:!s.timePickerInline,dp__inc_dec_button_inline:s.timePickerInline,dp__tp_inline_btn_top:s.timePickerInline,dp__inc_dec_button_disabled:F.value($.type),"dp--hidden-el":A.value}),"data-test":`${$.type}-time-inc-btn-${r.order}`,"aria-label":(x=d(p))==null?void 0:x.incrementValue($.type),tabindex:"0",onKeydown:be=>d(et)(be,()=>u($.type,!0,{keyboard:!0}),!0),onClick:be=>d(m).timeArrowHoldThreshold?void 0:u($.type,!0),onMousedown:be=>d(m).timeArrowHoldThreshold?u($.type,!0):void 0,onMouseup:z},[r.timePickerInline?(P(),W(we,{key:1},[s.$slots["tp-inline-arrow-up"]?ue(s.$slots,"tp-inline-arrow-up",{key:0}):(P(),W(we,{key:1},[L[2]||(L[2]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),L[3]||(L[3]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(P(),W(we,{key:0},[s.$slots["arrow-up"]?ue(s.$slots,"arrow-up",{key:0}):j("",!0),s.$slots["arrow-up"]?j("",!0):(P(),De(d(gn),{key:1}))],64))],42,Ui),ye("button",{ref_for:!0,ref:be=>T(be,ge,1),type:"button","aria-label":`${y.value($.type).text}-${(X=d(p))==null?void 0:X.openTpOverlay($.type)}`,class:ke({dp__time_display:!0,dp__time_display_block:!s.timePickerInline,dp__time_display_inline:s.timePickerInline,"dp--time-invalid":ae.value($.type),"dp--time-overlay-btn":!ae.value($.type),"dp--hidden-el":A.value}),disabled:M($.type),tabindex:"0","data-test":`${$.type}-toggle-overlay-btn-${r.order}`,onKeydown:be=>d(et)(be,()=>o($.type),!0),onClick:be=>o($.type)},[s.$slots[$.type]?ue(s.$slots,$.type,{key:0,text:y.value($.type).text,value:y.value($.type).value}):j("",!0),s.$slots[$.type]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(y.value($.type).text),1)],64))],42,Xi),ye("button",{ref_for:!0,ref:be=>T(be,ge,2),type:"button",class:ke({dp__btn:!0,dp__inc_dec_button:!s.timePickerInline,dp__inc_dec_button_inline:s.timePickerInline,dp__tp_inline_btn_bottom:s.timePickerInline,dp__inc_dec_button_disabled:N.value($.type),"dp--hidden-el":A.value}),"data-test":`${$.type}-time-dec-btn-${r.order}`,"aria-label":(de=d(p))==null?void 0:de.decrementValue($.type),tabindex:"0",onKeydown:be=>d(et)(be,()=>u($.type,!1,{keyboard:!0}),!0),onClick:be=>d(m).timeArrowHoldThreshold?void 0:u($.type,!1),onMousedown:be=>d(m).timeArrowHoldThreshold?u($.type,!1):void 0,onMouseup:z},[r.timePickerInline?(P(),W(we,{key:1},[s.$slots["tp-inline-arrow-down"]?ue(s.$slots,"tp-inline-arrow-down",{key:0}):(P(),W(we,{key:1},[L[4]||(L[4]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),L[5]||(L[5]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(P(),W(we,{key:0},[s.$slots["arrow-down"]?ue(s.$slots,"arrow-down",{key:0}):j("",!0),s.$slots["arrow-down"]?j("",!0):(P(),De(d(bn),{key:1}))],64))],42,Gi)],64))],2)}),128)),s.is24?j("",!0):(P(),W("div",ji,[s.$slots["am-pm-button"]?ue(s.$slots,"am-pm-button",{key:0,toggle:fe,value:f.value}):j("",!0),s.$slots["am-pm-button"]?j("",!0):(P(),W("button",{key:1,ref_key:"amPmButton",ref:S,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(J=d(p))==null?void 0:J.amPmButton,tabindex:"0",onClick:fe,onKeydown:L[0]||(L[0]=$=>d(et)($,()=>fe(),!0))},Ge(f.value),41,Ki))])),(P(!0),W(we,null,Ye(D.value,($,ge)=>(P(),De(ta,{key:ge,name:d(h)(Y[$.type]),css:d(k)},{default:_e(()=>{var x,X;return[Y[$.type]?(P(),De(ya,{key:0,items:R($.type),"is-last":s.autoApply&&!d(m).keepActionRow,"esc-close":s.escClose,type:$.type,"text-input":s.textInput,config:s.config,"arrow-navigation":s.arrowNavigation,"aria-labels":s.ariaLabels,"overlay-label":(X=(x=d(p)).timeOverlay)==null?void 0:X.call(x,$.type),onSelected:de=>K($.type,de),onToggle:de=>o($.type),onResetFlow:L[1]||(L[1]=de=>s.$emit("reset-flow"))},je({"button-icon":_e(()=>[s.$slots["clock-icon"]?ue(s.$slots,"clock-icon",{key:0}):j("",!0),s.$slots["clock-icon"]?j("",!0):(P(),De(Oa(s.timePickerInline?d(aa):d(yn)),{key:1}))]),_:2},[s.$slots[`${$.type}-overlay-value`]?{name:"item",fn:_e(({item:de})=>[ue(s.$slots,`${$.type}-overlay-value`,{text:de.text,value:de.value})]),key:"0"}:void 0,s.$slots[`${$.type}-overlay-header`]?{name:"header",fn:_e(()=>[ue(s.$slots,`${$.type}-overlay-header`,{toggle:()=>o($.type)})]),key:"1"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","aria-labels","overlay-label","onSelected","onToggle"])):j("",!0)]}),_:2},1032,["name","css"]))),128))]))}}}),Zi={class:"dp--tp-wrap"},es=["aria-label","tabindex"],ts=["role","aria-label","tabindex"],as=["aria-label"],Sr=ze({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...yt},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(e,{expose:t,emit:n}){const a=n,r=e,{buildMatrix:l,setTimePicker:i}=It(),p=qt(),{defaultedTransitions:c,defaultedAriaLabels:C,defaultedTextInput:m,defaultedConfig:v,defaultedRange:h}=Se(r),{transitionName:k,showTransition:Y}=ga(c),{hideNavigationButtons:f}=Ia(),S=Z(null),I=Z(null),U=Z([]),A=Z(null),q=Z(!1);Ke(()=>{a("mount"),!r.timePicker&&r.arrowNavigation?l([Fe(S.value)],"time"):i(!0,r.timePicker)});const ae=G(()=>h.value.enabled&&r.modelAuto?yr(r.internalModelValue):!0),E=Z(!1),B=R=>({hours:Array.isArray(r.hours)?r.hours[R]:r.hours,minutes:Array.isArray(r.minutes)?r.minutes[R]:r.minutes,seconds:Array.isArray(r.seconds)?r.seconds[R]:r.seconds}),ne=G(()=>{const R=[];if(h.value.enabled)for(let b=0;b<2;b++)R.push(B(b));else R.push(B(0));return R}),F=(R,b=!1,oe="")=>{b||a("reset-flow"),E.value=R,a(R?"overlay-opened":"overlay-closed",Xe.time),r.arrowNavigation&&i(R),it(()=>{oe!==""&&U.value[0]&&U.value[0].openChildCmp(oe)})},N=G(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:r.autoApply&&!v.value.keepActionRow})),ie=lt(p,"timePicker"),ce=(R,b,oe)=>h.value.enabled?b===0?[R,ne.value[1][oe]]:[ne.value[0][oe],R]:R,pe=R=>{a("update:hours",R)},g=R=>{a("update:minutes",R)},D=R=>{a("update:seconds",R)},y=()=>{if(A.value&&!m.value.enabled&&!r.noOverlayFocus){const R=gr(A.value);R&&R.focus({preventScroll:!0})}},H=R=>{q.value=!1,a("overlay-closed",R)},re=R=>{q.value=!0,a("overlay-opened",R)};return t({toggleTimePicker:F}),(R,b)=>{var oe;return P(),W("div",Zi,[!R.timePicker&&!R.timePickerInline?Ma((P(),W("button",{key:0,ref_key:"openTimePickerBtn",ref:S,type:"button",class:ke({...N.value,"dp--hidden-el":E.value}),"aria-label":(oe=d(C))==null?void 0:oe.openTimePicker,tabindex:R.noOverlayFocus?void 0:0,"data-test":"open-time-picker-btn",onKeydown:b[0]||(b[0]=V=>d(et)(V,()=>F(!0))),onClick:b[1]||(b[1]=V=>F(!0))},[R.$slots["clock-icon"]?ue(R.$slots,"clock-icon",{key:0}):j("",!0),R.$slots["clock-icon"]?j("",!0):(P(),De(d(yn),{key:1}))],42,es)),[[Da,!d(f)(R.hideNavigation,"time")]]):j("",!0),ot(ta,{name:d(k)(E.value),css:d(Y)&&!R.timePickerInline},{default:_e(()=>{var V,M;return[E.value||R.timePicker||R.timePickerInline?(P(),W("div",{key:0,ref_key:"overlayRef",ref:A,role:R.timePickerInline?void 0:"dialog",class:ke({dp__overlay:!R.timePickerInline,"dp--overlay-absolute":!r.timePicker&&!R.timePickerInline,"dp--overlay-relative":r.timePicker}),style:dt(R.timePicker?{height:`${d(v).modeHeight}px`}:void 0),"aria-label":(V=d(C))==null?void 0:V.timePicker,tabindex:R.timePickerInline?void 0:0},[ye("div",{class:ke(R.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[R.$slots["time-picker-overlay"]?ue(R.$slots,"time-picker-overlay",{key:0,hours:e.hours,minutes:e.minutes,seconds:e.seconds,setHours:pe,setMinutes:g,setSeconds:D}):j("",!0),R.$slots["time-picker-overlay"]?j("",!0):(P(),W("div",{key:1,class:ke(R.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(P(!0),W(we,null,Ye(ne.value,(o,w)=>Ma((P(),De(Ji,Qe({key:w,ref_for:!0},{...R.$props,order:w,hours:o.hours,minutes:o.minutes,seconds:o.seconds,closeTimePickerBtn:I.value,disabledTimesConfig:e.disabledTimesConfig,disabled:w===0?d(h).fixedStart:d(h).fixedEnd},{ref_for:!0,ref_key:"timeInputRefs",ref:U,"validate-time":(z,u)=>e.validateTime(z,ce(u,w,z)),"onUpdate:hours":z=>pe(ce(z,w,"hours")),"onUpdate:minutes":z=>g(ce(z,w,"minutes")),"onUpdate:seconds":z=>D(ce(z,w,"seconds")),onMounted:y,onOverlayClosed:H,onOverlayOpened:re,onAmPmChange:b[2]||(b[2]=z=>R.$emit("am-pm-change",z))}),je({_:2},[Ye(d(ie),(z,u)=>({name:z,fn:_e(le=>[ue(R.$slots,z,Qe({ref_for:!0},le))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[Da,w===0?!0:ae.value]])),128))],2)),!R.timePicker&&!R.timePickerInline?Ma((P(),W("button",{key:2,ref_key:"closeTimePickerBtn",ref:I,type:"button",class:ke({...N.value,"dp--hidden-el":q.value}),"aria-label":(M=d(C))==null?void 0:M.closeTimePicker,tabindex:"0",onKeydown:b[3]||(b[3]=o=>d(et)(o,()=>F(!1))),onClick:b[4]||(b[4]=o=>F(!1))},[R.$slots["calendar-icon"]?ue(R.$slots,"calendar-icon",{key:0}):j("",!0),R.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))],42,as)),[[Da,!d(f)(R.hideNavigation,"time")]]):j("",!0)],2)],14,ts)):j("",!0)]}),_:3},8,["name","css"])])}}}),Rr=(e,t,n,a)=>{const{defaultedRange:r}=Se(e),l=(A,q)=>Array.isArray(t[A])?t[A][q]:t[A],i=A=>e.enableSeconds?Array.isArray(t.seconds)?t.seconds[A]:t.seconds:0,p=(A,q)=>A?q!==void 0?St(A,l("hours",q),l("minutes",q),i(q)):St(A,t.hours,t.minutes,i()):mr(Q(),i(q)),c=(A,q)=>{t[A]=q},C=G(()=>e.modelAuto&&r.value.enabled?Array.isArray(n.value)?n.value.length>1:!1:r.value.enabled),m=(A,q)=>{const ae=Object.fromEntries(Object.keys(t).map(E=>E===A?[E,q]:[E,t[E]].slice()));if(C.value&&!r.value.disableTimeRangeValidation){const E=ne=>n.value?St(n.value[ne],ae.hours[ne],ae.minutes[ne],ae.seconds[ne]):null,B=ne=>vr(n.value[ne],0);return!(Me(E(0),E(1))&&(Kt(E(0),B(1))||pa(E(1),B(0))))}return!0},v=(A,q)=>{m(A,q)&&(c(A,q),a&&a())},h=A=>{v("hours",A)},k=A=>{v("minutes",A)},Y=A=>{v("seconds",A)},f=(A,q,ae,E)=>{q&&h(A),!q&&!ae&&k(A),ae&&Y(A),n.value&&E(n.value)},S=A=>{if(A){const q=Array.isArray(A),ae=q?[+A[0].hours,+A[1].hours]:+A.hours,E=q?[+A[0].minutes,+A[1].minutes]:+A.minutes,B=q?[+A[0].seconds,+A[1].seconds]:+A.seconds;c("hours",ae),c("minutes",E),e.enableSeconds&&c("seconds",B)}},I=(A,q)=>{const ae={hours:Array.isArray(t.hours)?t.hours[A]:t.hours,disabledArr:[]};return(q||q===0)&&(ae.hours=q),Array.isArray(e.disabledTimes)&&(ae.disabledArr=r.value.enabled&&Array.isArray(e.disabledTimes[A])?e.disabledTimes[A]:e.disabledTimes),ae},U=G(()=>(A,q)=>{var ae;if(Array.isArray(e.disabledTimes)){const{disabledArr:E,hours:B}=I(A,q),ne=E.filter(F=>+F.hours===B);return((ae=ne[0])==null?void 0:ae.minutes)==="*"?{hours:[B],minutes:void 0,seconds:void 0}:{hours:[],minutes:ne?.map(F=>+F.minutes)??[],seconds:ne?.map(F=>F.seconds?+F.seconds:void 0)??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:c,updateHours:h,updateMinutes:k,updateSeconds:Y,getSetDateTime:p,updateTimeValues:f,getSecondsValue:i,assignStartTime:S,validateTime:m,disabledTimesConfig:U}},ns=(e,t)=>{const n=()=>{e.isTextInputDate&&q()},{modelValue:a,time:r}=ba(e,t,n),{defaultedStartTime:l,defaultedRange:i,defaultedTz:p}=Se(e),{updateTimeValues:c,getSetDateTime:C,setTime:m,assignStartTime:v,disabledTimesConfig:h,validateTime:k}=Rr(e,r,a,Y);function Y(){t("update-flow-step")}const f=E=>{const{hours:B,minutes:ne,seconds:F}=E;return{hours:+B,minutes:+ne,seconds:F?+F:0}},S=()=>{if(e.startTime){if(Array.isArray(e.startTime)){const B=f(e.startTime[0]),ne=f(e.startTime[1]);return[Ce(Q(),B),Ce(Q(),ne)]}const E=f(e.startTime);return Ce(Q(),E)}return i.value.enabled?[null,null]:null},I=()=>{if(i.value.enabled){const[E,B]=S();a.value=[nt(C(E,0),p.value.timezone),nt(C(B,1),p.value.timezone)]}else a.value=nt(C(S()),p.value.timezone)},U=E=>Array.isArray(E)?[Ft(Q(E[0])),Ft(Q(E[1]))]:[Ft(E??Q())],A=(E,B,ne)=>{m("hours",E),m("minutes",B),m("seconds",e.enableSeconds?ne:0)},q=()=>{const[E,B]=U(a.value);return i.value.enabled?A([E.hours,B.hours],[E.minutes,B.minutes],[E.seconds,B.seconds]):A(E.hours,E.minutes,E.seconds)};Ke(()=>{if(!e.shadow)return v(l.value),a.value?q():I()});const ae=()=>{Array.isArray(a.value)?a.value=a.value.map((E,B)=>E&&C(E,B)):a.value=C(a.value),t("time-update")};return{modelValue:a,time:r,disabledTimesConfig:h,updateTime:(E,B=!0,ne=!1)=>{c(E,B,ne,ae)},validateTime:k}},rs=ze({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...yt},emits:["update:internal-model-value","time-update","am-pm-change","mount","reset-flow","update-flow-step","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=lt(l,"timePicker"),p=Z(null),{time:c,modelValue:C,disabledTimesConfig:m,updateTime:v,validateTime:h}=ns(r,a);return Ke(()=>{r.shadow||a("mount",null)}),t({getSidebarProps:()=>({modelValue:C,time:c,updateTime:v}),toggleTimePicker:(k,Y=!1,f="")=>{var S;(S=p.value)==null||S.toggleTimePicker(k,Y,f)}}),(k,Y)=>(P(),De(Sa,{"multi-calendars":0,stretch:""},{default:_e(()=>[ot(Sr,Qe({ref_key:"tpRef",ref:p},k.$props,{hours:d(c).hours,minutes:d(c).minutes,seconds:d(c).seconds,"internal-model-value":k.internalModelValue,"disabled-times-config":d(m),"validate-time":d(h),"onUpdate:hours":Y[0]||(Y[0]=f=>d(v)(f)),"onUpdate:minutes":Y[1]||(Y[1]=f=>d(v)(f,!1)),"onUpdate:seconds":Y[2]||(Y[2]=f=>d(v)(f,!1,!0)),onAmPmChange:Y[3]||(Y[3]=f=>k.$emit("am-pm-change",f)),onResetFlow:Y[4]||(Y[4]=f=>k.$emit("reset-flow")),onOverlayClosed:Y[5]||(Y[5]=f=>k.$emit("overlay-toggle",{open:!1,overlay:f})),onOverlayOpened:Y[6]||(Y[6]=f=>k.$emit("overlay-toggle",{open:!0,overlay:f}))}),je({_:2},[Ye(d(i),(f,S)=>({name:f,fn:_e(I=>[ue(k.$slots,f,We(at(I)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3}))}}),ls={class:"dp--header-wrap"},os={key:0,class:"dp__month_year_wrap"},is={key:0},ss={class:"dp__month_year_wrap"},us=["data-dp-element","aria-label","data-test","onClick","onKeydown"],ds=ze({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...yt},emits:["update-month-year","mount","reset-flow","overlay-closed","overlay-opened"],setup(e,{expose:t,emit:n}){const a=n,r=e,{defaultedTransitions:l,defaultedAriaLabels:i,defaultedMultiCalendars:p,defaultedFilters:c,defaultedConfig:C,defaultedHighlight:m,propDates:v,defaultedUI:h}=Se(r),{transitionName:k,showTransition:Y}=ga(l),{buildMatrix:f}=It(),{handleMonthYearChange:S,isDisabled:I,updateMonthYear:U}=Yi(r,a),{showLeftIcon:A,showRightIcon:q}=Ia(),ae=Z(!1),E=Z(!1),B=Z(!1),ne=Z([null,null,null,null]);Ke(()=>{a("mount")});const F=M=>({get:()=>r[M],set:o=>{const w=M===vt.month?vt.year:vt.month;a("update-month-year",{[M]:o,[w]:r[w]}),M===vt.month?H(!0):re(!0)}}),N=G(F(vt.month)),ie=G(F(vt.year)),ce=G(()=>M=>({month:r.month,year:r.year,items:M===vt.month?r.months:r.years,instance:r.instance,updateMonthYear:U,toggle:M===vt.month?H:re})),pe=G(()=>r.months.find(o=>o.value===r.month)||{text:"",value:0}),g=G(()=>Zt(r.months,M=>{const o=r.month===M.value,w=fa(M.value,wr(r.year,v.value.minDate),_r(r.year,v.value.maxDate))||c.value.months.includes(M.value),z=Tr(m.value,M.value,r.year);return{active:o,disabled:w,highlighted:z}})),D=G(()=>Zt(r.years,M=>{const o=r.year===M.value,w=fa(M.value,ea(v.value.minDate),ea(v.value.maxDate))||c.value.years.includes(M.value),z=Mn(m.value,M.value);return{active:o,disabled:w,highlighted:z}})),y=(M,o,w)=>{w!==void 0?M.value=w:M.value=!M.value,M.value?(B.value=!0,a("overlay-opened",o)):(B.value=!1,a("overlay-closed",o))},H=(M=!1,o)=>{R(M),y(ae,Xe.month,o)},re=(M=!1,o)=>{R(M),y(E,Xe.year,o)},R=M=>{M||a("reset-flow")},b=(M,o)=>{r.arrowNavigation&&(ne.value[o]=Fe(M),f(ne.value,"monthYear"))},oe=G(()=>{var M,o,w,z,u,le;return[{type:vt.month,index:1,toggle:H,modelValue:N.value,updateModelValue:fe=>N.value=fe,text:pe.value.text,showSelectionGrid:ae.value,items:g.value,ariaLabel:(M=i.value)==null?void 0:M.openMonthsOverlay,overlayLabel:((w=(o=i.value).monthPicker)==null?void 0:w.call(o,!0))??void 0},{type:vt.year,index:2,toggle:re,modelValue:ie.value,updateModelValue:fe=>ie.value=fe,text:br(r.year,r.locale),showSelectionGrid:E.value,items:D.value,ariaLabel:(z=i.value)==null?void 0:z.openYearsOverlay,overlayLabel:((le=(u=i.value).yearPicker)==null?void 0:le.call(u,!0))??void 0}]}),V=G(()=>r.disableYearSelect?[oe.value[0]]:r.yearFirst?[...oe.value].reverse():oe.value);return t({toggleMonthPicker:H,toggleYearPicker:re,handleMonthYearChange:S}),(M,o)=>{var w,z,u,le,fe,Ve;return P(),W("div",ls,[M.$slots["month-year"]?(P(),W("div",os,[ue(M.$slots,"month-year",We(at({month:e.month,year:e.year,months:e.months,years:e.years,updateMonthYear:d(U),handleMonthYearChange:d(S),instance:e.instance})))])):(P(),W(we,{key:1},[M.$slots["top-extra"]?(P(),W("div",is,[ue(M.$slots,"top-extra",{value:M.internalModelValue})])):j("",!0),ye("div",ss,[d(A)(d(p),e.instance)&&!M.vertical?(P(),De(da,{key:0,"aria-label":(w=d(i))==null?void 0:w.prevMonth,disabled:d(I)(!1),class:ke((z=d(h))==null?void 0:z.navBtnPrev),"el-name":"action-prev",onActivate:o[0]||(o[0]=T=>d(S)(!1,!0)),onSetRef:o[1]||(o[1]=T=>b(T,0))},{default:_e(()=>[M.$slots["arrow-left"]?ue(M.$slots,"arrow-left",{key:0}):j("",!0),M.$slots["arrow-left"]?j("",!0):(P(),De(d(fn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),ye("div",{class:ke(["dp__month_year_wrap",{dp__year_disable_select:M.disableYearSelect}])},[(P(!0),W(we,null,Ye(V.value,(T,K)=>(P(),W(we,{key:T.type},[ye("button",{ref_for:!0,ref:s=>b(s,K+1),type:"button","data-dp-element":`overlay-${T.type}`,class:ke(["dp__btn dp__month_year_select",{"dp--hidden-el":B.value}]),"aria-label":`${T.text}-${T.ariaLabel}`,"data-test":`${T.type}-toggle-overlay-${e.instance}`,onClick:T.toggle,onKeydown:s=>d(et)(s,()=>T.toggle(),!0)},[M.$slots[T.type]?ue(M.$slots,T.type,{key:0,text:T.text,value:r[T.type]}):j("",!0),M.$slots[T.type]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(T.text),1)],64))],42,us),ot(ta,{name:d(k)(T.showSelectionGrid),css:d(Y)},{default:_e(()=>[T.showSelectionGrid?(P(),De(ya,{key:0,items:T.items,"arrow-navigation":M.arrowNavigation,"hide-navigation":M.hideNavigation,"is-last":M.autoApply&&!d(C).keepActionRow,"skip-button-ref":!1,config:M.config,type:T.type,"header-refs":[],"esc-close":M.escClose,"menu-wrap-ref":M.menuWrapRef,"text-input":M.textInput,"aria-labels":M.ariaLabels,"overlay-label":T.overlayLabel,onSelected:T.updateModelValue,onToggle:T.toggle},je({"button-icon":_e(()=>[M.$slots["calendar-icon"]?ue(M.$slots,"calendar-icon",{key:0}):j("",!0),M.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))]),_:2},[M.$slots[`${T.type}-overlay-value`]?{name:"item",fn:_e(({item:s})=>[ue(M.$slots,`${T.type}-overlay-value`,{text:s.text,value:s.value})]),key:"0"}:void 0,M.$slots[`${T.type}-overlay`]?{name:"overlay",fn:_e(()=>[ue(M.$slots,`${T.type}-overlay`,Qe({ref_for:!0},ce.value(T.type)))]),key:"1"}:void 0,M.$slots[`${T.type}-overlay-header`]?{name:"header",fn:_e(()=>[ue(M.$slots,`${T.type}-overlay-header`,{toggle:T.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","menu-wrap-ref","text-input","aria-labels","overlay-label","onSelected","onToggle"])):j("",!0)]),_:2},1032,["name","css"])],64))),128))],2),d(A)(d(p),e.instance)&&M.vertical?(P(),De(da,{key:1,"aria-label":(u=d(i))==null?void 0:u.prevMonth,"el-name":"action-prev",disabled:d(I)(!1),class:ke((le=d(h))==null?void 0:le.navBtnPrev),onActivate:o[2]||(o[2]=T=>d(S)(!1,!0))},{default:_e(()=>[M.$slots["arrow-up"]?ue(M.$slots,"arrow-up",{key:0}):j("",!0),M.$slots["arrow-up"]?j("",!0):(P(),De(d(gn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),d(q)(d(p),e.instance)?(P(),De(da,{key:2,ref:"rightIcon","el-name":"action-next",disabled:d(I)(!0),"aria-label":(fe=d(i))==null?void 0:fe.nextMonth,class:ke((Ve=d(h))==null?void 0:Ve.navBtnNext),onActivate:o[3]||(o[3]=T=>d(S)(!0,!0)),onSetRef:o[4]||(o[4]=T=>b(T,M.disableYearSelect?2:3))},{default:_e(()=>[M.$slots[M.vertical?"arrow-down":"arrow-right"]?ue(M.$slots,M.vertical?"arrow-down":"arrow-right",{key:0}):j("",!0),M.$slots[M.vertical?"arrow-down":"arrow-right"]?j("",!0):(P(),De(Oa(M.vertical?d(bn):d(hn)),{key:1}))]),_:3},8,["disabled","aria-label","class"])):j("",!0)])],64))])}}}),cs={class:"dp__calendar_header",role:"row"},vs={key:0,class:"dp__calendar_header_item",role:"gridcell"},ms=["aria-label"],ps={key:0,class:"dp__calendar_item dp__week_num",role:"gridcell"},fs={class:"dp__cell_inner"},hs=["id","aria-pressed","aria-disabled","aria-label","tabindex","data-test","onClick","onTouchend","onKeydown","onMouseenter","onMouseleave","onMousedown"],ys=ze({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...yt},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(e,{expose:t,emit:n}){const a=n,r=e,{buildMultiLevelMatrix:l}=It(),{defaultedTransitions:i,defaultedConfig:p,defaultedAriaLabels:c,defaultedMultiCalendars:C,defaultedWeekNumbers:m,defaultedMultiDates:v,defaultedUI:h}=Se(r),k=Z(null),Y=Z({bottom:"",left:"",transform:""}),f=Z([]),S=Z(null),I=Z(!0),U=Z(""),A=Z({startX:0,endX:0,startY:0,endY:0}),q=Z([]),ae=Z({left:"50%"}),E=Z(!1),B=G(()=>r.calendar?r.calendar(r.mappedDates):r.mappedDates),ne=G(()=>r.dayNames?Array.isArray(r.dayNames)?r.dayNames:r.dayNames(r.locale,+r.weekStart):ei(r.formatLocale,r.locale,+r.weekStart));Ke(()=>{a("mount",{cmp:"calendar",refs:f}),p.value.noSwipe||S.value&&(S.value.addEventListener("touchstart",b,{passive:!1}),S.value.addEventListener("touchend",oe,{passive:!1}),S.value.addEventListener("touchmove",V,{passive:!1})),r.monthChangeOnScroll&&S.value&&S.value.addEventListener("wheel",w,{passive:!1})});const F=T=>T?r.vertical?"vNext":"next":r.vertical?"vPrevious":"previous",N=(T,K)=>{if(r.transitions){const s=tt(Mt(Q(),r.month,r.year));U.value=Ne(tt(Mt(Q(),T,K)),s)?i.value[F(!0)]:i.value[F(!1)],I.value=!1,it(()=>{I.value=!0})}},ie=G(()=>({...h.value.calendar??{}})),ce=G(()=>T=>{const K=ai(T);return{dp__marker_dot:K.type==="dot",dp__marker_line:K.type==="line"}}),pe=G(()=>T=>Me(T,k.value)),g=G(()=>({dp__calendar:!0,dp__calendar_next:C.value.count>0&&r.instance!==0})),D=G(()=>T=>r.hideOffsetDates?T.current:!0),y=async(T,K)=>{const{width:s,height:L}=T.getBoundingClientRect();k.value=K.value;let J={left:`${s/2}px`},$=-50;if(await it(),q.value[0]){const{left:ge,width:x}=q.value[0].getBoundingClientRect();ge<0&&(J={left:"0"},$=0,ae.value.left=`${s/2}px`),window.innerWidth{var L,J,$;const ge=Fe(f.value[K][s]);ge&&((L=T.marker)!=null&&L.customPosition&&($=(J=T.marker)==null?void 0:J.tooltip)!=null&&$.length?Y.value=T.marker.customPosition(ge):await y(ge,T),a("tooltip-open",T.marker))},re=async(T,K,s)=>{var L,J;if(E.value&&v.value.enabled&&v.value.dragSelect)return a("select-date",T);a("set-hover-date",T),(J=(L=T.marker)==null?void 0:L.tooltip)!=null&&J.length&&await H(T,K,s)},R=T=>{k.value&&(k.value=null,Y.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),a("tooltip-close",T.marker))},b=T=>{A.value.startX=T.changedTouches[0].screenX,A.value.startY=T.changedTouches[0].screenY},oe=T=>{A.value.endX=T.changedTouches[0].screenX,A.value.endY=T.changedTouches[0].screenY,M()},V=T=>{r.vertical&&!r.inline&&T.preventDefault()},M=()=>{const T=r.vertical?"Y":"X";Math.abs(A.value[`start${T}`]-A.value[`end${T}`])>10&&a("handle-swipe",A.value[`start${T}`]>A.value[`end${T}`]?"right":"left")},o=(T,K,s)=>{T&&(Array.isArray(f.value[K])?f.value[K][s]=T:f.value[K]=[T]),r.arrowNavigation&&l(f.value,"calendar")},w=T=>{r.monthChangeOnScroll&&(T.preventDefault(),a("handle-scroll",T))},z=T=>m.value.type==="local"?vn(T.value,{weekStartsOn:+r.weekStart}):m.value.type==="iso"?dn(T.value):typeof m.value.type=="function"?m.value.type(T.value):"",u=T=>{const K=T[0];return m.value.hideOnOffsetDates?T.some(s=>s.current)?z(K):"":z(K)},le=(T,K,s=!0)=>{s&&Vn()||!s&&!Vn()||v.value.enabled||(Yt(T,p.value),a("select-date",K))},fe=T=>{Yt(T,p.value)},Ve=T=>{v.value.enabled&&v.value.dragSelect?(E.value=!0,a("select-date",T)):v.value.enabled&&a("select-date",T)};return t({triggerTransition:N}),(T,K)=>(P(),W("div",{class:ke(g.value)},[ye("div",{ref_key:"calendarWrapRef",ref:S,class:ke(ie.value),role:"grid"},[ye("div",cs,[T.weekNumbers?(P(),W("div",vs,Ge(T.weekNumName),1)):j("",!0),(P(!0),W(we,null,Ye(ne.value,(s,L)=>{var J,$;return P(),W("div",{key:L,class:"dp__calendar_header_item",role:"gridcell","data-test":"calendar-header","aria-label":($=(J=d(c))==null?void 0:J.weekDay)==null?void 0:$.call(J,L)},[T.$slots["calendar-header"]?ue(T.$slots,"calendar-header",{key:0,day:s,index:L}):j("",!0),T.$slots["calendar-header"]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(s),1)],64))],8,ms)}),128))]),K[2]||(K[2]=ye("div",{class:"dp__calendar_header_separator"},null,-1)),ot(ta,{name:U.value,css:!!T.transitions},{default:_e(()=>[I.value?(P(),W("div",{key:0,class:"dp__calendar",role:"rowgroup",onMouseleave:K[1]||(K[1]=s=>E.value=!1)},[(P(!0),W(we,null,Ye(B.value,(s,L)=>(P(),W("div",{key:L,class:"dp__calendar_row",role:"row"},[T.weekNumbers?(P(),W("div",ps,[ye("div",fs,Ge(u(s.days)),1)])):j("",!0),(P(!0),W(we,null,Ye(s.days,(J,$)=>{var ge,x,X;return P(),W("div",{id:d(Pr)(J.value),ref_for:!0,ref:de=>o(de,L,$),key:$+L,role:"gridcell",class:"dp__calendar_item","aria-pressed":(J.classData.dp__active_date||J.classData.dp__range_start||J.classData.dp__range_start)??void 0,"aria-disabled":J.classData.dp__cell_disabled||void 0,"aria-label":(x=(ge=d(c))==null?void 0:ge.day)==null?void 0:x.call(ge,J),tabindex:!J.current&&T.hideOffsetDates?void 0:0,"data-test":J.value,onClick:va(de=>le(de,J),["prevent"]),onTouchend:de=>le(de,J,!1),onKeydown:de=>d(et)(de,()=>T.$emit("select-date",J)),onMouseenter:de=>re(J,L,$),onMouseleave:de=>R(J),onMousedown:de=>Ve(J),onMouseup:K[0]||(K[0]=de=>E.value=!1)},[ye("div",{class:ke(["dp__cell_inner",J.classData])},[T.$slots.day&&D.value(J)?ue(T.$slots,"day",{key:0,day:+J.text,date:J.value}):j("",!0),T.$slots.day?j("",!0):(P(),W(we,{key:1},[Dt(Ge(J.text),1)],64)),J.marker&&D.value(J)?(P(),W(we,{key:2},[T.$slots.marker?ue(T.$slots,"marker",{key:0,marker:J.marker,day:+J.text,date:J.value}):(P(),W("div",{key:1,class:ke(ce.value(J.marker)),style:dt(J.marker.color?{backgroundColor:J.marker.color}:{})},null,6))],64)):j("",!0),pe.value(J.value)?(P(),W("div",{key:3,ref_for:!0,ref_key:"activeTooltip",ref:q,class:"dp__marker_tooltip",style:dt(Y.value)},[(X=J.marker)!=null&&X.tooltip?(P(),W("div",{key:0,class:"dp__tooltip_content",onClick:fe},[(P(!0),W(we,null,Ye(J.marker.tooltip,(de,be)=>(P(),W("div",{key:be,class:"dp__tooltip_text"},[T.$slots["marker-tooltip"]?ue(T.$slots,"marker-tooltip",{key:0,tooltip:de,day:J.value}):j("",!0),T.$slots["marker-tooltip"]?j("",!0):(P(),W(we,{key:1},[ye("div",{class:"dp__tooltip_mark",style:dt(de.color?{backgroundColor:de.color}:{})},null,4),ye("div",null,Ge(de.text),1)],64))]))),128)),ye("div",{class:"dp__arrow_bottom_tp",style:dt(ae.value)},null,4)])):j("",!0)],4)):j("",!0)],2)],40,hs)}),128))]))),128))],32)):j("",!0)]),_:3},8,["name","css"])],2)],2))}}),zn=e=>Array.isArray(e),gs=(e,t,n,a)=>{const r=Z([]),l=Z(new Date),i=Z(),p=()=>b(e.isTextInputDate),{modelValue:c,calendars:C,time:m,today:v}=ba(e,t,p),{defaultedMultiCalendars:h,defaultedStartTime:k,defaultedRange:Y,defaultedConfig:f,defaultedTz:S,propDates:I,defaultedMultiDates:U}=Se(e),{validateMonthYearInRange:A,isDisabled:q,isDateRangeAllowed:ae,checkMinMaxRange:E}=Et(e),{updateTimeValues:B,getSetDateTime:ne,setTime:F,assignStartTime:N,validateTime:ie,disabledTimesConfig:ce}=Rr(e,m,c,a),pe=G(()=>_=>C.value[_]?C.value[_].month:0),g=G(()=>_=>C.value[_]?C.value[_].year:0),D=_=>!f.value.keepViewOnOffsetClick||_?!0:!i.value,y=(_,te,O,ee=!1)=>{var se,Je;D(ee)&&(C.value[_]||(C.value[_]={month:0,year:0}),C.value[_].month=Hn(te)?(se=C.value[_])==null?void 0:se.month:te,C.value[_].year=Hn(O)?(Je=C.value[_])==null?void 0:Je.year:O)},H=()=>{e.autoApply&&t("select-date")};Ke(()=>{e.shadow||(c.value||(T(),k.value&&N(k.value)),b(!0),e.focusStartDate&&e.startDate&&T())});const re=G(()=>{var _;return(_=e.flow)!=null&&_.length&&!e.partialFlow?e.flowStep===e.flow.length:!0}),R=()=>{e.autoApply&&re.value&&t("auto-apply",e.partialFlow?e.flowStep!==e.flow.length:!1)},b=(_=!1)=>{if(c.value)return Array.isArray(c.value)?(r.value=c.value,u(_)):M(c.value,_);if(h.value.count&&_&&!e.startDate)return V(Q(),_)},oe=()=>Array.isArray(c.value)&&Y.value.enabled?xe(c.value[0])===xe(c.value[1]??c.value[0]):!1,V=(_=new Date,te=!1)=>{if((!h.value.count||!h.value.static||te)&&y(0,xe(_),he(_)),h.value.count&&(!h.value.solo||!c.value||oe()))for(let O=1;O{V(_),F("hours",Tt(_)),F("minutes",Rt(_)),F("seconds",jt(_)),h.value.count&&te&&Ve()},o=_=>{if(h.value.count){if(h.value.solo)return 0;const te=xe(_[0]),O=xe(_[1]);return Math.abs(O-te){_[1]&&Y.value.showLastInRange?V(_[o(_)],te):V(_[0],te);const O=(ee,se)=>[ee(_[0]),_[1]?ee(_[1]):m[se][1]];F("hours",O(Tt,"hours")),F("minutes",O(Rt,"minutes")),F("seconds",O(jt,"seconds"))},z=(_,te)=>{if((Y.value.enabled||e.weekPicker)&&!U.value.enabled)return w(_,te);if(U.value.enabled&&te){const O=_[_.length-1];return M(O,te)}},u=_=>{const te=c.value;z(te,_),h.value.count&&h.value.solo&&Ve()},le=(_,te)=>{const O=Ce(Q(),{month:pe.value(te),year:g.value(te)}),ee=_<0?ft(O,1):Jt(O,1);A(xe(ee),he(ee),_<0,e.preventMinMaxNavigation)&&(y(te,xe(ee),he(ee)),t("update-month-year",{instance:te,month:xe(ee),year:he(ee)}),h.value.count&&!h.value.solo&&fe(te),n())},fe=_=>{for(let te=_-1;te>=0;te--){const O=Jt(Ce(Q(),{month:pe.value(te+1),year:g.value(te+1)}),1);y(te,xe(O),he(O))}for(let te=_+1;te<=h.value.count-1;te++){const O=ft(Ce(Q(),{month:pe.value(te-1),year:g.value(te-1)}),1);y(te,xe(O),he(O))}},Ve=()=>{if(Array.isArray(c.value)&&c.value.length===2){const _=Q(Q(c.value[1]?c.value[1]:ft(c.value[0],1))),[te,O]=[xe(c.value[0]),he(c.value[0])],[ee,se]=[xe(c.value[1]),he(c.value[1])];(te!==ee||te===ee&&O!==se)&&h.value.solo&&y(1,xe(_),he(_))}else c.value&&!Array.isArray(c.value)&&(y(0,xe(c.value),he(c.value)),V(Q()))},T=()=>{e.startDate&&(y(0,xe(Q(e.startDate)),he(Q(e.startDate))),h.value.count&&fe(0))},K=(_,te)=>{if(e.monthChangeOnScroll){const O=new Date().getTime()-l.value.getTime(),ee=Math.abs(_.deltaY);let se=500;ee>1&&(se=100),ee>100&&(se=0),O>se&&(l.value=new Date,le(e.monthChangeOnScroll!=="inverse"?-_.deltaY:_.deltaY,te))}},s=(_,te,O=!1)=>{e.monthChangeOnArrows&&e.vertical===O&&L(_,te)},L=(_,te)=>{le(_==="right"?-1:1,te)},J=_=>{if(I.value.markers)return Aa(_.value,I.value.markers)},$=(_,te)=>{switch(e.sixWeeks===!0?"append":e.sixWeeks){case"prepend":return[!0,!1];case"center":return[_==0,!0];case"fair":return[_==0||te>_,!0];case"append":return[!1,!1];default:return[!1,!1]}},ge=(_,te,O,ee)=>{if(e.sixWeeks&&_.length<6){const se=6-_.length,Je=(te.getDay()+7-ee)%7,ut=6-(O.getDay()+7-ee)%7,[Bt,_a]=$(Je,ut);for(let la=1;la<=se;la++)if(_a?!!(la%2)==Bt:Bt){const At=_[0].days[0],qa=x(mt(At.value,-7),xe(te));_.unshift({days:qa})}else{const At=_[_.length-1],qa=At.days[At.days.length-1],Er=x(mt(qa.value,1),xe(te));_.push({days:Er})}}return _},x=(_,te)=>{const O=Q(_),ee=[];for(let se=0;se<7;se++){const Je=mt(O,se),ut=xe(Je)!==te;ee.push({text:e.hideOffsetDates&&ut?"":Je.getDate(),value:Je,current:!ut,classData:{}})}return ee},X=(_,te)=>{const O=[],ee=new Date(te,_),se=new Date(te,_+1,0),Je=e.weekStart,ut=ht(ee,{weekStartsOn:Je}),Bt=_a=>{const la=x(_a,_);if(O.push({days:la}),!O[O.length-1].days.some(At=>Me(tt(At.value),tt(se)))){const At=mt(_a,7);Bt(At)}};return Bt(ut),ge(O,ee,se,Je)},de=_=>{const te=St(Q(_.value),m.hours,m.minutes,rt());t("date-update",te),U.value.enabled?Dn(te,c,U.value.limit):c.value=te,a(),it().then(()=>{R()})},be=_=>Y.value.noDisabledRange?kr(r.value[0],_).some(te=>q(te)):!1,st=()=>{r.value=c.value?c.value.slice():[],r.value.length===2&&!(Y.value.fixedStart||Y.value.fixedEnd)&&(r.value=[])},me=(_,te)=>{const O=[Q(_.value),mt(Q(_.value),+Y.value.autoRange)];ae(O)?(te&&Pt(_.value),r.value=O):t("invalid-date",_.value)},Pt=_=>{const te=xe(Q(_)),O=he(Q(_));if(y(0,te,O),h.value.count>0)for(let ee=1;ee{if(be(_.value)||!E(_.value,c.value,Y.value.fixedStart?0:1))return t("invalid-date",_.value);r.value=$r(Q(_.value),c,t,Y)},na=(_,te)=>{if(st(),Y.value.autoRange)return me(_,te);if(Y.value.fixedStart||Y.value.fixedEnd)return gt(_);r.value[0]?E(Q(_.value),c.value)&&!be(_.value)?Ie(Q(_.value),Q(r.value[0]))?(r.value.unshift(Q(_.value)),t("range-end",r.value[0])):(r.value[1]=Q(_.value),t("range-end",r.value[1])):(e.autoApply&&t("auto-apply-invalid",_.value),t("invalid-date",_.value)):(r.value[0]=Q(_.value),t("range-start",r.value[0]))},rt=(_=!0)=>e.enableSeconds?Array.isArray(m.seconds)?_?m.seconds[0]:m.seconds[1]:m.seconds:0,ra=_=>{r.value[_]=St(r.value[_],m.hours[_],m.minutes[_],rt(_!==1))},Ea=()=>{var _,te;r.value[0]&&r.value[1]&&+((_=r.value)==null?void 0:_[0])>+((te=r.value)==null?void 0:te[1])&&(r.value.reverse(),t("range-start",r.value[0]),t("range-end",r.value[1]))},wa=()=>{r.value.length&&(r.value[0]&&!r.value[1]?ra(0):(ra(0),ra(1),a()),Ea(),c.value=r.value.slice(),Ra(r.value,t,e.autoApply,e.modelAuto))},Ba=(_,te=!1)=>{if(q(_.value)||!_.current&&e.hideOffsetDates)return t("invalid-date",_.value);if(i.value=JSON.parse(JSON.stringify(_)),!Y.value.enabled)return de(_);zn(m.hours)&&zn(m.minutes)&&!U.value.enabled&&(na(_,te),wa())},Na=(_,te)=>{var O;y(_,te.month,te.year,!0),h.value.count&&!h.value.solo&&fe(_),t("update-month-year",{instance:_,month:te.month,year:te.year}),n(h.value.solo?_:void 0);const ee=(O=e.flow)!=null&&O.length?e.flow[e.flowStep]:void 0;!te.fromNav&&(ee===Xe.month||ee===Xe.year)&&a()},La=(_,te)=>{Or({value:_,modelValue:c,range:Y.value.enabled,timezone:te?void 0:S.value.timezone}),H(),e.multiCalendars&&it().then(()=>b(!0))},Ha=()=>{const _=wn(Q(),S.value);Y.value.enabled?c.value&&Array.isArray(c.value)&&c.value[0]?c.value=Ie(_,c.value[0])?[_,c.value[0]]:[c.value[0],_]:c.value=[_]:c.value=_,H()},Va=()=>{if(Array.isArray(c.value))if(U.value.enabled){const _=Fa();c.value[c.value.length-1]=ne(_)}else c.value=c.value.map((_,te)=>_&&ne(_,te));else c.value=ne(c.value);t("time-update")},Fa=()=>Array.isArray(c.value)&&c.value.length?c.value[c.value.length-1]:null;return{calendars:C,modelValue:c,month:pe,year:g,time:m,disabledTimesConfig:ce,today:v,validateTime:ie,getCalendarDays:X,getMarker:J,handleScroll:K,handleSwipe:L,handleArrow:s,selectDate:Ba,updateMonthYear:Na,presetDate:La,selectCurrentDate:Ha,updateTime:(_,te=!0,O=!1)=>{B(_,te,O,Va)},assignMonthAndYear:V}},bs={key:0},ws=ze({__name:"DatePicker",props:{...yt},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,{calendars:l,month:i,year:p,modelValue:c,time:C,disabledTimesConfig:m,today:v,validateTime:h,getCalendarDays:k,getMarker:Y,handleArrow:f,handleScroll:S,handleSwipe:I,selectDate:U,updateMonthYear:A,presetDate:q,selectCurrentDate:ae,updateTime:E,assignMonthAndYear:B}=gs(r,a,oe,V),ne=qt(),{setHoverDate:F,getDayClassData:N,clearHoverDate:ie}=Is(c,r),{defaultedMultiCalendars:ce}=Se(r),pe=Z([]),g=Z([]),D=Z(null),y=lt(ne,"calendar"),H=lt(ne,"monthYear"),re=lt(ne,"timePicker"),R=K=>{r.shadow||a("mount",K)};ct(l,()=>{r.shadow||setTimeout(()=>{a("recalculate-position")},0)},{deep:!0}),ct(ce,(K,s)=>{K.count-s.count>0&&B()},{deep:!0});const b=G(()=>K=>k(i.value(K),p.value(K)).map(s=>({...s,days:s.days.map(L=>(L.marker=Y(L),L.classData=N(L),L))})));function oe(K){var s;K||K===0?(s=g.value[K])==null||s.triggerTransition(i.value(K),p.value(K)):g.value.forEach((L,J)=>L.triggerTransition(i.value(J),p.value(J)))}function V(){a("update-flow-step")}const M=(K,s=!1)=>{U(K,s),r.spaceConfirm&&a("select-date")},o=(K,s,L=0)=>{var J;(J=pe.value[L])==null||J.toggleMonthPicker(K,s)},w=(K,s,L=0)=>{var J;(J=pe.value[L])==null||J.toggleYearPicker(K,s)},z=(K,s,L)=>{var J;(J=D.value)==null||J.toggleTimePicker(K,s,L)},u=(K,s)=>{var L;if(!r.range){const J=c.value?c.value:v,$=s?new Date(s):J,ge=K?ht($,{weekStartsOn:1}):ar($,{weekStartsOn:1});U({value:ge,current:xe($)===i.value(0),text:"",classData:{}}),(L=document.getElementById(Pr(ge)))==null||L.focus()}},le=K=>{var s;(s=pe.value[0])==null||s.handleMonthYearChange(K,!0)},fe=K=>{A(0,{month:i.value(0),year:p.value(0)+(K?1:-1),fromNav:!0})},Ve=(K,s)=>{K===Xe.time&&a(`time-picker-${s?"open":"close"}`),a("overlay-toggle",{open:s,overlay:K})},T=K=>{a("overlay-toggle",{open:!1,overlay:K}),a("focus-menu")};return t({clearHoverDate:ie,presetDate:q,selectCurrentDate:ae,toggleMonthPicker:o,toggleYearPicker:w,toggleTimePicker:z,handleArrow:f,updateMonthYear:A,getSidebarProps:()=>({modelValue:c,month:i,year:p,time:C,updateTime:E,updateMonthYear:A,selectDate:U,presetDate:q}),changeMonth:le,changeYear:fe,selectWeekDate:u}),(K,s)=>(P(),W(we,null,[ot(Sa,{"multi-calendars":d(ce).count,collapse:K.collapse},{default:_e(({instance:L,index:J})=>[K.disableMonthYearSelect?j("",!0):(P(),De(ds,Qe({key:0,ref:$=>{$&&(pe.value[J]=$)},months:d(hr)(K.formatLocale,K.locale,K.monthNameFormat),years:d(_n)(K.yearRange,K.locale,K.reverseYears),month:d(i)(L),year:d(p)(L),instance:L},K.$props,{onMount:s[0]||(s[0]=$=>R(d(Vt).header)),onResetFlow:s[1]||(s[1]=$=>K.$emit("reset-flow")),onUpdateMonthYear:$=>d(A)(L,$),onOverlayClosed:T,onOverlayOpened:s[2]||(s[2]=$=>K.$emit("overlay-toggle",{open:!0,overlay:$}))}),je({_:2},[Ye(d(H),($,ge)=>({name:$,fn:_e(x=>[ue(K.$slots,$,We(at(x)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),ot(ys,Qe({ref:$=>{$&&(g.value[J]=$)},"mapped-dates":b.value(L),month:d(i)(L),year:d(p)(L),instance:L},K.$props,{onSelectDate:$=>d(U)($,L!==1),onHandleSpace:$=>M($,L!==1),onSetHoverDate:s[3]||(s[3]=$=>d(F)($)),onHandleScroll:$=>d(S)($,L),onHandleSwipe:$=>d(I)($,L),onMount:s[4]||(s[4]=$=>R(d(Vt).calendar)),onResetFlow:s[5]||(s[5]=$=>K.$emit("reset-flow")),onTooltipOpen:s[6]||(s[6]=$=>K.$emit("tooltip-open",$)),onTooltipClose:s[7]||(s[7]=$=>K.$emit("tooltip-close",$))}),je({_:2},[Ye(d(y),($,ge)=>({name:$,fn:_e(x=>[ue(K.$slots,$,We(at({...x})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars","collapse"]),K.enableTimePicker?(P(),W("div",bs,[K.$slots["time-picker"]?ue(K.$slots,"time-picker",We(Qe({key:0},{time:d(C),updateTime:d(E)}))):(P(),De(Sr,Qe({key:1,ref_key:"timePickerRef",ref:D},K.$props,{hours:d(C).hours,minutes:d(C).minutes,seconds:d(C).seconds,"internal-model-value":K.internalModelValue,"disabled-times-config":d(m),"validate-time":d(h),onMount:s[8]||(s[8]=L=>R(d(Vt).timePicker)),"onUpdate:hours":s[9]||(s[9]=L=>d(E)(L)),"onUpdate:minutes":s[10]||(s[10]=L=>d(E)(L,!1)),"onUpdate:seconds":s[11]||(s[11]=L=>d(E)(L,!1,!0)),onResetFlow:s[12]||(s[12]=L=>K.$emit("reset-flow")),onOverlayClosed:s[13]||(s[13]=L=>Ve(L,!1)),onOverlayOpened:s[14]||(s[14]=L=>Ve(L,!0)),onAmPmChange:s[15]||(s[15]=L=>K.$emit("am-pm-change",L))}),je({_:2},[Ye(d(re),(L,J)=>({name:L,fn:_e($=>[ue(K.$slots,L,We(at($)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):j("",!0)],64))}}),_s=(e,t)=>{const n=Z(),{defaultedMultiCalendars:a,defaultedConfig:r,defaultedHighlight:l,defaultedRange:i,propDates:p,defaultedFilters:c,defaultedMultiDates:C}=Se(e),{modelValue:m,year:v,month:h,calendars:k}=ba(e,t),{isDisabled:Y}=Et(e),{selectYear:f,groupedYears:S,showYearPicker:I,isDisabled:U,toggleYearPicker:A,handleYearSelect:q,handleYear:ae}=Yr({modelValue:m,multiCalendars:a,range:i,highlight:l,calendars:k,propDates:p,month:h,year:v,filters:c,props:e,emit:t}),E=(D,y)=>[D,y].map(H=>kt(H,"MMMM",{locale:e.formatLocale})).join("-"),B=G(()=>D=>m.value?Array.isArray(m.value)?m.value.some(y=>Bn(D,y)):Bn(m.value,D):!1),ne=D=>{if(i.value.enabled){if(Array.isArray(m.value)){const y=Me(D,m.value[0])||Me(D,m.value[1]);return $a(m.value,n.value,D)&&!y}return!1}return!1},F=(D,y)=>D.quarter===$n(y)&&D.year===he(y),N=D=>typeof l.value=="function"?l.value({quarter:$n(D),year:he(D)}):!!l.value.quarters.find(y=>F(y,D)),ie=G(()=>D=>{const y=Ce(new Date,{year:v.value(D)});return el({start:ma(y),end:tr(y)}).map(H=>{const re=Ht(H),R=Yn(H),b=Y(H),oe=ne(re),V=N(re);return{text:E(re,R),value:re,active:B.value(re),highlighted:V,disabled:b,isBetween:oe}})}),ce=D=>{Dn(D,m,C.value.limit),t("auto-apply",!0)},pe=D=>{m.value=Tn(m,D,t),Ra(m.value,t,e.autoApply,e.modelAuto)},g=D=>{m.value=D,t("auto-apply")};return{defaultedConfig:r,defaultedMultiCalendars:a,groupedYears:S,year:v,isDisabled:U,quarters:ie,showYearPicker:I,modelValue:m,setHoverDate:D=>{n.value=D},selectYear:f,selectQuarter:(D,y,H)=>{if(!H)return k.value[y].month=xe(Yn(D)),C.value.enabled?ce(D):i.value.enabled?pe(D):g(D)},toggleYearPicker:A,handleYearSelect:q,handleYear:ae}},ks={class:"dp--quarter-items"},xs=["data-test","disabled","onClick","onMouseover"],Ms=ze({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...yt},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end","overlay-toggle","update-month-year"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=lt(l,"yearMode"),{defaultedMultiCalendars:p,defaultedConfig:c,groupedYears:C,year:m,isDisabled:v,quarters:h,modelValue:k,showYearPicker:Y,setHoverDate:f,selectQuarter:S,toggleYearPicker:I,handleYearSelect:U,handleYear:A}=_s(r,a);return t({getSidebarProps:()=>({modelValue:k,year:m,selectQuarter:S,handleYearSelect:U,handleYear:A})}),(q,ae)=>(P(),De(Sa,{"multi-calendars":d(p).count,collapse:q.collapse,stretch:""},{default:_e(({instance:E})=>[ye("div",{class:"dp-quarter-picker-wrap",style:dt({minHeight:`${d(c).modeHeight}px`})},[q.$slots["top-extra"]?ue(q.$slots,"top-extra",{key:0,value:q.internalModelValue}):j("",!0),ye("div",null,[ot(Cr,Qe(q.$props,{items:d(C)(E),instance:E,"show-year-picker":d(Y)[E],year:d(m)(E),"is-disabled":B=>d(v)(E,B),onHandleYear:B=>d(A)(E,B),onYearSelect:B=>d(U)(B,E),onToggleYearPicker:B=>d(I)(E,B?.flow,B?.show)}),je({_:2},[Ye(d(i),(B,ne)=>({name:B,fn:_e(F=>[ue(q.$slots,B,We(at(F)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),ye("div",ks,[(P(!0),W(we,null,Ye(d(h)(E),(B,ne)=>(P(),W("div",{key:ne},[ye("button",{type:"button",class:ke(["dp--qr-btn",{"dp--qr-btn-active":B.active,"dp--qr-btn-between":B.isBetween,"dp--qr-btn-disabled":B.disabled,"dp--highlighted":B.highlighted}]),"data-test":B.value,disabled:B.disabled,onClick:F=>d(S)(B.value,E,B.disabled),onMouseover:F=>d(f)(B.value)},[q.$slots.quarter?ue(q.$slots,"quarter",{key:0,value:B.value,text:B.text}):(P(),W(we,{key:1},[Dt(Ge(B.text),1)],64))],42,xs)]))),128))])],4)]),_:3},8,["multi-calendars","collapse"]))}}),Ds=["id","tabindex","role","aria-label"],Ts={key:0,class:"dp--menu-load-container"},Ps={key:1,class:"dp--menu-header"},As={key:0,class:"dp__sidebar_left"},Cs=["data-test","onClick","onKeydown"],Os={key:2,class:"dp__sidebar_right"},$s={key:3,class:"dp__action_extra"},Un=ze({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{...Ya,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=Z(null),i=G(()=>{const{openOnTop:x,...X}=r;return{...X,flowStep:F.value,collapse:r.collapse,noOverlayFocus:r.noOverlayFocus,menuWrapRef:l.value}}),{setMenuFocused:p,setShiftKey:c,control:C}=Ar(),m=qt(),{defaultedTextInput:v,defaultedInline:h,defaultedConfig:k,defaultedUI:Y}=Se(r),f=Z(null),S=Z(0),I=Z(null),U=Z(!1),A=Z(null);Ke(()=>{if(!r.shadow){U.value=!0,q(),window.addEventListener("resize",q);const x=Fe(l);if(x&&!v.value.enabled&&!h.value.enabled&&(p(!0),y()),x){const X=de=>{k.value.allowPreventDefault&&de.preventDefault(),Yt(de,k.value,!0)};x.addEventListener("pointerdown",X),x.addEventListener("mousedown",X)}}}),Ca(()=>{window.removeEventListener("resize",q)});const q=()=>{const x=Fe(I);x&&(S.value=x.getBoundingClientRect().width)},{arrowRight:ae,arrowLeft:E,arrowDown:B,arrowUp:ne}=It(),{flowStep:F,updateFlowStep:N,childMount:ie,resetFlow:ce,handleFlow:pe}=Es(r,a,A),g=G(()=>r.monthPicker?qi:r.yearPicker?Qi:r.timePicker?rs:r.quarterPicker?Ms:ws),D=G(()=>{var x;if(k.value.arrowLeft)return k.value.arrowLeft;const X=(x=l.value)==null?void 0:x.getBoundingClientRect(),de=r.getInputRect();return de?.width=(X?.right??0)&&de?.width{const x=Fe(l);x&&x.focus({preventScroll:!0})},H=G(()=>{var x;return((x=A.value)==null?void 0:x.getSidebarProps())||{}}),re=()=>{r.openOnTop&&a("recalculate-position")},R=lt(m,"action"),b=G(()=>r.monthPicker||r.yearPicker?lt(m,"monthYear"):r.timePicker?lt(m,"timePicker"):lt(m,"shared")),oe=G(()=>r.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),V=G(()=>({dp__menu_disabled:r.disabled,dp__menu_readonly:r.readonly,"dp-menu-loading":r.loading})),M=G(()=>({dp__menu:!0,dp__menu_index:!h.value.enabled,dp__relative:h.value.enabled,...Y.value.menu??{}})),o=x=>{Yt(x,k.value,!0)},w=()=>{r.escClose&&a("close-picker")},z=x=>{if(r.arrowNavigation){if(x===Ze.up)return ne();if(x===Ze.down)return B();if(x===Ze.left)return E();if(x===Ze.right)return ae()}else x===Ze.left||x===Ze.up?T("handleArrow",Ze.left,0,x===Ze.up):T("handleArrow",Ze.right,0,x===Ze.down)},u=x=>{c(x.shiftKey),!r.disableMonthYearSelect&&x.code===$e.tab&&x.target.classList.contains("dp__menu")&&C.value.shiftKeyInMenu&&(x.preventDefault(),Yt(x,k.value,!0),a("close-picker"))},le=()=>{y(),a("time-picker-close")},fe=x=>{var X,de,be;(X=A.value)==null||X.toggleTimePicker(!1,!1),(de=A.value)==null||de.toggleMonthPicker(!1,!1,x),(be=A.value)==null||be.toggleYearPicker(!1,!1,x)},Ve=(x,X=0)=>{var de,be,st;return x==="month"?(de=A.value)==null?void 0:de.toggleMonthPicker(!1,!0,X):x==="year"?(be=A.value)==null?void 0:be.toggleYearPicker(!1,!0,X):x==="time"?(st=A.value)==null?void 0:st.toggleTimePicker(!0,!1):fe(X)},T=(x,...X)=>{var de,be;(de=A.value)!=null&&de[x]&&((be=A.value)==null||be[x](...X))},K=()=>{T("selectCurrentDate")},s=(x,X)=>{T("presetDate",x,X)},L=()=>{T("clearHoverDate")},J=(x,X)=>{T("updateMonthYear",x,X)},$=(x,X)=>{x.preventDefault(),z(X)},ge=x=>{var X,de,be;if(u(x),x.key===$e.home||x.key===$e.end)return T("selectWeekDate",x.key===$e.home,x.target.getAttribute("id"));switch((x.key===$e.pageUp||x.key===$e.pageDown)&&(x.shiftKey?(T("changeYear",x.key===$e.pageUp),(X=on(l.value,"overlay-year"))==null||X.focus()):(T("changeMonth",x.key===$e.pageUp),(de=on(l.value,x.key===$e.pageUp?"action-prev":"action-next"))==null||de.focus()),x.target.getAttribute("id")&&((be=l.value)==null||be.focus({preventScroll:!0}))),x.key){case $e.esc:return w();case $e.arrowLeft:return $(x,Ze.left);case $e.arrowRight:return $(x,Ze.right);case $e.arrowUp:return $(x,Ze.up);case $e.arrowDown:return $(x,Ze.down);default:return}};return t({updateMonthYear:J,switchView:Ve,handleFlow:pe}),(x,X)=>{var de,be,st;return P(),W("div",{id:x.uid?`dp-menu-${x.uid}`:void 0,ref_key:"dpMenuRef",ref:l,tabindex:d(h).enabled?void 0:"0",role:d(h).enabled?void 0:"dialog","aria-label":(de=x.ariaLabels)==null?void 0:de.menu,class:ke(M.value),style:dt({"--dp-arrow-left":D.value}),onMouseleave:L,onClick:o,onKeydown:ge},[(x.disabled||x.readonly)&&d(h).enabled||x.loading?(P(),W("div",{key:0,class:ke(V.value)},[x.loading?(P(),W("div",Ts,X[19]||(X[19]=[ye("span",{class:"dp--menu-loader"},null,-1)]))):j("",!0)],2)):j("",!0),x.$slots["menu-header"]?(P(),W("div",Ps,[ue(x.$slots,"menu-header")])):j("",!0),!d(h).enabled&&!x.teleportCenter?(P(),W("div",{key:2,class:ke(oe.value)},null,2)):j("",!0),ye("div",{ref_key:"innerMenuRef",ref:I,class:ke({dp__menu_content_wrapper:((be=x.presetDates)==null?void 0:be.length)||!!x.$slots["left-sidebar"]||!!x.$slots["right-sidebar"],"dp--menu-content-wrapper-collapsed":e.collapse&&(((st=x.presetDates)==null?void 0:st.length)||!!x.$slots["left-sidebar"]||!!x.$slots["right-sidebar"])}),style:dt({"--dp-menu-width":`${S.value}px`})},[x.$slots["left-sidebar"]?(P(),W("div",As,[ue(x.$slots,"left-sidebar",We(at(H.value)))])):j("",!0),x.presetDates.length?(P(),W("div",{key:1,class:ke({"dp--preset-dates-collapsed":e.collapse,"dp--preset-dates":!0})},[(P(!0),W(we,null,Ye(x.presetDates,(me,Pt)=>(P(),W(we,{key:Pt},[me.slot?ue(x.$slots,me.slot,{key:0,presetDate:s,label:me.label,value:me.value}):(P(),W("button",{key:1,type:"button",style:dt(me.style||{}),class:ke(["dp__btn dp--preset-range",{"dp--preset-range-collapsed":e.collapse}]),"data-test":me.testId??void 0,onClick:va(gt=>s(me.value,me.noTz),["prevent"]),onKeydown:gt=>d(et)(gt,()=>s(me.value,me.noTz),!0)},Ge(me.label),47,Cs))],64))),128))],2)):j("",!0),ye("div",{ref_key:"calendarWrapperRef",ref:f,class:"dp__instance_calendar",role:"document"},[(P(),De(Oa(g.value),Qe({ref_key:"dynCmpRef",ref:A},i.value,{"flow-step":d(F),onMount:d(ie),onUpdateFlowStep:d(N),onResetFlow:d(ce),onFocusMenu:y,onSelectDate:X[0]||(X[0]=me=>x.$emit("select-date")),onDateUpdate:X[1]||(X[1]=me=>x.$emit("date-update",me)),onTooltipOpen:X[2]||(X[2]=me=>x.$emit("tooltip-open",me)),onTooltipClose:X[3]||(X[3]=me=>x.$emit("tooltip-close",me)),onAutoApply:X[4]||(X[4]=me=>x.$emit("auto-apply",me)),onRangeStart:X[5]||(X[5]=me=>x.$emit("range-start",me)),onRangeEnd:X[6]||(X[6]=me=>x.$emit("range-end",me)),onInvalidFixedRange:X[7]||(X[7]=me=>x.$emit("invalid-fixed-range",me)),onTimeUpdate:X[8]||(X[8]=me=>x.$emit("time-update")),onAmPmChange:X[9]||(X[9]=me=>x.$emit("am-pm-change",me)),onTimePickerOpen:X[10]||(X[10]=me=>x.$emit("time-picker-open",me)),onTimePickerClose:le,onRecalculatePosition:re,onUpdateMonthYear:X[11]||(X[11]=me=>x.$emit("update-month-year",me)),onAutoApplyInvalid:X[12]||(X[12]=me=>x.$emit("auto-apply-invalid",me)),onInvalidDate:X[13]||(X[13]=me=>x.$emit("invalid-date",me)),onOverlayToggle:X[14]||(X[14]=me=>x.$emit("overlay-toggle",me)),"onUpdate:internalModelValue":X[15]||(X[15]=me=>x.$emit("update:internal-model-value",me))}),je({_:2},[Ye(b.value,(me,Pt)=>({name:me,fn:_e(gt=>[ue(x.$slots,me,We(at({...gt})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),x.$slots["right-sidebar"]?(P(),W("div",Os,[ue(x.$slots,"right-sidebar",We(at(H.value)))])):j("",!0),x.$slots["action-extra"]?(P(),W("div",$s,[x.$slots["action-extra"]?ue(x.$slots,"action-extra",{key:0,selectCurrentDate:K}):j("",!0)])):j("",!0)],6),!x.autoApply||d(k).keepActionRow?(P(),De(Ii,Qe({key:3,"menu-mount":U.value},i.value,{"calendar-width":S.value,onClosePicker:X[16]||(X[16]=me=>x.$emit("close-picker")),onSelectDate:X[17]||(X[17]=me=>x.$emit("select-date")),onInvalidSelect:X[18]||(X[18]=me=>x.$emit("invalid-select")),onSelectNow:K}),je({_:2},[Ye(d(R),(me,Pt)=>({name:me,fn:_e(gt=>[ue(x.$slots,me,We(at({...gt})))])}))]),1040,["menu-mount","calendar-width"])):j("",!0)],46,Ds)}}});var Ut=(e=>(e.center="center",e.left="left",e.right="right",e))(Ut||{});const Ys=({menuRef:e,menuRefInner:t,inputRef:n,pickerWrapperRef:a,inline:r,emit:l,props:i,slots:p})=>{const{defaultedConfig:c}=Se(i),C=Z({}),m=Z(!1),v=Z({top:"0",left:"0"}),h=Z(!1),k=ca(i,"teleportCenter");ct(k,()=>{v.value=JSON.parse(JSON.stringify({})),ae()});const Y=y=>{if(i.teleport){const H=y.getBoundingClientRect();return{left:H.left+window.scrollX,top:H.top+window.scrollY}}return{top:0,left:0}},f=(y,H)=>{v.value.left=`${y+H-C.value.width}px`},S=y=>{v.value.left=`${y}px`},I=(y,H)=>{i.position===Ut.left&&S(y),i.position===Ut.right&&f(y,H),i.position===Ut.center&&(v.value.left=`${y+H/2-C.value.width/2}px`)},U=y=>{const{width:H,height:re}=y.getBoundingClientRect(),{top:R,left:b}=i.altPosition?i.altPosition(y):Y(y);return{top:+R,left:+b,width:H,height:re}},A=()=>{v.value.left="50%",v.value.top="50%",v.value.transform="translate(-50%, -50%)",v.value.position="fixed",delete v.value.opacity},q=()=>{const y=Fe(n),{top:H,left:re,transform:R}=i.altPosition(y);v.value={top:`${H}px`,left:`${re}px`,transform:R??""}},ae=(y=!0)=>{var H;if(!r.value.enabled){if(k.value)return A();if(i.altPosition!==null)return q();if(y){const re=i.teleport?(H=t.value)==null?void 0:H.$el:e.value;re&&(C.value=re.getBoundingClientRect()),l("recalculate-position")}return ce()}},E=({inputEl:y,left:H,width:re})=>{window.screen.width>768&&!m.value&&I(H,re),F(y)},B=y=>{const{top:H,left:re,height:R,width:b}=U(y);v.value.top=`${R+H+ +i.offset}px`,h.value=!1,m.value||(v.value.left=`${re+b/2-C.value.width/2}px`),E({inputEl:y,left:re,width:b})},ne=y=>{const{top:H,left:re,width:R}=U(y);v.value.top=`${H-+i.offset-C.value.height}px`,h.value=!0,E({inputEl:y,left:re,width:R})},F=y=>{if(i.autoPosition){const{left:H,width:re}=U(y),{left:R,right:b}=C.value;if(!m.value){if(Math.abs(R)!==Math.abs(b)){if(R<=0)return m.value=!0,S(H);if(b>=document.documentElement.clientWidth)return m.value=!0,f(H,re)}return I(H,re)}}},N=()=>{const y=Fe(n);if(y){const{height:H}=C.value,{top:re,height:R}=y.getBoundingClientRect(),b=window.innerHeight-re-R,oe=re;return H<=b?Lt.bottom:H>b&&H<=oe?Lt.top:b>=oe?Lt.bottom:Lt.top}return Lt.bottom},ie=y=>N()===Lt.bottom?B(y):ne(y),ce=()=>{const y=Fe(n);if(y)return i.autoPosition?ie(y):B(y)},pe=function(y){if(y){const H=y.scrollHeight>y.clientHeight,re=window.getComputedStyle(y).overflowY.indexOf("hidden")!==-1;return H&&!re}return!0},g=function(y){return!y||y===document.body||y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:pe(y)?y:g(y.assignedSlot&&c.value.shadowDom?y.assignedSlot.parentNode:y.parentNode)},D=y=>{if(y)switch(i.position){case Ut.left:return{left:0,transform:"translateX(0)"};case Ut.right:return{left:`${y.width}px`,transform:"translateX(-100%)"};default:return{left:`${y.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:h,menuStyle:v,xCorrect:m,setMenuPosition:ae,getScrollableParent:g,shadowRender:(y,H)=>{var re,R,b;const oe=document.createElement("div"),V=(re=Fe(n))==null?void 0:re.getBoundingClientRect();oe.setAttribute("id","dp--temp-container");const M=(R=a.value)!=null&&R.clientWidth?a.value:document.body;M.append(oe);const o=D(V),w=c.value.shadowDom?Object.keys(p).filter(u=>["right-sidebar","left-sidebar","top-extra","action-extra"].includes(u)):Object.keys(p),z=Nr(y,{...H,shadow:!0,style:{opacity:0,position:"absolute",...o}},Object.fromEntries(w.map(u=>[u,p[u]])));An(z,oe),C.value=(b=z.el)==null?void 0:b.getBoundingClientRect(),An(null,oe),M.removeChild(oe)}}},Ot=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"hours-overlay-header",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-header",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-header",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]},{name:"top-extra",use:["shared","month-year"]},{name:"tp-inline-arrow-up",use:["shared","time"]},{name:"tp-inline-arrow-down",use:["shared","time"]},{name:"menu-header",use:["menu"]}],Ss=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],Rs={all:()=>Ot,monthYear:()=>Ot.filter(e=>e.use.includes("month-year")),input:()=>Ss,timePicker:()=>Ot.filter(e=>e.use.includes("time")),action:()=>Ot.filter(e=>e.use.includes("action")),calendar:()=>Ot.filter(e=>e.use.includes("calendar")),menu:()=>Ot.filter(e=>e.use.includes("menu")),shared:()=>Ot.filter(e=>e.use.includes("shared")),yearMode:()=>Ot.filter(e=>e.use.includes("year-mode"))},lt=(e,t,n)=>{const a=[];return Rs[t]().forEach(r=>{e[r.name]&&a.push(r.name)}),n!=null&&n.length&&n.forEach(r=>{r.slot&&a.push(r.slot)}),a},ga=e=>{const t=G(()=>a=>e.value?a?e.value.open:e.value.close:""),n=G(()=>a=>e.value?a?e.value.menuAppearTop:e.value.menuAppearBottom:"");return{transitionName:t,showTransition:!!e.value,menuTransition:n}},ba=(e,t,n)=>{const{defaultedRange:a,defaultedTz:r}=Se(e),l=Q(nt(Q(),r.value.timezone)),i=Z([{month:xe(l),year:he(l)}]),p=h=>{const k={hours:Tt(l),minutes:Rt(l),seconds:0};return a.value.enabled?[k[h],k[h]]:k[h]},c=ha({hours:p("hours"),minutes:p("minutes"),seconds:p("seconds")});ct(a,(h,k)=>{h.enabled!==k.enabled&&(c.hours=p("hours"),c.minutes=p("minutes"),c.seconds=p("seconds"))},{deep:!0});const C=G({get:()=>e.internalModelValue,set:h=>{!e.readonly&&!e.disabled&&t("update:internal-model-value",h)}}),m=G(()=>h=>i.value[h]?i.value[h].month:0),v=G(()=>h=>i.value[h]?i.value[h].year:0);return ct(C,(h,k)=>{n&&JSON.stringify(h??{})!==JSON.stringify(k??{})&&n()},{deep:!0}),{calendars:i,time:c,modelValue:C,month:m,year:v,today:l}},Is=(e,t)=>{const{defaultedMultiCalendars:n,defaultedMultiDates:a,defaultedUI:r,defaultedHighlight:l,defaultedTz:i,propDates:p,defaultedRange:c}=Se(t),{isDisabled:C}=Et(t),m=Z(null),v=Z(nt(new Date,i.value.timezone)),h=o=>{!o.current&&t.hideOffsetDates||(m.value=o.value)},k=()=>{m.value=null},Y=o=>Array.isArray(e.value)&&c.value.enabled&&e.value[0]&&m.value?o?Ne(m.value,e.value[0]):Ie(m.value,e.value[0]):!0,f=(o,w)=>{const z=()=>e.value?w?e.value[0]||null:e.value[1]:null,u=e.value&&Array.isArray(e.value)?z():null;return Me(Q(o.value),u)},S=o=>{const w=Array.isArray(e.value)?e.value[0]:null;return o?!Ie(m.value??null,w):!0},I=(o,w=!0)=>(c.value.enabled||t.weekPicker)&&Array.isArray(e.value)&&e.value.length===2?t.hideOffsetDates&&!o.current?!1:Me(Q(o.value),e.value[w?0:1]):c.value.enabled?f(o,w)&&S(w)||Me(o.value,Array.isArray(e.value)?e.value[0]:null)&&Y(w):!1,U=(o,w)=>{if(Array.isArray(e.value)&&e.value[0]&&e.value.length===1){const z=Me(o.value,m.value);return w?Ne(e.value[0],o.value)&&z:Ie(e.value[0],o.value)&&z}return!1},A=o=>!e.value||t.hideOffsetDates&&!o.current?!1:c.value.enabled?t.modelAuto&&Array.isArray(e.value)?Me(o.value,e.value[0]?e.value[0]:v.value):!1:a.value.enabled&&Array.isArray(e.value)?e.value.some(w=>Me(w,o.value)):Me(o.value,e.value?e.value:v.value),q=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){if(t.hideOffsetDates&&!o.current)return!1;const w=mt(m.value,+c.value.autoRange),z=xt(Q(m.value),t.weekStart);return t.weekPicker?Me(z[1],Q(o.value)):Me(w,Q(o.value))}return!1}return!1},ae=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){const w=mt(m.value,+c.value.autoRange);if(t.hideOffsetDates&&!o.current)return!1;const z=xt(Q(m.value),t.weekStart);return t.weekPicker?Ne(o.value,z[0])&&Ie(o.value,z[1]):Ne(o.value,m.value)&&Ie(o.value,w)}return!1}return!1},E=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){if(t.hideOffsetDates&&!o.current)return!1;const w=xt(Q(m.value),t.weekStart);return t.weekPicker?Me(w[0],o.value):Me(m.value,o.value)}return!1}return!1},B=o=>$a(e.value,m.value,o.value),ne=()=>t.modelAuto&&Array.isArray(t.internalModelValue)?!!t.internalModelValue[0]:!1,F=()=>t.modelAuto?yr(t.internalModelValue):!0,N=o=>{if(t.weekPicker)return!1;const w=c.value.enabled?!I(o)&&!I(o,!1):!0;return!C(o.value)&&!A(o)&&!(!o.current&&t.hideOffsetDates)&&w},ie=o=>c.value.enabled?t.modelAuto?ne()&&A(o):!1:A(o),ce=o=>l.value?oi(o.value,p.value.highlight):!1,pe=o=>{const w=C(o.value);return w&&(typeof l.value=="function"?!l.value(o.value,w):!l.value.options.highlightDisabled)},g=o=>{var w;return typeof l.value=="function"?l.value(o.value):(w=l.value.weekdays)==null?void 0:w.includes(o.value.getDay())},D=o=>(c.value.enabled||t.weekPicker)&&(!(n.value.count>0)||o.current)&&F()&&!(!o.current&&t.hideOffsetDates)&&!A(o)?B(o):!1,y=o=>{const{isRangeStart:w,isRangeEnd:z}=b(o),u=c.value.enabled?w||z:!1;return{dp__cell_offset:!o.current,dp__pointer:!t.disabled&&!(!o.current&&t.hideOffsetDates)&&!C(o.value),dp__cell_disabled:C(o.value),dp__cell_highlight:!pe(o)&&(ce(o)||g(o))&&!ie(o)&&!u&&!E(o)&&!(D(o)&&t.weekPicker)&&!z,dp__cell_highlight_active:!pe(o)&&(ce(o)||g(o))&&ie(o),dp__today:!t.noToday&&Me(o.value,v.value)&&o.current,"dp--past":Ie(o.value,v.value),"dp--future":Ne(o.value,v.value)}},H=o=>({dp__active_date:ie(o),dp__date_hover:N(o)}),re=o=>{if(e.value&&!Array.isArray(e.value)){const w=xt(e.value,t.weekStart);return{...V(o),dp__range_start:Me(w[0],o.value),dp__range_end:Me(w[1],o.value),dp__range_between_week:Ne(o.value,w[0])&&Ie(o.value,w[1])}}return{...V(o)}},R=o=>{if(e.value&&Array.isArray(e.value)){const w=xt(e.value[0],t.weekStart),z=e.value[1]?xt(e.value[1],t.weekStart):[];return{...V(o),dp__range_start:Me(w[0],o.value)||Me(z[0],o.value),dp__range_end:Me(w[1],o.value)||Me(z[1],o.value),dp__range_between_week:Ne(o.value,w[0])&&Ie(o.value,w[1])||Ne(o.value,z[0])&&Ie(o.value,z[1]),dp__range_between:Ne(o.value,w[1])&&Ie(o.value,z[0])}}return{...V(o)}},b=o=>{const w=n.value.count>0?o.current&&I(o)&&F():I(o)&&F(),z=n.value.count>0?o.current&&I(o,!1)&&F():I(o,!1)&&F();return{isRangeStart:w,isRangeEnd:z}},oe=o=>{const{isRangeStart:w,isRangeEnd:z}=b(o);return{dp__range_start:w,dp__range_end:z,dp__range_between:D(o),dp__date_hover:Me(o.value,m.value)&&!w&&!z&&!t.weekPicker,dp__date_hover_start:U(o,!0),dp__date_hover_end:U(o,!1)}},V=o=>({...oe(o),dp__cell_auto_range:ae(o),dp__cell_auto_range_start:E(o),dp__cell_auto_range_end:q(o)}),M=o=>c.value.enabled?c.value.autoRange?V(o):t.modelAuto?{...H(o),...oe(o)}:t.weekPicker?R(o):oe(o):t.weekPicker?re(o):H(o);return{setHoverDate:h,clearHoverDate:k,getDayClassData:o=>t.hideOffsetDates&&!o.current?{}:{...y(o),...M(o),[t.dayClass?t.dayClass(o.value,t.internalModelValue):""]:!0,...r.value.calendarCell??{}}}},Et=e=>{const{defaultedFilters:t,defaultedRange:n,propDates:a,defaultedMultiDates:r}=Se(e),l=g=>a.value.disabledDates?typeof a.value.disabledDates=="function"?a.value.disabledDates(Q(g)):!!Aa(g,a.value.disabledDates):!1,i=g=>a.value.maxDate?e.yearPicker?he(g)>he(a.value.maxDate):Ne(g,a.value.maxDate):!1,p=g=>a.value.minDate?e.yearPicker?he(g){const D=i(g),y=p(g),H=l(g),re=t.value.months.map(M=>+M).includes(xe(g)),R=e.disabledWeekDays.length?e.disabledWeekDays.some(M=>+M===Ul(g)):!1,b=k(g),oe=he(g),V=oe<+e.yearRange[0]||oe>+e.yearRange[1];return!(D||y||H||re||V||R||b)},C=(g,D)=>Ie(...$t(a.value.minDate,g,D))||Me(...$t(a.value.minDate,g,D)),m=(g,D)=>Ne(...$t(a.value.maxDate,g,D))||Me(...$t(a.value.maxDate,g,D)),v=(g,D,y)=>{let H=!1;return a.value.maxDate&&y&&m(g,D)&&(H=!0),a.value.minDate&&!y&&C(g,D)&&(H=!0),H},h=(g,D,y,H)=>{let re=!1;return H&&(a.value.minDate||a.value.maxDate)?a.value.minDate&&a.value.maxDate?re=v(g,D,y):(a.value.minDate&&C(g,D)||a.value.maxDate&&m(g,D))&&(re=!0):re=!0,re},k=g=>Array.isArray(a.value.allowedDates)&&!a.value.allowedDates.length?!0:a.value.allowedDates?!Aa(g,a.value.allowedDates):!1,Y=g=>!c(g),f=g=>n.value.noDisabledRange?!er({start:g[0],end:g[1]}).some(D=>Y(D)):!0,S=g=>{if(g){const D=he(g);return D>=+e.yearRange[0]&&D<=e.yearRange[1]}return!0},I=(g,D)=>!!(Array.isArray(g)&&g[D]&&(n.value.maxRange||n.value.minRange)&&S(g[D])),U=(g,D,y=0)=>{if(I(D,y)&&S(g)){const H=Jn(g,D[y]),re=kr(D[y],g),R=re.length===1?0:re.filter(oe=>Y(oe)).length,b=Math.abs(H)-(n.value.minMaxRawRange?0:R);if(n.value.minRange&&n.value.maxRange)return b>=+n.value.minRange&&b<=+n.value.maxRange;if(n.value.minRange)return b>=+n.value.minRange;if(n.value.maxRange)return b<=+n.value.maxRange}return!0},A=()=>!e.enableTimePicker||e.monthPicker||e.yearPicker||e.ignoreTimeValidation,q=g=>Array.isArray(g)?[g[0]?Ga(g[0]):null,g[1]?Ga(g[1]):null]:Ga(g),ae=(g,D,y)=>g.find(H=>+H.hours===Tt(D)&&H.minutes==="*"?!0:+H.minutes===Rt(D)&&+H.hours===Tt(D))&&y,E=(g,D,y)=>{const[H,re]=g,[R,b]=D;return!ae(H,R,y)&&!ae(re,b,y)&&y},B=(g,D)=>{const y=Array.isArray(D)?D:[D];return Array.isArray(e.disabledTimes)?Array.isArray(e.disabledTimes[0])?E(e.disabledTimes,y,g):!y.some(H=>ae(e.disabledTimes,H,g)):g},ne=(g,D)=>{const y=Array.isArray(D)?[Ft(D[0]),D[1]?Ft(D[1]):void 0]:Ft(D),H=!e.disabledTimes(y);return g&&H},F=(g,D)=>e.disabledTimes?Array.isArray(e.disabledTimes)?B(D,g):ne(D,g):D,N=g=>{let D=!0;if(!g||A())return!0;const y=!a.value.minDate&&!a.value.maxDate?q(g):g;return(e.maxTime||a.value.maxDate)&&(D=qn(e.maxTime,a.value.maxDate,"max",qe(y),D)),(e.minTime||a.value.minDate)&&(D=qn(e.minTime,a.value.minDate,"min",qe(y),D)),F(g,D)},ie=g=>{if(!e.monthPicker)return!0;let D=!0;const y=Q(pt(g));if(a.value.minDate&&a.value.maxDate){const H=Q(pt(a.value.minDate)),re=Q(pt(a.value.maxDate));return Ne(y,H)&&Ie(y,re)||Me(y,H)||Me(y,re)}if(a.value.minDate){const H=Q(pt(a.value.minDate));D=Ne(y,H)||Me(y,H)}if(a.value.maxDate){const H=Q(pt(a.value.maxDate));D=Ie(y,H)||Me(y,H)}return D},ce=G(()=>g=>!e.enableTimePicker||e.ignoreTimeValidation?!0:N(g)),pe=G(()=>g=>e.monthPicker?Array.isArray(g)&&(n.value.enabled||r.value.enabled)?!g.filter(D=>!ie(D)).length:ie(g):!0);return{isDisabled:Y,validateDate:c,validateMonthYearInRange:h,isDateRangeAllowed:f,checkMinMaxRange:U,isValidTime:N,isTimeValid:ce,isMonthValid:pe}},Ia=()=>{const e=G(()=>(a,r)=>a?.includes(r)),t=G(()=>(a,r)=>a.count?a.solo?!0:r===0:!0),n=G(()=>(a,r)=>a.count?a.solo?!0:r===a.count-1:!0);return{hideNavigationButtons:e,showLeftIcon:t,showRightIcon:n}},Es=(e,t,n)=>{const a=Z(0),r=ha({[Vt.timePicker]:!e.enableTimePicker||e.timePicker||e.monthPicker,[Vt.calendar]:!1,[Vt.header]:!1}),l=G(()=>e.monthPicker||e.timePicker),i=v=>{var h;if((h=e.flow)!=null&&h.length){if(!v&&l.value)return m();r[v]=!0,Object.keys(r).filter(k=>!r[k]).length||m()}},p=()=>{var v,h;(v=e.flow)!=null&&v.length&&a.value!==-1&&(a.value+=1,t("flow-step",a.value),m()),((h=e.flow)==null?void 0:h.length)===a.value&&it().then(()=>c())},c=()=>{a.value=-1},C=(v,h,...k)=>{var Y,f;e.flow[a.value]===v&&n.value&&((f=(Y=n.value)[h])==null||f.call(Y,...k))},m=(v=0)=>{v&&(a.value+=v),C(Xe.month,"toggleMonthPicker",!0),C(Xe.year,"toggleYearPicker",!0),C(Xe.calendar,"toggleTimePicker",!1,!0),C(Xe.time,"toggleTimePicker",!0,!0);const h=e.flow[a.value];(h===Xe.hours||h===Xe.minutes||h===Xe.seconds)&&C(h,"toggleTimePicker",!0,!0,h)};return{childMount:i,updateFlowStep:p,resetFlow:c,handleFlow:m,flowStep:a}},Bs={key:1,class:"dp__input_wrap"},Ns=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-label","aria-disabled","aria-invalid"],Ls={key:2,class:"dp--clear-btn"},Hs=["aria-label"],Vs=ze({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},...Ya},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur","text-input"],setup(e,{expose:t,emit:n}){const a=n,r=e,{defaultedTextInput:l,defaultedAriaLabels:i,defaultedInline:p,defaultedConfig:c,defaultedRange:C,defaultedMultiDates:m,defaultedUI:v,getDefaultPattern:h,getDefaultStartTime:k}=Se(r),{checkMinMaxRange:Y}=Et(r),f=Z(),S=Z(null),I=Z(!1),U=Z(!1),A=G(()=>({dp__pointer:!r.disabled&&!r.readonly&&!l.value.enabled,dp__disabled:r.disabled,dp__input_readonly:!l.value.enabled,dp__input:!0,dp__input_icon_pad:!r.hideInputIcon,dp__input_valid:typeof r.state=="boolean"?r.state:!1,dp__input_invalid:typeof r.state=="boolean"?!r.state:!1,dp__input_focus:I.value||r.isMenuOpen,dp__input_reg:!l.value.enabled,...v.value.input??{}})),q=()=>{a("set-input-date",null),r.clearable&&r.autoApply&&(a("set-empty-date"),f.value=null)},ae=b=>{const oe=k();return ii(b,l.value.format??h(),oe??xr({},r.enableSeconds),r.inputValue,U.value,r.formatLocale)},E=b=>{const{rangeSeparator:oe}=l.value,[V,M]=b.split(`${oe}`);if(V){const o=ae(V.trim()),w=M?ae(M.trim()):null;if(Kt(o,w))return;const z=o&&w?[o,w]:[o];Y(w,z,0)&&(f.value=o?z:null)}},B=()=>{U.value=!0},ne=b=>{if(C.value.enabled)E(b);else if(m.value.enabled){const oe=b.split(";");f.value=oe.map(V=>ae(V.trim())).filter(V=>V)}else f.value=ae(b)},F=b=>{var oe;const V=typeof b=="string"?b:(oe=b.target)==null?void 0:oe.value;V!==""?(l.value.openMenu&&!r.isMenuOpen&&a("open"),ne(V),a("set-input-date",f.value)):q(),U.value=!1,a("update:input-value",V),a("text-input",b,f.value)},N=b=>{l.value.enabled?(ne(b.target.value),l.value.enterSubmit&&sn(f.value)&&r.inputValue!==""?(a("set-input-date",f.value,!0),f.value=null):l.value.enterSubmit&&r.inputValue===""&&(f.value=null,a("clear"))):pe(b)},ie=(b,oe)=>{l.value.enabled&&l.value.tabSubmit&&!oe&&ne(b.target.value),l.value.tabSubmit&&sn(f.value)&&r.inputValue!==""?(a("set-input-date",f.value,!0,!0),f.value=null):l.value.tabSubmit&&r.inputValue===""&&(f.value=null,a("clear",!0))},ce=()=>{I.value=!0,a("focus"),it().then(()=>{var b;l.value.enabled&&l.value.selectOnFocus&&((b=S.value)==null||b.select())})},pe=b=>{if(Yt(b,c.value,!0),l.value.enabled&&l.value.openMenu&&!p.value.input){if(l.value.openMenu==="open"&&!r.isMenuOpen)return a("open");if(l.value.openMenu==="toggle")return a("toggle")}else l.value.enabled||a("toggle")},g=()=>{a("real-blur"),I.value=!1,(!r.isMenuOpen||p.value.enabled&&p.value.input)&&a("blur"),r.autoApply&&l.value.enabled&&f.value&&!r.isMenuOpen&&(a("set-input-date",f.value),a("select-date"),f.value=null)},D=b=>{Yt(b,c.value,!0),a("clear")},y=b=>{if(b.key==="Tab"&&ie(b),b.key==="Enter"&&N(b),!l.value.enabled){if(b.code==="Tab")return;b.preventDefault()}},H=()=>{var b;(b=S.value)==null||b.focus({preventScroll:!0})},re=b=>{f.value=b},R=b=>{b.key===$e.tab&&ie(b,!0)};return t({focusInput:H,setParsedDate:re}),(b,oe)=>{var V,M,o;return P(),W("div",{onClick:pe},[b.$slots.trigger&&!b.$slots["dp-input"]&&!d(p).enabled?ue(b.$slots,"trigger",{key:0}):j("",!0),!b.$slots.trigger&&(!d(p).enabled||d(p).input)?(P(),W("div",Bs,[b.$slots["dp-input"]&&!b.$slots.trigger&&(!d(p).enabled||d(p).enabled&&d(p).input)?ue(b.$slots,"dp-input",{key:0,value:e.inputValue,isMenuOpen:e.isMenuOpen,onInput:F,onEnter:N,onTab:ie,onClear:D,onBlur:g,onKeypress:y,onPaste:B,onFocus:ce,openMenu:()=>b.$emit("open"),closeMenu:()=>b.$emit("close"),toggleMenu:()=>b.$emit("toggle")}):j("",!0),b.$slots["dp-input"]?j("",!0):(P(),W("input",{key:1,id:b.uid?`dp-input-${b.uid}`:void 0,ref_key:"inputRef",ref:S,"data-test":"dp-input",name:b.name,class:ke(A.value),inputmode:d(l).enabled?"text":"none",placeholder:b.placeholder,disabled:b.disabled,readonly:b.readonly,required:b.required,value:e.inputValue,autocomplete:b.autocomplete,"aria-label":(V=d(i))==null?void 0:V.input,"aria-disabled":b.disabled||void 0,"aria-invalid":b.state===!1?!0:void 0,onInput:F,onBlur:g,onFocus:ce,onKeypress:y,onKeydown:oe[0]||(oe[0]=w=>y(w)),onPaste:B},null,42,Ns)),ye("div",{onClick:oe[3]||(oe[3]=w=>a("toggle"))},[b.$slots["input-icon"]&&!b.hideInputIcon?(P(),W("span",{key:0,class:"dp__input_icon",onClick:oe[1]||(oe[1]=w=>a("toggle"))},[ue(b.$slots,"input-icon")])):j("",!0),!b.$slots["input-icon"]&&!b.hideInputIcon&&!b.$slots["dp-input"]?(P(),De(d(aa),{key:1,"aria-label":(M=d(i))==null?void 0:M.calendarIcon,class:"dp__input_icon dp__input_icons",onClick:oe[2]||(oe[2]=w=>a("toggle"))},null,8,["aria-label"])):j("",!0)]),b.$slots["clear-icon"]&&e.inputValue&&b.clearable&&!b.disabled&&!b.readonly?(P(),W("span",Ls,[ue(b.$slots,"clear-icon",{clear:D})])):j("",!0),b.clearable&&!b.$slots["clear-icon"]&&e.inputValue&&!b.disabled&&!b.readonly?(P(),W("button",{key:3,"aria-label":(o=d(i))==null?void 0:o.clearInput,class:"dp--clear-btn",type:"button",onKeydown:oe[4]||(oe[4]=w=>d(et)(w,()=>D(w),!0,R)),onClick:oe[5]||(oe[5]=va(w=>D(w),["prevent"]))},[ot(d(fr),{class:"dp__input_icons","data-test":"clear-icon"})],40,Hs)):j("",!0)])):j("",!0)])}}}),Fs=typeof window<"u"?window:void 0,tn=()=>{},qs=e=>Fr()?(qr(e),!0):!1,Ws=(e,t,n,a)=>{if(!e)return tn;let r=tn;const l=ct(()=>d(e),p=>{r(),p&&(p.addEventListener(t,n,a),r=()=>{p.removeEventListener(t,n,a),r=tn})},{immediate:!0,flush:"post"}),i=()=>{l(),r()};return qs(i),i},Qs=(e,t,n,a={})=>{const{window:r=Fs,event:l="pointerdown"}=a;return r?Ws(r,l,i=>{const p=Fe(e),c=Fe(t);!p||!c||p===i.target||i.composedPath().includes(p)||i.composedPath().includes(c)||n(i)},{passive:!0}):void 0},zs=ze({compatConfig:{MODE:3},__name:"VueDatePicker",props:{...Ya},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update","invalid-date","overlay-toggle","text-input"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=Z(!1),p=ca(r,"modelValue"),c=ca(r,"timezone"),C=Z(null),m=Z(null),v=Z(null),h=Z(!1),k=Z(null),Y=Z(!1),f=Z(!1),S=Z(!1),I=Z(!1),{setMenuFocused:U,setShiftKey:A}=Ar(),{clearArrowNav:q}=It(),{validateDate:ae,isValidTime:E}=Et(r),{defaultedTransitions:B,defaultedTextInput:ne,defaultedInline:F,defaultedConfig:N,defaultedRange:ie,defaultedMultiDates:ce}=Se(r),{menuTransition:pe,showTransition:g}=ga(B);Ke(()=>{w(r.modelValue),it().then(()=>{if(!F.value.enabled){const O=oe(k.value);O?.addEventListener("scroll",J),window?.addEventListener("resize",$)}}),F.value.enabled&&(i.value=!0),window?.addEventListener("keyup",ge),window?.addEventListener("keydown",x)}),Ca(()=>{if(!F.value.enabled){const O=oe(k.value);O?.removeEventListener("scroll",J),window?.removeEventListener("resize",$)}window?.removeEventListener("keyup",ge),window?.removeEventListener("keydown",x)});const D=lt(l,"all",r.presetDates),y=lt(l,"input");ct([p,c],()=>{w(p.value)},{deep:!0});const{openOnTop:H,menuStyle:re,xCorrect:R,setMenuPosition:b,getScrollableParent:oe,shadowRender:V}=Ys({menuRef:C,menuRefInner:m,inputRef:v,pickerWrapperRef:k,inline:F,emit:a,props:r,slots:l}),{inputValue:M,internalModelValue:o,parseExternalModelValue:w,emitModelValue:z,formatInputValue:u,checkBeforeEmit:le}=$i(a,r,h),fe=G(()=>({dp__main:!0,dp__theme_dark:r.dark,dp__theme_light:!r.dark,dp__flex_display:F.value.enabled,"dp--flex-display-collapsed":S.value,dp__flex_display_with_input:F.value.input})),Ve=G(()=>r.dark?"dp__theme_dark":"dp__theme_light"),T=G(()=>r.teleport?{to:typeof r.teleport=="boolean"?"body":r.teleport,disabled:!r.teleport||F.value.enabled}:{}),K=G(()=>({class:"dp__outer_menu_wrap"})),s=G(()=>F.value.enabled&&(r.timePicker||r.monthPicker||r.yearPicker||r.quarterPicker)),L=()=>{var O,ee;return(ee=(O=v.value)==null?void 0:O.$el)==null?void 0:ee.getBoundingClientRect()},J=()=>{i.value&&(N.value.closeOnScroll?rt():b())},$=()=>{var O;i.value&&b();const ee=(O=m.value)==null?void 0:O.$el.getBoundingClientRect().width;S.value=document.body.offsetWidth<=ee},ge=O=>{O.key==="Tab"&&!F.value.enabled&&!r.teleport&&N.value.tabOutClosesMenu&&(k.value.contains(document.activeElement)||rt()),f.value=O.shiftKey},x=O=>{f.value=O.shiftKey},X=()=>{!r.disabled&&!r.readonly&&(V(Un,r),b(!1),i.value=!0,i.value&&a("open"),i.value||na(),w(r.modelValue))},de=()=>{var O;M.value="",na(),(O=v.value)==null||O.setParsedDate(null),a("update:model-value",null),a("update:model-timezone-value",null),a("cleared"),N.value.closeOnClearValue&&rt()},be=()=>{const O=o.value;return!O||!Array.isArray(O)&&ae(O)?!0:Array.isArray(O)?ce.value.enabled||O.length===2&&ae(O[0])&&ae(O[1])?!0:ie.value.partialRange&&!r.timePicker?ae(O[0]):!1:!1},st=()=>{le()&&be()?(z(),rt()):a("invalid-select",o.value)},me=O=>{Pt(),z(),N.value.closeOnAutoApply&&!O&&rt()},Pt=()=>{v.value&&ne.value.enabled&&v.value.setParsedDate(o.value)},gt=(O=!1)=>{r.autoApply&&E(o.value)&&be()&&(ie.value.enabled&&Array.isArray(o.value)?(ie.value.partialRange||o.value.length===2)&&me(O):me(O))},na=()=>{ne.value.enabled||(o.value=null)},rt=()=>{F.value.enabled||(i.value&&(i.value=!1,R.value=!1,U(!1),A(!1),q(),a("closed"),M.value&&w(p.value)),na(),a("blur"))},ra=(O,ee,se=!1)=>{if(!O){o.value=null;return}const Je=Array.isArray(O)?!O.some(Bt=>!ae(Bt)):ae(O),ut=E(O);Je&&ut?(I.value=!0,o.value=O,ee&&(Y.value=se,st(),a("text-submit")),it().then(()=>{I.value=!1})):a("invalid-date",O)},Ea=()=>{r.autoApply&&E(o.value)&&z(),Pt()},wa=()=>i.value?rt():X(),Ba=O=>{o.value=O},Na=()=>{ne.value.enabled&&(h.value=!0,u()),a("focus")},La=()=>{if(ne.value.enabled&&(h.value=!1,w(r.modelValue),Y.value)){const O=li(k.value,f.value);O?.focus()}a("blur")},Ha=O=>{m.value&&m.value.updateMonthYear(0,{month:Ln(O.month),year:Ln(O.year)})},Va=O=>{w(O??r.modelValue)},Fa=(O,ee)=>{var se;(se=m.value)==null||se.switchView(O,ee)},_=O=>N.value.onClickOutside?N.value.onClickOutside(O):rt(),te=(O=0)=>{var ee;(ee=m.value)==null||ee.handleFlow(O)};return Qs(C,v,()=>_(be)),t({closeMenu:rt,selectDate:st,clearValue:de,openMenu:X,onScroll:J,formatInputValue:u,updateInternalModelValue:Ba,setMonthYear:Ha,parseModel:Va,switchView:Fa,toggleMenu:wa,handleFlow:te,dpWrapMenuRef:C}),(O,ee)=>(P(),W("div",{ref_key:"pickerWrapperRef",ref:k,class:ke(fe.value),"data-datepicker-instance":""},[ot(Vs,Qe({ref_key:"inputRef",ref:v,"input-value":d(M),"onUpdate:inputValue":ee[0]||(ee[0]=se=>Pn(M)?M.value=se:null),"is-menu-open":i.value},O.$props,{onClear:de,onOpen:X,onSetInputDate:ra,onSetEmptyDate:d(z),onSelectDate:st,onToggle:wa,onClose:rt,onFocus:Na,onBlur:La,onRealBlur:ee[1]||(ee[1]=se=>h.value=!1),onTextInput:ee[2]||(ee[2]=se=>O.$emit("text-input",se))}),je({_:2},[Ye(d(y),(se,Je)=>({name:se,fn:_e(ut=>[ue(O.$slots,se,We(at(ut)))])}))]),1040,["input-value","is-menu-open","onSetEmptyDate"]),(P(),De(Oa(O.teleport?Br:"div"),We(at(T.value)),{default:_e(()=>[ot(ta,{name:d(pe)(d(H)),css:d(g)&&!d(F).enabled},{default:_e(()=>[i.value?(P(),W("div",Qe({key:0,ref_key:"dpWrapMenuRef",ref:C},K.value,{class:{"dp--menu-wrapper":!d(F).enabled},style:d(F).enabled?void 0:d(re)}),[ot(Un,Qe({ref_key:"dpMenuRef",ref:m},O.$props,{"internal-model-value":d(o),"onUpdate:internalModelValue":ee[3]||(ee[3]=se=>Pn(o)?o.value=se:null),class:{[Ve.value]:!0,"dp--menu-wrapper":O.teleport},"open-on-top":d(H),"no-overlay-focus":s.value,collapse:S.value,"get-input-rect":L,"is-text-input-date":I.value,onClosePicker:rt,onSelectDate:st,onAutoApply:gt,onTimeUpdate:Ea,onFlowStep:ee[4]||(ee[4]=se=>O.$emit("flow-step",se)),onUpdateMonthYear:ee[5]||(ee[5]=se=>O.$emit("update-month-year",se)),onInvalidSelect:ee[6]||(ee[6]=se=>O.$emit("invalid-select",d(o))),onAutoApplyInvalid:ee[7]||(ee[7]=se=>O.$emit("invalid-select",se)),onInvalidFixedRange:ee[8]||(ee[8]=se=>O.$emit("invalid-fixed-range",se)),onRecalculatePosition:d(b),onTooltipOpen:ee[9]||(ee[9]=se=>O.$emit("tooltip-open",se)),onTooltipClose:ee[10]||(ee[10]=se=>O.$emit("tooltip-close",se)),onTimePickerOpen:ee[11]||(ee[11]=se=>O.$emit("time-picker-open",se)),onTimePickerClose:ee[12]||(ee[12]=se=>O.$emit("time-picker-close",se)),onAmPmChange:ee[13]||(ee[13]=se=>O.$emit("am-pm-change",se)),onRangeStart:ee[14]||(ee[14]=se=>O.$emit("range-start",se)),onRangeEnd:ee[15]||(ee[15]=se=>O.$emit("range-end",se)),onDateUpdate:ee[16]||(ee[16]=se=>O.$emit("date-update",se)),onInvalidDate:ee[17]||(ee[17]=se=>O.$emit("invalid-date",se)),onOverlayToggle:ee[18]||(ee[18]=se=>O.$emit("overlay-toggle",se))}),je({_:2},[Ye(d(D),(se,Je)=>({name:se,fn:_e(ut=>[ue(O.$slots,se,We(at({...ut})))])}))]),1040,["internal-model-value","class","open-on-top","no-overlay-focus","collapse","is-text-input-date","onRecalculatePosition"])],16)):j("",!0)]),_:3},8,["name","css"])]),_:3},16))],2))}}),Ir=(()=>{const e=zs;return e.install=t=>{t.component("Vue3DatePicker",e)},e})(),Us=Object.freeze(Object.defineProperty({__proto__:null,default:Ir},Symbol.toStringTag,{value:"Module"}));Object.entries(Us).forEach(([e,t])=>{e!=="default"&&(Ir[e]=t)});export{Ir as V}; +import{I as ha,r as Z,P as ze,a6 as qt,a7 as ca,o as Ke,Y as it,V as Ca,H as ct,p as G,a as P,c as W,d as ot,a8 as je,h as Ye,w as _e,a9 as ue,aa as We,ab as at,A as d,ac as Qe,ad as Pn,i as De,T as ta,e as j,l as Oa,ae as Br,n as ke,b as ye,F as we,q as dt,a4 as va,t as Ge,R as Nr,af as An,ag as Lr,f as Dt,ah as Hr,m as Ma,ai as Da,C as Vr,L as Fr,M as qr}from"./index-CgM9eUIs.js";function ve(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Te(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function mt(e,t){const n=ve(e);return isNaN(t)?Te(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function ft(e,t){const n=ve(e);if(isNaN(t))return Te(e,NaN);if(!t)return n;const a=n.getDate(),r=Te(e,n.getTime());r.setMonth(n.getMonth()+t+1,0);const l=r.getDate();return a>=l?r:(n.setFullYear(r.getFullYear(),r.getMonth(),a),n)}function Xn(e,t){const{years:n=0,months:a=0,weeks:r=0,days:l=0,hours:i=0,minutes:p=0,seconds:c=0}=t,C=ve(e),m=a||n?ft(C,a+n*12):C,v=l||r?mt(m,l+r*7):m,h=p+i*60,Y=(c+h*60)*1e3;return Te(e,v.getTime()+Y)}function Wr(e,t){const n=+ve(e);return Te(e,n+t)}const Gn=6048e5,Qr=864e5,zr=6e4,jn=36e5,Ur=1e3;function Xr(e,t){return Wr(e,t*jn)}let Gr={};function Wt(){return Gr}function ht(e,t){const n=Wt(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ve(e),l=r.getDay(),i=(l=r.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Cn(e){const t=ve(e);return t.setHours(0,0,0,0),t}function Ta(e){const t=ve(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Jn(e,t){const n=Cn(e),a=Cn(t),r=+n-Ta(n),l=+a-Ta(a);return Math.round((r-l)/Qr)}function jr(e){const t=Kn(e),n=Te(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Gt(n)}function Kr(e,t){const n=t*3;return ft(e,n)}function un(e,t){return ft(e,t*12)}function On(e,t){const n=ve(e),a=ve(t),r=n.getTime()-a.getTime();return r<0?-1:r>0?1:r}function Zn(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ua(e){if(!Zn(e)&&typeof e!="number")return!1;const t=ve(e);return!isNaN(Number(t))}function $n(e){const t=ve(e);return Math.trunc(t.getMonth()/3)+1}function Jr(e,t){const n=ve(e),a=ve(t);return n.getFullYear()-a.getFullYear()}function Zr(e,t){const n=ve(e),a=ve(t),r=On(n,a),l=Math.abs(Jr(n,a));n.setFullYear(1584),a.setFullYear(1584);const i=On(n,a)===-r,p=r*(l-+i);return p===0?0:p}function er(e,t){const n=ve(e.start),a=ve(e.end);let r=+n>+a;const l=r?+n:+a,i=r?a:n;i.setHours(0,0,0,0);let p=1;const c=[];for(;+i<=l;)c.push(ve(i)),i.setDate(i.getDate()+p),i.setHours(0,0,0,0);return r?c.reverse():c}function Ht(e){const t=ve(e),n=t.getMonth(),a=n-n%3;return t.setMonth(a,1),t.setHours(0,0,0,0),t}function el(e,t){const n=ve(e.start),a=ve(e.end);let r=+n>+a;const l=r?+Ht(n):+Ht(a);let i=Ht(r?a:n),p=1;const c=[];for(;+i<=l;)c.push(ve(i)),i=Kr(i,p);return r?c.reverse():c}function tl(e){const t=ve(e);return t.setDate(1),t.setHours(0,0,0,0),t}function tr(e){const t=ve(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}function ma(e){const t=ve(e),n=Te(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ar(e,t){const n=Wt(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ve(e),l=r.getDay(),i=(l{let a;const r=al[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function Wa(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const rl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ll={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ol={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},il={date:Wa({formats:rl,defaultWidth:"full"}),time:Wa({formats:ll,defaultWidth:"full"}),dateTime:Wa({formats:ol,defaultWidth:"full"})},sl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ul=(e,t,n,a)=>sl[e];function oa(e){return(t,n)=>{const a=n?.context?String(n.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,p=n?.width?String(n.width):i;r=e.formattingValues[p]||e.formattingValues[i]}else{const i=e.defaultWidth,p=n?.width?String(n.width):e.defaultWidth;r=e.values[p]||e.values[i]}const l=e.argumentCallback?e.argumentCallback(t):t;return r[l]}}const dl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},cl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},vl={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ml={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},pl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hl=(e,t)=>{const n=Number(e),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yl={ordinalNumber:hl,era:oa({values:dl,defaultWidth:"wide"}),quarter:oa({values:cl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:oa({values:vl,defaultWidth:"wide"}),day:oa({values:ml,defaultWidth:"wide"}),dayPeriod:oa({values:pl,defaultWidth:"wide",formattingValues:fl,defaultFormattingWidth:"wide"})};function ia(e){return(t,n={})=>{const a=n.width,r=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],l=t.match(r);if(!l)return null;const i=l[0],p=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(p)?bl(p,v=>v.test(i)):gl(p,v=>v.test(i));let C;C=e.valueCallback?e.valueCallback(c):c,C=n.valueCallback?n.valueCallback(C):C;const m=t.slice(i.length);return{value:C,rest:m}}}function gl(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function bl(e,t){for(let n=0;n{const a=t.match(e.matchPattern);if(!a)return null;const r=a[0],l=t.match(e.parsePattern);if(!l)return null;let i=e.valueCallback?e.valueCallback(l[0]):l[0];i=n.valueCallback?n.valueCallback(i):i;const p=t.slice(r.length);return{value:i,rest:p}}}const _l=/^(\d+)(th|st|nd|rd)?/i,kl=/\d+/i,xl={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ml={any:[/^b/i,/^(a|c)/i]},Dl={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tl={any:[/1/i,/2/i,/3/i,/4/i]},Pl={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Al={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Cl={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ol={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$l={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Yl={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Sl={ordinalNumber:wl({matchPattern:_l,parsePattern:kl,valueCallback:e=>parseInt(e,10)}),era:ia({matchPatterns:xl,defaultMatchWidth:"wide",parsePatterns:Ml,defaultParseWidth:"any"}),quarter:ia({matchPatterns:Dl,defaultMatchWidth:"wide",parsePatterns:Tl,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ia({matchPatterns:Pl,defaultMatchWidth:"wide",parsePatterns:Al,defaultParseWidth:"any"}),day:ia({matchPatterns:Cl,defaultMatchWidth:"wide",parsePatterns:Ol,defaultParseWidth:"any"}),dayPeriod:ia({matchPatterns:$l,defaultMatchWidth:"any",parsePatterns:Yl,defaultParseWidth:"any"})},nr={code:"en-US",formatDistance:nl,formatLong:il,formatRelative:ul,localize:yl,match:Sl,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Rl(e){const t=ve(e);return Jn(t,ma(t))+1}function dn(e){const t=ve(e),n=+Gt(t)-+jr(t);return Math.round(n/Gn)+1}function cn(e,t){const n=ve(e),a=n.getFullYear(),r=Wt(),l=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=Te(e,0);i.setFullYear(a+1,0,l),i.setHours(0,0,0,0);const p=ht(i,t),c=Te(e,0);c.setFullYear(a,0,l),c.setHours(0,0,0,0);const C=ht(c,t);return n.getTime()>=p.getTime()?a+1:n.getTime()>=C.getTime()?a:a-1}function Il(e,t){const n=Wt(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=cn(e,t),l=Te(e,0);return l.setFullYear(r,0,a),l.setHours(0,0,0,0),ht(l,t)}function vn(e,t){const n=ve(e),a=+ht(n,t)-+Il(n,t);return Math.round(a/Gn)+1}function Ae(e,t){const n=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return n+a}const Ct={y(e,t){const n=e.getFullYear(),a=n>0?n:1-n;return Ae(t==="yy"?a%100:a,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ae(n+1,2)},d(e,t){return Ae(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ae(e.getHours()%12||12,t.length)},H(e,t){return Ae(e.getHours(),t.length)},m(e,t){return Ae(e.getMinutes(),t.length)},s(e,t){return Ae(e.getSeconds(),t.length)},S(e,t){const n=t.length,a=e.getMilliseconds(),r=Math.trunc(a*Math.pow(10,n-3));return Ae(r,t.length)}},Qt={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sn={G:function(e,t,n){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const a=e.getFullYear(),r=a>0?a:1-a;return n.ordinalNumber(r,{unit:"year"})}return Ct.y(e,t)},Y:function(e,t,n,a){const r=cn(e,a),l=r>0?r:1-r;if(t==="YY"){const i=l%100;return Ae(i,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):Ae(l,t.length)},R:function(e,t){const n=Kn(e);return Ae(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ae(n,t.length)},Q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Ae(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Ae(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){const a=e.getMonth();switch(t){case"M":case"MM":return Ct.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return Ae(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,n,a){const r=vn(e,a);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Ae(r,t.length)},I:function(e,t,n){const a=dn(e);return t==="Io"?n.ordinalNumber(a,{unit:"week"}):Ae(a,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ct.d(e,t)},D:function(e,t,n){const a=Rl(e);return t==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):Ae(a,t.length)},E:function(e,t,n){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});case"EEEE":default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){const r=e.getDay(),l=(r-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return Ae(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){const r=e.getDay(),l=(r-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return Ae(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const a=e.getDay(),r=a===0?7:a;switch(t){case"i":return String(r);case"ii":return Ae(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const a=e.getHours();let r;switch(a===12?r=Qt.noon:a===0?r=Qt.midnight:r=a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const a=e.getHours();let r;switch(a>=17?r=Qt.evening:a>=12?r=Qt.afternoon:a>=4?r=Qt.morning:r=Qt.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return Ct.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ct.H(e,t)},K:function(e,t,n){const a=e.getHours()%12;return t==="Ko"?n.ordinalNumber(a,{unit:"hour"}):Ae(a,t.length)},k:function(e,t,n){let a=e.getHours();return a===0&&(a=24),t==="ko"?n.ordinalNumber(a,{unit:"hour"}):Ae(a,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ct.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ct.s(e,t)},S:function(e,t){return Ct.S(e,t)},X:function(e,t,n){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return In(a);case"XXXX":case"XX":return Nt(a);case"XXXXX":case"XXX":default:return Nt(a,":")}},x:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"x":return In(a);case"xxxx":case"xx":return Nt(a);case"xxxxx":case"xxx":default:return Nt(a,":")}},O:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Rn(a,":");case"OOOO":default:return"GMT"+Nt(a,":")}},z:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Rn(a,":");case"zzzz":default:return"GMT"+Nt(a,":")}},t:function(e,t,n){const a=Math.trunc(e.getTime()/1e3);return Ae(a,t.length)},T:function(e,t,n){const a=e.getTime();return Ae(a,t.length)}};function Rn(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),r=Math.trunc(a/60),l=a%60;return l===0?n+String(r):n+String(r)+t+Ae(l,2)}function In(e,t){return e%60===0?(e>0?"-":"+")+Ae(Math.abs(e)/60,2):Nt(e,t)}function Nt(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),r=Ae(Math.trunc(a/60),2),l=Ae(a%60,2);return n+r+t+l}const En=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},rr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},El=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],a=n[1],r=n[2];if(!r)return En(e,t);let l;switch(a){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",En(a,t)).replace("{{time}}",rr(r,t))},an={p:rr,P:El},Bl=/^D+$/,Nl=/^Y+$/,Ll=["D","DD","YY","YYYY"];function lr(e){return Bl.test(e)}function or(e){return Nl.test(e)}function nn(e,t,n){const a=Hl(e,t,n);if(console.warn(a),Ll.includes(e))throw new RangeError(a)}function Hl(e,t,n){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ql=/^'([^]*?)'?$/,Wl=/''/g,Ql=/[a-zA-Z]/;function kt(e,t,n){const a=Wt(),r=n?.locale??a.locale??nr,l=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,p=ve(e);if(!ua(p))throw new RangeError("Invalid time value");let c=t.match(Fl).map(m=>{const v=m[0];if(v==="p"||v==="P"){const h=an[v];return h(m,r.formatLong)}return m}).join("").match(Vl).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const v=m[0];if(v==="'")return{isToken:!1,value:zl(m)};if(Sn[v])return{isToken:!0,value:m};if(v.match(Ql))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:m}});r.localize.preprocessor&&(c=r.localize.preprocessor(p,c));const C={firstWeekContainsDate:l,weekStartsOn:i,locale:r};return c.map(m=>{if(!m.isToken)return m.value;const v=m.value;(!n?.useAdditionalWeekYearTokens&&or(v)||!n?.useAdditionalDayOfYearTokens&&lr(v))&&nn(v,t,String(e));const h=Sn[v[0]];return h(p,v,r.localize,C)}).join("")}function zl(e){const t=e.match(ql);return t?t[1].replace(Wl,"'"):e}function Ul(e){return ve(e).getDay()}function Xl(e){const t=ve(e),n=t.getFullYear(),a=t.getMonth(),r=Te(e,0);return r.setFullYear(n,a+1,0),r.setHours(0,0,0,0),r.getDate()}function Gl(){return Object.assign({},Wt())}function Tt(e){return ve(e).getHours()}function jl(e){let n=ve(e).getDay();return n===0&&(n=7),n}function Rt(e){return ve(e).getMinutes()}function xe(e){return ve(e).getMonth()}function jt(e){return ve(e).getSeconds()}function he(e){return ve(e).getFullYear()}function Kt(e,t){const n=ve(e),a=ve(t);return n.getTime()>a.getTime()}function pa(e,t){const n=ve(e),a=ve(t);return+n<+a}function Xt(e,t){const n=ve(e),a=ve(t);return+n==+a}function Kl(e,t){const n=t instanceof Date?Te(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const Jl=10;class ir{subPriority=0;validate(t,n){return!0}}class Zl extends ir{constructor(t,n,a,r,l){super(),this.value=t,this.validateValue=n,this.setValue=a,this.priority=r,l&&(this.subPriority=l)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,a){return this.setValue(t,n,this.value,a)}}class eo extends ir{priority=Jl;subPriority=-1;set(t,n){return n.timestampIsSet?t:Te(t,Kl(t,Date))}}class Pe{run(t,n,a,r){const l=this.parse(t,n,a,r);return l?{setter:new Zl(l.value,this.validate,this.set,this.priority,this.subPriority),rest:l.rest}:null}validate(t,n,a){return!0}}class to extends Pe{priority=140;parse(t,n,a){switch(n){case"G":case"GG":case"GGG":return a.era(t,{width:"abbreviated"})||a.era(t,{width:"narrow"});case"GGGGG":return a.era(t,{width:"narrow"});case"GGGG":default:return a.era(t,{width:"wide"})||a.era(t,{width:"abbreviated"})||a.era(t,{width:"narrow"})}}set(t,n,a){return n.era=a,t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const Le={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},bt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function He(e,t){return e&&{value:t(e.value),rest:e.rest}}function Re(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function wt(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const a=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,l=n[3]?parseInt(n[3],10):0,i=n[5]?parseInt(n[5],10):0;return{value:a*(r*jn+l*zr+i*Ur),rest:t.slice(n[0].length)}}function sr(e){return Re(Le.anyDigitsSigned,e)}function Ee(e,t){switch(e){case 1:return Re(Le.singleDigit,t);case 2:return Re(Le.twoDigits,t);case 3:return Re(Le.threeDigits,t);case 4:return Re(Le.fourDigits,t);default:return Re(new RegExp("^\\d{1,"+e+"}"),t)}}function Pa(e,t){switch(e){case 1:return Re(Le.singleDigitSigned,t);case 2:return Re(Le.twoDigitsSigned,t);case 3:return Re(Le.threeDigitsSigned,t);case 4:return Re(Le.fourDigitsSigned,t);default:return Re(new RegExp("^-?\\d{1,"+e+"}"),t)}}function mn(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function ur(e,t){const n=t>0,a=n?t:1-t;let r;if(a<=50)r=e||100;else{const l=a+50,i=Math.trunc(l/100)*100,p=e>=l%100;r=e+i-(p?100:0)}return n?r:1-r}function dr(e){return e%400===0||e%4===0&&e%100!==0}class ao extends Pe{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,a){const r=l=>({year:l,isTwoDigitYear:n==="yy"});switch(n){case"y":return He(Ee(4,t),r);case"yo":return He(a.ordinalNumber(t,{unit:"year"}),r);default:return He(Ee(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,a){const r=t.getFullYear();if(a.isTwoDigitYear){const i=ur(a.year,r);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const l=!("era"in n)||n.era===1?a.year:1-a.year;return t.setFullYear(l,0,1),t.setHours(0,0,0,0),t}}class no extends Pe{priority=130;parse(t,n,a){const r=l=>({year:l,isTwoDigitYear:n==="YY"});switch(n){case"Y":return He(Ee(4,t),r);case"Yo":return He(a.ordinalNumber(t,{unit:"year"}),r);default:return He(Ee(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,a,r){const l=cn(t,r);if(a.isTwoDigitYear){const p=ur(a.year,l);return t.setFullYear(p,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),ht(t,r)}const i=!("era"in n)||n.era===1?a.year:1-a.year;return t.setFullYear(i,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),ht(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ro extends Pe{priority=130;parse(t,n){return Pa(n==="R"?4:n.length,t)}set(t,n,a){const r=Te(t,0);return r.setFullYear(a,0,4),r.setHours(0,0,0,0),Gt(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class lo extends Pe{priority=130;parse(t,n){return Pa(n==="u"?4:n.length,t)}set(t,n,a){return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class oo extends Pe{priority=120;parse(t,n,a){switch(n){case"Q":case"QQ":return Ee(n.length,t);case"Qo":return a.ordinalNumber(t,{unit:"quarter"});case"QQQ":return a.quarter(t,{width:"abbreviated",context:"formatting"})||a.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(t,{width:"wide",context:"formatting"})||a.quarter(t,{width:"abbreviated",context:"formatting"})||a.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,a){return t.setMonth((a-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class io extends Pe{priority=120;parse(t,n,a){switch(n){case"q":case"qq":return Ee(n.length,t);case"qo":return a.ordinalNumber(t,{unit:"quarter"});case"qqq":return a.quarter(t,{width:"abbreviated",context:"standalone"})||a.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(t,{width:"wide",context:"standalone"})||a.quarter(t,{width:"abbreviated",context:"standalone"})||a.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,a){return t.setMonth((a-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class so extends Pe{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,a){const r=l=>l-1;switch(n){case"M":return He(Re(Le.month,t),r);case"MM":return He(Ee(2,t),r);case"Mo":return He(a.ordinalNumber(t,{unit:"month"}),r);case"MMM":return a.month(t,{width:"abbreviated",context:"formatting"})||a.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(t,{width:"wide",context:"formatting"})||a.month(t,{width:"abbreviated",context:"formatting"})||a.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.setMonth(a,1),t.setHours(0,0,0,0),t}}class uo extends Pe{priority=110;parse(t,n,a){const r=l=>l-1;switch(n){case"L":return He(Re(Le.month,t),r);case"LL":return He(Ee(2,t),r);case"Lo":return He(a.ordinalNumber(t,{unit:"month"}),r);case"LLL":return a.month(t,{width:"abbreviated",context:"standalone"})||a.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(t,{width:"wide",context:"standalone"})||a.month(t,{width:"abbreviated",context:"standalone"})||a.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.setMonth(a,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function co(e,t,n){const a=ve(e),r=vn(a,n)-t;return a.setDate(a.getDate()-r*7),a}class vo extends Pe{priority=100;parse(t,n,a){switch(n){case"w":return Re(Le.week,t);case"wo":return a.ordinalNumber(t,{unit:"week"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,a,r){return ht(co(t,a,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function mo(e,t){const n=ve(e),a=dn(n)-t;return n.setDate(n.getDate()-a*7),n}class po extends Pe{priority=100;parse(t,n,a){switch(n){case"I":return Re(Le.week,t);case"Io":return a.ordinalNumber(t,{unit:"week"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,a){return Gt(mo(t,a))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const fo=[31,28,31,30,31,30,31,31,30,31,30,31],ho=[31,29,31,30,31,30,31,31,30,31,30,31];class yo extends Pe{priority=90;subPriority=1;parse(t,n,a){switch(n){case"d":return Re(Le.date,t);case"do":return a.ordinalNumber(t,{unit:"date"});default:return Ee(n.length,t)}}validate(t,n){const a=t.getFullYear(),r=dr(a),l=t.getMonth();return r?n>=1&&n<=ho[l]:n>=1&&n<=fo[l]}set(t,n,a){return t.setDate(a),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class go extends Pe{priority=90;subpriority=1;parse(t,n,a){switch(n){case"D":case"DD":return Re(Le.dayOfYear,t);case"Do":return a.ordinalNumber(t,{unit:"date"});default:return Ee(n.length,t)}}validate(t,n){const a=t.getFullYear();return dr(a)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,a){return t.setMonth(0,a),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function pn(e,t,n){const a=Wt(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,l=ve(e),i=l.getDay(),c=(t%7+7)%7,C=7-r,m=t<0||t>6?t-(i+C)%7:(c+C)%7-(i+C)%7;return mt(l,m)}class bo extends Pe{priority=90;parse(t,n,a){switch(n){case"E":case"EE":case"EEE":return a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class wo extends Pe{priority=90;parse(t,n,a,r){const l=i=>{const p=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+p};switch(n){case"e":case"ee":return He(Ee(n.length,t),l);case"eo":return He(a.ordinalNumber(t,{unit:"day"}),l);case"eee":return a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"eeeee":return a.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class _o extends Pe{priority=90;parse(t,n,a,r){const l=i=>{const p=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+p};switch(n){case"c":case"cc":return He(Ee(n.length,t),l);case"co":return He(a.ordinalNumber(t,{unit:"day"}),l);case"ccc":return a.day(t,{width:"abbreviated",context:"standalone"})||a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"});case"ccccc":return a.day(t,{width:"narrow",context:"standalone"});case"cccccc":return a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(t,{width:"wide",context:"standalone"})||a.day(t,{width:"abbreviated",context:"standalone"})||a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function ko(e,t){const n=ve(e),a=jl(n),r=t-a;return mt(n,r)}class xo extends Pe{priority=90;parse(t,n,a){const r=l=>l===0?7:l;switch(n){case"i":case"ii":return Ee(n.length,t);case"io":return a.ordinalNumber(t,{unit:"day"});case"iii":return He(a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return He(a.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return He(a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r);case"iiii":default:return He(a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,n){return n>=1&&n<=7}set(t,n,a){return t=ko(t,a),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Mo extends Pe{priority=80;parse(t,n,a){switch(n){case"a":case"aa":case"aaa":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class Do extends Pe{priority=80;parse(t,n,a){switch(n){case"b":case"bb":case"bbb":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class To extends Pe{priority=80;parse(t,n,a){switch(n){case"B":case"BB":case"BBB":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class Po extends Pe{priority=70;parse(t,n,a){switch(n){case"h":return Re(Le.hour12h,t);case"ho":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,a){const r=t.getHours()>=12;return r&&a<12?t.setHours(a+12,0,0,0):!r&&a===12?t.setHours(0,0,0,0):t.setHours(a,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class Ao extends Pe{priority=70;parse(t,n,a){switch(n){case"H":return Re(Le.hour23h,t);case"Ho":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,a){return t.setHours(a,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class Co extends Pe{priority=70;parse(t,n,a){switch(n){case"K":return Re(Le.hour11h,t);case"Ko":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.getHours()>=12&&a<12?t.setHours(a+12,0,0,0):t.setHours(a,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Oo extends Pe{priority=70;parse(t,n,a){switch(n){case"k":return Re(Le.hour24h,t);case"ko":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,a){const r=a<=24?a%24:a;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class $o extends Pe{priority=60;parse(t,n,a){switch(n){case"m":return Re(Le.minute,t);case"mo":return a.ordinalNumber(t,{unit:"minute"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,a){return t.setMinutes(a,0,0),t}incompatibleTokens=["t","T"]}class Yo extends Pe{priority=50;parse(t,n,a){switch(n){case"s":return Re(Le.second,t);case"so":return a.ordinalNumber(t,{unit:"second"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,a){return t.setSeconds(a,0),t}incompatibleTokens=["t","T"]}class So extends Pe{priority=30;parse(t,n){const a=r=>Math.trunc(r*Math.pow(10,-n.length+3));return He(Ee(n.length,t),a)}set(t,n,a){return t.setMilliseconds(a),t}incompatibleTokens=["t","T"]}class Ro extends Pe{priority=10;parse(t,n){switch(n){case"X":return wt(bt.basicOptionalMinutes,t);case"XX":return wt(bt.basic,t);case"XXXX":return wt(bt.basicOptionalSeconds,t);case"XXXXX":return wt(bt.extendedOptionalSeconds,t);case"XXX":default:return wt(bt.extended,t)}}set(t,n,a){return n.timestampIsSet?t:Te(t,t.getTime()-Ta(t)-a)}incompatibleTokens=["t","T","x"]}class Io extends Pe{priority=10;parse(t,n){switch(n){case"x":return wt(bt.basicOptionalMinutes,t);case"xx":return wt(bt.basic,t);case"xxxx":return wt(bt.basicOptionalSeconds,t);case"xxxxx":return wt(bt.extendedOptionalSeconds,t);case"xxx":default:return wt(bt.extended,t)}}set(t,n,a){return n.timestampIsSet?t:Te(t,t.getTime()-Ta(t)-a)}incompatibleTokens=["t","T","X"]}class Eo extends Pe{priority=40;parse(t){return sr(t)}set(t,n,a){return[Te(t,a*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Bo extends Pe{priority=20;parse(t){return sr(t)}set(t,n,a){return[Te(t,a),{timestampIsSet:!0}]}incompatibleTokens="*"}const No={G:new to,y:new ao,Y:new no,R:new ro,u:new lo,Q:new oo,q:new io,M:new so,L:new uo,w:new vo,I:new po,d:new yo,D:new go,E:new bo,e:new wo,c:new _o,i:new xo,a:new Mo,b:new Do,B:new To,h:new Po,H:new Ao,K:new Co,k:new Oo,m:new $o,s:new Yo,S:new So,X:new Ro,x:new Io,t:new Eo,T:new Bo},Lo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ho=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vo=/^'([^]*?)'?$/,Fo=/''/g,qo=/\S/,Wo=/[a-zA-Z]/;function rn(e,t,n,a){const r=Gl(),l=a?.locale??r.locale??nr,i=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,p=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0;if(t==="")return e===""?ve(n):Te(n,NaN);const c={firstWeekContainsDate:i,weekStartsOn:p,locale:l},C=[new eo],m=t.match(Ho).map(f=>{const S=f[0];if(S in an){const I=an[S];return I(f,l.formatLong)}return f}).join("").match(Lo),v=[];for(let f of m){!a?.useAdditionalWeekYearTokens&&or(f)&&nn(f,t,e),!a?.useAdditionalDayOfYearTokens&&lr(f)&&nn(f,t,e);const S=f[0],I=No[S];if(I){const{incompatibleTokens:U}=I;if(Array.isArray(U)){const q=v.find(ae=>U.includes(ae.token)||ae.token===S);if(q)throw new RangeError(`The format string mustn't contain \`${q.fullToken}\` and \`${f}\` at the same time`)}else if(I.incompatibleTokens==="*"&&v.length>0)throw new RangeError(`The format string mustn't contain \`${f}\` and any other token at the same time`);v.push({token:S,fullToken:f});const A=I.run(e,f,l.match,c);if(!A)return Te(n,NaN);C.push(A.setter),e=A.rest}else{if(S.match(Wo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");if(f==="''"?f="'":S==="'"&&(f=Qo(f)),e.indexOf(f)===0)e=e.slice(f.length);else return Te(n,NaN)}}if(e.length>0&&qo.test(e))return Te(n,NaN);const h=C.map(f=>f.priority).sort((f,S)=>S-f).filter((f,S,I)=>I.indexOf(f)===S).map(f=>C.filter(S=>S.priority===f).sort((S,I)=>I.subPriority-S.subPriority)).map(f=>f[0]);let k=ve(n);if(isNaN(k.getTime()))return Te(n,NaN);const Y={};for(const f of h){if(!f.validate(k,c))return Te(n,NaN);const S=f.set(k,Y,c);Array.isArray(S)?(k=S[0],Object.assign(Y,S[1])):k=S}return Te(n,k)}function Qo(e){return e.match(Vo)[1].replace(Fo,"'")}function Bn(e,t){const n=Ht(e),a=Ht(t);return+n==+a}function zo(e,t){return mt(e,-t)}function cr(e,t){const n=ve(e),a=n.getFullYear(),r=n.getDate(),l=Te(e,0);l.setFullYear(a,t,15),l.setHours(0,0,0,0);const i=Xl(l);return n.setMonth(t,Math.min(r,i)),n}function Ce(e,t){let n=ve(e);return isNaN(+n)?Te(e,NaN):(t.year!=null&&n.setFullYear(t.year),t.month!=null&&(n=cr(n,t.month)),t.date!=null&&n.setDate(t.date),t.hours!=null&&n.setHours(t.hours),t.minutes!=null&&n.setMinutes(t.minutes),t.seconds!=null&&n.setSeconds(t.seconds),t.milliseconds!=null&&n.setMilliseconds(t.milliseconds),n)}function Uo(e,t){const n=ve(e);return n.setHours(t),n}function vr(e,t){const n=ve(e);return n.setMilliseconds(t),n}function Xo(e,t){const n=ve(e);return n.setMinutes(t),n}function mr(e,t){const n=ve(e);return n.setSeconds(t),n}function _t(e,t){const n=ve(e);return isNaN(+n)?Te(e,NaN):(n.setFullYear(t),n)}function Jt(e,t){return ft(e,-t)}function Go(e,t){const{years:n=0,months:a=0,weeks:r=0,days:l=0,hours:i=0,minutes:p=0,seconds:c=0}=t,C=Jt(e,a+n*12),m=zo(C,l+r*7),v=p+i*60,k=(c+v*60)*1e3;return Te(e,m.getTime()-k)}function pr(e,t){return un(e,-t)}function aa(){const e=Lr();return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img",...e},[ye("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),ye("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),ye("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),ye("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}aa.compatConfig={MODE:3};function fr(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),ye("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}fr.compatConfig={MODE:3};function fn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}fn.compatConfig={MODE:3};function hn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}hn.compatConfig={MODE:3};function yn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),ye("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}yn.compatConfig={MODE:3};function gn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}gn.compatConfig={MODE:3};function bn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}bn.compatConfig={MODE:3};const nt=(e,t)=>t?new Date(e.toLocaleString("en-US",{timeZone:t})):new Date(e),wn=(e,t,n)=>ln(e,t,n)||Q(),jo=(e,t,n)=>{const a=t.dateInTz?nt(new Date(e),t.dateInTz):Q(e);return n?tt(a,!0):a},ln=(e,t,n)=>{if(!e)return null;const a=n?tt(Q(e),!0):Q(e);return t?t.exactMatch?jo(e,t,n):nt(a,t.timezone):a},Ko=e=>{if(!e)return 0;const t=new Date,n=new Date(t.toLocaleString("en-US",{timeZone:"UTC"})),a=new Date(t.toLocaleString("en-US",{timeZone:e})),r=a.getTimezoneOffset()/60;return(+n-+a)/(1e3*60*60)-r};var vt=(e=>(e.month="month",e.year="year",e))(vt||{}),Lt=(e=>(e.top="top",e.bottom="bottom",e))(Lt||{}),Vt=(e=>(e.header="header",e.calendar="calendar",e.timePicker="timePicker",e))(Vt||{}),Xe=(e=>(e.month="month",e.year="year",e.calendar="calendar",e.time="time",e.minutes="minutes",e.hours="hours",e.seconds="seconds",e))(Xe||{});const Jo=["timestamp","date","iso"];var Ze=(e=>(e.up="up",e.down="down",e.left="left",e.right="right",e))(Ze||{}),$e=(e=>(e.arrowUp="ArrowUp",e.arrowDown="ArrowDown",e.arrowLeft="ArrowLeft",e.arrowRight="ArrowRight",e.enter="Enter",e.space=" ",e.esc="Escape",e.tab="Tab",e.home="Home",e.end="End",e.pageUp="PageUp",e.pageDown="PageDown",e))($e||{});function Nn(e){return t=>new Intl.DateTimeFormat(e,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${t}T00:00:00+00:00`)).slice(0,2)}function Zo(e){return t=>kt(nt(new Date(`2017-01-0${t}T00:00:00+00:00`),"UTC"),"EEEEEE",{locale:e})}const ei=(e,t,n)=>{const a=[1,2,3,4,5,6,7];let r;if(e!==null)try{r=a.map(Zo(e))}catch{r=a.map(Nn(t))}else r=a.map(Nn(t));const l=r.slice(0,n),i=r.slice(n+1,r.length);return[r[n]].concat(...i).concat(...l)},_n=(e,t,n)=>{const a=[];for(let r=+e[0];r<=+e[1];r++)a.push({value:+r,text:br(r,t)});return n?a.reverse():a},hr=(e,t,n)=>{const a=[1,2,3,4,5,6,7,8,9,10,11,12].map(l=>{const i=l<10?`0${l}`:l;return new Date(`2017-${i}-01T00:00:00+00:00`)});if(e!==null)try{const l=n==="long"?"LLLL":"LLL";return a.map((i,p)=>{const c=kt(nt(i,"UTC"),l,{locale:e});return{text:c.charAt(0).toUpperCase()+c.substring(1),value:p}})}catch{}const r=new Intl.DateTimeFormat(t,{month:n,timeZone:"UTC"});return a.map((l,i)=>{const p=r.format(l);return{text:p.charAt(0).toUpperCase()+p.substring(1),value:i}})},ti=e=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][e],Fe=e=>{const t=d(e);return t!=null&&t.$el?t?.$el:t},ai=e=>({type:"dot",...e??{}}),yr=e=>Array.isArray(e)?!!e[0]&&!!e[1]:!1,kn={prop:e=>`"${e}" prop must be enabled!`,dateArr:e=>`You need to use array as "model-value" binding in order to support "${e}"`},qe=e=>e,Ln=e=>e===0?e:!e||isNaN(+e)?null:+e,Hn=e=>e===null,gr=e=>{if(e)return[...e.querySelectorAll("input, button, select, textarea, a[href]")][0]},ni=e=>{const t=[],n=a=>a.filter(r=>r);for(let a=0;a{const a=n!=null,r=t!=null;if(!a&&!r)return!1;const l=+n,i=+t;return a&&r?+e>l||+el:r?+eni(e).map(n=>n.map(a=>{const{active:r,disabled:l,isBetween:i,highlighted:p}=t(a);return{...a,active:r,disabled:l,className:{dp__overlay_cell_active:r,dp__overlay_cell:!r,dp__overlay_cell_disabled:l,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:l&&r,dp__cell_in_between:i,"dp--highlighted":p}}})),Yt=(e,t,n=!1)=>{e&&t.allowStopPropagation&&(n&&e.stopImmediatePropagation(),e.stopPropagation())},ri=()=>["a[href]","area[href]","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","[tabindex]:not([tabindex='-1'])","[data-datepicker-instance]"].join(", ");function li(e,t){let n=[...document.querySelectorAll(ri())];n=n.filter(r=>!e.contains(r)||r.hasAttribute("data-datepicker-instance"));const a=n.indexOf(e);if(a>=0&&(t?a-1>=0:a+1<=n.length))return n[a+(t?-1:1)]}const on=(e,t)=>e?.querySelector(`[data-dp-element="${t}"]`),br=(e,t)=>new Intl.NumberFormat(t,{useGrouping:!1,style:"decimal"}).format(e),xn=e=>kt(e,"dd-MM-yyyy"),Qa=e=>Array.isArray(e),Aa=(e,t)=>t.get(xn(e)),oi=(e,t)=>e?t?t instanceof Map?!!Aa(e,t):t(Q(e)):!1:!0,et=(e,t,n=!1,a)=>{if(e.key===$e.enter||e.key===$e.space)return n&&e.preventDefault(),t();if(a)return a(e)},Vn=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].some(e=>navigator.userAgent.includes(e))||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Fn=(e,t,n,a,r,l)=>{const i=rn(e,t.slice(0,e.length),new Date,{locale:l});return ua(i)&&Zn(i)?a||r?i:Ce(i,{hours:+n.hours,minutes:+n?.minutes,seconds:+n?.seconds,milliseconds:0}):null},ii=(e,t,n,a,r,l)=>{const i=Array.isArray(n)?n[0]:n;if(typeof t=="string")return Fn(e,t,i,a,r,l);if(Array.isArray(t)){let p=null;for(const c of t)if(p=Fn(e,c,i,a,r,l),p)break;return p}return typeof t=="function"?t(e):null},Q=e=>e?new Date(e):new Date,si=(e,t,n)=>{if(t){const r=(e.getMonth()+1).toString().padStart(2,"0"),l=e.getDate().toString().padStart(2,"0"),i=e.getHours().toString().padStart(2,"0"),p=e.getMinutes().toString().padStart(2,"0"),c=n?e.getSeconds().toString().padStart(2,"0"):"00";return`${e.getFullYear()}-${r}-${l}T${i}:${p}:${c}.000Z`}const a=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return new Date(a).toISOString()},tt=(e,t)=>{const n=Q(JSON.parse(JSON.stringify(e))),a=Ce(n,{hours:0,minutes:0,seconds:0,milliseconds:0});return t?tl(a):a},St=(e,t,n,a)=>{let r=e?Q(e):Q();return(t||t===0)&&(r=Uo(r,+t)),(n||n===0)&&(r=Xo(r,+n)),(a||a===0)&&(r=mr(r,+a)),vr(r,0)},Ie=(e,t)=>!e||!t?!1:pa(tt(e),tt(t)),Me=(e,t)=>!e||!t?!1:Xt(tt(e),tt(t)),Ne=(e,t)=>!e||!t?!1:Kt(tt(e),tt(t)),$a=(e,t,n)=>e!=null&&e[0]&&e!=null&&e[1]?Ne(n,e[0])&&Ie(n,e[1]):e!=null&&e[0]&&t?Ne(n,e[0])&&Ie(n,t)||Ie(n,e[0])&&Ne(n,t):!1,pt=e=>{const t=Ce(new Date(e),{date:1});return tt(t)},za=(e,t,n)=>t&&(n||n===0)?Object.fromEntries(["hours","minutes","seconds"].map(a=>a===t?[a,n]:[a,isNaN(+e[a])?void 0:+e[a]])):{hours:isNaN(+e.hours)?void 0:+e.hours,minutes:isNaN(+e.minutes)?void 0:+e.minutes,seconds:isNaN(+e.seconds)?void 0:+e.seconds},Ft=e=>({hours:Tt(e),minutes:Rt(e),seconds:jt(e)}),wr=(e,t)=>{if(t){const n=he(Q(t));if(n>e)return 12;if(n===e)return xe(Q(t))}},_r=(e,t)=>{if(t){const n=he(Q(t));return n{if(e)return he(Q(e))},kr=(e,t)=>{const n=Ne(e,t)?t:e,a=Ne(t,e)?t:e;return er({start:n,end:a})},ui=e=>{const t=ft(e,1);return{month:xe(t),year:he(t)}},xt=(e,t)=>{const n=ht(e,{weekStartsOn:+t}),a=ar(e,{weekStartsOn:+t});return[n,a]},xr=(e,t)=>{const n={hours:Tt(Q()),minutes:Rt(Q()),seconds:t?jt(Q()):0};return Object.assign(n,e)},$t=(e,t,n)=>[Ce(Q(e),{date:1}),Ce(Q(),{month:t,year:n,date:1})],Mt=(e,t,n)=>{let a=e?Q(e):Q();return(t||t===0)&&(a=cr(a,t)),n&&(a=_t(a,n)),a},Mr=(e,t,n,a,r)=>{if(!a||r&&!t||!r&&!n)return!1;const l=r?ft(e,1):Jt(e,1),i=[xe(l),he(l)];return r?!ci(...i,t):!di(...i,n)},di=(e,t,n)=>Ie(...$t(n,e,t))||Me(...$t(n,e,t)),ci=(e,t,n)=>Ne(...$t(n,e,t))||Me(...$t(n,e,t)),Dr=(e,t,n,a,r,l,i)=>{if(typeof t=="function"&&!i)return t(e);const p=n?{locale:n}:void 0;return Array.isArray(e)?`${kt(e[0],l,p)}${r&&!e[1]?"":a}${e[1]?kt(e[1],l,p):""}`:kt(e,l,p)},zt=e=>{if(e)return null;throw new Error(kn.prop("partial-range"))},ka=(e,t)=>{if(t)return e();throw new Error(kn.prop("range"))},sn=e=>Array.isArray(e)?ua(e[0])&&(e[1]?ua(e[1]):!0):e?ua(e):!1,vi=(e,t)=>Ce(t??Q(),{hours:+e.hours||0,minutes:+e.minutes||0,seconds:+e.seconds||0}),Ua=(e,t,n,a)=>{if(!e)return!0;if(a){const r=n==="max"?pa(e,t):Kt(e,t),l={seconds:0,milliseconds:0};return r||Xt(Ce(e,l),Ce(t,l))}return n==="max"?e.getTime()<=t.getTime():e.getTime()>=t.getTime()},Xa=(e,t,n)=>e?vi(e,t):Q(n??t),qn=(e,t,n,a,r)=>{if(Array.isArray(a)){const i=Xa(e,a[0],t),p=Xa(e,a[1],t);return Ua(a[0],i,n,!!t)&&Ua(a[1],p,n,!!t)&&r}const l=Xa(e,a,t);return Ua(a,l,n,!!t)&&r},Ga=e=>Ce(Q(),Ft(e)),mi=(e,t)=>e instanceof Map?Array.from(e.values()).filter(n=>he(Q(n))===t).map(n=>xe(n)):[],Tr=(e,t,n)=>typeof e=="function"?e({month:t,year:n}):!!e.months.find(a=>a.month===t&&a.year===n),Mn=(e,t)=>typeof e=="function"?e(t):e.years.includes(t),Pr=e=>kt(e,"yyyy-MM-dd"),sa=ha({menuFocused:!1,shiftKeyInMenu:!1}),Ar=()=>{const e=n=>{sa.menuFocused=n},t=n=>{sa.shiftKeyInMenu!==n&&(sa.shiftKeyInMenu=n)};return{control:G(()=>({shiftKeyInMenu:sa.shiftKeyInMenu,menuFocused:sa.menuFocused})),setMenuFocused:e,setShiftKey:t}},Oe=ha({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),ja=Z(null),xa=Z(!1),Ka=Z(!1),Ja=Z(!1),Za=Z(!1),Ue=Z(0),Be=Z(0),It=()=>{const e=G(()=>xa.value?[...Oe.selectionGrid,Oe.actionRow].filter(v=>v.length):Ka.value?[...Oe.timePicker[0],...Oe.timePicker[1],Za.value?[]:[ja.value],Oe.actionRow].filter(v=>v.length):Ja.value?[...Oe.monthPicker,Oe.actionRow]:[Oe.monthYear,...Oe.calendar,Oe.time,Oe.actionRow].filter(v=>v.length)),t=v=>{Ue.value=v?Ue.value+1:Ue.value-1;let h=null;e.value[Be.value]&&(h=e.value[Be.value][Ue.value]),!h&&e.value[Be.value+(v?1:-1)]?(Be.value=Be.value+(v?1:-1),Ue.value=v?0:e.value[Be.value].length-1):h||(Ue.value=v?Ue.value-1:Ue.value+1)},n=v=>{Be.value===0&&!v||Be.value===e.value.length&&v||(Be.value=v?Be.value+1:Be.value-1,e.value[Be.value]?e.value[Be.value]&&!e.value[Be.value][Ue.value]&&Ue.value!==0&&(Ue.value=e.value[Be.value].length-1):Be.value=v?Be.value-1:Be.value+1)},a=v=>{let h=null;e.value[Be.value]&&(h=e.value[Be.value][Ue.value]),h?h.focus({preventScroll:!xa.value}):Ue.value=v?Ue.value-1:Ue.value+1},r=()=>{t(!0),a(!0)},l=()=>{t(!1),a(!1)},i=()=>{n(!1),a(!0)},p=()=>{n(!0),a(!0)},c=(v,h)=>{Oe[h]=v},C=(v,h)=>{Oe[h]=v},m=()=>{Ue.value=0,Be.value=0};return{buildMatrix:c,buildMultiLevelMatrix:C,setTimePickerBackRef:v=>{ja.value=v},setSelectionGrid:v=>{xa.value=v,m(),v||(Oe.selectionGrid=[])},setTimePicker:(v,h=!1)=>{Ka.value=v,Za.value=h,m(),v||(Oe.timePicker[0]=[],Oe.timePicker[1]=[])},setTimePickerElements:(v,h=0)=>{Oe.timePicker[h]=v},arrowRight:r,arrowLeft:l,arrowUp:i,arrowDown:p,clearArrowNav:()=>{Oe.monthYear=[],Oe.calendar=[],Oe.time=[],Oe.actionRow=[],Oe.selectionGrid=[],Oe.timePicker[0]=[],Oe.timePicker[1]=[],xa.value=!1,Ka.value=!1,Za.value=!1,Ja.value=!1,m(),ja.value=null},setMonthPicker:v=>{Ja.value=v,m()},refSets:Oe}},Wn=e=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...e??{}}),pi=e=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:t=>`Increment ${t}`,decrementValue:t=>`Decrement ${t}`,openTpOverlay:t=>`Open ${t} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:void 0,weekDay:void 0,clearInput:"Clear value",calendarIcon:"Calendar icon",timePicker:"Time picker",monthPicker:t=>`Month picker${t?" overlay":""}`,yearPicker:t=>`Year picker${t?" overlay":""}`,timeOverlay:t=>`${t} overlay`,...e??{}}),Qn=e=>e?typeof e=="boolean"?e?2:0:+e>=2?+e:2:0,fi=e=>{const t=typeof e=="object"&&e,n={static:!0,solo:!1};if(!e)return{...n,count:Qn(!1)};const a=t?e:{},r=t?a.count??!0:e,l=Qn(r);return Object.assign(n,a,{count:l})},hi=(e,t,n)=>e||(typeof n=="string"?n:t),yi=e=>typeof e=="boolean"?e?Wn({}):!1:Wn(e),gi=e=>{const t={enterSubmit:!0,tabSubmit:!0,openMenu:"open",selectOnFocus:!1,rangeSeparator:" - "};return typeof e=="object"?{...t,...e??{},enabled:!0}:{...t,enabled:e}},bi=e=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...e??{}}),wi=e=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...e??{}}),_i=e=>{const t={input:!1};return typeof e=="object"?{...t,...e??{},enabled:!0}:{enabled:e,...t}},ki=e=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,tabOutClosesMenu:!0,arrowLeft:void 0,keepViewOnOffsetClick:!1,timeArrowHoldThreshold:0,shadowDom:!1,...e??{}}),xi=e=>{const t={dates:Array.isArray(e)?e.map(n=>Q(n)):[],years:[],months:[],quarters:[],weeks:[],weekdays:[],options:{highlightDisabled:!1}};return typeof e=="function"?e:{...t,...e??{}}},Mi=e=>typeof e=="object"?{type:e?.type??"local",hideOnOffsetDates:e?.hideOnOffsetDates??!1}:{type:e,hideOnOffsetDates:!1},Di=e=>{const t={noDisabledRange:!1,showLastInRange:!0,minMaxRawRange:!1,partialRange:!0,disableTimeRangeValidation:!1,maxRange:void 0,minRange:void 0,autoRange:void 0,fixedStart:!1,fixedEnd:!1};return typeof e=="object"?{enabled:!0,...t,...e}:{enabled:e,...t}},Ti=e=>e?typeof e=="string"?{timezone:e,exactMatch:!1,dateInTz:void 0,emitTimezone:void 0,convertModel:!0}:{timezone:e.timezone,exactMatch:e.exactMatch??!1,dateInTz:e.dateInTz??void 0,emitTimezone:e.emitTimezone??void 0,convertModel:e.convertModel??!0}:{timezone:void 0,exactMatch:!1,emitTimezone:void 0},en=(e,t,n)=>new Map(e.map(a=>{const r=wn(a,t,n);return[xn(r),r]})),Pi=(e,t)=>e.length?new Map(e.map(n=>{const a=wn(n.date,t);return[xn(a),n]})):null,Ai=e=>{var t;return{minDate:ln(e.minDate,e.timezone,e.isSpecific),maxDate:ln(e.maxDate,e.timezone,e.isSpecific),disabledDates:Qa(e.disabledDates)?en(e.disabledDates,e.timezone,e.isSpecific):e.disabledDates,allowedDates:Qa(e.allowedDates)?en(e.allowedDates,e.timezone,e.isSpecific):null,highlight:typeof e.highlight=="object"&&Qa((t=e.highlight)==null?void 0:t.dates)?en(e.highlight.dates,e.timezone):e.highlight,markers:Pi(e.markers,e.timezone)}},Ci=e=>typeof e=="boolean"?{enabled:e,dragSelect:!0,limit:null}:{enabled:!!e,limit:e.limit?+e.limit:null,dragSelect:e.dragSelect??!0},Oi=e=>({...Object.fromEntries(Object.keys(e).map(t=>{const n=t,a=e[n],r=typeof e[n]=="string"?{[a]:!0}:Object.fromEntries(a.map(l=>[l,!0]));return[t,r]}))}),Se=e=>{const t=()=>{const E=e.enableSeconds?":ss":"",B=e.enableMinutes?":mm":"";return e.is24?`HH${B}${E}`:`hh${B}${E} aa`},n=()=>{var E;return e.format?e.format:e.monthPicker?"MM/yyyy":e.timePicker?t():e.weekPicker?`${((E=S.value)==null?void 0:E.type)==="iso"?"RR":"ww"}-yyyy`:e.yearPicker?"yyyy":e.quarterPicker?"QQQ/yyyy":e.enableTimePicker?`MM/dd/yyyy, ${t()}`:"MM/dd/yyyy"},a=E=>xr(E,e.enableSeconds),r=()=>q.value.enabled?e.startTime&&Array.isArray(e.startTime)?[a(e.startTime[0]),a(e.startTime[1])]:null:e.startTime&&!Array.isArray(e.startTime)?a(e.startTime):null,l=G(()=>fi(e.multiCalendars)),i=G(()=>r()),p=G(()=>pi(e.ariaLabels)),c=G(()=>bi(e.filters)),C=G(()=>yi(e.transitions)),m=G(()=>wi(e.actionRow)),v=G(()=>hi(e.previewFormat,e.format,n())),h=G(()=>gi(e.textInput)),k=G(()=>_i(e.inline)),Y=G(()=>ki(e.config)),f=G(()=>xi(e.highlight)),S=G(()=>Mi(e.weekNumbers)),I=G(()=>Ti(e.timezone)),U=G(()=>Ci(e.multiDates)),A=G(()=>Ai({minDate:e.minDate,maxDate:e.maxDate,disabledDates:e.disabledDates,allowedDates:e.allowedDates,highlight:f.value,markers:e.markers,timezone:I.value,isSpecific:e.monthPicker||e.yearPicker||e.quarterPicker})),q=G(()=>Di(e.range)),ae=G(()=>Oi(e.ui));return{defaultedTransitions:C,defaultedMultiCalendars:l,defaultedStartTime:i,defaultedAriaLabels:p,defaultedFilters:c,defaultedActionRow:m,defaultedPreviewFormat:v,defaultedTextInput:h,defaultedInline:k,defaultedConfig:Y,defaultedHighlight:f,defaultedWeekNumbers:S,defaultedRange:q,propDates:A,defaultedTz:I,defaultedMultiDates:U,defaultedUI:ae,getDefaultPattern:n,getDefaultStartTime:r}},$i=(e,t,n)=>{const a=Z(),{defaultedTextInput:r,defaultedRange:l,defaultedTz:i,defaultedMultiDates:p,getDefaultPattern:c}=Se(t),C=Z(""),m=ca(t,"format"),v=ca(t,"formatLocale");ct(a,()=>{typeof t.onInternalModelChange=="function"&&e("internal-model-change",a.value,z(!0))},{deep:!0}),ct(l,(u,le)=>{u.enabled!==le.enabled&&(a.value=null)}),ct(m,()=>{re()});const h=u=>i.value.timezone&&i.value.convertModel?nt(u,i.value.timezone):u,k=u=>{if(i.value.timezone&&i.value.convertModel){const le=Ko(i.value.timezone);return Xr(u,le)}return u},Y=(u,le,fe=!1)=>Dr(u,t.format,t.formatLocale,r.value.rangeSeparator,t.modelAuto,le??c(),fe),f=u=>u?t.modelType?b(u):{hours:Tt(u),minutes:Rt(u),seconds:t.enableSeconds?jt(u):0}:null,S=u=>t.modelType?b(u):{month:xe(u),year:he(u)},I=u=>Array.isArray(u)?p.value.enabled?u.map(le=>U(le,_t(Q(),le))):ka(()=>[_t(Q(),u[0]),u[1]?_t(Q(),u[1]):zt(l.value.partialRange)],l.value.enabled):_t(Q(),+u),U=(u,le)=>(typeof u=="string"||typeof u=="number")&&t.modelType?R(u):le,A=u=>Array.isArray(u)?[U(u[0],St(null,+u[0].hours,+u[0].minutes,u[0].seconds)),U(u[1],St(null,+u[1].hours,+u[1].minutes,u[1].seconds))]:U(u,St(null,u.hours,u.minutes,u.seconds)),q=u=>{const le=Ce(Q(),{date:1});return Array.isArray(u)?p.value.enabled?u.map(fe=>U(fe,Mt(le,+fe.month,+fe.year))):ka(()=>[U(u[0],Mt(le,+u[0].month,+u[0].year)),U(u[1],u[1]?Mt(le,+u[1].month,+u[1].year):zt(l.value.partialRange))],l.value.enabled):U(u,Mt(le,+u.month,+u.year))},ae=u=>{if(Array.isArray(u))return u.map(le=>R(le));throw new Error(kn.dateArr("multi-dates"))},E=u=>{if(Array.isArray(u)&&l.value.enabled){const le=u[0],fe=u[1];return[Q(Array.isArray(le)?le[0]:null),Array.isArray(fe)&&fe.length?Q(fe[0]):null]}return Q(u[0])},B=u=>t.modelAuto?Array.isArray(u)?[R(u[0]),R(u[1])]:t.autoApply?[R(u)]:[R(u),null]:Array.isArray(u)?ka(()=>u[1]?[R(u[0]),u[1]?R(u[1]):zt(l.value.partialRange)]:[R(u[0])],l.value.enabled):R(u),ne=()=>{Array.isArray(a.value)&&l.value.enabled&&a.value.length===1&&a.value.push(zt(l.value.partialRange))},F=()=>{const u=a.value;return[b(u[0]),u[1]?b(u[1]):zt(l.value.partialRange)]},N=()=>a.value[1]?F():b(qe(a.value[0])),ie=()=>(a.value||[]).map(u=>b(u)),ce=(u=!1)=>(u||ne(),t.modelAuto?N():p.value.enabled?ie():Array.isArray(a.value)?ka(()=>F(),l.value.enabled):b(qe(a.value))),pe=u=>!u||Array.isArray(u)&&!u.length?null:t.timePicker?A(qe(u)):t.monthPicker?q(qe(u)):t.yearPicker?I(qe(u)):p.value.enabled?ae(qe(u)):t.weekPicker?E(qe(u)):B(qe(u)),g=u=>{const le=pe(u);sn(qe(le))?(a.value=qe(le),re()):(a.value=null,C.value="")},D=()=>{const u=le=>kt(le,r.value.format);return`${u(a.value[0])} ${r.value.rangeSeparator} ${a.value[1]?u(a.value[1]):""}`},y=()=>n.value&&a.value?Array.isArray(a.value)?D():kt(a.value,r.value.format):Y(a.value),H=()=>a.value?p.value.enabled?a.value.map(u=>Y(u)).join("; "):r.value.enabled&&typeof r.value.format=="string"?y():Y(a.value):"",re=()=>{!t.format||typeof t.format=="string"||r.value.enabled&&typeof r.value.format=="string"?C.value=H():C.value=t.format(a.value)},R=u=>{if(t.utc){const le=new Date(u);return t.utc==="preserve"?new Date(le.getTime()+le.getTimezoneOffset()*6e4):le}return t.modelType?Jo.includes(t.modelType)?h(new Date(u)):t.modelType==="format"&&(typeof t.format=="string"||!t.format)?h(rn(u,c(),new Date,{locale:v.value})):h(rn(u,t.modelType,new Date,{locale:v.value})):h(new Date(u))},b=u=>u?t.utc?si(u,t.utc==="preserve",t.enableSeconds):t.modelType?t.modelType==="timestamp"?+k(u):t.modelType==="iso"?k(u).toISOString():t.modelType==="format"&&(typeof t.format=="string"||!t.format)?Y(k(u)):Y(k(u),t.modelType,!0):k(u):"",oe=(u,le=!1,fe=!1)=>{if(fe)return u;if(e("update:model-value",u),i.value.emitTimezone&&le){const Ve=Array.isArray(u)?u.map(T=>nt(qe(T),i.value.emitTimezone)):nt(qe(u),i.value.emitTimezone);e("update:model-timezone-value",Ve)}},V=u=>Array.isArray(a.value)?p.value.enabled?a.value.map(le=>u(le)):[u(a.value[0]),a.value[1]?u(a.value[1]):zt(l.value.partialRange)]:u(qe(a.value)),M=()=>{if(Array.isArray(a.value)){const u=xt(a.value[0],t.weekStart),le=a.value[1]?xt(a.value[1],t.weekStart):[];return[u.map(fe=>Q(fe)),le.map(fe=>Q(fe))]}return xt(a.value,t.weekStart).map(u=>Q(u))},o=(u,le)=>oe(qe(V(u)),!1,le),w=u=>{const le=M();return u?le:e("update:model-value",M())},z=(u=!1)=>(u||re(),t.monthPicker?o(S,u):t.timePicker?o(f,u):t.yearPicker?o(he,u):t.weekPicker?w(u):oe(ce(u),!0,u));return{inputValue:C,internalModelValue:a,checkBeforeEmit:()=>a.value?l.value.enabled?l.value.partialRange?a.value.length>=1:a.value.length===2:!!a.value:!1,parseExternalModelValue:g,formatInputValue:re,emitModelValue:z}},Yi=(e,t)=>{const{defaultedFilters:n,propDates:a}=Se(e),{validateMonthYearInRange:r}=Et(e),l=(m,v)=>{let h=m;return n.value.months.includes(xe(h))?(h=v?ft(m,1):Jt(m,1),l(h,v)):h},i=(m,v)=>{let h=m;return n.value.years.includes(he(h))?(h=v?un(m,1):pr(m,1),i(h,v)):h},p=(m,v=!1)=>{const h=Ce(Q(),{month:e.month,year:e.year});let k=m?ft(h,1):Jt(h,1);e.disableYearSelect&&(k=_t(k,e.year));let Y=xe(k),f=he(k);n.value.months.includes(Y)&&(k=l(k,m),Y=xe(k),f=he(k)),n.value.years.includes(f)&&(k=i(k,m),f=he(k)),r(Y,f,m,e.preventMinMaxNavigation)&&c(Y,f,v)},c=(m,v,h)=>{t("update-month-year",{month:m,year:v,fromNav:h})},C=G(()=>m=>Mr(Ce(Q(),{month:e.month,year:e.year}),a.value.maxDate,a.value.minDate,e.preventMinMaxNavigation,m));return{handleMonthYearChange:p,isDisabled:C,updateMonthYear:c}},Ya={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:Boolean,default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:[String,Object],default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},highlight:{type:[Function,Object],default:null},teleport:{type:[Boolean,String,Object],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function,Object],default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:[Object,Boolean],default:!1},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:[Boolean,Object],default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1},yearFirst:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},onInternalModelChange:{type:[Function,Object],default:null},enableMinutes:{type:Boolean,default:!0},ui:{type:Object,default:()=>({})}},yt={...Ya,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},menuWrapRef:{type:Object,default:null},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},Si=["title"],Ri=["disabled"],Ii=ze({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...yt},emits:["close-picker","select-date","select-now","invalid-select"],setup(e,{emit:t}){const n=t,a=e,{defaultedActionRow:r,defaultedPreviewFormat:l,defaultedMultiCalendars:i,defaultedTextInput:p,defaultedInline:c,defaultedRange:C,defaultedMultiDates:m}=Se(a),{isTimeValid:v,isMonthValid:h}=Et(a),{buildMatrix:k}=It(),Y=Z(null),f=Z(null),S=Z(!1),I=Z({}),U=Z(null),A=Z(null);Ke(()=>{a.arrowNavigation&&k([Fe(Y),Fe(f)],"actionRow"),q(),window.addEventListener("resize",q)}),Ca(()=>{window.removeEventListener("resize",q)});const q=()=>{S.value=!1,setTimeout(()=>{var g,D;const y=(g=U.value)==null?void 0:g.getBoundingClientRect(),H=(D=A.value)==null?void 0:D.getBoundingClientRect();y&&H&&(I.value.maxWidth=`${H.width-y.width-20}px`),S.value=!0},0)},ae=G(()=>C.value.enabled&&!C.value.partialRange&&a.internalModelValue?a.internalModelValue.length===2:!0),E=G(()=>!v.value(a.internalModelValue)||!h.value(a.internalModelValue)||!ae.value),B=()=>{const g=l.value;return a.timePicker||a.monthPicker,g(qe(a.internalModelValue))},ne=()=>{const g=a.internalModelValue;return i.value.count>0?`${F(g[0])} - ${F(g[1])}`:[F(g[0]),F(g[1])]},F=g=>Dr(g,l.value,a.formatLocale,p.value.rangeSeparator,a.modelAuto,l.value),N=G(()=>!a.internalModelValue||!a.menuMount?"":typeof l.value=="string"?Array.isArray(a.internalModelValue)?a.internalModelValue.length===2&&a.internalModelValue[1]?ne():m.value.enabled?a.internalModelValue.map(g=>`${F(g)}`):a.modelAuto?`${F(a.internalModelValue[0])}`:`${F(a.internalModelValue[0])} -`:F(a.internalModelValue):B()),ie=()=>m.value.enabled?"; ":" - ",ce=G(()=>Array.isArray(N.value)?N.value.join(ie()):N.value),pe=()=>{v.value(a.internalModelValue)&&h.value(a.internalModelValue)&&ae.value?n("select-date"):n("invalid-select")};return(g,D)=>(P(),W("div",{ref_key:"actionRowRef",ref:A,class:"dp__action_row"},[g.$slots["action-row"]?ue(g.$slots,"action-row",We(Qe({key:0},{internalModelValue:g.internalModelValue,disabled:E.value,selectDate:()=>g.$emit("select-date"),closePicker:()=>g.$emit("close-picker")}))):(P(),W(we,{key:1},[d(r).showPreview?(P(),W("div",{key:0,class:"dp__selection_preview",title:ce.value,style:dt(I.value)},[g.$slots["action-preview"]&&S.value?ue(g.$slots,"action-preview",{key:0,value:g.internalModelValue}):j("",!0),!g.$slots["action-preview"]&&S.value?(P(),W(we,{key:1},[Dt(Ge(ce.value),1)],64)):j("",!0)],12,Si)):j("",!0),ye("div",{ref_key:"actionBtnContainer",ref:U,class:"dp__action_buttons","data-dp-element":"action-row"},[g.$slots["action-buttons"]?ue(g.$slots,"action-buttons",{key:0,value:g.internalModelValue}):j("",!0),g.$slots["action-buttons"]?j("",!0):(P(),W(we,{key:1},[!d(c).enabled&&d(r).showCancel?(P(),W("button",{key:0,ref_key:"cancelButtonRef",ref:Y,type:"button",class:"dp__action_button dp__action_cancel",onClick:D[0]||(D[0]=y=>g.$emit("close-picker")),onKeydown:D[1]||(D[1]=y=>d(et)(y,()=>g.$emit("close-picker")))},Ge(g.cancelText),545)):j("",!0),d(r).showNow?(P(),W("button",{key:1,type:"button",class:"dp__action_button dp__action_cancel",onClick:D[2]||(D[2]=y=>g.$emit("select-now")),onKeydown:D[3]||(D[3]=y=>d(et)(y,()=>g.$emit("select-now")))},Ge(g.nowButtonLabel),33)):j("",!0),d(r).showSelect?(P(),W("button",{key:2,ref_key:"selectButtonRef",ref:f,type:"button",class:"dp__action_button dp__action_select",disabled:E.value,"data-test":"select-button",onKeydown:D[4]||(D[4]=y=>d(et)(y,()=>pe())),onClick:pe},Ge(g.selectText),41,Ri)):j("",!0)],64))],512)],64))],512))}}),Ei=["role","aria-label","tabindex"],Bi={class:"dp__selection_grid_header"},Ni=["aria-selected","aria-disabled","data-test","onClick","onKeydown","onMouseover"],Li=["aria-label"],ya=ze({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean},focusValue:{},menuWrapRef:{},ariaLabels:{},overlayLabel:{}},emits:["selected","toggle","reset-flow","hover-value"],setup(e,{expose:t,emit:n}){const{setSelectionGrid:a,buildMultiLevelMatrix:r,setMonthPicker:l}=It(),i=n,p=e,{defaultedAriaLabels:c,defaultedTextInput:C,defaultedConfig:m}=Se(p),{hideNavigationButtons:v}=Ia(),h=Z(!1),k=Z(null),Y=Z(null),f=Z([]),S=Z(),I=Z(null),U=Z(0),A=Z(null);Hr(()=>{k.value=null}),Ke(()=>{it().then(()=>ie()),p.noOverlayFocus||ae(),q(!0)}),Ca(()=>q(!1));const q=V=>{var M;p.arrowNavigation&&((M=p.headerRefs)!=null&&M.length?l(V):a(V))},ae=()=>{var V;const M=Fe(Y);M&&(C.value.enabled||(k.value?(V=k.value)==null||V.focus({preventScroll:!0}):M.focus({preventScroll:!0})),h.value=M.clientHeight({dp__overlay:!0,"dp--overlay-absolute":!p.useRelative,"dp--overlay-relative":p.useRelative})),B=G(()=>p.useRelative?{height:`${p.height}px`,width:"var(--dp-menu-min-width)"}:void 0),ne=G(()=>({dp__overlay_col:!0})),F=G(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:h.value,dp__button_bottom:p.isLast})),N=G(()=>{var V,M;return{dp__overlay_container:!0,dp__container_flex:((V=p.items)==null?void 0:V.length)<=6,dp__container_block:((M=p.items)==null?void 0:M.length)>6}});ct(()=>p.items,()=>ie(!1),{deep:!0});const ie=(V=!0)=>{it().then(()=>{const M=Fe(k),o=Fe(Y),w=Fe(I),z=Fe(A),u=w?w.getBoundingClientRect().height:0;o&&(o.getBoundingClientRect().height?U.value=o.getBoundingClientRect().height-u:U.value=m.value.modeHeight-u),M&&z&&V&&(z.scrollTop=M.offsetTop-z.offsetTop-(U.value/2-M.getBoundingClientRect().height)-u)})},ce=V=>{V.disabled||i("selected",V.value)},pe=()=>{i("toggle"),i("reset-flow")},g=()=>{p.escClose&&pe()},D=(V,M,o,w)=>{V&&((M.active||M.value===p.focusValue)&&(k.value=V),p.arrowNavigation&&(Array.isArray(f.value[o])?f.value[o][w]=V:f.value[o]=[V],y()))},y=()=>{var V,M;const o=(V=p.headerRefs)!=null&&V.length?[p.headerRefs].concat(f.value):f.value.concat([p.skipButtonRef?[]:[I.value]]);r(qe(o),(M=p.headerRefs)!=null&&M.length?"monthPicker":"selectionGrid")},H=V=>{p.arrowNavigation||Yt(V,m.value,!0)},re=V=>{S.value=V,i("hover-value",V)},R=()=>{if(pe(),!p.isLast){const V=on(p.menuWrapRef??null,"action-row");if(V){const M=gr(V);M?.focus()}}},b=V=>{switch(V.key){case $e.esc:return g();case $e.arrowLeft:return H(V);case $e.arrowRight:return H(V);case $e.arrowUp:return H(V);case $e.arrowDown:return H(V);default:return}},oe=V=>{if(V.key===$e.enter)return pe();if(V.key===$e.tab)return R()};return t({focusGrid:ae}),(V,M)=>{var o;return P(),W("div",{ref_key:"gridWrapRef",ref:Y,class:ke(E.value),style:dt(B.value),role:V.useRelative?void 0:"dialog","aria-label":V.overlayLabel,tabindex:V.useRelative?void 0:"0",onKeydown:b,onClick:M[0]||(M[0]=va(()=>{},["prevent"]))},[ye("div",{ref_key:"containerRef",ref:A,class:ke(N.value),style:dt({"--dp-overlay-height":`${U.value}px`}),role:"grid"},[ye("div",Bi,[ue(V.$slots,"header")]),V.$slots.overlay?ue(V.$slots,"overlay",{key:0}):(P(!0),W(we,{key:1},Ye(V.items,(w,z)=>(P(),W("div",{key:z,class:ke(["dp__overlay_row",{dp__flex_row:V.items.length>=3}]),role:"row"},[(P(!0),W(we,null,Ye(w,(u,le)=>(P(),W("div",{key:u.value,ref_for:!0,ref:fe=>D(fe,u,z,le),role:"gridcell",class:ke(ne.value),"aria-selected":u.active||void 0,"aria-disabled":u.disabled||void 0,tabindex:"0","data-test":u.text,onClick:va(fe=>ce(u),["prevent"]),onKeydown:fe=>d(et)(fe,()=>ce(u),!0),onMouseover:fe=>re(u.value)},[ye("div",{class:ke(u.className)},[V.$slots.item?ue(V.$slots,"item",{key:0,item:u}):j("",!0),V.$slots.item?j("",!0):(P(),W(we,{key:1},[Dt(Ge(u.text),1)],64))],2)],42,Ni))),128))],2))),128))],6),V.$slots["button-icon"]?Ma((P(),W("button",{key:0,ref_key:"toggleButton",ref:I,type:"button","aria-label":(o=d(c))==null?void 0:o.toggleOverlay,class:ke(F.value),tabindex:"0",onClick:pe,onKeydown:oe},[ue(V.$slots,"button-icon")],42,Li)),[[Da,!d(v)(V.hideNavigation,V.type)]]):j("",!0)],46,Ei)}}}),Sa=ze({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean},collapse:{type:Boolean}},setup(e){const t=e,n=G(()=>t.multiCalendars>0?[...Array(t.multiCalendars).keys()]:[0]),a=G(()=>({dp__instance_calendar:t.multiCalendars>0}));return(r,l)=>(P(),W("div",{class:ke({dp__menu_inner:!r.stretch,"dp--menu--inner-stretched":r.stretch,dp__flex_display:r.multiCalendars>0,"dp--flex-display-collapsed":r.collapse})},[(P(!0),W(we,null,Ye(n.value,(i,p)=>(P(),W("div",{key:i,class:ke(a.value)},[ue(r.$slots,"default",{instance:i,index:p})],2))),128))],2))}}),Hi=["data-dp-element","aria-label","aria-disabled"],da=ze({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},elName:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(e,{emit:t}){const n=t,a=Z(null);return Ke(()=>n("set-ref",a)),(r,l)=>(P(),W("button",{ref_key:"elRef",ref:a,type:"button","data-dp-element":r.elName,class:"dp__btn dp--arrow-btn-nav",tabindex:"0","aria-label":r.ariaLabel,"aria-disabled":r.disabled||void 0,onClick:l[0]||(l[0]=i=>r.$emit("activate")),onKeydown:l[1]||(l[1]=i=>d(et)(i,()=>r.$emit("activate"),!0))},[ye("span",{class:ke(["dp__inner_nav",{dp__inner_nav_disabled:r.disabled}])},[ue(r.$slots,"default")],2)],40,Hi))}}),Vi=["aria-label","data-test"],Cr=ze({__name:"YearModePicker",props:{...yt,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(e,{emit:t}){const n=t,a=e,{showRightIcon:r,showLeftIcon:l}=Ia(),{defaultedConfig:i,defaultedMultiCalendars:p,defaultedAriaLabels:c,defaultedTransitions:C,defaultedUI:m}=Se(a),{showTransition:v,transitionName:h}=ga(C),k=Z(!1),Y=(I=!1,U)=>{k.value=!k.value,n("toggle-year-picker",{flow:I,show:U})},f=I=>{k.value=!1,n("year-select",I)},S=(I=!1)=>{n("handle-year",I)};return(I,U)=>{var A,q,ae,E,B;return P(),W(we,null,[ye("div",{class:ke(["dp--year-mode-picker",{"dp--hidden-el":k.value}])},[d(l)(d(p),e.instance)?(P(),De(da,{key:0,ref:"mpPrevIconRef","aria-label":(A=d(c))==null?void 0:A.prevYear,disabled:e.isDisabled(!1),class:ke((q=d(m))==null?void 0:q.navBtnPrev),onActivate:U[0]||(U[0]=ne=>S(!1))},{default:_e(()=>[I.$slots["arrow-left"]?ue(I.$slots,"arrow-left",{key:0}):j("",!0),I.$slots["arrow-left"]?j("",!0):(P(),De(d(fn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),ye("button",{ref:"mpYearButtonRef",class:"dp__btn dp--year-select",type:"button","aria-label":`${e.year}-${(ae=d(c))==null?void 0:ae.openYearsOverlay}`,"data-test":`year-mode-btn-${e.instance}`,onClick:U[1]||(U[1]=()=>Y(!1)),onKeydown:U[2]||(U[2]=Vr(()=>Y(!1),["enter"]))},[I.$slots.year?ue(I.$slots,"year",{key:0,year:e.year}):j("",!0),I.$slots.year?j("",!0):(P(),W(we,{key:1},[Dt(Ge(e.year),1)],64))],40,Vi),d(r)(d(p),e.instance)?(P(),De(da,{key:1,ref:"mpNextIconRef","aria-label":(E=d(c))==null?void 0:E.nextYear,disabled:e.isDisabled(!0),class:ke((B=d(m))==null?void 0:B.navBtnNext),onActivate:U[3]||(U[3]=ne=>S(!0))},{default:_e(()=>[I.$slots["arrow-right"]?ue(I.$slots,"arrow-right",{key:0}):j("",!0),I.$slots["arrow-right"]?j("",!0):(P(),De(d(hn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0)],2),ot(ta,{name:d(h)(e.showYearPicker),css:d(v)},{default:_e(()=>{var ne,F;return[e.showYearPicker?(P(),De(ya,{key:0,items:e.items,"text-input":I.textInput,"esc-close":I.escClose,config:I.config,"is-last":I.autoApply&&!d(i).keepActionRow,"hide-navigation":I.hideNavigation,"aria-labels":I.ariaLabels,"overlay-label":(F=(ne=d(c))==null?void 0:ne.yearPicker)==null?void 0:F.call(ne,!0),type:"year",onToggle:Y,onSelected:U[4]||(U[4]=N=>f(N))},je({"button-icon":_e(()=>[I.$slots["calendar-icon"]?ue(I.$slots,"calendar-icon",{key:0}):j("",!0),I.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))]),_:2},[I.$slots["year-overlay-value"]?{name:"item",fn:_e(({item:N})=>[ue(I.$slots,"year-overlay-value",{text:N.text,value:N.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last","hide-navigation","aria-labels","overlay-label"])):j("",!0)]}),_:3},8,["name","css"])],64)}}}),Dn=(e,t,n)=>{if(t.value&&Array.isArray(t.value))if(t.value.some(a=>Me(e,a))){const a=t.value.filter(r=>!Me(r,e));t.value=a.length?a:null}else(n&&+n>t.value.length||!n)&&t.value.push(e);else t.value=[e]},Tn=(e,t,n)=>{let a=e.value?e.value.slice():[];return a.length===2&&a[1]!==null&&(a=[]),a.length?Ie(t,a[0])?(a.unshift(t),n("range-start",a[0]),n("range-start",a[1])):(a[1]=t,n("range-end",t)):(a=[t],n("range-start",t)),a},Ra=(e,t,n,a)=>{e&&(e[0]&&e[1]&&n&&t("auto-apply"),e[0]&&!e[1]&&a&&n&&t("auto-apply"))},Or=e=>{Array.isArray(e.value)&&e.value.length<=2&&e.range?e.modelValue.value=e.value.map(t=>nt(Q(t),e.timezone)):Array.isArray(e.value)||(e.modelValue.value=nt(Q(e.value),e.timezone))},$r=(e,t,n,a)=>Array.isArray(t.value)&&(t.value.length===2||t.value.length===1&&a.value.partialRange)?a.value.fixedStart&&(Ne(e,t.value[0])||Me(e,t.value[0]))?[t.value[0],e]:a.value.fixedEnd&&(Ie(e,t.value[1])||Me(e,t.value[1]))?[e,t.value[1]]:(n("invalid-fixed-range",e),t.value):[],Yr=({multiCalendars:e,range:t,highlight:n,propDates:a,calendars:r,modelValue:l,props:i,filters:p,year:c,month:C,emit:m})=>{const v=G(()=>_n(i.yearRange,i.locale,i.reverseYears)),h=Z([!1]),k=G(()=>(N,ie)=>{const ce=Ce(pt(new Date),{month:C.value(N),year:c.value(N)}),pe=ie?tr(ce):ma(ce);return Mr(pe,a.value.maxDate,a.value.minDate,i.preventMinMaxNavigation,ie)}),Y=()=>Array.isArray(l.value)&&e.value.solo&&l.value[1],f=()=>{for(let N=0;N{if(!N)return f();const ie=Ce(Q(),r.value[N]);return r.value[0].year=he(pr(ie,e.value.count-1)),f()},I=(N,ie)=>{const ce=Zr(ie,N);return t.value.showLastInRange&&ce>1?ie:N},U=N=>i.focusStartDate||e.value.solo?N[0]:N[1]?I(N[0],N[1]):N[0],A=()=>{if(l.value){const N=Array.isArray(l.value)?U(l.value):l.value;r.value[0]={month:xe(N),year:he(N)}}},q=()=>{A(),e.value.count&&f()};ct(l,(N,ie)=>{i.isTextInputDate&&JSON.stringify(N??{})!==JSON.stringify(ie??{})&&q()}),Ke(()=>{q()});const ae=(N,ie)=>{r.value[ie].year=N,m("update-month-year",{instance:ie,year:N,month:r.value[ie].month}),e.value.count&&!e.value.solo&&S(ie)},E=G(()=>N=>Zt(v.value,ie=>{var ce;const pe=c.value(N)===ie.value,g=fa(ie.value,ea(a.value.minDate),ea(a.value.maxDate))||((ce=p.value.years)==null?void 0:ce.includes(c.value(N))),D=Mn(n.value,ie.value);return{active:pe,disabled:g,highlighted:D}})),B=(N,ie)=>{ae(N,ie),F(ie)},ne=(N,ie=!1)=>{if(!k.value(N,ie)){const ce=ie?c.value(N)+1:c.value(N)-1;ae(ce,N)}},F=(N,ie=!1,ce)=>{ie||m("reset-flow"),ce!==void 0?h.value[N]=ce:h.value[N]=!h.value[N],h.value[N]?m("overlay-toggle",{open:!0,overlay:Xe.year}):(m("overlay-closed"),m("overlay-toggle",{open:!1,overlay:Xe.year}))};return{isDisabled:k,groupedYears:E,showYearPicker:h,selectYear:ae,toggleYearPicker:F,handleYearSelect:B,handleYear:ne}},Fi=(e,t)=>{const{defaultedMultiCalendars:n,defaultedAriaLabels:a,defaultedTransitions:r,defaultedConfig:l,defaultedRange:i,defaultedHighlight:p,propDates:c,defaultedTz:C,defaultedFilters:m,defaultedMultiDates:v}=Se(e),h=()=>{e.isTextInputDate&&q(he(Q(e.startDate)),0)},{modelValue:k,year:Y,month:f,calendars:S}=ba(e,t,h),I=G(()=>hr(e.formatLocale,e.locale,e.monthNameFormat)),U=Z(null),{checkMinMaxRange:A}=Et(e),{selectYear:q,groupedYears:ae,showYearPicker:E,toggleYearPicker:B,handleYearSelect:ne,handleYear:F,isDisabled:N}=Yr({modelValue:k,multiCalendars:n,range:i,highlight:p,calendars:S,year:Y,propDates:c,month:f,filters:m,props:e,emit:t});Ke(()=>{e.startDate&&(k.value&&e.focusStartDate||!k.value)&&q(he(Q(e.startDate)),0)});const ie=o=>o?{month:xe(o),year:he(o)}:{month:null,year:null},ce=()=>k.value?Array.isArray(k.value)?k.value.map(o=>ie(o)):ie(k.value):ie(),pe=(o,w)=>{const z=S.value[o],u=ce();return Array.isArray(u)?u.some(le=>le.year===z?.year&&le.month===w):z?.year===u.year&&w===u.month},g=(o,w,z)=>{var u,le;const fe=ce();return Array.isArray(fe)?Y.value(w)===((u=fe[z])==null?void 0:u.year)&&o===((le=fe[z])==null?void 0:le.month):!1},D=(o,w)=>{if(i.value.enabled){const z=ce();if(Array.isArray(k.value)&&Array.isArray(z)){const u=g(o,w,0)||g(o,w,1),le=Mt(pt(Q()),o,Y.value(w));return $a(k.value,U.value,le)&&!u}return!1}return!1},y=G(()=>o=>Zt(I.value,w=>{var z;const u=pe(o,w.value),le=fa(w.value,wr(Y.value(o),c.value.minDate),_r(Y.value(o),c.value.maxDate))||mi(c.value.disabledDates,Y.value(o)).includes(w.value)||((z=m.value.months)==null?void 0:z.includes(w.value)),fe=D(w.value,o),Ve=Tr(p.value,w.value,Y.value(o));return{active:u,disabled:le,isBetween:fe,highlighted:Ve}})),H=(o,w)=>Mt(pt(Q()),o,Y.value(w)),re=(o,w)=>{const z=k.value?k.value:pt(new Date);k.value=Mt(z,o,Y.value(w)),t("auto-apply"),t("update-flow-step")},R=(o,w)=>{const z=H(o,w);i.value.fixedEnd||i.value.fixedStart?k.value=$r(z,k,t,i):k.value?A(z,k.value)&&(k.value=Tn(k,H(o,w),t)):k.value=[H(o,w)],it().then(()=>{Ra(k.value,t,e.autoApply,e.modelAuto)})},b=(o,w)=>{Dn(H(o,w),k,v.value.limit),t("auto-apply",!0)},oe=(o,w)=>(S.value[w].month=o,M(w,S.value[w].year,o),v.value.enabled?b(o,w):i.value.enabled?R(o,w):re(o,w)),V=(o,w)=>{q(o,w),M(w,o,null)},M=(o,w,z)=>{let u=z;if(!u&&u!==0){const le=ce();u=Array.isArray(le)?le[o].month:le.month}t("update-month-year",{instance:o,year:w,month:u})};return{groupedMonths:y,groupedYears:ae,year:Y,isDisabled:N,defaultedMultiCalendars:n,defaultedAriaLabels:a,defaultedTransitions:r,defaultedConfig:l,showYearPicker:E,modelValue:k,presetDate:(o,w)=>{Or({value:o,modelValue:k,range:i.value.enabled,timezone:w?void 0:C.value.timezone}),t("auto-apply")},setHoverDate:(o,w)=>{U.value=H(o,w)},selectMonth:oe,selectYear:V,toggleYearPicker:B,handleYearSelect:ne,handleYear:F,getModelMonthYear:ce}},qi=ze({compatConfig:{MODE:3},__name:"MonthPicker",props:{...yt},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year","update-flow-step","mount","invalid-fixed-range","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=qt(),l=lt(r,"yearMode"),i=e;Ke(()=>{i.shadow||a("mount",null)});const{groupedMonths:p,groupedYears:c,year:C,isDisabled:m,defaultedMultiCalendars:v,defaultedConfig:h,showYearPicker:k,modelValue:Y,presetDate:f,setHoverDate:S,selectMonth:I,selectYear:U,toggleYearPicker:A,handleYearSelect:q,handleYear:ae,getModelMonthYear:E}=Fi(i,a);return t({getSidebarProps:()=>({modelValue:Y,year:C,getModelMonthYear:E,selectMonth:I,selectYear:U,handleYear:ae}),presetDate:f,toggleYearPicker:B=>A(0,B)}),(B,ne)=>(P(),De(Sa,{"multi-calendars":d(v).count,collapse:B.collapse,stretch:""},{default:_e(({instance:F})=>[B.$slots["top-extra"]?ue(B.$slots,"top-extra",{key:0,value:B.internalModelValue}):j("",!0),B.$slots["month-year"]?ue(B.$slots,"month-year",We(Qe({key:1},{year:d(C),months:d(p)(F),years:d(c)(F),selectMonth:d(I),selectYear:d(U),instance:F}))):(P(),De(ya,{key:2,items:d(p)(F),"arrow-navigation":B.arrowNavigation,"is-last":B.autoApply&&!d(h).keepActionRow,"esc-close":B.escClose,height:d(h).modeHeight,config:B.config,"no-overlay-focus":!!(B.noOverlayFocus||B.textInput),"use-relative":"",type:"month",onSelected:N=>d(I)(N,F),onHoverValue:N=>d(S)(N,F)},je({header:_e(()=>[ot(Cr,Qe(B.$props,{items:d(c)(F),instance:F,"show-year-picker":d(k)[F],year:d(C)(F),"is-disabled":N=>d(m)(F,N),onHandleYear:N=>d(ae)(F,N),onYearSelect:N=>d(q)(N,F),onToggleYearPicker:N=>d(A)(F,N?.flow,N?.show)}),je({_:2},[Ye(d(l),(N,ie)=>({name:N,fn:_e(ce=>[ue(B.$slots,N,We(at(ce)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},[B.$slots["month-overlay-value"]?{name:"item",fn:_e(({item:N})=>[ue(B.$slots,"month-overlay-value",{text:N.text,value:N.value})]),key:"0"}:void 0]),1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars","collapse"]))}}),Wi=(e,t)=>{const n=()=>{e.isTextInputDate&&(m.value=he(Q(e.startDate)))},{modelValue:a}=ba(e,t,n),r=Z(null),{defaultedHighlight:l,defaultedMultiDates:i,defaultedFilters:p,defaultedRange:c,propDates:C}=Se(e),m=Z();Ke(()=>{e.startDate&&(a.value&&e.focusStartDate||!a.value)&&(m.value=he(Q(e.startDate)))});const v=f=>Array.isArray(a.value)?a.value.some(S=>he(S)===f):a.value?he(a.value)===f:!1,h=f=>c.value.enabled&&Array.isArray(a.value)?$a(a.value,r.value,Y(f)):!1,k=G(()=>Zt(_n(e.yearRange,e.locale,e.reverseYears),f=>{const S=v(f.value),I=fa(f.value,ea(C.value.minDate),ea(C.value.maxDate))||p.value.years.includes(f.value),U=h(f.value)&&!S,A=Mn(l.value,f.value);return{active:S,disabled:I,isBetween:U,highlighted:A}})),Y=f=>_t(pt(ma(new Date)),f);return{groupedYears:k,modelValue:a,focusYear:m,setHoverValue:f=>{r.value=_t(pt(new Date),f)},selectYear:f=>{var S;if(t("update-month-year",{instance:0,year:f}),i.value.enabled)return a.value?Array.isArray(a.value)&&(((S=a.value)==null?void 0:S.map(I=>he(I))).includes(f)?a.value=a.value.filter(I=>he(I)!==f):a.value.push(_t(tt(Q()),f))):a.value=[_t(tt(ma(Q())),f)],t("auto-apply",!0);c.value.enabled?(a.value=Tn(a,Y(f),t),it().then(()=>{Ra(a.value,t,e.autoApply,e.modelAuto)})):(a.value=Y(f),t("auto-apply"))}}},Qi=ze({compatConfig:{MODE:3},__name:"YearPicker",props:{...yt},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply","update-month-year"],setup(e,{expose:t,emit:n}){const a=n,r=e,{groupedYears:l,modelValue:i,focusYear:p,selectYear:c,setHoverValue:C}=Wi(r,a),{defaultedConfig:m}=Se(r);return t({getSidebarProps:()=>({modelValue:i,selectYear:c})}),(v,h)=>(P(),W("div",null,[v.$slots["top-extra"]?ue(v.$slots,"top-extra",{key:0,value:v.internalModelValue}):j("",!0),v.$slots["month-year"]?ue(v.$slots,"month-year",We(Qe({key:1},{years:d(l),selectYear:d(c)}))):(P(),De(ya,{key:2,items:d(l),"is-last":v.autoApply&&!d(m).keepActionRow,height:d(m).modeHeight,config:v.config,"no-overlay-focus":!!(v.noOverlayFocus||v.textInput),"focus-value":d(p),type:"year","use-relative":"",onSelected:d(c),onHoverValue:d(C)},je({_:2},[v.$slots["year-overlay-value"]?{name:"item",fn:_e(({item:k})=>[ue(v.$slots,"year-overlay-value",{text:k.text,value:k.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","focus-value","onSelected","onHoverValue"]))]))}}),zi={key:0,class:"dp__time_input"},Ui=["data-test","aria-label","onKeydown","onClick","onMousedown"],Xi=["aria-label","disabled","data-test","onKeydown","onClick"],Gi=["data-test","aria-label","onKeydown","onClick","onMousedown"],ji={key:0},Ki=["aria-label"],Ji=ze({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...yt},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","overlay-opened","am-pm-change"],setup(e,{expose:t,emit:n}){const a=n,r=e,{setTimePickerElements:l,setTimePickerBackRef:i}=It(),{defaultedAriaLabels:p,defaultedTransitions:c,defaultedFilters:C,defaultedConfig:m,defaultedRange:v}=Se(r),{transitionName:h,showTransition:k}=ga(c),Y=ha({hours:!1,minutes:!1,seconds:!1}),f=Z("AM"),S=Z(null),I=Z([]),U=Z(),A=Z(!1);Ke(()=>{a("mounted")});const q=s=>Ce(new Date,{hours:s.hours,minutes:s.minutes,seconds:r.enableSeconds?s.seconds:0,milliseconds:0}),ae=G(()=>s=>H(s,r[s])||B(s,r[s])),E=G(()=>({hours:r.hours,minutes:r.minutes,seconds:r.seconds})),B=(s,L)=>v.value.enabled&&!v.value.disableTimeRangeValidation?!r.validateTime(s,L):!1,ne=(s,L)=>{if(v.value.enabled&&!v.value.disableTimeRangeValidation){const J=L?+r[`${s}Increment`]:-+r[`${s}Increment`],$=r[s]+J;return!r.validateTime(s,$)}return!1},F=G(()=>s=>!V(+r[s]+ +r[`${s}Increment`],s)||ne(s,!0)),N=G(()=>s=>!V(+r[s]-+r[`${s}Increment`],s)||ne(s,!1)),ie=(s,L)=>Xn(Ce(Q(),s),L),ce=(s,L)=>Go(Ce(Q(),s),L),pe=G(()=>({dp__time_col:!0,dp__time_col_block:!r.timePickerInline,dp__time_col_reg_block:!r.enableSeconds&&r.is24&&!r.timePickerInline,dp__time_col_reg_inline:!r.enableSeconds&&r.is24&&r.timePickerInline,dp__time_col_reg_with_button:!r.enableSeconds&&!r.is24,dp__time_col_sec:r.enableSeconds&&r.is24,dp__time_col_sec_with_button:r.enableSeconds&&!r.is24})),g=G(()=>{const s=[{type:"hours"}];return r.enableMinutes&&s.push({type:"",separator:!0},{type:"minutes"}),r.enableSeconds&&s.push({type:"",separator:!0},{type:"seconds"}),s}),D=G(()=>g.value.filter(s=>!s.separator)),y=G(()=>s=>{if(s==="hours"){const L=le(+r.hours);return{text:L<10?`0${L}`:`${L}`,value:L}}return{text:r[s]<10?`0${r[s]}`:`${r[s]}`,value:r[s]}}),H=(s,L)=>{var J;if(!r.disabledTimesConfig)return!1;const $=r.disabledTimesConfig(r.order,s==="hours"?L:void 0);return $[s]?!!((J=$[s])!=null&&J.includes(L)):!0},re=(s,L)=>L!=="hours"||f.value==="AM"?s:s+12,R=s=>{const L=r.is24?24:12,J=s==="hours"?L:60,$=+r[`${s}GridIncrement`],ge=s==="hours"&&!r.is24?$:0,x=[];for(let X=ge;X({active:!1,disabled:C.value.times[s].includes(X.value)||!V(X.value,s)||H(s,X.value)||B(s,X.value)}))},b=s=>s>=0?s:59,oe=s=>s>=0?s:23,V=(s,L)=>{const J=r.minTime?q(za(r.minTime)):null,$=r.maxTime?q(za(r.maxTime)):null,ge=q(za(E.value,L,L==="minutes"||L==="seconds"?b(s):oe(s)));return J&&$?(pa(ge,$)||Xt(ge,$))&&(Kt(ge,J)||Xt(ge,J)):J?Kt(ge,J)||Xt(ge,J):$?pa(ge,$)||Xt(ge,$):!0},M=s=>r[`no${s[0].toUpperCase()+s.slice(1)}Overlay`],o=s=>{M(s)||(Y[s]=!Y[s],Y[s]?(A.value=!0,a("overlay-opened",s)):(A.value=!1,a("overlay-closed",s)))},w=s=>s==="hours"?Tt:s==="minutes"?Rt:jt,z=()=>{U.value&&clearTimeout(U.value)},u=(s,L=!0,J)=>{const $=L?ie:ce,ge=L?+r[`${s}Increment`]:-+r[`${s}Increment`];V(+r[s]+ge,s)&&a(`update:${s}`,w(s)($({[s]:+r[s]},{[s]:+r[`${s}Increment`]}))),!(J!=null&&J.keyboard)&&m.value.timeArrowHoldThreshold&&(U.value=setTimeout(()=>{u(s,L)},m.value.timeArrowHoldThreshold))},le=s=>r.is24?s:(s>=12?f.value="PM":f.value="AM",ti(s)),fe=()=>{f.value==="PM"?(f.value="AM",a("update:hours",r.hours-12)):(f.value="PM",a("update:hours",r.hours+12)),a("am-pm-change",f.value)},Ve=s=>{Y[s]=!0},T=(s,L,J)=>{if(s&&r.arrowNavigation){Array.isArray(I.value[L])?I.value[L][J]=s:I.value[L]=[s];const $=I.value.reduce((ge,x)=>x.map((X,de)=>[...ge[de]||[],x[de]]),[]);i(r.closeTimePickerBtn),S.value&&($[1]=$[1].concat(S.value)),l($,r.order)}},K=(s,L)=>(o(s),a(`update:${s}`,L));return t({openChildCmp:Ve}),(s,L)=>{var J;return s.disabled?j("",!0):(P(),W("div",zi,[(P(!0),W(we,null,Ye(g.value,($,ge)=>{var x,X,de;return P(),W("div",{key:ge,class:ke(pe.value)},[$.separator?(P(),W(we,{key:0},[A.value?j("",!0):(P(),W(we,{key:0},[Dt(":")],64))],64)):(P(),W(we,{key:1},[ye("button",{ref_for:!0,ref:be=>T(be,ge,0),type:"button",class:ke({dp__btn:!0,dp__inc_dec_button:!s.timePickerInline,dp__inc_dec_button_inline:s.timePickerInline,dp__tp_inline_btn_top:s.timePickerInline,dp__inc_dec_button_disabled:F.value($.type),"dp--hidden-el":A.value}),"data-test":`${$.type}-time-inc-btn-${r.order}`,"aria-label":(x=d(p))==null?void 0:x.incrementValue($.type),tabindex:"0",onKeydown:be=>d(et)(be,()=>u($.type,!0,{keyboard:!0}),!0),onClick:be=>d(m).timeArrowHoldThreshold?void 0:u($.type,!0),onMousedown:be=>d(m).timeArrowHoldThreshold?u($.type,!0):void 0,onMouseup:z},[r.timePickerInline?(P(),W(we,{key:1},[s.$slots["tp-inline-arrow-up"]?ue(s.$slots,"tp-inline-arrow-up",{key:0}):(P(),W(we,{key:1},[L[2]||(L[2]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),L[3]||(L[3]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(P(),W(we,{key:0},[s.$slots["arrow-up"]?ue(s.$slots,"arrow-up",{key:0}):j("",!0),s.$slots["arrow-up"]?j("",!0):(P(),De(d(gn),{key:1}))],64))],42,Ui),ye("button",{ref_for:!0,ref:be=>T(be,ge,1),type:"button","aria-label":`${y.value($.type).text}-${(X=d(p))==null?void 0:X.openTpOverlay($.type)}`,class:ke({dp__time_display:!0,dp__time_display_block:!s.timePickerInline,dp__time_display_inline:s.timePickerInline,"dp--time-invalid":ae.value($.type),"dp--time-overlay-btn":!ae.value($.type),"dp--hidden-el":A.value}),disabled:M($.type),tabindex:"0","data-test":`${$.type}-toggle-overlay-btn-${r.order}`,onKeydown:be=>d(et)(be,()=>o($.type),!0),onClick:be=>o($.type)},[s.$slots[$.type]?ue(s.$slots,$.type,{key:0,text:y.value($.type).text,value:y.value($.type).value}):j("",!0),s.$slots[$.type]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(y.value($.type).text),1)],64))],42,Xi),ye("button",{ref_for:!0,ref:be=>T(be,ge,2),type:"button",class:ke({dp__btn:!0,dp__inc_dec_button:!s.timePickerInline,dp__inc_dec_button_inline:s.timePickerInline,dp__tp_inline_btn_bottom:s.timePickerInline,dp__inc_dec_button_disabled:N.value($.type),"dp--hidden-el":A.value}),"data-test":`${$.type}-time-dec-btn-${r.order}`,"aria-label":(de=d(p))==null?void 0:de.decrementValue($.type),tabindex:"0",onKeydown:be=>d(et)(be,()=>u($.type,!1,{keyboard:!0}),!0),onClick:be=>d(m).timeArrowHoldThreshold?void 0:u($.type,!1),onMousedown:be=>d(m).timeArrowHoldThreshold?u($.type,!1):void 0,onMouseup:z},[r.timePickerInline?(P(),W(we,{key:1},[s.$slots["tp-inline-arrow-down"]?ue(s.$slots,"tp-inline-arrow-down",{key:0}):(P(),W(we,{key:1},[L[4]||(L[4]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),L[5]||(L[5]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(P(),W(we,{key:0},[s.$slots["arrow-down"]?ue(s.$slots,"arrow-down",{key:0}):j("",!0),s.$slots["arrow-down"]?j("",!0):(P(),De(d(bn),{key:1}))],64))],42,Gi)],64))],2)}),128)),s.is24?j("",!0):(P(),W("div",ji,[s.$slots["am-pm-button"]?ue(s.$slots,"am-pm-button",{key:0,toggle:fe,value:f.value}):j("",!0),s.$slots["am-pm-button"]?j("",!0):(P(),W("button",{key:1,ref_key:"amPmButton",ref:S,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(J=d(p))==null?void 0:J.amPmButton,tabindex:"0",onClick:fe,onKeydown:L[0]||(L[0]=$=>d(et)($,()=>fe(),!0))},Ge(f.value),41,Ki))])),(P(!0),W(we,null,Ye(D.value,($,ge)=>(P(),De(ta,{key:ge,name:d(h)(Y[$.type]),css:d(k)},{default:_e(()=>{var x,X;return[Y[$.type]?(P(),De(ya,{key:0,items:R($.type),"is-last":s.autoApply&&!d(m).keepActionRow,"esc-close":s.escClose,type:$.type,"text-input":s.textInput,config:s.config,"arrow-navigation":s.arrowNavigation,"aria-labels":s.ariaLabels,"overlay-label":(X=(x=d(p)).timeOverlay)==null?void 0:X.call(x,$.type),onSelected:de=>K($.type,de),onToggle:de=>o($.type),onResetFlow:L[1]||(L[1]=de=>s.$emit("reset-flow"))},je({"button-icon":_e(()=>[s.$slots["clock-icon"]?ue(s.$slots,"clock-icon",{key:0}):j("",!0),s.$slots["clock-icon"]?j("",!0):(P(),De(Oa(s.timePickerInline?d(aa):d(yn)),{key:1}))]),_:2},[s.$slots[`${$.type}-overlay-value`]?{name:"item",fn:_e(({item:de})=>[ue(s.$slots,`${$.type}-overlay-value`,{text:de.text,value:de.value})]),key:"0"}:void 0,s.$slots[`${$.type}-overlay-header`]?{name:"header",fn:_e(()=>[ue(s.$slots,`${$.type}-overlay-header`,{toggle:()=>o($.type)})]),key:"1"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","aria-labels","overlay-label","onSelected","onToggle"])):j("",!0)]}),_:2},1032,["name","css"]))),128))]))}}}),Zi={class:"dp--tp-wrap"},es=["aria-label","tabindex"],ts=["role","aria-label","tabindex"],as=["aria-label"],Sr=ze({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...yt},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(e,{expose:t,emit:n}){const a=n,r=e,{buildMatrix:l,setTimePicker:i}=It(),p=qt(),{defaultedTransitions:c,defaultedAriaLabels:C,defaultedTextInput:m,defaultedConfig:v,defaultedRange:h}=Se(r),{transitionName:k,showTransition:Y}=ga(c),{hideNavigationButtons:f}=Ia(),S=Z(null),I=Z(null),U=Z([]),A=Z(null),q=Z(!1);Ke(()=>{a("mount"),!r.timePicker&&r.arrowNavigation?l([Fe(S.value)],"time"):i(!0,r.timePicker)});const ae=G(()=>h.value.enabled&&r.modelAuto?yr(r.internalModelValue):!0),E=Z(!1),B=R=>({hours:Array.isArray(r.hours)?r.hours[R]:r.hours,minutes:Array.isArray(r.minutes)?r.minutes[R]:r.minutes,seconds:Array.isArray(r.seconds)?r.seconds[R]:r.seconds}),ne=G(()=>{const R=[];if(h.value.enabled)for(let b=0;b<2;b++)R.push(B(b));else R.push(B(0));return R}),F=(R,b=!1,oe="")=>{b||a("reset-flow"),E.value=R,a(R?"overlay-opened":"overlay-closed",Xe.time),r.arrowNavigation&&i(R),it(()=>{oe!==""&&U.value[0]&&U.value[0].openChildCmp(oe)})},N=G(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:r.autoApply&&!v.value.keepActionRow})),ie=lt(p,"timePicker"),ce=(R,b,oe)=>h.value.enabled?b===0?[R,ne.value[1][oe]]:[ne.value[0][oe],R]:R,pe=R=>{a("update:hours",R)},g=R=>{a("update:minutes",R)},D=R=>{a("update:seconds",R)},y=()=>{if(A.value&&!m.value.enabled&&!r.noOverlayFocus){const R=gr(A.value);R&&R.focus({preventScroll:!0})}},H=R=>{q.value=!1,a("overlay-closed",R)},re=R=>{q.value=!0,a("overlay-opened",R)};return t({toggleTimePicker:F}),(R,b)=>{var oe;return P(),W("div",Zi,[!R.timePicker&&!R.timePickerInline?Ma((P(),W("button",{key:0,ref_key:"openTimePickerBtn",ref:S,type:"button",class:ke({...N.value,"dp--hidden-el":E.value}),"aria-label":(oe=d(C))==null?void 0:oe.openTimePicker,tabindex:R.noOverlayFocus?void 0:0,"data-test":"open-time-picker-btn",onKeydown:b[0]||(b[0]=V=>d(et)(V,()=>F(!0))),onClick:b[1]||(b[1]=V=>F(!0))},[R.$slots["clock-icon"]?ue(R.$slots,"clock-icon",{key:0}):j("",!0),R.$slots["clock-icon"]?j("",!0):(P(),De(d(yn),{key:1}))],42,es)),[[Da,!d(f)(R.hideNavigation,"time")]]):j("",!0),ot(ta,{name:d(k)(E.value),css:d(Y)&&!R.timePickerInline},{default:_e(()=>{var V,M;return[E.value||R.timePicker||R.timePickerInline?(P(),W("div",{key:0,ref_key:"overlayRef",ref:A,role:R.timePickerInline?void 0:"dialog",class:ke({dp__overlay:!R.timePickerInline,"dp--overlay-absolute":!r.timePicker&&!R.timePickerInline,"dp--overlay-relative":r.timePicker}),style:dt(R.timePicker?{height:`${d(v).modeHeight}px`}:void 0),"aria-label":(V=d(C))==null?void 0:V.timePicker,tabindex:R.timePickerInline?void 0:0},[ye("div",{class:ke(R.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[R.$slots["time-picker-overlay"]?ue(R.$slots,"time-picker-overlay",{key:0,hours:e.hours,minutes:e.minutes,seconds:e.seconds,setHours:pe,setMinutes:g,setSeconds:D}):j("",!0),R.$slots["time-picker-overlay"]?j("",!0):(P(),W("div",{key:1,class:ke(R.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(P(!0),W(we,null,Ye(ne.value,(o,w)=>Ma((P(),De(Ji,Qe({key:w,ref_for:!0},{...R.$props,order:w,hours:o.hours,minutes:o.minutes,seconds:o.seconds,closeTimePickerBtn:I.value,disabledTimesConfig:e.disabledTimesConfig,disabled:w===0?d(h).fixedStart:d(h).fixedEnd},{ref_for:!0,ref_key:"timeInputRefs",ref:U,"validate-time":(z,u)=>e.validateTime(z,ce(u,w,z)),"onUpdate:hours":z=>pe(ce(z,w,"hours")),"onUpdate:minutes":z=>g(ce(z,w,"minutes")),"onUpdate:seconds":z=>D(ce(z,w,"seconds")),onMounted:y,onOverlayClosed:H,onOverlayOpened:re,onAmPmChange:b[2]||(b[2]=z=>R.$emit("am-pm-change",z))}),je({_:2},[Ye(d(ie),(z,u)=>({name:z,fn:_e(le=>[ue(R.$slots,z,Qe({ref_for:!0},le))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[Da,w===0?!0:ae.value]])),128))],2)),!R.timePicker&&!R.timePickerInline?Ma((P(),W("button",{key:2,ref_key:"closeTimePickerBtn",ref:I,type:"button",class:ke({...N.value,"dp--hidden-el":q.value}),"aria-label":(M=d(C))==null?void 0:M.closeTimePicker,tabindex:"0",onKeydown:b[3]||(b[3]=o=>d(et)(o,()=>F(!1))),onClick:b[4]||(b[4]=o=>F(!1))},[R.$slots["calendar-icon"]?ue(R.$slots,"calendar-icon",{key:0}):j("",!0),R.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))],42,as)),[[Da,!d(f)(R.hideNavigation,"time")]]):j("",!0)],2)],14,ts)):j("",!0)]}),_:3},8,["name","css"])])}}}),Rr=(e,t,n,a)=>{const{defaultedRange:r}=Se(e),l=(A,q)=>Array.isArray(t[A])?t[A][q]:t[A],i=A=>e.enableSeconds?Array.isArray(t.seconds)?t.seconds[A]:t.seconds:0,p=(A,q)=>A?q!==void 0?St(A,l("hours",q),l("minutes",q),i(q)):St(A,t.hours,t.minutes,i()):mr(Q(),i(q)),c=(A,q)=>{t[A]=q},C=G(()=>e.modelAuto&&r.value.enabled?Array.isArray(n.value)?n.value.length>1:!1:r.value.enabled),m=(A,q)=>{const ae=Object.fromEntries(Object.keys(t).map(E=>E===A?[E,q]:[E,t[E]].slice()));if(C.value&&!r.value.disableTimeRangeValidation){const E=ne=>n.value?St(n.value[ne],ae.hours[ne],ae.minutes[ne],ae.seconds[ne]):null,B=ne=>vr(n.value[ne],0);return!(Me(E(0),E(1))&&(Kt(E(0),B(1))||pa(E(1),B(0))))}return!0},v=(A,q)=>{m(A,q)&&(c(A,q),a&&a())},h=A=>{v("hours",A)},k=A=>{v("minutes",A)},Y=A=>{v("seconds",A)},f=(A,q,ae,E)=>{q&&h(A),!q&&!ae&&k(A),ae&&Y(A),n.value&&E(n.value)},S=A=>{if(A){const q=Array.isArray(A),ae=q?[+A[0].hours,+A[1].hours]:+A.hours,E=q?[+A[0].minutes,+A[1].minutes]:+A.minutes,B=q?[+A[0].seconds,+A[1].seconds]:+A.seconds;c("hours",ae),c("minutes",E),e.enableSeconds&&c("seconds",B)}},I=(A,q)=>{const ae={hours:Array.isArray(t.hours)?t.hours[A]:t.hours,disabledArr:[]};return(q||q===0)&&(ae.hours=q),Array.isArray(e.disabledTimes)&&(ae.disabledArr=r.value.enabled&&Array.isArray(e.disabledTimes[A])?e.disabledTimes[A]:e.disabledTimes),ae},U=G(()=>(A,q)=>{var ae;if(Array.isArray(e.disabledTimes)){const{disabledArr:E,hours:B}=I(A,q),ne=E.filter(F=>+F.hours===B);return((ae=ne[0])==null?void 0:ae.minutes)==="*"?{hours:[B],minutes:void 0,seconds:void 0}:{hours:[],minutes:ne?.map(F=>+F.minutes)??[],seconds:ne?.map(F=>F.seconds?+F.seconds:void 0)??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:c,updateHours:h,updateMinutes:k,updateSeconds:Y,getSetDateTime:p,updateTimeValues:f,getSecondsValue:i,assignStartTime:S,validateTime:m,disabledTimesConfig:U}},ns=(e,t)=>{const n=()=>{e.isTextInputDate&&q()},{modelValue:a,time:r}=ba(e,t,n),{defaultedStartTime:l,defaultedRange:i,defaultedTz:p}=Se(e),{updateTimeValues:c,getSetDateTime:C,setTime:m,assignStartTime:v,disabledTimesConfig:h,validateTime:k}=Rr(e,r,a,Y);function Y(){t("update-flow-step")}const f=E=>{const{hours:B,minutes:ne,seconds:F}=E;return{hours:+B,minutes:+ne,seconds:F?+F:0}},S=()=>{if(e.startTime){if(Array.isArray(e.startTime)){const B=f(e.startTime[0]),ne=f(e.startTime[1]);return[Ce(Q(),B),Ce(Q(),ne)]}const E=f(e.startTime);return Ce(Q(),E)}return i.value.enabled?[null,null]:null},I=()=>{if(i.value.enabled){const[E,B]=S();a.value=[nt(C(E,0),p.value.timezone),nt(C(B,1),p.value.timezone)]}else a.value=nt(C(S()),p.value.timezone)},U=E=>Array.isArray(E)?[Ft(Q(E[0])),Ft(Q(E[1]))]:[Ft(E??Q())],A=(E,B,ne)=>{m("hours",E),m("minutes",B),m("seconds",e.enableSeconds?ne:0)},q=()=>{const[E,B]=U(a.value);return i.value.enabled?A([E.hours,B.hours],[E.minutes,B.minutes],[E.seconds,B.seconds]):A(E.hours,E.minutes,E.seconds)};Ke(()=>{if(!e.shadow)return v(l.value),a.value?q():I()});const ae=()=>{Array.isArray(a.value)?a.value=a.value.map((E,B)=>E&&C(E,B)):a.value=C(a.value),t("time-update")};return{modelValue:a,time:r,disabledTimesConfig:h,updateTime:(E,B=!0,ne=!1)=>{c(E,B,ne,ae)},validateTime:k}},rs=ze({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...yt},emits:["update:internal-model-value","time-update","am-pm-change","mount","reset-flow","update-flow-step","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=lt(l,"timePicker"),p=Z(null),{time:c,modelValue:C,disabledTimesConfig:m,updateTime:v,validateTime:h}=ns(r,a);return Ke(()=>{r.shadow||a("mount",null)}),t({getSidebarProps:()=>({modelValue:C,time:c,updateTime:v}),toggleTimePicker:(k,Y=!1,f="")=>{var S;(S=p.value)==null||S.toggleTimePicker(k,Y,f)}}),(k,Y)=>(P(),De(Sa,{"multi-calendars":0,stretch:""},{default:_e(()=>[ot(Sr,Qe({ref_key:"tpRef",ref:p},k.$props,{hours:d(c).hours,minutes:d(c).minutes,seconds:d(c).seconds,"internal-model-value":k.internalModelValue,"disabled-times-config":d(m),"validate-time":d(h),"onUpdate:hours":Y[0]||(Y[0]=f=>d(v)(f)),"onUpdate:minutes":Y[1]||(Y[1]=f=>d(v)(f,!1)),"onUpdate:seconds":Y[2]||(Y[2]=f=>d(v)(f,!1,!0)),onAmPmChange:Y[3]||(Y[3]=f=>k.$emit("am-pm-change",f)),onResetFlow:Y[4]||(Y[4]=f=>k.$emit("reset-flow")),onOverlayClosed:Y[5]||(Y[5]=f=>k.$emit("overlay-toggle",{open:!1,overlay:f})),onOverlayOpened:Y[6]||(Y[6]=f=>k.$emit("overlay-toggle",{open:!0,overlay:f}))}),je({_:2},[Ye(d(i),(f,S)=>({name:f,fn:_e(I=>[ue(k.$slots,f,We(at(I)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3}))}}),ls={class:"dp--header-wrap"},os={key:0,class:"dp__month_year_wrap"},is={key:0},ss={class:"dp__month_year_wrap"},us=["data-dp-element","aria-label","data-test","onClick","onKeydown"],ds=ze({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...yt},emits:["update-month-year","mount","reset-flow","overlay-closed","overlay-opened"],setup(e,{expose:t,emit:n}){const a=n,r=e,{defaultedTransitions:l,defaultedAriaLabels:i,defaultedMultiCalendars:p,defaultedFilters:c,defaultedConfig:C,defaultedHighlight:m,propDates:v,defaultedUI:h}=Se(r),{transitionName:k,showTransition:Y}=ga(l),{buildMatrix:f}=It(),{handleMonthYearChange:S,isDisabled:I,updateMonthYear:U}=Yi(r,a),{showLeftIcon:A,showRightIcon:q}=Ia(),ae=Z(!1),E=Z(!1),B=Z(!1),ne=Z([null,null,null,null]);Ke(()=>{a("mount")});const F=M=>({get:()=>r[M],set:o=>{const w=M===vt.month?vt.year:vt.month;a("update-month-year",{[M]:o,[w]:r[w]}),M===vt.month?H(!0):re(!0)}}),N=G(F(vt.month)),ie=G(F(vt.year)),ce=G(()=>M=>({month:r.month,year:r.year,items:M===vt.month?r.months:r.years,instance:r.instance,updateMonthYear:U,toggle:M===vt.month?H:re})),pe=G(()=>r.months.find(o=>o.value===r.month)||{text:"",value:0}),g=G(()=>Zt(r.months,M=>{const o=r.month===M.value,w=fa(M.value,wr(r.year,v.value.minDate),_r(r.year,v.value.maxDate))||c.value.months.includes(M.value),z=Tr(m.value,M.value,r.year);return{active:o,disabled:w,highlighted:z}})),D=G(()=>Zt(r.years,M=>{const o=r.year===M.value,w=fa(M.value,ea(v.value.minDate),ea(v.value.maxDate))||c.value.years.includes(M.value),z=Mn(m.value,M.value);return{active:o,disabled:w,highlighted:z}})),y=(M,o,w)=>{w!==void 0?M.value=w:M.value=!M.value,M.value?(B.value=!0,a("overlay-opened",o)):(B.value=!1,a("overlay-closed",o))},H=(M=!1,o)=>{R(M),y(ae,Xe.month,o)},re=(M=!1,o)=>{R(M),y(E,Xe.year,o)},R=M=>{M||a("reset-flow")},b=(M,o)=>{r.arrowNavigation&&(ne.value[o]=Fe(M),f(ne.value,"monthYear"))},oe=G(()=>{var M,o,w,z,u,le;return[{type:vt.month,index:1,toggle:H,modelValue:N.value,updateModelValue:fe=>N.value=fe,text:pe.value.text,showSelectionGrid:ae.value,items:g.value,ariaLabel:(M=i.value)==null?void 0:M.openMonthsOverlay,overlayLabel:((w=(o=i.value).monthPicker)==null?void 0:w.call(o,!0))??void 0},{type:vt.year,index:2,toggle:re,modelValue:ie.value,updateModelValue:fe=>ie.value=fe,text:br(r.year,r.locale),showSelectionGrid:E.value,items:D.value,ariaLabel:(z=i.value)==null?void 0:z.openYearsOverlay,overlayLabel:((le=(u=i.value).yearPicker)==null?void 0:le.call(u,!0))??void 0}]}),V=G(()=>r.disableYearSelect?[oe.value[0]]:r.yearFirst?[...oe.value].reverse():oe.value);return t({toggleMonthPicker:H,toggleYearPicker:re,handleMonthYearChange:S}),(M,o)=>{var w,z,u,le,fe,Ve;return P(),W("div",ls,[M.$slots["month-year"]?(P(),W("div",os,[ue(M.$slots,"month-year",We(at({month:e.month,year:e.year,months:e.months,years:e.years,updateMonthYear:d(U),handleMonthYearChange:d(S),instance:e.instance})))])):(P(),W(we,{key:1},[M.$slots["top-extra"]?(P(),W("div",is,[ue(M.$slots,"top-extra",{value:M.internalModelValue})])):j("",!0),ye("div",ss,[d(A)(d(p),e.instance)&&!M.vertical?(P(),De(da,{key:0,"aria-label":(w=d(i))==null?void 0:w.prevMonth,disabled:d(I)(!1),class:ke((z=d(h))==null?void 0:z.navBtnPrev),"el-name":"action-prev",onActivate:o[0]||(o[0]=T=>d(S)(!1,!0)),onSetRef:o[1]||(o[1]=T=>b(T,0))},{default:_e(()=>[M.$slots["arrow-left"]?ue(M.$slots,"arrow-left",{key:0}):j("",!0),M.$slots["arrow-left"]?j("",!0):(P(),De(d(fn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),ye("div",{class:ke(["dp__month_year_wrap",{dp__year_disable_select:M.disableYearSelect}])},[(P(!0),W(we,null,Ye(V.value,(T,K)=>(P(),W(we,{key:T.type},[ye("button",{ref_for:!0,ref:s=>b(s,K+1),type:"button","data-dp-element":`overlay-${T.type}`,class:ke(["dp__btn dp__month_year_select",{"dp--hidden-el":B.value}]),"aria-label":`${T.text}-${T.ariaLabel}`,"data-test":`${T.type}-toggle-overlay-${e.instance}`,onClick:T.toggle,onKeydown:s=>d(et)(s,()=>T.toggle(),!0)},[M.$slots[T.type]?ue(M.$slots,T.type,{key:0,text:T.text,value:r[T.type]}):j("",!0),M.$slots[T.type]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(T.text),1)],64))],42,us),ot(ta,{name:d(k)(T.showSelectionGrid),css:d(Y)},{default:_e(()=>[T.showSelectionGrid?(P(),De(ya,{key:0,items:T.items,"arrow-navigation":M.arrowNavigation,"hide-navigation":M.hideNavigation,"is-last":M.autoApply&&!d(C).keepActionRow,"skip-button-ref":!1,config:M.config,type:T.type,"header-refs":[],"esc-close":M.escClose,"menu-wrap-ref":M.menuWrapRef,"text-input":M.textInput,"aria-labels":M.ariaLabels,"overlay-label":T.overlayLabel,onSelected:T.updateModelValue,onToggle:T.toggle},je({"button-icon":_e(()=>[M.$slots["calendar-icon"]?ue(M.$slots,"calendar-icon",{key:0}):j("",!0),M.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))]),_:2},[M.$slots[`${T.type}-overlay-value`]?{name:"item",fn:_e(({item:s})=>[ue(M.$slots,`${T.type}-overlay-value`,{text:s.text,value:s.value})]),key:"0"}:void 0,M.$slots[`${T.type}-overlay`]?{name:"overlay",fn:_e(()=>[ue(M.$slots,`${T.type}-overlay`,Qe({ref_for:!0},ce.value(T.type)))]),key:"1"}:void 0,M.$slots[`${T.type}-overlay-header`]?{name:"header",fn:_e(()=>[ue(M.$slots,`${T.type}-overlay-header`,{toggle:T.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","menu-wrap-ref","text-input","aria-labels","overlay-label","onSelected","onToggle"])):j("",!0)]),_:2},1032,["name","css"])],64))),128))],2),d(A)(d(p),e.instance)&&M.vertical?(P(),De(da,{key:1,"aria-label":(u=d(i))==null?void 0:u.prevMonth,"el-name":"action-prev",disabled:d(I)(!1),class:ke((le=d(h))==null?void 0:le.navBtnPrev),onActivate:o[2]||(o[2]=T=>d(S)(!1,!0))},{default:_e(()=>[M.$slots["arrow-up"]?ue(M.$slots,"arrow-up",{key:0}):j("",!0),M.$slots["arrow-up"]?j("",!0):(P(),De(d(gn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),d(q)(d(p),e.instance)?(P(),De(da,{key:2,ref:"rightIcon","el-name":"action-next",disabled:d(I)(!0),"aria-label":(fe=d(i))==null?void 0:fe.nextMonth,class:ke((Ve=d(h))==null?void 0:Ve.navBtnNext),onActivate:o[3]||(o[3]=T=>d(S)(!0,!0)),onSetRef:o[4]||(o[4]=T=>b(T,M.disableYearSelect?2:3))},{default:_e(()=>[M.$slots[M.vertical?"arrow-down":"arrow-right"]?ue(M.$slots,M.vertical?"arrow-down":"arrow-right",{key:0}):j("",!0),M.$slots[M.vertical?"arrow-down":"arrow-right"]?j("",!0):(P(),De(Oa(M.vertical?d(bn):d(hn)),{key:1}))]),_:3},8,["disabled","aria-label","class"])):j("",!0)])],64))])}}}),cs={class:"dp__calendar_header",role:"row"},vs={key:0,class:"dp__calendar_header_item",role:"gridcell"},ms=["aria-label"],ps={key:0,class:"dp__calendar_item dp__week_num",role:"gridcell"},fs={class:"dp__cell_inner"},hs=["id","aria-pressed","aria-disabled","aria-label","tabindex","data-test","onClick","onTouchend","onKeydown","onMouseenter","onMouseleave","onMousedown"],ys=ze({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...yt},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(e,{expose:t,emit:n}){const a=n,r=e,{buildMultiLevelMatrix:l}=It(),{defaultedTransitions:i,defaultedConfig:p,defaultedAriaLabels:c,defaultedMultiCalendars:C,defaultedWeekNumbers:m,defaultedMultiDates:v,defaultedUI:h}=Se(r),k=Z(null),Y=Z({bottom:"",left:"",transform:""}),f=Z([]),S=Z(null),I=Z(!0),U=Z(""),A=Z({startX:0,endX:0,startY:0,endY:0}),q=Z([]),ae=Z({left:"50%"}),E=Z(!1),B=G(()=>r.calendar?r.calendar(r.mappedDates):r.mappedDates),ne=G(()=>r.dayNames?Array.isArray(r.dayNames)?r.dayNames:r.dayNames(r.locale,+r.weekStart):ei(r.formatLocale,r.locale,+r.weekStart));Ke(()=>{a("mount",{cmp:"calendar",refs:f}),p.value.noSwipe||S.value&&(S.value.addEventListener("touchstart",b,{passive:!1}),S.value.addEventListener("touchend",oe,{passive:!1}),S.value.addEventListener("touchmove",V,{passive:!1})),r.monthChangeOnScroll&&S.value&&S.value.addEventListener("wheel",w,{passive:!1})});const F=T=>T?r.vertical?"vNext":"next":r.vertical?"vPrevious":"previous",N=(T,K)=>{if(r.transitions){const s=tt(Mt(Q(),r.month,r.year));U.value=Ne(tt(Mt(Q(),T,K)),s)?i.value[F(!0)]:i.value[F(!1)],I.value=!1,it(()=>{I.value=!0})}},ie=G(()=>({...h.value.calendar??{}})),ce=G(()=>T=>{const K=ai(T);return{dp__marker_dot:K.type==="dot",dp__marker_line:K.type==="line"}}),pe=G(()=>T=>Me(T,k.value)),g=G(()=>({dp__calendar:!0,dp__calendar_next:C.value.count>0&&r.instance!==0})),D=G(()=>T=>r.hideOffsetDates?T.current:!0),y=async(T,K)=>{const{width:s,height:L}=T.getBoundingClientRect();k.value=K.value;let J={left:`${s/2}px`},$=-50;if(await it(),q.value[0]){const{left:ge,width:x}=q.value[0].getBoundingClientRect();ge<0&&(J={left:"0"},$=0,ae.value.left=`${s/2}px`),window.innerWidth{var L,J,$;const ge=Fe(f.value[K][s]);ge&&((L=T.marker)!=null&&L.customPosition&&($=(J=T.marker)==null?void 0:J.tooltip)!=null&&$.length?Y.value=T.marker.customPosition(ge):await y(ge,T),a("tooltip-open",T.marker))},re=async(T,K,s)=>{var L,J;if(E.value&&v.value.enabled&&v.value.dragSelect)return a("select-date",T);a("set-hover-date",T),(J=(L=T.marker)==null?void 0:L.tooltip)!=null&&J.length&&await H(T,K,s)},R=T=>{k.value&&(k.value=null,Y.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),a("tooltip-close",T.marker))},b=T=>{A.value.startX=T.changedTouches[0].screenX,A.value.startY=T.changedTouches[0].screenY},oe=T=>{A.value.endX=T.changedTouches[0].screenX,A.value.endY=T.changedTouches[0].screenY,M()},V=T=>{r.vertical&&!r.inline&&T.preventDefault()},M=()=>{const T=r.vertical?"Y":"X";Math.abs(A.value[`start${T}`]-A.value[`end${T}`])>10&&a("handle-swipe",A.value[`start${T}`]>A.value[`end${T}`]?"right":"left")},o=(T,K,s)=>{T&&(Array.isArray(f.value[K])?f.value[K][s]=T:f.value[K]=[T]),r.arrowNavigation&&l(f.value,"calendar")},w=T=>{r.monthChangeOnScroll&&(T.preventDefault(),a("handle-scroll",T))},z=T=>m.value.type==="local"?vn(T.value,{weekStartsOn:+r.weekStart}):m.value.type==="iso"?dn(T.value):typeof m.value.type=="function"?m.value.type(T.value):"",u=T=>{const K=T[0];return m.value.hideOnOffsetDates?T.some(s=>s.current)?z(K):"":z(K)},le=(T,K,s=!0)=>{s&&Vn()||!s&&!Vn()||v.value.enabled||(Yt(T,p.value),a("select-date",K))},fe=T=>{Yt(T,p.value)},Ve=T=>{v.value.enabled&&v.value.dragSelect?(E.value=!0,a("select-date",T)):v.value.enabled&&a("select-date",T)};return t({triggerTransition:N}),(T,K)=>(P(),W("div",{class:ke(g.value)},[ye("div",{ref_key:"calendarWrapRef",ref:S,class:ke(ie.value),role:"grid"},[ye("div",cs,[T.weekNumbers?(P(),W("div",vs,Ge(T.weekNumName),1)):j("",!0),(P(!0),W(we,null,Ye(ne.value,(s,L)=>{var J,$;return P(),W("div",{key:L,class:"dp__calendar_header_item",role:"gridcell","data-test":"calendar-header","aria-label":($=(J=d(c))==null?void 0:J.weekDay)==null?void 0:$.call(J,L)},[T.$slots["calendar-header"]?ue(T.$slots,"calendar-header",{key:0,day:s,index:L}):j("",!0),T.$slots["calendar-header"]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(s),1)],64))],8,ms)}),128))]),K[2]||(K[2]=ye("div",{class:"dp__calendar_header_separator"},null,-1)),ot(ta,{name:U.value,css:!!T.transitions},{default:_e(()=>[I.value?(P(),W("div",{key:0,class:"dp__calendar",role:"rowgroup",onMouseleave:K[1]||(K[1]=s=>E.value=!1)},[(P(!0),W(we,null,Ye(B.value,(s,L)=>(P(),W("div",{key:L,class:"dp__calendar_row",role:"row"},[T.weekNumbers?(P(),W("div",ps,[ye("div",fs,Ge(u(s.days)),1)])):j("",!0),(P(!0),W(we,null,Ye(s.days,(J,$)=>{var ge,x,X;return P(),W("div",{id:d(Pr)(J.value),ref_for:!0,ref:de=>o(de,L,$),key:$+L,role:"gridcell",class:"dp__calendar_item","aria-pressed":(J.classData.dp__active_date||J.classData.dp__range_start||J.classData.dp__range_start)??void 0,"aria-disabled":J.classData.dp__cell_disabled||void 0,"aria-label":(x=(ge=d(c))==null?void 0:ge.day)==null?void 0:x.call(ge,J),tabindex:!J.current&&T.hideOffsetDates?void 0:0,"data-test":J.value,onClick:va(de=>le(de,J),["prevent"]),onTouchend:de=>le(de,J,!1),onKeydown:de=>d(et)(de,()=>T.$emit("select-date",J)),onMouseenter:de=>re(J,L,$),onMouseleave:de=>R(J),onMousedown:de=>Ve(J),onMouseup:K[0]||(K[0]=de=>E.value=!1)},[ye("div",{class:ke(["dp__cell_inner",J.classData])},[T.$slots.day&&D.value(J)?ue(T.$slots,"day",{key:0,day:+J.text,date:J.value}):j("",!0),T.$slots.day?j("",!0):(P(),W(we,{key:1},[Dt(Ge(J.text),1)],64)),J.marker&&D.value(J)?(P(),W(we,{key:2},[T.$slots.marker?ue(T.$slots,"marker",{key:0,marker:J.marker,day:+J.text,date:J.value}):(P(),W("div",{key:1,class:ke(ce.value(J.marker)),style:dt(J.marker.color?{backgroundColor:J.marker.color}:{})},null,6))],64)):j("",!0),pe.value(J.value)?(P(),W("div",{key:3,ref_for:!0,ref_key:"activeTooltip",ref:q,class:"dp__marker_tooltip",style:dt(Y.value)},[(X=J.marker)!=null&&X.tooltip?(P(),W("div",{key:0,class:"dp__tooltip_content",onClick:fe},[(P(!0),W(we,null,Ye(J.marker.tooltip,(de,be)=>(P(),W("div",{key:be,class:"dp__tooltip_text"},[T.$slots["marker-tooltip"]?ue(T.$slots,"marker-tooltip",{key:0,tooltip:de,day:J.value}):j("",!0),T.$slots["marker-tooltip"]?j("",!0):(P(),W(we,{key:1},[ye("div",{class:"dp__tooltip_mark",style:dt(de.color?{backgroundColor:de.color}:{})},null,4),ye("div",null,Ge(de.text),1)],64))]))),128)),ye("div",{class:"dp__arrow_bottom_tp",style:dt(ae.value)},null,4)])):j("",!0)],4)):j("",!0)],2)],40,hs)}),128))]))),128))],32)):j("",!0)]),_:3},8,["name","css"])],2)],2))}}),zn=e=>Array.isArray(e),gs=(e,t,n,a)=>{const r=Z([]),l=Z(new Date),i=Z(),p=()=>b(e.isTextInputDate),{modelValue:c,calendars:C,time:m,today:v}=ba(e,t,p),{defaultedMultiCalendars:h,defaultedStartTime:k,defaultedRange:Y,defaultedConfig:f,defaultedTz:S,propDates:I,defaultedMultiDates:U}=Se(e),{validateMonthYearInRange:A,isDisabled:q,isDateRangeAllowed:ae,checkMinMaxRange:E}=Et(e),{updateTimeValues:B,getSetDateTime:ne,setTime:F,assignStartTime:N,validateTime:ie,disabledTimesConfig:ce}=Rr(e,m,c,a),pe=G(()=>_=>C.value[_]?C.value[_].month:0),g=G(()=>_=>C.value[_]?C.value[_].year:0),D=_=>!f.value.keepViewOnOffsetClick||_?!0:!i.value,y=(_,te,O,ee=!1)=>{var se,Je;D(ee)&&(C.value[_]||(C.value[_]={month:0,year:0}),C.value[_].month=Hn(te)?(se=C.value[_])==null?void 0:se.month:te,C.value[_].year=Hn(O)?(Je=C.value[_])==null?void 0:Je.year:O)},H=()=>{e.autoApply&&t("select-date")};Ke(()=>{e.shadow||(c.value||(T(),k.value&&N(k.value)),b(!0),e.focusStartDate&&e.startDate&&T())});const re=G(()=>{var _;return(_=e.flow)!=null&&_.length&&!e.partialFlow?e.flowStep===e.flow.length:!0}),R=()=>{e.autoApply&&re.value&&t("auto-apply",e.partialFlow?e.flowStep!==e.flow.length:!1)},b=(_=!1)=>{if(c.value)return Array.isArray(c.value)?(r.value=c.value,u(_)):M(c.value,_);if(h.value.count&&_&&!e.startDate)return V(Q(),_)},oe=()=>Array.isArray(c.value)&&Y.value.enabled?xe(c.value[0])===xe(c.value[1]??c.value[0]):!1,V=(_=new Date,te=!1)=>{if((!h.value.count||!h.value.static||te)&&y(0,xe(_),he(_)),h.value.count&&(!h.value.solo||!c.value||oe()))for(let O=1;O{V(_),F("hours",Tt(_)),F("minutes",Rt(_)),F("seconds",jt(_)),h.value.count&&te&&Ve()},o=_=>{if(h.value.count){if(h.value.solo)return 0;const te=xe(_[0]),O=xe(_[1]);return Math.abs(O-te){_[1]&&Y.value.showLastInRange?V(_[o(_)],te):V(_[0],te);const O=(ee,se)=>[ee(_[0]),_[1]?ee(_[1]):m[se][1]];F("hours",O(Tt,"hours")),F("minutes",O(Rt,"minutes")),F("seconds",O(jt,"seconds"))},z=(_,te)=>{if((Y.value.enabled||e.weekPicker)&&!U.value.enabled)return w(_,te);if(U.value.enabled&&te){const O=_[_.length-1];return M(O,te)}},u=_=>{const te=c.value;z(te,_),h.value.count&&h.value.solo&&Ve()},le=(_,te)=>{const O=Ce(Q(),{month:pe.value(te),year:g.value(te)}),ee=_<0?ft(O,1):Jt(O,1);A(xe(ee),he(ee),_<0,e.preventMinMaxNavigation)&&(y(te,xe(ee),he(ee)),t("update-month-year",{instance:te,month:xe(ee),year:he(ee)}),h.value.count&&!h.value.solo&&fe(te),n())},fe=_=>{for(let te=_-1;te>=0;te--){const O=Jt(Ce(Q(),{month:pe.value(te+1),year:g.value(te+1)}),1);y(te,xe(O),he(O))}for(let te=_+1;te<=h.value.count-1;te++){const O=ft(Ce(Q(),{month:pe.value(te-1),year:g.value(te-1)}),1);y(te,xe(O),he(O))}},Ve=()=>{if(Array.isArray(c.value)&&c.value.length===2){const _=Q(Q(c.value[1]?c.value[1]:ft(c.value[0],1))),[te,O]=[xe(c.value[0]),he(c.value[0])],[ee,se]=[xe(c.value[1]),he(c.value[1])];(te!==ee||te===ee&&O!==se)&&h.value.solo&&y(1,xe(_),he(_))}else c.value&&!Array.isArray(c.value)&&(y(0,xe(c.value),he(c.value)),V(Q()))},T=()=>{e.startDate&&(y(0,xe(Q(e.startDate)),he(Q(e.startDate))),h.value.count&&fe(0))},K=(_,te)=>{if(e.monthChangeOnScroll){const O=new Date().getTime()-l.value.getTime(),ee=Math.abs(_.deltaY);let se=500;ee>1&&(se=100),ee>100&&(se=0),O>se&&(l.value=new Date,le(e.monthChangeOnScroll!=="inverse"?-_.deltaY:_.deltaY,te))}},s=(_,te,O=!1)=>{e.monthChangeOnArrows&&e.vertical===O&&L(_,te)},L=(_,te)=>{le(_==="right"?-1:1,te)},J=_=>{if(I.value.markers)return Aa(_.value,I.value.markers)},$=(_,te)=>{switch(e.sixWeeks===!0?"append":e.sixWeeks){case"prepend":return[!0,!1];case"center":return[_==0,!0];case"fair":return[_==0||te>_,!0];case"append":return[!1,!1];default:return[!1,!1]}},ge=(_,te,O,ee)=>{if(e.sixWeeks&&_.length<6){const se=6-_.length,Je=(te.getDay()+7-ee)%7,ut=6-(O.getDay()+7-ee)%7,[Bt,_a]=$(Je,ut);for(let la=1;la<=se;la++)if(_a?!!(la%2)==Bt:Bt){const At=_[0].days[0],qa=x(mt(At.value,-7),xe(te));_.unshift({days:qa})}else{const At=_[_.length-1],qa=At.days[At.days.length-1],Er=x(mt(qa.value,1),xe(te));_.push({days:Er})}}return _},x=(_,te)=>{const O=Q(_),ee=[];for(let se=0;se<7;se++){const Je=mt(O,se),ut=xe(Je)!==te;ee.push({text:e.hideOffsetDates&&ut?"":Je.getDate(),value:Je,current:!ut,classData:{}})}return ee},X=(_,te)=>{const O=[],ee=new Date(te,_),se=new Date(te,_+1,0),Je=e.weekStart,ut=ht(ee,{weekStartsOn:Je}),Bt=_a=>{const la=x(_a,_);if(O.push({days:la}),!O[O.length-1].days.some(At=>Me(tt(At.value),tt(se)))){const At=mt(_a,7);Bt(At)}};return Bt(ut),ge(O,ee,se,Je)},de=_=>{const te=St(Q(_.value),m.hours,m.minutes,rt());t("date-update",te),U.value.enabled?Dn(te,c,U.value.limit):c.value=te,a(),it().then(()=>{R()})},be=_=>Y.value.noDisabledRange?kr(r.value[0],_).some(te=>q(te)):!1,st=()=>{r.value=c.value?c.value.slice():[],r.value.length===2&&!(Y.value.fixedStart||Y.value.fixedEnd)&&(r.value=[])},me=(_,te)=>{const O=[Q(_.value),mt(Q(_.value),+Y.value.autoRange)];ae(O)?(te&&Pt(_.value),r.value=O):t("invalid-date",_.value)},Pt=_=>{const te=xe(Q(_)),O=he(Q(_));if(y(0,te,O),h.value.count>0)for(let ee=1;ee{if(be(_.value)||!E(_.value,c.value,Y.value.fixedStart?0:1))return t("invalid-date",_.value);r.value=$r(Q(_.value),c,t,Y)},na=(_,te)=>{if(st(),Y.value.autoRange)return me(_,te);if(Y.value.fixedStart||Y.value.fixedEnd)return gt(_);r.value[0]?E(Q(_.value),c.value)&&!be(_.value)?Ie(Q(_.value),Q(r.value[0]))?(r.value.unshift(Q(_.value)),t("range-end",r.value[0])):(r.value[1]=Q(_.value),t("range-end",r.value[1])):(e.autoApply&&t("auto-apply-invalid",_.value),t("invalid-date",_.value)):(r.value[0]=Q(_.value),t("range-start",r.value[0]))},rt=(_=!0)=>e.enableSeconds?Array.isArray(m.seconds)?_?m.seconds[0]:m.seconds[1]:m.seconds:0,ra=_=>{r.value[_]=St(r.value[_],m.hours[_],m.minutes[_],rt(_!==1))},Ea=()=>{var _,te;r.value[0]&&r.value[1]&&+((_=r.value)==null?void 0:_[0])>+((te=r.value)==null?void 0:te[1])&&(r.value.reverse(),t("range-start",r.value[0]),t("range-end",r.value[1]))},wa=()=>{r.value.length&&(r.value[0]&&!r.value[1]?ra(0):(ra(0),ra(1),a()),Ea(),c.value=r.value.slice(),Ra(r.value,t,e.autoApply,e.modelAuto))},Ba=(_,te=!1)=>{if(q(_.value)||!_.current&&e.hideOffsetDates)return t("invalid-date",_.value);if(i.value=JSON.parse(JSON.stringify(_)),!Y.value.enabled)return de(_);zn(m.hours)&&zn(m.minutes)&&!U.value.enabled&&(na(_,te),wa())},Na=(_,te)=>{var O;y(_,te.month,te.year,!0),h.value.count&&!h.value.solo&&fe(_),t("update-month-year",{instance:_,month:te.month,year:te.year}),n(h.value.solo?_:void 0);const ee=(O=e.flow)!=null&&O.length?e.flow[e.flowStep]:void 0;!te.fromNav&&(ee===Xe.month||ee===Xe.year)&&a()},La=(_,te)=>{Or({value:_,modelValue:c,range:Y.value.enabled,timezone:te?void 0:S.value.timezone}),H(),e.multiCalendars&&it().then(()=>b(!0))},Ha=()=>{const _=wn(Q(),S.value);Y.value.enabled?c.value&&Array.isArray(c.value)&&c.value[0]?c.value=Ie(_,c.value[0])?[_,c.value[0]]:[c.value[0],_]:c.value=[_]:c.value=_,H()},Va=()=>{if(Array.isArray(c.value))if(U.value.enabled){const _=Fa();c.value[c.value.length-1]=ne(_)}else c.value=c.value.map((_,te)=>_&&ne(_,te));else c.value=ne(c.value);t("time-update")},Fa=()=>Array.isArray(c.value)&&c.value.length?c.value[c.value.length-1]:null;return{calendars:C,modelValue:c,month:pe,year:g,time:m,disabledTimesConfig:ce,today:v,validateTime:ie,getCalendarDays:X,getMarker:J,handleScroll:K,handleSwipe:L,handleArrow:s,selectDate:Ba,updateMonthYear:Na,presetDate:La,selectCurrentDate:Ha,updateTime:(_,te=!0,O=!1)=>{B(_,te,O,Va)},assignMonthAndYear:V}},bs={key:0},ws=ze({__name:"DatePicker",props:{...yt},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,{calendars:l,month:i,year:p,modelValue:c,time:C,disabledTimesConfig:m,today:v,validateTime:h,getCalendarDays:k,getMarker:Y,handleArrow:f,handleScroll:S,handleSwipe:I,selectDate:U,updateMonthYear:A,presetDate:q,selectCurrentDate:ae,updateTime:E,assignMonthAndYear:B}=gs(r,a,oe,V),ne=qt(),{setHoverDate:F,getDayClassData:N,clearHoverDate:ie}=Is(c,r),{defaultedMultiCalendars:ce}=Se(r),pe=Z([]),g=Z([]),D=Z(null),y=lt(ne,"calendar"),H=lt(ne,"monthYear"),re=lt(ne,"timePicker"),R=K=>{r.shadow||a("mount",K)};ct(l,()=>{r.shadow||setTimeout(()=>{a("recalculate-position")},0)},{deep:!0}),ct(ce,(K,s)=>{K.count-s.count>0&&B()},{deep:!0});const b=G(()=>K=>k(i.value(K),p.value(K)).map(s=>({...s,days:s.days.map(L=>(L.marker=Y(L),L.classData=N(L),L))})));function oe(K){var s;K||K===0?(s=g.value[K])==null||s.triggerTransition(i.value(K),p.value(K)):g.value.forEach((L,J)=>L.triggerTransition(i.value(J),p.value(J)))}function V(){a("update-flow-step")}const M=(K,s=!1)=>{U(K,s),r.spaceConfirm&&a("select-date")},o=(K,s,L=0)=>{var J;(J=pe.value[L])==null||J.toggleMonthPicker(K,s)},w=(K,s,L=0)=>{var J;(J=pe.value[L])==null||J.toggleYearPicker(K,s)},z=(K,s,L)=>{var J;(J=D.value)==null||J.toggleTimePicker(K,s,L)},u=(K,s)=>{var L;if(!r.range){const J=c.value?c.value:v,$=s?new Date(s):J,ge=K?ht($,{weekStartsOn:1}):ar($,{weekStartsOn:1});U({value:ge,current:xe($)===i.value(0),text:"",classData:{}}),(L=document.getElementById(Pr(ge)))==null||L.focus()}},le=K=>{var s;(s=pe.value[0])==null||s.handleMonthYearChange(K,!0)},fe=K=>{A(0,{month:i.value(0),year:p.value(0)+(K?1:-1),fromNav:!0})},Ve=(K,s)=>{K===Xe.time&&a(`time-picker-${s?"open":"close"}`),a("overlay-toggle",{open:s,overlay:K})},T=K=>{a("overlay-toggle",{open:!1,overlay:K}),a("focus-menu")};return t({clearHoverDate:ie,presetDate:q,selectCurrentDate:ae,toggleMonthPicker:o,toggleYearPicker:w,toggleTimePicker:z,handleArrow:f,updateMonthYear:A,getSidebarProps:()=>({modelValue:c,month:i,year:p,time:C,updateTime:E,updateMonthYear:A,selectDate:U,presetDate:q}),changeMonth:le,changeYear:fe,selectWeekDate:u}),(K,s)=>(P(),W(we,null,[ot(Sa,{"multi-calendars":d(ce).count,collapse:K.collapse},{default:_e(({instance:L,index:J})=>[K.disableMonthYearSelect?j("",!0):(P(),De(ds,Qe({key:0,ref:$=>{$&&(pe.value[J]=$)},months:d(hr)(K.formatLocale,K.locale,K.monthNameFormat),years:d(_n)(K.yearRange,K.locale,K.reverseYears),month:d(i)(L),year:d(p)(L),instance:L},K.$props,{onMount:s[0]||(s[0]=$=>R(d(Vt).header)),onResetFlow:s[1]||(s[1]=$=>K.$emit("reset-flow")),onUpdateMonthYear:$=>d(A)(L,$),onOverlayClosed:T,onOverlayOpened:s[2]||(s[2]=$=>K.$emit("overlay-toggle",{open:!0,overlay:$}))}),je({_:2},[Ye(d(H),($,ge)=>({name:$,fn:_e(x=>[ue(K.$slots,$,We(at(x)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),ot(ys,Qe({ref:$=>{$&&(g.value[J]=$)},"mapped-dates":b.value(L),month:d(i)(L),year:d(p)(L),instance:L},K.$props,{onSelectDate:$=>d(U)($,L!==1),onHandleSpace:$=>M($,L!==1),onSetHoverDate:s[3]||(s[3]=$=>d(F)($)),onHandleScroll:$=>d(S)($,L),onHandleSwipe:$=>d(I)($,L),onMount:s[4]||(s[4]=$=>R(d(Vt).calendar)),onResetFlow:s[5]||(s[5]=$=>K.$emit("reset-flow")),onTooltipOpen:s[6]||(s[6]=$=>K.$emit("tooltip-open",$)),onTooltipClose:s[7]||(s[7]=$=>K.$emit("tooltip-close",$))}),je({_:2},[Ye(d(y),($,ge)=>({name:$,fn:_e(x=>[ue(K.$slots,$,We(at({...x})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars","collapse"]),K.enableTimePicker?(P(),W("div",bs,[K.$slots["time-picker"]?ue(K.$slots,"time-picker",We(Qe({key:0},{time:d(C),updateTime:d(E)}))):(P(),De(Sr,Qe({key:1,ref_key:"timePickerRef",ref:D},K.$props,{hours:d(C).hours,minutes:d(C).minutes,seconds:d(C).seconds,"internal-model-value":K.internalModelValue,"disabled-times-config":d(m),"validate-time":d(h),onMount:s[8]||(s[8]=L=>R(d(Vt).timePicker)),"onUpdate:hours":s[9]||(s[9]=L=>d(E)(L)),"onUpdate:minutes":s[10]||(s[10]=L=>d(E)(L,!1)),"onUpdate:seconds":s[11]||(s[11]=L=>d(E)(L,!1,!0)),onResetFlow:s[12]||(s[12]=L=>K.$emit("reset-flow")),onOverlayClosed:s[13]||(s[13]=L=>Ve(L,!1)),onOverlayOpened:s[14]||(s[14]=L=>Ve(L,!0)),onAmPmChange:s[15]||(s[15]=L=>K.$emit("am-pm-change",L))}),je({_:2},[Ye(d(re),(L,J)=>({name:L,fn:_e($=>[ue(K.$slots,L,We(at($)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):j("",!0)],64))}}),_s=(e,t)=>{const n=Z(),{defaultedMultiCalendars:a,defaultedConfig:r,defaultedHighlight:l,defaultedRange:i,propDates:p,defaultedFilters:c,defaultedMultiDates:C}=Se(e),{modelValue:m,year:v,month:h,calendars:k}=ba(e,t),{isDisabled:Y}=Et(e),{selectYear:f,groupedYears:S,showYearPicker:I,isDisabled:U,toggleYearPicker:A,handleYearSelect:q,handleYear:ae}=Yr({modelValue:m,multiCalendars:a,range:i,highlight:l,calendars:k,propDates:p,month:h,year:v,filters:c,props:e,emit:t}),E=(D,y)=>[D,y].map(H=>kt(H,"MMMM",{locale:e.formatLocale})).join("-"),B=G(()=>D=>m.value?Array.isArray(m.value)?m.value.some(y=>Bn(D,y)):Bn(m.value,D):!1),ne=D=>{if(i.value.enabled){if(Array.isArray(m.value)){const y=Me(D,m.value[0])||Me(D,m.value[1]);return $a(m.value,n.value,D)&&!y}return!1}return!1},F=(D,y)=>D.quarter===$n(y)&&D.year===he(y),N=D=>typeof l.value=="function"?l.value({quarter:$n(D),year:he(D)}):!!l.value.quarters.find(y=>F(y,D)),ie=G(()=>D=>{const y=Ce(new Date,{year:v.value(D)});return el({start:ma(y),end:tr(y)}).map(H=>{const re=Ht(H),R=Yn(H),b=Y(H),oe=ne(re),V=N(re);return{text:E(re,R),value:re,active:B.value(re),highlighted:V,disabled:b,isBetween:oe}})}),ce=D=>{Dn(D,m,C.value.limit),t("auto-apply",!0)},pe=D=>{m.value=Tn(m,D,t),Ra(m.value,t,e.autoApply,e.modelAuto)},g=D=>{m.value=D,t("auto-apply")};return{defaultedConfig:r,defaultedMultiCalendars:a,groupedYears:S,year:v,isDisabled:U,quarters:ie,showYearPicker:I,modelValue:m,setHoverDate:D=>{n.value=D},selectYear:f,selectQuarter:(D,y,H)=>{if(!H)return k.value[y].month=xe(Yn(D)),C.value.enabled?ce(D):i.value.enabled?pe(D):g(D)},toggleYearPicker:A,handleYearSelect:q,handleYear:ae}},ks={class:"dp--quarter-items"},xs=["data-test","disabled","onClick","onMouseover"],Ms=ze({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...yt},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end","overlay-toggle","update-month-year"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=lt(l,"yearMode"),{defaultedMultiCalendars:p,defaultedConfig:c,groupedYears:C,year:m,isDisabled:v,quarters:h,modelValue:k,showYearPicker:Y,setHoverDate:f,selectQuarter:S,toggleYearPicker:I,handleYearSelect:U,handleYear:A}=_s(r,a);return t({getSidebarProps:()=>({modelValue:k,year:m,selectQuarter:S,handleYearSelect:U,handleYear:A})}),(q,ae)=>(P(),De(Sa,{"multi-calendars":d(p).count,collapse:q.collapse,stretch:""},{default:_e(({instance:E})=>[ye("div",{class:"dp-quarter-picker-wrap",style:dt({minHeight:`${d(c).modeHeight}px`})},[q.$slots["top-extra"]?ue(q.$slots,"top-extra",{key:0,value:q.internalModelValue}):j("",!0),ye("div",null,[ot(Cr,Qe(q.$props,{items:d(C)(E),instance:E,"show-year-picker":d(Y)[E],year:d(m)(E),"is-disabled":B=>d(v)(E,B),onHandleYear:B=>d(A)(E,B),onYearSelect:B=>d(U)(B,E),onToggleYearPicker:B=>d(I)(E,B?.flow,B?.show)}),je({_:2},[Ye(d(i),(B,ne)=>({name:B,fn:_e(F=>[ue(q.$slots,B,We(at(F)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),ye("div",ks,[(P(!0),W(we,null,Ye(d(h)(E),(B,ne)=>(P(),W("div",{key:ne},[ye("button",{type:"button",class:ke(["dp--qr-btn",{"dp--qr-btn-active":B.active,"dp--qr-btn-between":B.isBetween,"dp--qr-btn-disabled":B.disabled,"dp--highlighted":B.highlighted}]),"data-test":B.value,disabled:B.disabled,onClick:F=>d(S)(B.value,E,B.disabled),onMouseover:F=>d(f)(B.value)},[q.$slots.quarter?ue(q.$slots,"quarter",{key:0,value:B.value,text:B.text}):(P(),W(we,{key:1},[Dt(Ge(B.text),1)],64))],42,xs)]))),128))])],4)]),_:3},8,["multi-calendars","collapse"]))}}),Ds=["id","tabindex","role","aria-label"],Ts={key:0,class:"dp--menu-load-container"},Ps={key:1,class:"dp--menu-header"},As={key:0,class:"dp__sidebar_left"},Cs=["data-test","onClick","onKeydown"],Os={key:2,class:"dp__sidebar_right"},$s={key:3,class:"dp__action_extra"},Un=ze({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{...Ya,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=Z(null),i=G(()=>{const{openOnTop:x,...X}=r;return{...X,flowStep:F.value,collapse:r.collapse,noOverlayFocus:r.noOverlayFocus,menuWrapRef:l.value}}),{setMenuFocused:p,setShiftKey:c,control:C}=Ar(),m=qt(),{defaultedTextInput:v,defaultedInline:h,defaultedConfig:k,defaultedUI:Y}=Se(r),f=Z(null),S=Z(0),I=Z(null),U=Z(!1),A=Z(null);Ke(()=>{if(!r.shadow){U.value=!0,q(),window.addEventListener("resize",q);const x=Fe(l);if(x&&!v.value.enabled&&!h.value.enabled&&(p(!0),y()),x){const X=de=>{k.value.allowPreventDefault&&de.preventDefault(),Yt(de,k.value,!0)};x.addEventListener("pointerdown",X),x.addEventListener("mousedown",X)}}}),Ca(()=>{window.removeEventListener("resize",q)});const q=()=>{const x=Fe(I);x&&(S.value=x.getBoundingClientRect().width)},{arrowRight:ae,arrowLeft:E,arrowDown:B,arrowUp:ne}=It(),{flowStep:F,updateFlowStep:N,childMount:ie,resetFlow:ce,handleFlow:pe}=Es(r,a,A),g=G(()=>r.monthPicker?qi:r.yearPicker?Qi:r.timePicker?rs:r.quarterPicker?Ms:ws),D=G(()=>{var x;if(k.value.arrowLeft)return k.value.arrowLeft;const X=(x=l.value)==null?void 0:x.getBoundingClientRect(),de=r.getInputRect();return de?.width=(X?.right??0)&&de?.width{const x=Fe(l);x&&x.focus({preventScroll:!0})},H=G(()=>{var x;return((x=A.value)==null?void 0:x.getSidebarProps())||{}}),re=()=>{r.openOnTop&&a("recalculate-position")},R=lt(m,"action"),b=G(()=>r.monthPicker||r.yearPicker?lt(m,"monthYear"):r.timePicker?lt(m,"timePicker"):lt(m,"shared")),oe=G(()=>r.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),V=G(()=>({dp__menu_disabled:r.disabled,dp__menu_readonly:r.readonly,"dp-menu-loading":r.loading})),M=G(()=>({dp__menu:!0,dp__menu_index:!h.value.enabled,dp__relative:h.value.enabled,...Y.value.menu??{}})),o=x=>{Yt(x,k.value,!0)},w=()=>{r.escClose&&a("close-picker")},z=x=>{if(r.arrowNavigation){if(x===Ze.up)return ne();if(x===Ze.down)return B();if(x===Ze.left)return E();if(x===Ze.right)return ae()}else x===Ze.left||x===Ze.up?T("handleArrow",Ze.left,0,x===Ze.up):T("handleArrow",Ze.right,0,x===Ze.down)},u=x=>{c(x.shiftKey),!r.disableMonthYearSelect&&x.code===$e.tab&&x.target.classList.contains("dp__menu")&&C.value.shiftKeyInMenu&&(x.preventDefault(),Yt(x,k.value,!0),a("close-picker"))},le=()=>{y(),a("time-picker-close")},fe=x=>{var X,de,be;(X=A.value)==null||X.toggleTimePicker(!1,!1),(de=A.value)==null||de.toggleMonthPicker(!1,!1,x),(be=A.value)==null||be.toggleYearPicker(!1,!1,x)},Ve=(x,X=0)=>{var de,be,st;return x==="month"?(de=A.value)==null?void 0:de.toggleMonthPicker(!1,!0,X):x==="year"?(be=A.value)==null?void 0:be.toggleYearPicker(!1,!0,X):x==="time"?(st=A.value)==null?void 0:st.toggleTimePicker(!0,!1):fe(X)},T=(x,...X)=>{var de,be;(de=A.value)!=null&&de[x]&&((be=A.value)==null||be[x](...X))},K=()=>{T("selectCurrentDate")},s=(x,X)=>{T("presetDate",x,X)},L=()=>{T("clearHoverDate")},J=(x,X)=>{T("updateMonthYear",x,X)},$=(x,X)=>{x.preventDefault(),z(X)},ge=x=>{var X,de,be;if(u(x),x.key===$e.home||x.key===$e.end)return T("selectWeekDate",x.key===$e.home,x.target.getAttribute("id"));switch((x.key===$e.pageUp||x.key===$e.pageDown)&&(x.shiftKey?(T("changeYear",x.key===$e.pageUp),(X=on(l.value,"overlay-year"))==null||X.focus()):(T("changeMonth",x.key===$e.pageUp),(de=on(l.value,x.key===$e.pageUp?"action-prev":"action-next"))==null||de.focus()),x.target.getAttribute("id")&&((be=l.value)==null||be.focus({preventScroll:!0}))),x.key){case $e.esc:return w();case $e.arrowLeft:return $(x,Ze.left);case $e.arrowRight:return $(x,Ze.right);case $e.arrowUp:return $(x,Ze.up);case $e.arrowDown:return $(x,Ze.down);default:return}};return t({updateMonthYear:J,switchView:Ve,handleFlow:pe}),(x,X)=>{var de,be,st;return P(),W("div",{id:x.uid?`dp-menu-${x.uid}`:void 0,ref_key:"dpMenuRef",ref:l,tabindex:d(h).enabled?void 0:"0",role:d(h).enabled?void 0:"dialog","aria-label":(de=x.ariaLabels)==null?void 0:de.menu,class:ke(M.value),style:dt({"--dp-arrow-left":D.value}),onMouseleave:L,onClick:o,onKeydown:ge},[(x.disabled||x.readonly)&&d(h).enabled||x.loading?(P(),W("div",{key:0,class:ke(V.value)},[x.loading?(P(),W("div",Ts,X[19]||(X[19]=[ye("span",{class:"dp--menu-loader"},null,-1)]))):j("",!0)],2)):j("",!0),x.$slots["menu-header"]?(P(),W("div",Ps,[ue(x.$slots,"menu-header")])):j("",!0),!d(h).enabled&&!x.teleportCenter?(P(),W("div",{key:2,class:ke(oe.value)},null,2)):j("",!0),ye("div",{ref_key:"innerMenuRef",ref:I,class:ke({dp__menu_content_wrapper:((be=x.presetDates)==null?void 0:be.length)||!!x.$slots["left-sidebar"]||!!x.$slots["right-sidebar"],"dp--menu-content-wrapper-collapsed":e.collapse&&(((st=x.presetDates)==null?void 0:st.length)||!!x.$slots["left-sidebar"]||!!x.$slots["right-sidebar"])}),style:dt({"--dp-menu-width":`${S.value}px`})},[x.$slots["left-sidebar"]?(P(),W("div",As,[ue(x.$slots,"left-sidebar",We(at(H.value)))])):j("",!0),x.presetDates.length?(P(),W("div",{key:1,class:ke({"dp--preset-dates-collapsed":e.collapse,"dp--preset-dates":!0})},[(P(!0),W(we,null,Ye(x.presetDates,(me,Pt)=>(P(),W(we,{key:Pt},[me.slot?ue(x.$slots,me.slot,{key:0,presetDate:s,label:me.label,value:me.value}):(P(),W("button",{key:1,type:"button",style:dt(me.style||{}),class:ke(["dp__btn dp--preset-range",{"dp--preset-range-collapsed":e.collapse}]),"data-test":me.testId??void 0,onClick:va(gt=>s(me.value,me.noTz),["prevent"]),onKeydown:gt=>d(et)(gt,()=>s(me.value,me.noTz),!0)},Ge(me.label),47,Cs))],64))),128))],2)):j("",!0),ye("div",{ref_key:"calendarWrapperRef",ref:f,class:"dp__instance_calendar",role:"document"},[(P(),De(Oa(g.value),Qe({ref_key:"dynCmpRef",ref:A},i.value,{"flow-step":d(F),onMount:d(ie),onUpdateFlowStep:d(N),onResetFlow:d(ce),onFocusMenu:y,onSelectDate:X[0]||(X[0]=me=>x.$emit("select-date")),onDateUpdate:X[1]||(X[1]=me=>x.$emit("date-update",me)),onTooltipOpen:X[2]||(X[2]=me=>x.$emit("tooltip-open",me)),onTooltipClose:X[3]||(X[3]=me=>x.$emit("tooltip-close",me)),onAutoApply:X[4]||(X[4]=me=>x.$emit("auto-apply",me)),onRangeStart:X[5]||(X[5]=me=>x.$emit("range-start",me)),onRangeEnd:X[6]||(X[6]=me=>x.$emit("range-end",me)),onInvalidFixedRange:X[7]||(X[7]=me=>x.$emit("invalid-fixed-range",me)),onTimeUpdate:X[8]||(X[8]=me=>x.$emit("time-update")),onAmPmChange:X[9]||(X[9]=me=>x.$emit("am-pm-change",me)),onTimePickerOpen:X[10]||(X[10]=me=>x.$emit("time-picker-open",me)),onTimePickerClose:le,onRecalculatePosition:re,onUpdateMonthYear:X[11]||(X[11]=me=>x.$emit("update-month-year",me)),onAutoApplyInvalid:X[12]||(X[12]=me=>x.$emit("auto-apply-invalid",me)),onInvalidDate:X[13]||(X[13]=me=>x.$emit("invalid-date",me)),onOverlayToggle:X[14]||(X[14]=me=>x.$emit("overlay-toggle",me)),"onUpdate:internalModelValue":X[15]||(X[15]=me=>x.$emit("update:internal-model-value",me))}),je({_:2},[Ye(b.value,(me,Pt)=>({name:me,fn:_e(gt=>[ue(x.$slots,me,We(at({...gt})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),x.$slots["right-sidebar"]?(P(),W("div",Os,[ue(x.$slots,"right-sidebar",We(at(H.value)))])):j("",!0),x.$slots["action-extra"]?(P(),W("div",$s,[x.$slots["action-extra"]?ue(x.$slots,"action-extra",{key:0,selectCurrentDate:K}):j("",!0)])):j("",!0)],6),!x.autoApply||d(k).keepActionRow?(P(),De(Ii,Qe({key:3,"menu-mount":U.value},i.value,{"calendar-width":S.value,onClosePicker:X[16]||(X[16]=me=>x.$emit("close-picker")),onSelectDate:X[17]||(X[17]=me=>x.$emit("select-date")),onInvalidSelect:X[18]||(X[18]=me=>x.$emit("invalid-select")),onSelectNow:K}),je({_:2},[Ye(d(R),(me,Pt)=>({name:me,fn:_e(gt=>[ue(x.$slots,me,We(at({...gt})))])}))]),1040,["menu-mount","calendar-width"])):j("",!0)],46,Ds)}}});var Ut=(e=>(e.center="center",e.left="left",e.right="right",e))(Ut||{});const Ys=({menuRef:e,menuRefInner:t,inputRef:n,pickerWrapperRef:a,inline:r,emit:l,props:i,slots:p})=>{const{defaultedConfig:c}=Se(i),C=Z({}),m=Z(!1),v=Z({top:"0",left:"0"}),h=Z(!1),k=ca(i,"teleportCenter");ct(k,()=>{v.value=JSON.parse(JSON.stringify({})),ae()});const Y=y=>{if(i.teleport){const H=y.getBoundingClientRect();return{left:H.left+window.scrollX,top:H.top+window.scrollY}}return{top:0,left:0}},f=(y,H)=>{v.value.left=`${y+H-C.value.width}px`},S=y=>{v.value.left=`${y}px`},I=(y,H)=>{i.position===Ut.left&&S(y),i.position===Ut.right&&f(y,H),i.position===Ut.center&&(v.value.left=`${y+H/2-C.value.width/2}px`)},U=y=>{const{width:H,height:re}=y.getBoundingClientRect(),{top:R,left:b}=i.altPosition?i.altPosition(y):Y(y);return{top:+R,left:+b,width:H,height:re}},A=()=>{v.value.left="50%",v.value.top="50%",v.value.transform="translate(-50%, -50%)",v.value.position="fixed",delete v.value.opacity},q=()=>{const y=Fe(n),{top:H,left:re,transform:R}=i.altPosition(y);v.value={top:`${H}px`,left:`${re}px`,transform:R??""}},ae=(y=!0)=>{var H;if(!r.value.enabled){if(k.value)return A();if(i.altPosition!==null)return q();if(y){const re=i.teleport?(H=t.value)==null?void 0:H.$el:e.value;re&&(C.value=re.getBoundingClientRect()),l("recalculate-position")}return ce()}},E=({inputEl:y,left:H,width:re})=>{window.screen.width>768&&!m.value&&I(H,re),F(y)},B=y=>{const{top:H,left:re,height:R,width:b}=U(y);v.value.top=`${R+H+ +i.offset}px`,h.value=!1,m.value||(v.value.left=`${re+b/2-C.value.width/2}px`),E({inputEl:y,left:re,width:b})},ne=y=>{const{top:H,left:re,width:R}=U(y);v.value.top=`${H-+i.offset-C.value.height}px`,h.value=!0,E({inputEl:y,left:re,width:R})},F=y=>{if(i.autoPosition){const{left:H,width:re}=U(y),{left:R,right:b}=C.value;if(!m.value){if(Math.abs(R)!==Math.abs(b)){if(R<=0)return m.value=!0,S(H);if(b>=document.documentElement.clientWidth)return m.value=!0,f(H,re)}return I(H,re)}}},N=()=>{const y=Fe(n);if(y){const{height:H}=C.value,{top:re,height:R}=y.getBoundingClientRect(),b=window.innerHeight-re-R,oe=re;return H<=b?Lt.bottom:H>b&&H<=oe?Lt.top:b>=oe?Lt.bottom:Lt.top}return Lt.bottom},ie=y=>N()===Lt.bottom?B(y):ne(y),ce=()=>{const y=Fe(n);if(y)return i.autoPosition?ie(y):B(y)},pe=function(y){if(y){const H=y.scrollHeight>y.clientHeight,re=window.getComputedStyle(y).overflowY.indexOf("hidden")!==-1;return H&&!re}return!0},g=function(y){return!y||y===document.body||y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:pe(y)?y:g(y.assignedSlot&&c.value.shadowDom?y.assignedSlot.parentNode:y.parentNode)},D=y=>{if(y)switch(i.position){case Ut.left:return{left:0,transform:"translateX(0)"};case Ut.right:return{left:`${y.width}px`,transform:"translateX(-100%)"};default:return{left:`${y.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:h,menuStyle:v,xCorrect:m,setMenuPosition:ae,getScrollableParent:g,shadowRender:(y,H)=>{var re,R,b;const oe=document.createElement("div"),V=(re=Fe(n))==null?void 0:re.getBoundingClientRect();oe.setAttribute("id","dp--temp-container");const M=(R=a.value)!=null&&R.clientWidth?a.value:document.body;M.append(oe);const o=D(V),w=c.value.shadowDom?Object.keys(p).filter(u=>["right-sidebar","left-sidebar","top-extra","action-extra"].includes(u)):Object.keys(p),z=Nr(y,{...H,shadow:!0,style:{opacity:0,position:"absolute",...o}},Object.fromEntries(w.map(u=>[u,p[u]])));An(z,oe),C.value=(b=z.el)==null?void 0:b.getBoundingClientRect(),An(null,oe),M.removeChild(oe)}}},Ot=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"hours-overlay-header",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-header",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-header",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]},{name:"top-extra",use:["shared","month-year"]},{name:"tp-inline-arrow-up",use:["shared","time"]},{name:"tp-inline-arrow-down",use:["shared","time"]},{name:"menu-header",use:["menu"]}],Ss=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],Rs={all:()=>Ot,monthYear:()=>Ot.filter(e=>e.use.includes("month-year")),input:()=>Ss,timePicker:()=>Ot.filter(e=>e.use.includes("time")),action:()=>Ot.filter(e=>e.use.includes("action")),calendar:()=>Ot.filter(e=>e.use.includes("calendar")),menu:()=>Ot.filter(e=>e.use.includes("menu")),shared:()=>Ot.filter(e=>e.use.includes("shared")),yearMode:()=>Ot.filter(e=>e.use.includes("year-mode"))},lt=(e,t,n)=>{const a=[];return Rs[t]().forEach(r=>{e[r.name]&&a.push(r.name)}),n!=null&&n.length&&n.forEach(r=>{r.slot&&a.push(r.slot)}),a},ga=e=>{const t=G(()=>a=>e.value?a?e.value.open:e.value.close:""),n=G(()=>a=>e.value?a?e.value.menuAppearTop:e.value.menuAppearBottom:"");return{transitionName:t,showTransition:!!e.value,menuTransition:n}},ba=(e,t,n)=>{const{defaultedRange:a,defaultedTz:r}=Se(e),l=Q(nt(Q(),r.value.timezone)),i=Z([{month:xe(l),year:he(l)}]),p=h=>{const k={hours:Tt(l),minutes:Rt(l),seconds:0};return a.value.enabled?[k[h],k[h]]:k[h]},c=ha({hours:p("hours"),minutes:p("minutes"),seconds:p("seconds")});ct(a,(h,k)=>{h.enabled!==k.enabled&&(c.hours=p("hours"),c.minutes=p("minutes"),c.seconds=p("seconds"))},{deep:!0});const C=G({get:()=>e.internalModelValue,set:h=>{!e.readonly&&!e.disabled&&t("update:internal-model-value",h)}}),m=G(()=>h=>i.value[h]?i.value[h].month:0),v=G(()=>h=>i.value[h]?i.value[h].year:0);return ct(C,(h,k)=>{n&&JSON.stringify(h??{})!==JSON.stringify(k??{})&&n()},{deep:!0}),{calendars:i,time:c,modelValue:C,month:m,year:v,today:l}},Is=(e,t)=>{const{defaultedMultiCalendars:n,defaultedMultiDates:a,defaultedUI:r,defaultedHighlight:l,defaultedTz:i,propDates:p,defaultedRange:c}=Se(t),{isDisabled:C}=Et(t),m=Z(null),v=Z(nt(new Date,i.value.timezone)),h=o=>{!o.current&&t.hideOffsetDates||(m.value=o.value)},k=()=>{m.value=null},Y=o=>Array.isArray(e.value)&&c.value.enabled&&e.value[0]&&m.value?o?Ne(m.value,e.value[0]):Ie(m.value,e.value[0]):!0,f=(o,w)=>{const z=()=>e.value?w?e.value[0]||null:e.value[1]:null,u=e.value&&Array.isArray(e.value)?z():null;return Me(Q(o.value),u)},S=o=>{const w=Array.isArray(e.value)?e.value[0]:null;return o?!Ie(m.value??null,w):!0},I=(o,w=!0)=>(c.value.enabled||t.weekPicker)&&Array.isArray(e.value)&&e.value.length===2?t.hideOffsetDates&&!o.current?!1:Me(Q(o.value),e.value[w?0:1]):c.value.enabled?f(o,w)&&S(w)||Me(o.value,Array.isArray(e.value)?e.value[0]:null)&&Y(w):!1,U=(o,w)=>{if(Array.isArray(e.value)&&e.value[0]&&e.value.length===1){const z=Me(o.value,m.value);return w?Ne(e.value[0],o.value)&&z:Ie(e.value[0],o.value)&&z}return!1},A=o=>!e.value||t.hideOffsetDates&&!o.current?!1:c.value.enabled?t.modelAuto&&Array.isArray(e.value)?Me(o.value,e.value[0]?e.value[0]:v.value):!1:a.value.enabled&&Array.isArray(e.value)?e.value.some(w=>Me(w,o.value)):Me(o.value,e.value?e.value:v.value),q=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){if(t.hideOffsetDates&&!o.current)return!1;const w=mt(m.value,+c.value.autoRange),z=xt(Q(m.value),t.weekStart);return t.weekPicker?Me(z[1],Q(o.value)):Me(w,Q(o.value))}return!1}return!1},ae=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){const w=mt(m.value,+c.value.autoRange);if(t.hideOffsetDates&&!o.current)return!1;const z=xt(Q(m.value),t.weekStart);return t.weekPicker?Ne(o.value,z[0])&&Ie(o.value,z[1]):Ne(o.value,m.value)&&Ie(o.value,w)}return!1}return!1},E=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){if(t.hideOffsetDates&&!o.current)return!1;const w=xt(Q(m.value),t.weekStart);return t.weekPicker?Me(w[0],o.value):Me(m.value,o.value)}return!1}return!1},B=o=>$a(e.value,m.value,o.value),ne=()=>t.modelAuto&&Array.isArray(t.internalModelValue)?!!t.internalModelValue[0]:!1,F=()=>t.modelAuto?yr(t.internalModelValue):!0,N=o=>{if(t.weekPicker)return!1;const w=c.value.enabled?!I(o)&&!I(o,!1):!0;return!C(o.value)&&!A(o)&&!(!o.current&&t.hideOffsetDates)&&w},ie=o=>c.value.enabled?t.modelAuto?ne()&&A(o):!1:A(o),ce=o=>l.value?oi(o.value,p.value.highlight):!1,pe=o=>{const w=C(o.value);return w&&(typeof l.value=="function"?!l.value(o.value,w):!l.value.options.highlightDisabled)},g=o=>{var w;return typeof l.value=="function"?l.value(o.value):(w=l.value.weekdays)==null?void 0:w.includes(o.value.getDay())},D=o=>(c.value.enabled||t.weekPicker)&&(!(n.value.count>0)||o.current)&&F()&&!(!o.current&&t.hideOffsetDates)&&!A(o)?B(o):!1,y=o=>{const{isRangeStart:w,isRangeEnd:z}=b(o),u=c.value.enabled?w||z:!1;return{dp__cell_offset:!o.current,dp__pointer:!t.disabled&&!(!o.current&&t.hideOffsetDates)&&!C(o.value),dp__cell_disabled:C(o.value),dp__cell_highlight:!pe(o)&&(ce(o)||g(o))&&!ie(o)&&!u&&!E(o)&&!(D(o)&&t.weekPicker)&&!z,dp__cell_highlight_active:!pe(o)&&(ce(o)||g(o))&&ie(o),dp__today:!t.noToday&&Me(o.value,v.value)&&o.current,"dp--past":Ie(o.value,v.value),"dp--future":Ne(o.value,v.value)}},H=o=>({dp__active_date:ie(o),dp__date_hover:N(o)}),re=o=>{if(e.value&&!Array.isArray(e.value)){const w=xt(e.value,t.weekStart);return{...V(o),dp__range_start:Me(w[0],o.value),dp__range_end:Me(w[1],o.value),dp__range_between_week:Ne(o.value,w[0])&&Ie(o.value,w[1])}}return{...V(o)}},R=o=>{if(e.value&&Array.isArray(e.value)){const w=xt(e.value[0],t.weekStart),z=e.value[1]?xt(e.value[1],t.weekStart):[];return{...V(o),dp__range_start:Me(w[0],o.value)||Me(z[0],o.value),dp__range_end:Me(w[1],o.value)||Me(z[1],o.value),dp__range_between_week:Ne(o.value,w[0])&&Ie(o.value,w[1])||Ne(o.value,z[0])&&Ie(o.value,z[1]),dp__range_between:Ne(o.value,w[1])&&Ie(o.value,z[0])}}return{...V(o)}},b=o=>{const w=n.value.count>0?o.current&&I(o)&&F():I(o)&&F(),z=n.value.count>0?o.current&&I(o,!1)&&F():I(o,!1)&&F();return{isRangeStart:w,isRangeEnd:z}},oe=o=>{const{isRangeStart:w,isRangeEnd:z}=b(o);return{dp__range_start:w,dp__range_end:z,dp__range_between:D(o),dp__date_hover:Me(o.value,m.value)&&!w&&!z&&!t.weekPicker,dp__date_hover_start:U(o,!0),dp__date_hover_end:U(o,!1)}},V=o=>({...oe(o),dp__cell_auto_range:ae(o),dp__cell_auto_range_start:E(o),dp__cell_auto_range_end:q(o)}),M=o=>c.value.enabled?c.value.autoRange?V(o):t.modelAuto?{...H(o),...oe(o)}:t.weekPicker?R(o):oe(o):t.weekPicker?re(o):H(o);return{setHoverDate:h,clearHoverDate:k,getDayClassData:o=>t.hideOffsetDates&&!o.current?{}:{...y(o),...M(o),[t.dayClass?t.dayClass(o.value,t.internalModelValue):""]:!0,...r.value.calendarCell??{}}}},Et=e=>{const{defaultedFilters:t,defaultedRange:n,propDates:a,defaultedMultiDates:r}=Se(e),l=g=>a.value.disabledDates?typeof a.value.disabledDates=="function"?a.value.disabledDates(Q(g)):!!Aa(g,a.value.disabledDates):!1,i=g=>a.value.maxDate?e.yearPicker?he(g)>he(a.value.maxDate):Ne(g,a.value.maxDate):!1,p=g=>a.value.minDate?e.yearPicker?he(g){const D=i(g),y=p(g),H=l(g),re=t.value.months.map(M=>+M).includes(xe(g)),R=e.disabledWeekDays.length?e.disabledWeekDays.some(M=>+M===Ul(g)):!1,b=k(g),oe=he(g),V=oe<+e.yearRange[0]||oe>+e.yearRange[1];return!(D||y||H||re||V||R||b)},C=(g,D)=>Ie(...$t(a.value.minDate,g,D))||Me(...$t(a.value.minDate,g,D)),m=(g,D)=>Ne(...$t(a.value.maxDate,g,D))||Me(...$t(a.value.maxDate,g,D)),v=(g,D,y)=>{let H=!1;return a.value.maxDate&&y&&m(g,D)&&(H=!0),a.value.minDate&&!y&&C(g,D)&&(H=!0),H},h=(g,D,y,H)=>{let re=!1;return H&&(a.value.minDate||a.value.maxDate)?a.value.minDate&&a.value.maxDate?re=v(g,D,y):(a.value.minDate&&C(g,D)||a.value.maxDate&&m(g,D))&&(re=!0):re=!0,re},k=g=>Array.isArray(a.value.allowedDates)&&!a.value.allowedDates.length?!0:a.value.allowedDates?!Aa(g,a.value.allowedDates):!1,Y=g=>!c(g),f=g=>n.value.noDisabledRange?!er({start:g[0],end:g[1]}).some(D=>Y(D)):!0,S=g=>{if(g){const D=he(g);return D>=+e.yearRange[0]&&D<=e.yearRange[1]}return!0},I=(g,D)=>!!(Array.isArray(g)&&g[D]&&(n.value.maxRange||n.value.minRange)&&S(g[D])),U=(g,D,y=0)=>{if(I(D,y)&&S(g)){const H=Jn(g,D[y]),re=kr(D[y],g),R=re.length===1?0:re.filter(oe=>Y(oe)).length,b=Math.abs(H)-(n.value.minMaxRawRange?0:R);if(n.value.minRange&&n.value.maxRange)return b>=+n.value.minRange&&b<=+n.value.maxRange;if(n.value.minRange)return b>=+n.value.minRange;if(n.value.maxRange)return b<=+n.value.maxRange}return!0},A=()=>!e.enableTimePicker||e.monthPicker||e.yearPicker||e.ignoreTimeValidation,q=g=>Array.isArray(g)?[g[0]?Ga(g[0]):null,g[1]?Ga(g[1]):null]:Ga(g),ae=(g,D,y)=>g.find(H=>+H.hours===Tt(D)&&H.minutes==="*"?!0:+H.minutes===Rt(D)&&+H.hours===Tt(D))&&y,E=(g,D,y)=>{const[H,re]=g,[R,b]=D;return!ae(H,R,y)&&!ae(re,b,y)&&y},B=(g,D)=>{const y=Array.isArray(D)?D:[D];return Array.isArray(e.disabledTimes)?Array.isArray(e.disabledTimes[0])?E(e.disabledTimes,y,g):!y.some(H=>ae(e.disabledTimes,H,g)):g},ne=(g,D)=>{const y=Array.isArray(D)?[Ft(D[0]),D[1]?Ft(D[1]):void 0]:Ft(D),H=!e.disabledTimes(y);return g&&H},F=(g,D)=>e.disabledTimes?Array.isArray(e.disabledTimes)?B(D,g):ne(D,g):D,N=g=>{let D=!0;if(!g||A())return!0;const y=!a.value.minDate&&!a.value.maxDate?q(g):g;return(e.maxTime||a.value.maxDate)&&(D=qn(e.maxTime,a.value.maxDate,"max",qe(y),D)),(e.minTime||a.value.minDate)&&(D=qn(e.minTime,a.value.minDate,"min",qe(y),D)),F(g,D)},ie=g=>{if(!e.monthPicker)return!0;let D=!0;const y=Q(pt(g));if(a.value.minDate&&a.value.maxDate){const H=Q(pt(a.value.minDate)),re=Q(pt(a.value.maxDate));return Ne(y,H)&&Ie(y,re)||Me(y,H)||Me(y,re)}if(a.value.minDate){const H=Q(pt(a.value.minDate));D=Ne(y,H)||Me(y,H)}if(a.value.maxDate){const H=Q(pt(a.value.maxDate));D=Ie(y,H)||Me(y,H)}return D},ce=G(()=>g=>!e.enableTimePicker||e.ignoreTimeValidation?!0:N(g)),pe=G(()=>g=>e.monthPicker?Array.isArray(g)&&(n.value.enabled||r.value.enabled)?!g.filter(D=>!ie(D)).length:ie(g):!0);return{isDisabled:Y,validateDate:c,validateMonthYearInRange:h,isDateRangeAllowed:f,checkMinMaxRange:U,isValidTime:N,isTimeValid:ce,isMonthValid:pe}},Ia=()=>{const e=G(()=>(a,r)=>a?.includes(r)),t=G(()=>(a,r)=>a.count?a.solo?!0:r===0:!0),n=G(()=>(a,r)=>a.count?a.solo?!0:r===a.count-1:!0);return{hideNavigationButtons:e,showLeftIcon:t,showRightIcon:n}},Es=(e,t,n)=>{const a=Z(0),r=ha({[Vt.timePicker]:!e.enableTimePicker||e.timePicker||e.monthPicker,[Vt.calendar]:!1,[Vt.header]:!1}),l=G(()=>e.monthPicker||e.timePicker),i=v=>{var h;if((h=e.flow)!=null&&h.length){if(!v&&l.value)return m();r[v]=!0,Object.keys(r).filter(k=>!r[k]).length||m()}},p=()=>{var v,h;(v=e.flow)!=null&&v.length&&a.value!==-1&&(a.value+=1,t("flow-step",a.value),m()),((h=e.flow)==null?void 0:h.length)===a.value&&it().then(()=>c())},c=()=>{a.value=-1},C=(v,h,...k)=>{var Y,f;e.flow[a.value]===v&&n.value&&((f=(Y=n.value)[h])==null||f.call(Y,...k))},m=(v=0)=>{v&&(a.value+=v),C(Xe.month,"toggleMonthPicker",!0),C(Xe.year,"toggleYearPicker",!0),C(Xe.calendar,"toggleTimePicker",!1,!0),C(Xe.time,"toggleTimePicker",!0,!0);const h=e.flow[a.value];(h===Xe.hours||h===Xe.minutes||h===Xe.seconds)&&C(h,"toggleTimePicker",!0,!0,h)};return{childMount:i,updateFlowStep:p,resetFlow:c,handleFlow:m,flowStep:a}},Bs={key:1,class:"dp__input_wrap"},Ns=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-label","aria-disabled","aria-invalid"],Ls={key:2,class:"dp--clear-btn"},Hs=["aria-label"],Vs=ze({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},...Ya},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur","text-input"],setup(e,{expose:t,emit:n}){const a=n,r=e,{defaultedTextInput:l,defaultedAriaLabels:i,defaultedInline:p,defaultedConfig:c,defaultedRange:C,defaultedMultiDates:m,defaultedUI:v,getDefaultPattern:h,getDefaultStartTime:k}=Se(r),{checkMinMaxRange:Y}=Et(r),f=Z(),S=Z(null),I=Z(!1),U=Z(!1),A=G(()=>({dp__pointer:!r.disabled&&!r.readonly&&!l.value.enabled,dp__disabled:r.disabled,dp__input_readonly:!l.value.enabled,dp__input:!0,dp__input_icon_pad:!r.hideInputIcon,dp__input_valid:typeof r.state=="boolean"?r.state:!1,dp__input_invalid:typeof r.state=="boolean"?!r.state:!1,dp__input_focus:I.value||r.isMenuOpen,dp__input_reg:!l.value.enabled,...v.value.input??{}})),q=()=>{a("set-input-date",null),r.clearable&&r.autoApply&&(a("set-empty-date"),f.value=null)},ae=b=>{const oe=k();return ii(b,l.value.format??h(),oe??xr({},r.enableSeconds),r.inputValue,U.value,r.formatLocale)},E=b=>{const{rangeSeparator:oe}=l.value,[V,M]=b.split(`${oe}`);if(V){const o=ae(V.trim()),w=M?ae(M.trim()):null;if(Kt(o,w))return;const z=o&&w?[o,w]:[o];Y(w,z,0)&&(f.value=o?z:null)}},B=()=>{U.value=!0},ne=b=>{if(C.value.enabled)E(b);else if(m.value.enabled){const oe=b.split(";");f.value=oe.map(V=>ae(V.trim())).filter(V=>V)}else f.value=ae(b)},F=b=>{var oe;const V=typeof b=="string"?b:(oe=b.target)==null?void 0:oe.value;V!==""?(l.value.openMenu&&!r.isMenuOpen&&a("open"),ne(V),a("set-input-date",f.value)):q(),U.value=!1,a("update:input-value",V),a("text-input",b,f.value)},N=b=>{l.value.enabled?(ne(b.target.value),l.value.enterSubmit&&sn(f.value)&&r.inputValue!==""?(a("set-input-date",f.value,!0),f.value=null):l.value.enterSubmit&&r.inputValue===""&&(f.value=null,a("clear"))):pe(b)},ie=(b,oe)=>{l.value.enabled&&l.value.tabSubmit&&!oe&&ne(b.target.value),l.value.tabSubmit&&sn(f.value)&&r.inputValue!==""?(a("set-input-date",f.value,!0,!0),f.value=null):l.value.tabSubmit&&r.inputValue===""&&(f.value=null,a("clear",!0))},ce=()=>{I.value=!0,a("focus"),it().then(()=>{var b;l.value.enabled&&l.value.selectOnFocus&&((b=S.value)==null||b.select())})},pe=b=>{if(Yt(b,c.value,!0),l.value.enabled&&l.value.openMenu&&!p.value.input){if(l.value.openMenu==="open"&&!r.isMenuOpen)return a("open");if(l.value.openMenu==="toggle")return a("toggle")}else l.value.enabled||a("toggle")},g=()=>{a("real-blur"),I.value=!1,(!r.isMenuOpen||p.value.enabled&&p.value.input)&&a("blur"),r.autoApply&&l.value.enabled&&f.value&&!r.isMenuOpen&&(a("set-input-date",f.value),a("select-date"),f.value=null)},D=b=>{Yt(b,c.value,!0),a("clear")},y=b=>{if(b.key==="Tab"&&ie(b),b.key==="Enter"&&N(b),!l.value.enabled){if(b.code==="Tab")return;b.preventDefault()}},H=()=>{var b;(b=S.value)==null||b.focus({preventScroll:!0})},re=b=>{f.value=b},R=b=>{b.key===$e.tab&&ie(b,!0)};return t({focusInput:H,setParsedDate:re}),(b,oe)=>{var V,M,o;return P(),W("div",{onClick:pe},[b.$slots.trigger&&!b.$slots["dp-input"]&&!d(p).enabled?ue(b.$slots,"trigger",{key:0}):j("",!0),!b.$slots.trigger&&(!d(p).enabled||d(p).input)?(P(),W("div",Bs,[b.$slots["dp-input"]&&!b.$slots.trigger&&(!d(p).enabled||d(p).enabled&&d(p).input)?ue(b.$slots,"dp-input",{key:0,value:e.inputValue,isMenuOpen:e.isMenuOpen,onInput:F,onEnter:N,onTab:ie,onClear:D,onBlur:g,onKeypress:y,onPaste:B,onFocus:ce,openMenu:()=>b.$emit("open"),closeMenu:()=>b.$emit("close"),toggleMenu:()=>b.$emit("toggle")}):j("",!0),b.$slots["dp-input"]?j("",!0):(P(),W("input",{key:1,id:b.uid?`dp-input-${b.uid}`:void 0,ref_key:"inputRef",ref:S,"data-test":"dp-input",name:b.name,class:ke(A.value),inputmode:d(l).enabled?"text":"none",placeholder:b.placeholder,disabled:b.disabled,readonly:b.readonly,required:b.required,value:e.inputValue,autocomplete:b.autocomplete,"aria-label":(V=d(i))==null?void 0:V.input,"aria-disabled":b.disabled||void 0,"aria-invalid":b.state===!1?!0:void 0,onInput:F,onBlur:g,onFocus:ce,onKeypress:y,onKeydown:oe[0]||(oe[0]=w=>y(w)),onPaste:B},null,42,Ns)),ye("div",{onClick:oe[3]||(oe[3]=w=>a("toggle"))},[b.$slots["input-icon"]&&!b.hideInputIcon?(P(),W("span",{key:0,class:"dp__input_icon",onClick:oe[1]||(oe[1]=w=>a("toggle"))},[ue(b.$slots,"input-icon")])):j("",!0),!b.$slots["input-icon"]&&!b.hideInputIcon&&!b.$slots["dp-input"]?(P(),De(d(aa),{key:1,"aria-label":(M=d(i))==null?void 0:M.calendarIcon,class:"dp__input_icon dp__input_icons",onClick:oe[2]||(oe[2]=w=>a("toggle"))},null,8,["aria-label"])):j("",!0)]),b.$slots["clear-icon"]&&e.inputValue&&b.clearable&&!b.disabled&&!b.readonly?(P(),W("span",Ls,[ue(b.$slots,"clear-icon",{clear:D})])):j("",!0),b.clearable&&!b.$slots["clear-icon"]&&e.inputValue&&!b.disabled&&!b.readonly?(P(),W("button",{key:3,"aria-label":(o=d(i))==null?void 0:o.clearInput,class:"dp--clear-btn",type:"button",onKeydown:oe[4]||(oe[4]=w=>d(et)(w,()=>D(w),!0,R)),onClick:oe[5]||(oe[5]=va(w=>D(w),["prevent"]))},[ot(d(fr),{class:"dp__input_icons","data-test":"clear-icon"})],40,Hs)):j("",!0)])):j("",!0)])}}}),Fs=typeof window<"u"?window:void 0,tn=()=>{},qs=e=>Fr()?(qr(e),!0):!1,Ws=(e,t,n,a)=>{if(!e)return tn;let r=tn;const l=ct(()=>d(e),p=>{r(),p&&(p.addEventListener(t,n,a),r=()=>{p.removeEventListener(t,n,a),r=tn})},{immediate:!0,flush:"post"}),i=()=>{l(),r()};return qs(i),i},Qs=(e,t,n,a={})=>{const{window:r=Fs,event:l="pointerdown"}=a;return r?Ws(r,l,i=>{const p=Fe(e),c=Fe(t);!p||!c||p===i.target||i.composedPath().includes(p)||i.composedPath().includes(c)||n(i)},{passive:!0}):void 0},zs=ze({compatConfig:{MODE:3},__name:"VueDatePicker",props:{...Ya},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update","invalid-date","overlay-toggle","text-input"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=Z(!1),p=ca(r,"modelValue"),c=ca(r,"timezone"),C=Z(null),m=Z(null),v=Z(null),h=Z(!1),k=Z(null),Y=Z(!1),f=Z(!1),S=Z(!1),I=Z(!1),{setMenuFocused:U,setShiftKey:A}=Ar(),{clearArrowNav:q}=It(),{validateDate:ae,isValidTime:E}=Et(r),{defaultedTransitions:B,defaultedTextInput:ne,defaultedInline:F,defaultedConfig:N,defaultedRange:ie,defaultedMultiDates:ce}=Se(r),{menuTransition:pe,showTransition:g}=ga(B);Ke(()=>{w(r.modelValue),it().then(()=>{if(!F.value.enabled){const O=oe(k.value);O?.addEventListener("scroll",J),window?.addEventListener("resize",$)}}),F.value.enabled&&(i.value=!0),window?.addEventListener("keyup",ge),window?.addEventListener("keydown",x)}),Ca(()=>{if(!F.value.enabled){const O=oe(k.value);O?.removeEventListener("scroll",J),window?.removeEventListener("resize",$)}window?.removeEventListener("keyup",ge),window?.removeEventListener("keydown",x)});const D=lt(l,"all",r.presetDates),y=lt(l,"input");ct([p,c],()=>{w(p.value)},{deep:!0});const{openOnTop:H,menuStyle:re,xCorrect:R,setMenuPosition:b,getScrollableParent:oe,shadowRender:V}=Ys({menuRef:C,menuRefInner:m,inputRef:v,pickerWrapperRef:k,inline:F,emit:a,props:r,slots:l}),{inputValue:M,internalModelValue:o,parseExternalModelValue:w,emitModelValue:z,formatInputValue:u,checkBeforeEmit:le}=$i(a,r,h),fe=G(()=>({dp__main:!0,dp__theme_dark:r.dark,dp__theme_light:!r.dark,dp__flex_display:F.value.enabled,"dp--flex-display-collapsed":S.value,dp__flex_display_with_input:F.value.input})),Ve=G(()=>r.dark?"dp__theme_dark":"dp__theme_light"),T=G(()=>r.teleport?{to:typeof r.teleport=="boolean"?"body":r.teleport,disabled:!r.teleport||F.value.enabled}:{}),K=G(()=>({class:"dp__outer_menu_wrap"})),s=G(()=>F.value.enabled&&(r.timePicker||r.monthPicker||r.yearPicker||r.quarterPicker)),L=()=>{var O,ee;return(ee=(O=v.value)==null?void 0:O.$el)==null?void 0:ee.getBoundingClientRect()},J=()=>{i.value&&(N.value.closeOnScroll?rt():b())},$=()=>{var O;i.value&&b();const ee=(O=m.value)==null?void 0:O.$el.getBoundingClientRect().width;S.value=document.body.offsetWidth<=ee},ge=O=>{O.key==="Tab"&&!F.value.enabled&&!r.teleport&&N.value.tabOutClosesMenu&&(k.value.contains(document.activeElement)||rt()),f.value=O.shiftKey},x=O=>{f.value=O.shiftKey},X=()=>{!r.disabled&&!r.readonly&&(V(Un,r),b(!1),i.value=!0,i.value&&a("open"),i.value||na(),w(r.modelValue))},de=()=>{var O;M.value="",na(),(O=v.value)==null||O.setParsedDate(null),a("update:model-value",null),a("update:model-timezone-value",null),a("cleared"),N.value.closeOnClearValue&&rt()},be=()=>{const O=o.value;return!O||!Array.isArray(O)&&ae(O)?!0:Array.isArray(O)?ce.value.enabled||O.length===2&&ae(O[0])&&ae(O[1])?!0:ie.value.partialRange&&!r.timePicker?ae(O[0]):!1:!1},st=()=>{le()&&be()?(z(),rt()):a("invalid-select",o.value)},me=O=>{Pt(),z(),N.value.closeOnAutoApply&&!O&&rt()},Pt=()=>{v.value&&ne.value.enabled&&v.value.setParsedDate(o.value)},gt=(O=!1)=>{r.autoApply&&E(o.value)&&be()&&(ie.value.enabled&&Array.isArray(o.value)?(ie.value.partialRange||o.value.length===2)&&me(O):me(O))},na=()=>{ne.value.enabled||(o.value=null)},rt=()=>{F.value.enabled||(i.value&&(i.value=!1,R.value=!1,U(!1),A(!1),q(),a("closed"),M.value&&w(p.value)),na(),a("blur"))},ra=(O,ee,se=!1)=>{if(!O){o.value=null;return}const Je=Array.isArray(O)?!O.some(Bt=>!ae(Bt)):ae(O),ut=E(O);Je&&ut?(I.value=!0,o.value=O,ee&&(Y.value=se,st(),a("text-submit")),it().then(()=>{I.value=!1})):a("invalid-date",O)},Ea=()=>{r.autoApply&&E(o.value)&&z(),Pt()},wa=()=>i.value?rt():X(),Ba=O=>{o.value=O},Na=()=>{ne.value.enabled&&(h.value=!0,u()),a("focus")},La=()=>{if(ne.value.enabled&&(h.value=!1,w(r.modelValue),Y.value)){const O=li(k.value,f.value);O?.focus()}a("blur")},Ha=O=>{m.value&&m.value.updateMonthYear(0,{month:Ln(O.month),year:Ln(O.year)})},Va=O=>{w(O??r.modelValue)},Fa=(O,ee)=>{var se;(se=m.value)==null||se.switchView(O,ee)},_=O=>N.value.onClickOutside?N.value.onClickOutside(O):rt(),te=(O=0)=>{var ee;(ee=m.value)==null||ee.handleFlow(O)};return Qs(C,v,()=>_(be)),t({closeMenu:rt,selectDate:st,clearValue:de,openMenu:X,onScroll:J,formatInputValue:u,updateInternalModelValue:Ba,setMonthYear:Ha,parseModel:Va,switchView:Fa,toggleMenu:wa,handleFlow:te,dpWrapMenuRef:C}),(O,ee)=>(P(),W("div",{ref_key:"pickerWrapperRef",ref:k,class:ke(fe.value),"data-datepicker-instance":""},[ot(Vs,Qe({ref_key:"inputRef",ref:v,"input-value":d(M),"onUpdate:inputValue":ee[0]||(ee[0]=se=>Pn(M)?M.value=se:null),"is-menu-open":i.value},O.$props,{onClear:de,onOpen:X,onSetInputDate:ra,onSetEmptyDate:d(z),onSelectDate:st,onToggle:wa,onClose:rt,onFocus:Na,onBlur:La,onRealBlur:ee[1]||(ee[1]=se=>h.value=!1),onTextInput:ee[2]||(ee[2]=se=>O.$emit("text-input",se))}),je({_:2},[Ye(d(y),(se,Je)=>({name:se,fn:_e(ut=>[ue(O.$slots,se,We(at(ut)))])}))]),1040,["input-value","is-menu-open","onSetEmptyDate"]),(P(),De(Oa(O.teleport?Br:"div"),We(at(T.value)),{default:_e(()=>[ot(ta,{name:d(pe)(d(H)),css:d(g)&&!d(F).enabled},{default:_e(()=>[i.value?(P(),W("div",Qe({key:0,ref_key:"dpWrapMenuRef",ref:C},K.value,{class:{"dp--menu-wrapper":!d(F).enabled},style:d(F).enabled?void 0:d(re)}),[ot(Un,Qe({ref_key:"dpMenuRef",ref:m},O.$props,{"internal-model-value":d(o),"onUpdate:internalModelValue":ee[3]||(ee[3]=se=>Pn(o)?o.value=se:null),class:{[Ve.value]:!0,"dp--menu-wrapper":O.teleport},"open-on-top":d(H),"no-overlay-focus":s.value,collapse:S.value,"get-input-rect":L,"is-text-input-date":I.value,onClosePicker:rt,onSelectDate:st,onAutoApply:gt,onTimeUpdate:Ea,onFlowStep:ee[4]||(ee[4]=se=>O.$emit("flow-step",se)),onUpdateMonthYear:ee[5]||(ee[5]=se=>O.$emit("update-month-year",se)),onInvalidSelect:ee[6]||(ee[6]=se=>O.$emit("invalid-select",d(o))),onAutoApplyInvalid:ee[7]||(ee[7]=se=>O.$emit("invalid-select",se)),onInvalidFixedRange:ee[8]||(ee[8]=se=>O.$emit("invalid-fixed-range",se)),onRecalculatePosition:d(b),onTooltipOpen:ee[9]||(ee[9]=se=>O.$emit("tooltip-open",se)),onTooltipClose:ee[10]||(ee[10]=se=>O.$emit("tooltip-close",se)),onTimePickerOpen:ee[11]||(ee[11]=se=>O.$emit("time-picker-open",se)),onTimePickerClose:ee[12]||(ee[12]=se=>O.$emit("time-picker-close",se)),onAmPmChange:ee[13]||(ee[13]=se=>O.$emit("am-pm-change",se)),onRangeStart:ee[14]||(ee[14]=se=>O.$emit("range-start",se)),onRangeEnd:ee[15]||(ee[15]=se=>O.$emit("range-end",se)),onDateUpdate:ee[16]||(ee[16]=se=>O.$emit("date-update",se)),onInvalidDate:ee[17]||(ee[17]=se=>O.$emit("invalid-date",se)),onOverlayToggle:ee[18]||(ee[18]=se=>O.$emit("overlay-toggle",se))}),je({_:2},[Ye(d(D),(se,Je)=>({name:se,fn:_e(ut=>[ue(O.$slots,se,We(at({...ut})))])}))]),1040,["internal-model-value","class","open-on-top","no-overlay-focus","collapse","is-text-input-date","onRecalculatePosition"])],16)):j("",!0)]),_:3},8,["name","css"])]),_:3},16))],2))}}),Ir=(()=>{const e=zs;return e.install=t=>{t.component("Vue3DatePicker",e)},e})(),Us=Object.freeze(Object.defineProperty({__proto__:null,default:Ir},Symbol.toStringTag,{value:"Module"}));Object.entries(Us).forEach(([e,t])=>{e!=="default"&&(Ir[e]=t)});export{Ir as V}; diff --git a/src/static/app/dist/index.html b/src/static/app/dist/index.html index 668d206..2988fe5 100644 --- a/src/static/app/dist/index.html +++ b/src/static/app/dist/index.html @@ -10,7 +10,7 @@ WGDashboard - + diff --git a/src/static/app/src/components/map/osmapSocket.vue b/src/static/app/src/components/map/osmapSocket.vue index 67a0834..b335bfe 100644 --- a/src/static/app/src/components/map/osmapSocket.vue +++ b/src/static/app/src/components/map/osmapSocket.vue @@ -94,7 +94,6 @@ if (osmAvailable.value){ lineStringFeature.setGeometry(lineString) sourceVector.removeFeature(lineStringFeature) sourceVector.addFeature(lineStringFeature) - console.log(lineStringFeature) sourceVector.addFeature(new Feature({ geometry: new Point(cord), last: false, diff --git a/src/static/app/src/views/ping.vue b/src/static/app/src/views/ping.vue index ee2b8ad..9c7e03b 100644 --- a/src/static/app/src/views/ping.vue +++ b/src/static/app/src/views/ping.vue @@ -20,7 +20,6 @@ export default { selectedPeer: undefined, selectedIp: undefined, pingResult: undefined, - } }, setup(){ @@ -42,13 +41,18 @@ export default { console.assert("Failed to connect socket.io") } sio.on('pingResponse', (...arg) => { - let data = arg[0].data - data.id = v4().toString() - socketResult.value.pingResults.push(data) - if (socketResult.value.pingResults.length === count.value){ + let data = arg[0] + if (data.status && pinging.value){ + data.data.id = v4().toString() + socketResult.value.pingResults.push(data.data) + }else{ + store.newMessage("Server", data.message, "danger") pinging.value = false } }) + sio.on('pingResponseEnd', () => { + pinging.value = false + }) return {store, sio, socketResult, count, pinging} }, beforeUnmount() { @@ -157,7 +161,6 @@ export default { -
- -
-
- -
-
-
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- {{hop.hop}} - - - {{hop.ip}} - - - - {{hop.avg_rtt}} - - - - {{hop.min_rtt}} - - - - {{hop.max_rtt}} - - - - {{hop.geo.city}}, {{hop.geo.country}} - - - - - -
-
-
-
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ {{hop.hop}} + + + {{hop.ip}} + + + + {{hop.avg_rtt}} + + + + {{hop.min_rtt}} + + + + {{hop.max_rtt}} + + + + {{hop.geo.city}}, {{hop.geo.country}} + +
+ + + +
+