@rubytech/create-maxy-code 0.1.501 → 0.1.503

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/docs/superpowers/plans/2026-07-25-task-1974-uploads-intake-inbox.md +235 -0
  3. package/payload/platform/docs/superpowers/plans/2026-07-25-task-1976-intra-folder-hygiene.md +215 -0
  4. package/payload/platform/plugins/admin/PLUGIN.md +1 -0
  5. package/payload/platform/plugins/admin/hooks/__tests__/quote-engine-gate.test.sh +98 -0
  6. package/payload/platform/plugins/admin/hooks/quote-engine-gate.sh +68 -0
  7. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +2 -2
  8. package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +13 -0
  9. package/payload/platform/plugins/docs/references/internals.md +1 -1
  10. package/payload/platform/scripts/lib/provision-account-dir.sh +2 -1
  11. package/payload/platform/services/telegram-channel/dist/instructions.js +2 -2
  12. package/payload/platform/services/telegram-channel/dist/instructions.js.map +1 -1
  13. package/payload/platform/services/webchat-channel/dist/instructions.js +2 -2
  14. package/payload/platform/services/webchat-channel/dist/instructions.js.map +1 -1
  15. package/payload/platform/services/whatsapp-channel/dist/notification.js +2 -2
  16. package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
  17. package/payload/platform/templates/account-schema/SCHEMA.md +36 -1
  18. package/payload/platform/templates/specialists/agents/data-manager.md +4 -2
  19. package/payload/server/public/activity.html +5 -5
  20. package/payload/server/public/assets/AdminLoginScreens-Bv_bKKeL.js +1 -0
  21. package/payload/server/public/assets/AdminShell-Gq8DU_ig.js +2 -0
  22. package/payload/server/public/assets/{activity-CVdVSw5V.js → activity-DZFYDHNA.js} +1 -1
  23. package/payload/server/public/assets/{admin-If1QLlS3.js → admin-DLUOixl6.js} +1 -1
  24. package/payload/server/public/assets/{bot-8b26IlQY.js → bot-CrEhKW1l.js} +1 -1
  25. package/payload/server/public/assets/{browser-F40DXfKA.js → browser-Bt4-LKLU.js} +1 -1
  26. package/payload/server/public/assets/calendar-B8ujkn_K.js +1 -0
  27. package/payload/server/public/assets/chat-lQXd6gsM.js +1 -0
  28. package/payload/server/public/assets/chevron-left-CQ8rcBoO.js +1 -0
  29. package/payload/server/public/assets/chevron-right-CSRSqblN.js +1 -0
  30. package/payload/server/public/assets/clock-B7Ba8AZL.js +1 -0
  31. package/payload/server/public/assets/data-BdlGqjKM.js +1 -0
  32. package/payload/server/public/assets/{file-text-B1HjPFbM.js → file-text-BpLcZKld.js} +1 -1
  33. package/payload/server/public/assets/{graph-CIC-mgKR.js → graph-HB0199x-.js} +3 -3
  34. package/payload/server/public/assets/{graph-labels-BnpHCHaQ.js → graph-labels-Bx19ZYvJ.js} +1 -1
  35. package/payload/server/public/assets/{maximize-2-BL7QVTcQ.js → maximize-2-BhR-Ec21.js} +1 -1
  36. package/payload/server/public/assets/operator-Bf3hP3qo.js +1 -0
  37. package/payload/server/public/assets/page-Bs24tO-C.js +32 -0
  38. package/payload/server/public/assets/page-FnCmAeHc.js +1 -0
  39. package/payload/server/public/assets/{public-BI21tOkm.js → public-DZHPsyKX.js} +1 -1
  40. package/payload/server/public/assets/{rotate-ccw-C_20Bc3E.js → rotate-ccw-D9qOBLig.js} +1 -1
  41. package/payload/server/public/assets/{routines-Ci3N8wqV.js → routines-lGiYaMiX.js} +1 -1
  42. package/payload/server/public/assets/skills-y-h0P9rC.js +1 -0
  43. package/payload/server/public/assets/{tasks-DC2Yf2Ev.js → tasks-Cyc1EfLA.js} +1 -1
  44. package/payload/server/public/assets/{time-entry-format-CNcjs2HV.js → time-entry-format-RkCW7hKu.js} +1 -1
  45. package/payload/server/public/assets/{triangle-alert-CngnWtjD.js → triangle-alert-k8ulav-N.js} +1 -1
  46. package/payload/server/public/assets/{useCopyFeedback-DZ9Bw5CI.js → useCopyFeedback-DN1WA5vU.js} +1 -1
  47. package/payload/server/public/assets/useSubAccountSwitcher-fvBunpOC.css +1 -0
  48. package/payload/server/public/assets/useSubAccountSwitcher-iQGqNJhI.js +9 -0
  49. package/payload/server/public/assets/useVoiceRecorder-v--TIxaM.js +2 -0
  50. package/payload/server/public/assets/{wrench-dky2-13x.js → wrench-CKhz8KnQ.js} +1 -1
  51. package/payload/server/public/browser.html +4 -4
  52. package/payload/server/public/calendar.html +7 -7
  53. package/payload/server/public/chat.html +14 -14
  54. package/payload/server/public/data.html +11 -11
  55. package/payload/server/public/graph.html +9 -9
  56. package/payload/server/public/index.html +15 -15
  57. package/payload/server/public/operator.html +15 -15
  58. package/payload/server/public/public.html +14 -14
  59. package/payload/server/public/routines.html +6 -6
  60. package/payload/server/public/skills.html +5 -5
  61. package/payload/server/public/tasks.html +6 -6
  62. package/payload/server/server.js +840 -748
  63. package/payload/server/public/assets/AdminLoginScreens-C3LZOPIY.js +0 -1
  64. package/payload/server/public/assets/AdminShell-BlbUNAPc.js +0 -2
  65. package/payload/server/public/assets/calendar-DZiHiBwV.js +0 -1
  66. package/payload/server/public/assets/chat-uD28FVCS.js +0 -1
  67. package/payload/server/public/assets/chevron-left-lBxD57tD.js +0 -1
  68. package/payload/server/public/assets/chevron-right-C-lDig9Y.js +0 -1
  69. package/payload/server/public/assets/clock-DqRNsY40.js +0 -1
  70. package/payload/server/public/assets/data-BsFyBN85.js +0 -1
  71. package/payload/server/public/assets/operator-B62h_TaC.js +0 -1
  72. package/payload/server/public/assets/page-BUUBseJZ.js +0 -32
  73. package/payload/server/public/assets/page-Bw-tYjw7.js +0 -1
  74. package/payload/server/public/assets/skills-CiflzOko.js +0 -1
  75. package/payload/server/public/assets/useSubAccountSwitcher-CHwQhkaI.js +0 -9
  76. package/payload/server/public/assets/useSubAccountSwitcher-yFQqnpQ8.css +0 -1
  77. package/payload/server/public/assets/useVoiceRecorder-C3G6aqZr.js +0 -2
@@ -1,4 +1,4 @@
1
- import{o as e,t}from"./chunk-CCr-iYLO.js";import{B as n,F as r,G as i,H as a,M as o,T as s,U as c,_ as l,b as u,g as d,p as f,x as p,y as m}from"./useSubAccountSwitcher-CHwQhkaI.js";import{C as h,S as g,n as _,p as v,t as y,v as b}from"./AdminShell-BlbUNAPc.js";import{t as x}from"./chevron-left-lBxD57tD.js";import{n as S,t as ee}from"./maximize-2-BL7QVTcQ.js";import{t as C}from"./rotate-ccw-C_20Bc3E.js";import{i as te,n as w,r as ne}from"./graph-labels-BnpHCHaQ.js";import{t as T}from"./useCopyFeedback-DZ9Bw5CI.js";var E=r(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),D=r(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),O=r(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),k=r(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),re=r(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),ie=r(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),A=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.vis=n.vis||{}))})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||(function(){return this})()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},w=typeof document==`object`&&document.all,ne={all:w,IS_HTMLDDA:w===void 0&&w!==void 0},T=ne,E=T.all,D=T.IS_HTMLDDA?function(e){return typeof e==`function`||e===E}:function(e){return typeof e==`function`},O={},k=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),re=c,ie=Function.prototype.call,A=re?ie.bind(ie):function(){return ie.apply(ie,arguments)},ae={},oe={}.propertyIsEnumerable,se=Object.getOwnPropertyDescriptor;ae.f=se&&!oe.call({1:2},1)?function(e){var t=se(this,e);return!!t&&t.enumerable}:oe;var ce=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},j=v,le=s,ue=S,de=Object,fe=j(``.split),pe=le(function(){return!de(`z`).propertyIsEnumerable(0)})?function(e){return ue(e)===`String`?fe(e,``):de(e)}:de,me=function(e){return e==null},he=me,ge=TypeError,_e=function(e){if(he(e))throw new ge(`Can't call method on `+e);return e},ve=pe,ye=_e,be=function(e){return ve(ye(e))},xe=D,M=ne,N=M.all,P=M.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:xe(e)||e===N}:function(e){return typeof e==`object`?e!==null:xe(e)},Se={},Ce=Se,we=o,Te=D,F=function(e){return Te(e)?e:void 0},I=function(e,t){return arguments.length<2?F(Ce[e])||F(we[e]):Ce[e]&&Ce[e][t]||we[e]&&we[e][t]},Ee=v({}.isPrototypeOf),De=typeof navigator<`u`&&String(navigator.userAgent)||``,Oe=o,ke=De,Ae=Oe.process,je=Oe.Deno,Me=Ae&&Ae.versions||je&&je.version,Ne=Me&&Me.v8,Pe,Fe;Ne&&(Pe=Ne.split(`.`),Fe=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1])),!Fe&&ke&&(Pe=ke.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=ke.match(/Chrome\/(\d+)/),Pe&&(Fe=+Pe[1])));var Ie=Fe,Le=Ie,Re=s,ze=o.String,Be=!!Object.getOwnPropertySymbols&&!Re(function(){var e=Symbol(`symbol detection`);return!ze(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Le&&Le<41}),Ve=Be&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,He=I,Ue=D,We=Ee,Ge=Ve,Ke=Object,qe=Ge?function(e){return typeof e==`symbol`}:function(e){var t=He(`Symbol`);return Ue(t)&&We(t.prototype,Ke(e))},Je=String,Ye=function(e){try{return Je(e)}catch{return`Object`}},Xe=D,Ze=Ye,Qe=TypeError,$e=function(e){if(Xe(e))return e;throw new Qe(Ze(e)+` is not a function`)},et=$e,tt=me,nt=function(e,t){var n=e[t];return tt(n)?void 0:et(n)},rt=A,it=D,at=P,ot=TypeError,L=function(e,t){var n,r;if(t===`string`&&it(n=e.toString)&&!at(r=rt(n,e))||it(n=e.valueOf)&&!at(r=rt(n,e))||t!==`string`&&it(n=e.toString)&&!at(r=rt(n,e)))return r;throw new ot(`Can't convert object to primitive value`)},st={exports:{}},ct=!0,lt=o,ut=Object.defineProperty,dt=function(e,t){try{ut(lt,e,{value:t,configurable:!0,writable:!0})}catch{lt[e]=t}return t},ft=o,pt=dt,mt=`__core-js_shared__`,ht=ft[mt]||pt(mt,{}),gt=ht;(st.exports=function(e,t){return gt[e]||(gt[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var _t=st.exports,vt=_e,yt=Object,bt=function(e){return yt(vt(e))},xt=v,St=bt,Ct=xt({}.hasOwnProperty),wt=Object.hasOwn||function(e,t){return Ct(St(e),t)},Tt=v,Et=0,Dt=Math.random(),Ot=Tt(1 .toString),kt=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+Ot(++Et+Dt,36)},At=o,jt=_t,Mt=wt,Nt=kt,Pt=Be,Ft=Ve,It=At.Symbol,Lt=jt(`wks`),Rt=Ft?It.for||It:It&&It.withoutSetter||Nt,zt=function(e){return Mt(Lt,e)||(Lt[e]=Pt&&Mt(It,e)?It[e]:Rt(`Symbol.`+e)),Lt[e]},Bt=A,Vt=P,Ht=qe,Ut=nt,Wt=L,Gt=zt,Kt=TypeError,qt=Gt(`toPrimitive`),Jt=function(e,t){if(!Vt(e)||Ht(e))return e;var n=Ut(e,qt),r;if(n){if(t===void 0&&(t=`default`),r=Bt(n,e,t),!Vt(r)||Ht(r))return r;throw new Kt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Wt(e,t)},Yt=qe,Xt=function(e){var t=Jt(e,`string`);return Yt(t)?t:t+``},Zt=o,Qt=P,$t=Zt.document,en=Qt($t)&&Qt($t.createElement),tn=function(e){return en?$t.createElement(e):{}},nn=k,rn=s,an=tn,on=!nn&&!rn(function(){return Object.defineProperty(an(`div`),`a`,{get:function(){return 7}}).a!==7}),sn=k,cn=A,ln=ae,un=ce,dn=be,fn=Xt,pn=wt,mn=on,hn=Object.getOwnPropertyDescriptor;O.f=sn?hn:function(e,t){if(e=dn(e),t=fn(t),mn)try{return hn(e,t)}catch{}if(pn(e,t))return un(!cn(ln.f,e,t),e[t])};var gn=s,_n=D,vn=/#|\.prototype\./,yn=function(e,t){var n=xn[bn(e)];return n===Cn?!0:n===Sn?!1:_n(t)?gn(t):!!t},bn=yn.normalize=function(e){return String(e).replace(vn,`.`).toLowerCase()},xn=yn.data={},Sn=yn.NATIVE=`N`,Cn=yn.POLYFILL=`P`,wn=yn,Tn=te,En=$e,Dn=c,On=Tn(Tn.bind),kn=function(e,t){return En(e),t===void 0?e:Dn?On(e,t):function(){return e.apply(t,arguments)}},An={},jn=k&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Mn=P,Nn=String,Pn=TypeError,Fn=function(e){if(Mn(e))return e;throw new Pn(Nn(e)+` is not an object`)},In=k,Ln=on,Rn=jn,zn=Fn,Bn=Xt,Vn=TypeError,Hn=Object.defineProperty,Un=Object.getOwnPropertyDescriptor,Wn=`enumerable`,R=`configurable`,z=`writable`;An.f=In?Rn?function(e,t,n){if(zn(e),t=Bn(t),zn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&z in n&&!n[z]){var r=Un(e,t);r&&r[z]&&(e[t]=n.value,n={configurable:R in n?n[R]:r[R],enumerable:Wn in n?n[Wn]:r[Wn],writable:!1})}return Hn(e,t,n)}:Hn:function(e,t,n){if(zn(e),t=Bn(t),zn(n),Ln)try{return Hn(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Vn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Gn=k,Kn=An,qn=ce,Jn=Gn?function(e,t,n){return Kn.f(e,t,qn(1,n))}:function(e,t,n){return e[t]=n,e},Yn=o,Xn=p,Zn=te,Qn=D,$n=O.f,er=wn,tr=Se,nr=kn,rr=Jn,ir=wt,ar=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Xn(e,this,arguments)};return t.prototype=e.prototype,t},B=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Yn:i?Yn[n]:(Yn[n]||{}).prototype,s=r?tr:tr[n]||rr(tr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=er(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ir(o,f),m=s[f],u&&(e.dontCallGetSet?(_=$n(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?nr(p,Yn):e.wrap&&u?ar(p):a&&Qn(p)?Zn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&rr(g,`sham`,!0),rr(s,f,g),a&&(d=n+`Prototype`,ir(tr,d)||rr(tr,d,{}),rr(tr[d],f,p),e.real&&c&&(l||!c[f])&&rr(c,f,p)))},or=B,sr=k,cr=An.f;or({target:`Object`,stat:!0,forced:Object.defineProperty!==cr,sham:!sr},{defineProperty:cr});var lr=Se.Object,ur=i.exports=function(e,t,n){return lr.defineProperty(e,t,n)};lr.defineProperty.sham&&(ur.sham=!0);var dr=i.exports,fr=dr,pr=r(fr),mr=S,hr=Array.isArray||function(e){return mr(e)===`Array`},gr=Math.ceil,_r=Math.floor,vr=Math.trunc||function(e){var t=+e;return(t>0?_r:gr)(t)},yr=function(e){var t=+e;return t!==t||t===0?0:vr(t)},br=yr,xr=Math.min,Sr=function(e){return e>0?xr(br(e),9007199254740991):0},Cr=function(e){return Sr(e.length)},wr=TypeError,Tr=9007199254740991,Er=function(e){if(e>Tr)throw wr(`Maximum allowed index exceeded`);return e},Dr=Xt,Or=An,kr=ce,Ar=function(e,t,n){var r=Dr(t);r in e?Or.f(e,r,kr(0,n)):e[r]=n},jr=zt(`toStringTag`),Mr={};Mr[jr]=`z`;var Nr=String(Mr)===`[object z]`,Pr=Nr,Fr=D,Ir=S,Lr=zt(`toStringTag`),Rr=Object,zr=Ir(function(){return arguments}())===`Arguments`,Br=function(e,t){try{return e[t]}catch{}},Vr=Pr?Ir:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Br(t=Rr(e),Lr))==`string`?n:zr?Ir(t):(r=Ir(t))===`Object`&&Fr(t.callee)?`Arguments`:r},Hr=v,Ur=D,Wr=ht,Gr=Hr(Function.toString);Ur(Wr.inspectSource)||(Wr.inspectSource=function(e){return Gr(e)});var Kr=Wr.inspectSource,qr=v,Jr=s,Yr=D,Xr=Vr,Zr=I,V=Kr,Qr=function(){},$r=[],ei=Zr(`Reflect`,`construct`),ti=/^\s*(?:class|function)\b/,ni=qr(ti.exec),ri=!ti.test(Qr),ii=function(e){if(!Yr(e))return!1;try{return ei(Qr,$r,e),!0}catch{return!1}},ai=function(e){if(!Yr(e))return!1;switch(Xr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ri||!!ni(ti,V(e))}catch{return!0}};ai.sham=!0;var oi=!ei||Jr(function(){var e;return ii(ii.call)||!ii(Object)||!ii(function(){e=!0})||e})?ai:ii,si=hr,ci=oi,li=P,ui=zt(`species`),di=Array,fi=function(e){var t;return si(e)&&(t=e.constructor,ci(t)&&(t===di||si(t.prototype))?t=void 0:li(t)&&(t=t[ui],t===null&&(t=void 0))),t===void 0?di:t},pi=function(e,t){return new(fi(e))(t===0?0:t)},mi=s,hi=zt,gi=Ie,_i=hi(`species`),vi=function(e){return gi>=51||!mi(function(){var t=[],n=t.constructor={};return n[_i]=function(){return{foo:1}},t[e](Boolean).foo!==1})},yi=B,bi=s,xi=hr,Si=P,Ci=bt,wi=Cr,Ti=Er,Ei=Ar,Di=pi,Oi=vi,ki=zt,Ai=Ie,ji=ki(`isConcatSpreadable`),Mi=Ai>=51||!bi(function(){var e=[];return e[ji]=!1,e.concat()[0]!==e}),Ni=function(e){if(!Si(e))return!1;var t=e[ji];return t===void 0?xi(e):!!t};yi({target:`Array`,proto:!0,arity:1,forced:!Mi||!Oi(`concat`)},{concat:function(e){var t=Ci(this),n=Di(t,0),r=0,i,a,o,s,c;for(i=-1,o=arguments.length;i<o;i++)if(c=i===-1?t:arguments[i],Ni(c))for(s=wi(c),Ti(r+s),a=0;a<s;a++,r++)a in c&&Ei(n,r,c[a]);else Ti(r+1),Ei(n,r++,c);return n.length=r,n}});var Pi=Vr,Fi=String,Ii=function(e){if(Pi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Fi(e)},Li={},Ri=yr,zi=Math.max,Bi=Math.min,Vi=function(e,t){var n=Ri(e);return n<0?zi(n+t,0):Bi(n,t)},Hi=be,Ui=Vi,Wi=Cr,Gi=function(e){return function(t,n,r){var i=Hi(t),a=Wi(i),o=Ui(r,a),s;if(e&&n!==n){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},Ki={includes:Gi(!0),indexOf:Gi(!1)},qi={},Ji=v,Yi=wt,Xi=be,Zi=Ki.indexOf,Qi=qi,$i=Ji([].push),ea=function(e,t){var n=Xi(e),r=0,i=[],a;for(a in n)!Yi(Qi,a)&&Yi(n,a)&&$i(i,a);for(;t.length>r;)Yi(n,a=t[r++])&&(~Zi(i,a)||$i(i,a));return i},ta=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],na=ea,ra=ta,ia=Object.keys||function(e){return na(e,ra)},aa=k,oa=jn,sa=An,ca=Fn,la=be,ua=ia;Li.f=aa&&!oa?Object.defineProperties:function(e,t){ca(e);for(var n=la(t),r=ua(t),i=r.length,a=0,o;i>a;)sa.f(e,o=r[a++],n[o]);return e};var da=I(`document`,`documentElement`),fa=_t,pa=kt,ma=fa(`keys`),ha=function(e){return ma[e]||(ma[e]=pa(e))},ga=Fn,_a=Li,va=ta,ya=qi,ba=da,xa=tn,Sa=ha,Ca=`>`,wa=`<`,Ta=`prototype`,Ea=`script`,Da=Sa(`IE_PROTO`),Oa=function(){},ka=function(e){return wa+Ea+Ca+e+wa+`/`+Ea+Ca},Aa=function(e){e.write(ka(``)),e.close();var t=e.parentWindow.Object;return e=null,t},ja=function(){var e=xa(`iframe`),t=`java`+Ea+`:`,n;return e.style.display=`none`,ba.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(ka(`document.F=Object`)),n.close(),n.F},Ma,Na=function(){try{Ma=new ActiveXObject(`htmlfile`)}catch{}Na=typeof document<`u`?document.domain&&Ma?Aa(Ma):ja():Aa(Ma);for(var e=va.length;e--;)delete Na[Ta][va[e]];return Na()};ya[Da]=!0;var Pa=Object.create||function(e,t){var n;return e===null?n=Na():(Oa[Ta]=ga(e),n=new Oa,Oa[Ta]=null,n[Da]=e),t===void 0?n:_a.f(n,t)},Fa={},Ia=ea,La=ta.concat(`length`,`prototype`);Fa.f=Object.getOwnPropertyNames||function(e){return Ia(e,La)};var Ra={},za=Vi,Ba=Cr,Va=Ar,Ha=Array,Ua=Math.max,Wa=function(e,t,n){for(var r=Ba(e),i=za(t,r),a=za(n===void 0?r:n,r),o=Ha(Ua(a-i,0)),s=0;i<a;i++,s++)Va(o,s,e[i]);return o.length=s,o},Ga=S,Ka=be,qa=Fa.f,Ja=Wa,Ya=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Xa=function(e){try{return qa(e)}catch{return Ja(Ya)}};Ra.f=function(e){return Ya&&Ga(e)===`Window`?Xa(e):qa(Ka(e))};var Za={};Za.f=Object.getOwnPropertySymbols;var Qa=Jn,$a=function(e,t,n,r){return r&&r.enumerable?e[t]=n:Qa(e,t,n),e},eo=An,to=function(e,t,n){return eo.f(e,t,n)},no={};no.f=zt;var ro=Se,io=wt,ao=no,oo=An.f,so=function(e){var t=ro.Symbol||={};io(t,e)||oo(t,e,{value:ao.f(e)})},co=A,lo=I,uo=zt,fo=$a,po=function(){var e=lo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=uo(`toPrimitive`);t&&!t[r]&&fo(t,r,function(e){return co(n,this)},{arity:1})},mo=Nr,ho=Vr,go=mo?{}.toString:function(){return`[object `+ho(this)+`]`},_o=Nr,vo=An.f,yo=Jn,bo=wt,xo=go,So=zt(`toStringTag`),Co=function(e,t,n,r){if(e){var i=n?e:e.prototype;bo(i,So)||vo(i,So,{configurable:!0,value:t}),r&&!_o&&yo(i,`toString`,xo)}},wo=o,To=D,Eo=wo.WeakMap,Do=To(Eo)&&/native code/.test(String(Eo)),Oo=o,ko=P,Ao=Jn,jo=wt,Mo=ht,No=ha,Po=qi,Fo=`Object already initialized`,Io=Oo.TypeError,Lo=Oo.WeakMap,Ro,zo,Bo,Vo=function(e){return Bo(e)?zo(e):Ro(e,{})},Ho=function(e){return function(t){var n;if(!ko(t)||(n=zo(t)).type!==e)throw new Io(`Incompatible receiver, `+e+` required`);return n}};if(Do||Mo.state){var Uo=Mo.state||=new Lo;Uo.get=Uo.get,Uo.has=Uo.has,Uo.set=Uo.set,Ro=function(e,t){if(Uo.has(e))throw new Io(Fo);return t.facade=e,Uo.set(e,t),t},zo=function(e){return Uo.get(e)||{}},Bo=function(e){return Uo.has(e)}}else{var Wo=No(`state`);Po[Wo]=!0,Ro=function(e,t){if(jo(e,Wo))throw new Io(Fo);return t.facade=e,Ao(e,Wo,t),t},zo=function(e){return jo(e,Wo)?e[Wo]:{}},Bo=function(e){return jo(e,Wo)}}var Go={set:Ro,get:zo,has:Bo,enforce:Vo,getterFor:Ho},Ko=kn,qo=v,Jo=pe,Yo=bt,Xo=Cr,Zo=pi,Qo=qo([].push),$o=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f=Yo(c),p=Jo(f),m=Ko(l,u),h=Xo(p),g=0,_=d||Zo,v=t?_(c,h):n||o?_(c,0):void 0,y,b;h>g;g++)if((s||g in p)&&(y=p[g],b=m(y,g,f),e))if(t)v[g]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return g;case 2:Qo(v,y)}else switch(e){case 4:return!1;case 7:Qo(v,y)}return a?-1:r||i?i:v}},es={forEach:$o(0),map:$o(1),filter:$o(2),some:$o(3),every:$o(4),find:$o(5),findIndex:$o(6),filterReject:$o(7)},ts=B,ns=o,rs=A,is=v,as=k,os=Be,ss=s,cs=wt,ls=Ee,us=Fn,ds=be,fs=Xt,ps=Ii,ms=ce,hs=Pa,gs=ia,_s=Fa,vs=Ra,ys=Za,bs=O,xs=An,Ss=Li,Cs=ae,ws=$a,Ts=to,Es=_t,Ds=ha,Os=qi,ks=kt,As=zt,js=no,Ms=so,Ns=po,Ps=Co,Fs=Go,Is=es.forEach,Ls=Ds(`hidden`),Rs=`Symbol`,zs=`prototype`,Bs=Fs.set,Vs=Fs.getterFor(Rs),Hs=Object[zs],Us=ns.Symbol,Ws=Us&&Us[zs],Gs=ns.RangeError,Ks=ns.TypeError,qs=ns.QObject,Js=bs.f,Ys=xs.f,Xs=vs.f,Zs=Cs.f,Qs=is([].push),$s=Es(`symbols`),ec=Es(`op-symbols`),tc=Es(`wks`),nc=!qs||!qs[zs]||!qs[zs].findChild,rc=function(e,t,n){var r=Js(Hs,t);r&&delete Hs[t],Ys(e,t,n),r&&e!==Hs&&Ys(Hs,t,r)},ic=as&&ss(function(){return hs(Ys({},`a`,{get:function(){return Ys(this,`a`,{value:7}).a}})).a!==7})?rc:Ys,ac=function(e,t){var n=$s[e]=hs(Ws);return Bs(n,{type:Rs,tag:e,description:t}),as||(n.description=t),n},oc=function(e,t,n){e===Hs&&oc(ec,t,n),us(e);var r=fs(t);return us(n),cs($s,r)?(n.enumerable?(cs(e,Ls)&&e[Ls][r]&&(e[Ls][r]=!1),n=hs(n,{enumerable:ms(0,!1)})):(cs(e,Ls)||Ys(e,Ls,ms(1,{})),e[Ls][r]=!0),ic(e,r,n)):Ys(e,r,n)},sc=function(e,t){us(e);var n=ds(t);return Is(gs(n).concat(fc(n)),function(t){(!as||rs(lc,n,t))&&oc(e,t,n[t])}),e},cc=function(e,t){return t===void 0?hs(e):sc(hs(e),t)},lc=function(e){var t=fs(e),n=rs(Zs,this,t);return this===Hs&&cs($s,t)&&!cs(ec,t)?!1:n||!cs(this,t)||!cs($s,t)||cs(this,Ls)&&this[Ls][t]?n:!0},uc=function(e,t){var n=ds(e),r=fs(t);if(!(n===Hs&&cs($s,r)&&!cs(ec,r))){var i=Js(n,r);return i&&cs($s,r)&&!(cs(n,Ls)&&n[Ls][r])&&(i.enumerable=!0),i}},dc=function(e){var t=Xs(ds(e)),n=[];return Is(t,function(e){!cs($s,e)&&!cs(Os,e)&&Qs(n,e)}),n},fc=function(e){var t=e===Hs,n=Xs(t?ec:ds(e)),r=[];return Is(n,function(e){cs($s,e)&&(!t||cs(Hs,e))&&Qs(r,$s[e])}),r};os||(Us=function(){if(ls(Ws,this))throw new Ks(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ps(arguments[0]),t=ks(e),n=function(e){var r=this===void 0?ns:this;r===Hs&&rs(n,ec,e),cs(r,Ls)&&cs(r[Ls],t)&&(r[Ls][t]=!1);var i=ms(1,e);try{ic(r,t,i)}catch(e){if(!(e instanceof Gs))throw e;rc(r,t,i)}};return as&&nc&&ic(Hs,t,{configurable:!0,set:n}),ac(t,e)},Ws=Us[zs],ws(Ws,`toString`,function(){return Vs(this).tag}),ws(Us,`withoutSetter`,function(e){return ac(ks(e),e)}),Cs.f=lc,xs.f=oc,Ss.f=sc,bs.f=uc,_s.f=vs.f=dc,ys.f=fc,js.f=function(e){return ac(As(e),e)},as&&Ts(Ws,`description`,{configurable:!0,get:function(){return Vs(this).description}})),ts({global:!0,constructor:!0,wrap:!0,forced:!os,sham:!os},{Symbol:Us}),Is(gs(tc),function(e){Ms(e)}),ts({target:Rs,stat:!0,forced:!os},{useSetter:function(){nc=!0},useSimple:function(){nc=!1}}),ts({target:`Object`,stat:!0,forced:!os,sham:!as},{create:cc,defineProperty:oc,defineProperties:sc,getOwnPropertyDescriptor:uc}),ts({target:`Object`,stat:!0,forced:!os},{getOwnPropertyNames:dc}),Ns(),Ps(Us,Rs),Os[Ls]=!0;var pc=Be&&!!Symbol.for&&!!Symbol.keyFor,mc=B,hc=I,gc=wt,_c=Ii,vc=_t,yc=pc,bc=vc(`string-to-symbol-registry`),H=vc(`symbol-to-string-registry`);mc({target:`Symbol`,stat:!0,forced:!yc},{for:function(e){var t=_c(e);if(gc(bc,t))return bc[t];var n=hc(`Symbol`)(t);return bc[t]=n,H[n]=t,n}});var xc=B,Sc=wt,Cc=qe,wc=Ye,Tc=_t,Ec=pc,Dc=Tc(`symbol-to-string-registry`);xc({target:`Symbol`,stat:!0,forced:!Ec},{keyFor:function(e){if(!Cc(e))throw TypeError(wc(e)+` is not a symbol`);if(Sc(Dc,e))return Dc[e]}});var Oc=v([].slice),kc=v,Ac=hr,jc=D,Mc=S,Nc=Ii,Pc=kc([].push),Fc=function(e){if(jc(e))return e;if(Ac(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Pc(n,i):(typeof i==`number`||Mc(i)===`Number`||Mc(i)===`String`)&&Pc(n,Nc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(Ac(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Ic=B,Lc=I,Rc=p,zc=A,Bc=v,Vc=s,Hc=D,Uc=qe,Wc=Oc,Gc=Fc,Kc=Be,qc=String,Jc=Lc(`JSON`,`stringify`),Yc=Bc(/./.exec),Xc=Bc(``.charAt),Zc=Bc(``.charCodeAt),Qc=Bc(``.replace),$c=Bc(1 .toString),el=/[\uD800-\uDFFF]/g,tl=/^[\uD800-\uDBFF]$/,nl=/^[\uDC00-\uDFFF]$/,rl=!Kc||Vc(function(){var e=Lc(`Symbol`)(`stringify detection`);return Jc([e])!==`[null]`||Jc({a:e})!==`{}`||Jc(Object(e))!==`{}`}),il=Vc(function(){return Jc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Jc(`\udead`)!==`"\\udead"`}),al=function(e,t){var n=Wc(arguments),r=Gc(t);if(!(!Hc(r)&&(e===void 0||Uc(e))))return n[1]=function(e,t){if(Hc(r)&&(t=zc(r,this,qc(e),t)),!Uc(t))return t},Rc(Jc,null,n)},ol=function(e,t,n){var r=Xc(n,t-1),i=Xc(n,t+1);return Yc(tl,e)&&!Yc(nl,i)||Yc(nl,e)&&!Yc(tl,r)?`\\u`+$c(Zc(e,0),16):e};Jc&&Ic({target:`JSON`,stat:!0,arity:3,forced:rl||il},{stringify:function(e,t,n){var r=Wc(arguments),i=Rc(rl?al:Jc,null,r);return il&&typeof i==`string`?Qc(i,el,ol):i}});var sl=B,cl=Be,ll=s,ul=Za,dl=bt;sl({target:`Object`,stat:!0,forced:!cl||ll(function(){ul.f(1)})},{getOwnPropertySymbols:function(e){var t=ul.f;return t?t(dl(e)):[]}}),so(`asyncIterator`),so(`hasInstance`),so(`isConcatSpreadable`),so(`iterator`),so(`match`),so(`matchAll`),so(`replace`),so(`search`),so(`species`),so(`split`);var fl=so,pl=po;fl(`toPrimitive`),pl();var ml=I,hl=so,gl=Co;hl(`toStringTag`),gl(ml(`Symbol`),`Symbol`),so(`unscopables`),Co(o.JSON,`JSON`,!0);var _l=Se.Symbol,vl={},yl=k,bl=wt,xl=Function.prototype,Sl=yl&&Object.getOwnPropertyDescriptor,Cl=bl(xl,`name`),wl={EXISTS:Cl,PROPER:Cl&&(function(){}).name===`something`,CONFIGURABLE:Cl&&(!yl||yl&&Sl(xl,`name`).configurable)},Tl=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),El=wt,Dl=D,Ol=bt,kl=ha,Al=Tl,jl=kl(`IE_PROTO`),Ml=Object,Nl=Ml.prototype,Pl=Al?Ml.getPrototypeOf:function(e){var t=Ol(e);if(El(t,jl))return t[jl];var n=t.constructor;return Dl(n)&&t instanceof n?n.prototype:t instanceof Ml?Nl:null},Fl=s,Il=D,Ll=P,Rl=Pa,zl=Pl,Bl=$a,Vl=zt(`iterator`),Hl=!1,Ul,Wl,Gl;[].keys&&(Gl=[].keys(),`next`in Gl?(Wl=zl(zl(Gl)),Wl!==Object.prototype&&(Ul=Wl)):Hl=!0),Ul=!Ll(Ul)||Fl(function(){var e={};return Ul[Vl].call(e)!==e})?{}:Rl(Ul),Il(Ul[Vl])||Bl(Ul,Vl,function(){return this});var Kl={IteratorPrototype:Ul,BUGGY_SAFARI_ITERATORS:Hl},ql=Kl.IteratorPrototype,Jl=Pa,Yl=ce,Xl=Co,Zl=vl,Ql=function(){return this},$l=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Jl(ql,{next:Yl(+!r,n)}),Xl(e,i,!1,!0),Zl[i]=Ql,e},eu=v,tu=$e,nu=function(e,t,n){try{return eu(tu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},ru=D,iu=String,au=TypeError,ou=function(e){if(typeof e==`object`||ru(e))return e;throw new au(`Can't set `+iu(e)+` as a prototype`)},su=nu,cu=Fn,lu=ou,uu=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=su(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return cu(t),lu(r),e?n(t,r):t.__proto__=r,t}}():void 0),du=B,fu=A,pu=wl,mu=$l,hu=Pl,gu=Co,_u=$a,vu=zt,yu=vl,bu=Kl,xu=pu.PROPER;pu.CONFIGURABLE,bu.IteratorPrototype;var Su=bu.BUGGY_SAFARI_ITERATORS,Cu=vu(`iterator`),wu=`keys`,Tu=`values`,Eu=`entries`,Du=function(){return this},Ou=function(e,t,n,r,i,a,o){mu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Su&&e&&e in u)return u[e];switch(e){case wu:return function(){return new n(this,e)};case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[Cu]||u[`@@iterator`]||i&&u[i],f=!Su&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=hu(p.call(new e)),m!==Object.prototype&&m.next&&(gu(m,c,!0,!0),yu[c]=Du)),xu&&i===Tu&&d&&d.name!==Tu&&(l=!0,f=function(){return fu(d,this)}),i)if(h={values:s(Tu),keys:a?f:s(wu),entries:s(Eu)},o)for(g in h)(Su||l||!(g in u))&&_u(u,g,h[g]);else du({target:t,proto:!0,forced:Su||l},h);return o&&u[Cu]!==f&&_u(u,Cu,f,{name:i}),yu[t]=f,h},ku=function(e,t){return{value:e,done:t}},Au=be,ju=vl,Mu=Go;An.f;var Nu=Ou,Pu=ku,Fu=`Array Iterator`,Iu=Mu.set,Lu=Mu.getterFor(Fu);Nu(Array,`Array`,function(e,t){Iu(this,{type:Fu,target:Au(e),index:0,kind:t})},function(){var e=Lu(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Pu(void 0,!0);switch(e.kind){case`keys`:return Pu(n,!1);case`values`:return Pu(t[n],!1)}return Pu([n,t[n]],!1)},`values`),ju.Arguments=ju.Array;var Ru={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},zu=o,Bu=Vr,Vu=Jn,Hu=vl,Uu=zt(`toStringTag`);for(var Wu in Ru){var Gu=zu[Wu],Ku=Gu&&Gu.prototype;Ku&&Bu(Ku)!==Uu&&Vu(Ku,Uu,Wu),Hu[Wu]=Hu.Array}var qu=_l,Ju=zt,Yu=An.f,Xu=Ju(`metadata`),Zu=Function.prototype;Zu[Xu]===void 0&&Yu(Zu,Xu,{value:null}),so(`asyncDispose`),so(`dispose`),so(`metadata`);var Qu=qu,$u=I,ed=v,td=$u(`Symbol`),nd=td.keyFor,rd=ed(td.prototype.valueOf),id=td.isRegisteredSymbol||function(e){try{return nd(rd(e))!==void 0}catch{return!1}};B({target:`Symbol`,stat:!0},{isRegisteredSymbol:id});for(var ad=_t,od=I,sd=v,cd=qe,ld=zt,ud=od(`Symbol`),dd=ud.isWellKnownSymbol,fd=od(`Object`,`getOwnPropertyNames`),pd=sd(ud.prototype.valueOf),md=ad(`wks`),hd=0,gd=fd(ud),_d=gd.length;hd<_d;hd++)try{var vd=gd[hd];cd(ud[vd])&&ld(vd)}catch{}var yd=function(e){if(dd&&dd(e))return!0;try{for(var t=pd(e),n=0,r=fd(md),i=r.length;n<i;n++)if(md[r[n]]==t)return!0}catch{}return!1};B({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:yd}),so(`matcher`),so(`observable`),B({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:id}),B({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:yd}),so(`metadataKey`),so(`patternMatch`),so(`replaceAll`);var bd=Qu,xd=r(bd),Sd=v,Cd=yr,wd=Ii,Td=_e,Ed=Sd(``.charAt),Dd=Sd(``.charCodeAt),Od=Sd(``.slice),kd=function(e){return function(t,n){var r=wd(Td(t)),i=Cd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Dd(r,i),o<55296||o>56319||i+1===a||(s=Dd(r,i+1))<56320||s>57343?e?Ed(r,i):o:e?Od(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},Ad={codeAt:kd(!1),charAt:kd(!0)}.charAt,jd=Ii,Md=Go,Nd=Ou,Pd=ku,Fd=`String Iterator`,Id=Md.set,Ld=Md.getterFor(Fd);Nd(String,`String`,function(e){Id(this,{type:Fd,string:jd(e),index:0})},function(){var e=Ld(this),t=e.string,n=e.index,r;return n>=t.length?Pd(void 0,!0):(r=Ad(t,n),e.index+=r.length,Pd(r,!1))});var Rd=no.f(`iterator`),zd=Rd,Bd=r(zd);function Vd(e){"@babel/helpers - typeof";return Vd=typeof xd==`function`&&typeof Bd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof xd==`function`&&e.constructor===xd&&e!==xd.prototype?`symbol`:typeof e},Vd(e)}var Hd=r(no.f(`toPrimitive`));function Ud(e,t){if(Vd(e)!==`object`||e===null)return e;var n=e[Hd];if(n!==void 0){var r=n.call(e,t||`default`);if(Vd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wd(e){var t=Ud(e,`string`);return Vd(t)===`symbol`?t:String(t)}function Gd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),pr(e,Wd(r.key),r)}}function Kd(e,t,n){return t&&Gd(e.prototype,t),n&&Gd(e,n),pr(e,`prototype`,{writable:!1}),e}function qd(e,t,n){return t=Wd(t),t in e?pr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jd=v,Yd=$e,Xd=P,Zd=wt,Qd=Oc,$d=c,ef=Function,tf=Jd([].concat),nf=Jd([].join),rf={},af=function(e,t,n){if(!Zd(rf,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;rf[t]=ef(`C,a`,`return new C(`+nf(r,`,`)+`)`)}return rf[t](e,n)},of=$d?ef.bind:function(e){var t=Yd(this),n=t.prototype,r=Qd(arguments,1),i=function(){var n=tf(r,Qd(arguments));return this instanceof i?af(t,n.length,n):t.apply(e,n)};return Xd(n)&&(i.prototype=n),i},sf=B,cf=of;sf({target:`Function`,proto:!0,forced:Function.bind!==cf},{bind:cf});var lf=o,uf=Se,df=function(e,t){var n=uf[e+`Prototype`],r=n&&n[t];if(r)return r;var i=lf[e],a=i&&i.prototype;return a&&a[t]},ff=df(`Function`,`bind`),pf=Ee,mf=ff,hf=Function.prototype,gf=function(e){var t=e.bind;return e===hf||pf(hf,e)&&t===hf.bind?mf:t},_f=r(gf),vf=$e,yf=bt,bf=pe,xf=Cr,Sf=TypeError,Cf=function(e){return function(t,n,r,i){vf(n);var a=yf(t),o=bf(a),s=xf(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new Sf(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},wf={left:Cf(!1),right:Cf(!0)},U=s,Tf=function(e,t){var n=[][e];return!!n&&U(function(){n.call(null,t||function(){return 1},1)})},Ef=S(o.process)===`process`,Df=B,Of=wf.left,kf=Tf,Af=Ie;Df({target:`Array`,proto:!0,forced:!Ef&&Af>79&&Af<83||!kf(`reduce`)},{reduce:function(e){var t=arguments.length;return Of(this,e,t,t>1?arguments[1]:void 0)}});var jf=df(`Array`,`reduce`),Mf=Ee,Nf=jf,Pf=Array.prototype,Ff=r(function(e){var t=e.reduce;return e===Pf||Mf(Pf,e)&&t===Pf.reduce?Nf:t}),If=B,Lf=es.filter;If({target:`Array`,proto:!0,forced:!vi(`filter`)},{filter:function(e){return Lf(this,e,arguments.length>1?arguments[1]:void 0)}});var Rf=df(`Array`,`filter`),zf=Ee,Bf=Rf,Vf=Array.prototype,Hf=r(function(e){var t=e.filter;return e===Vf||zf(Vf,e)&&t===Vf.filter?Bf:t}),Uf=B,Wf=es.map;Uf({target:`Array`,proto:!0,forced:!vi(`map`)},{map:function(e){return Wf(this,e,arguments.length>1?arguments[1]:void 0)}});var Gf=df(`Array`,`map`),Kf=Ee,qf=Gf,Jf=Array.prototype,Yf=r(function(e){var t=e.map;return e===Jf||Kf(Jf,e)&&t===Jf.map?qf:t}),Xf=hr,Zf=Cr,Qf=Er,$f=kn,ep=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?$f(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Xf(d)?(f=Zf(d),c=ep(e,t,d,f,c,a-1)-1):(Qf(c+1),e[c]=d),c++),l++;return c},tp=ep,np=B,rp=tp,ip=$e,ap=bt,op=Cr,sp=pi;np({target:`Array`,proto:!0},{flatMap:function(e){var t=ap(this),n=op(t),r;return ip(e),r=sp(t,0),r.length=rp(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var cp=df(`Array`,`flatMap`),lp=Ee,up=cp,dp=Array.prototype,fp=r(function(e){var t=e.flatMap;return e===dp||lp(dp,e)&&t===dp.flatMap?up:t});function pp(e){return new hp(e)}var mp=function(){function e(n,r,i){var a,o,s;t(this,e),qd(this,`_listeners`,{add:_f(a=this._add).call(a,this),remove:_f(o=this._remove).call(o,this),update:_f(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return Kd(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return Ff(t=this._transformers).call(t,function(e,t){return t(e)},e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),hp=function(){function e(n){t(this,e),qd(this,`_transformers`,[]),this._source=n}return Kd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Hf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Yf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return fp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new mp(this._source,this._transformers,e)}}]),e}(),gp=A,_p=Fn,vp=nt,yp=function(e,t,n){var r,i;_p(e);try{if(r=vp(e,`return`),!r){if(t===`throw`)throw n;return n}r=gp(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return _p(r),n},bp=Fn,xp=yp,Sp=function(e,t,n,r){try{return r?t(bp(n)[0],n[1]):t(n)}catch(t){xp(e,`throw`,t)}},Cp=zt,wp=vl,Tp=Cp(`iterator`),Ep=Array.prototype,Dp=function(e){return e!==void 0&&(wp.Array===e||Ep[Tp]===e)},Op=Vr,kp=nt,Ap=me,jp=vl,Mp=zt(`iterator`),Np=function(e){if(!Ap(e))return kp(e,Mp)||kp(e,`@@iterator`)||jp[Op(e)]},Pp=A,Fp=$e,Ip=Fn,Lp=Ye,Rp=Np,zp=TypeError,Bp=function(e,t){var n=arguments.length<2?Rp(e):t;if(Fp(n))return Ip(Pp(n,e));throw new zp(Lp(e)+` is not iterable`)},Vp=kn,Hp=A,Up=bt,Wp=Sp,Gp=Dp,Kp=oi,qp=Cr,Jp=Ar,Yp=Bp,Xp=Np,Zp=Array,Qp=function(e){var t=Up(e),n=Kp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Vp(i,r>2?arguments[2]:void 0));var o=Xp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Zp&&Gp(o)))for(d=Yp(t,o),f=d.next,l=n?new this:[];!(u=Hp(f,d)).done;s++)p=a?Wp(d,i,[u.value,s],!0):u.value,Jp(l,s,p);else for(c=qp(t),l=n?new this(c):Zp(c);c>s;s++)p=a?i(t[s],s):t[s],Jp(l,s,p);return l.length=s,l},$p=zt(`iterator`),em=!1;try{var tm=0,nm={next:function(){return{done:!!tm++}},return:function(){em=!0}};nm[$p]=function(){return this},Array.from(nm,function(){throw 2})}catch{}var rm=function(e,t){try{if(!t&&!em)return!1}catch{return!1}var n=!1;try{var r={};r[$p]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},im=B,am=Qp;im({target:`Array`,stat:!0,forced:!rm(function(e){Array.from(e)})},{from:am});var om=Se.Array.from,sm=r(om),cm=Np,lm=r(cm),um=r(cm);B({target:`Array`,stat:!0},{isArray:hr});var dm=Se.Array.isArray,fm=r(dm);function pm(e){if(fm(e))return e}var mm=k,hm=hr,gm=TypeError,_m=Object.getOwnPropertyDescriptor,vm=mm&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(hm(e)&&!_m(e,`length`).writable)throw new gm(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},ym=B,bm=bt,xm=Cr,Sm=vm,Cm=Er;ym({target:`Array`,proto:!0,arity:1,forced:s(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=bm(this),n=xm(t),r=arguments.length;Cm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Sm(t,n),n}});var wm=df(`Array`,`push`),Tm=Ee,Em=wm,Dm=Array.prototype,Om=function(e){var t=e.push;return e===Dm||Tm(Dm,e)&&t===Dm.push?Em:t},km=r(Om);function Am(e,t){var n=e==null?null:xd!==void 0&&lm(e)||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(km(s).call(s,r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}var jm=B,Mm=hr,Nm=oi,Pm=P,Fm=Vi,Im=Cr,Lm=be,Rm=Ar,zm=zt,Bm=vi,Vm=Oc,Hm=Bm(`slice`),Um=zm(`species`),Wm=Array,Gm=Math.max;jm({target:`Array`,proto:!0,forced:!Hm},{slice:function(e,t){var n=Lm(this),r=Im(n),i=Fm(e,r),a=Fm(t===void 0?r:t,r),o,s,c;if(Mm(n)&&(o=n.constructor,Nm(o)&&(o===Wm||Mm(o.prototype))?o=void 0:Pm(o)&&(o=o[Um],o===null&&(o=void 0)),o===Wm||o===void 0))return Vm(n,i,a);for(s=new(o===void 0?Wm:o)(Gm(a-i,0)),c=0;i<a;i++,c++)i in n&&Rm(s,c,n[i]);return s.length=c,s}});var Km=df(`Array`,`slice`),qm=Ee,Jm=Km,Ym=Array.prototype,Xm=function(e){var t=e.slice;return e===Ym||qm(Ym,e)&&t===Ym.slice?Jm:t},Zm=Xm,Qm=r(Zm),$m=r(om);function eh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function th(e,t){var n;if(e){if(typeof e==`string`)return eh(e,t);var r=Qm(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return $m(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eh(e,t)}}function nh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{o as e,t}from"./chunk-CCr-iYLO.js";import{F as n,K as r,M as i,T as a,U as o,V as s,W as c,_ as l,b as u,g as d,p as f,x as p,y as m}from"./useSubAccountSwitcher-iQGqNJhI.js";import{C as h,S as g,n as _,p as v,t as y,v as b}from"./AdminShell-Gq8DU_ig.js";import{t as x}from"./chevron-left-CQ8rcBoO.js";import{n as S,t as ee}from"./maximize-2-BhR-Ec21.js";import{t as C}from"./rotate-ccw-D9qOBLig.js";import{i as te,n as w,r as ne}from"./graph-labels-Bx19ZYvJ.js";import{t as T}from"./useCopyFeedback-DN1WA5vU.js";var E=n(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),D=n(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),O=n(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),k=n(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),re=n(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),ie=n(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),A=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.vis=n.vis||{}))})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||(function(){return this})()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},w=typeof document==`object`&&document.all,ne={all:w,IS_HTMLDDA:w===void 0&&w!==void 0},T=ne,E=T.all,D=T.IS_HTMLDDA?function(e){return typeof e==`function`||e===E}:function(e){return typeof e==`function`},O={},k=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),re=c,ie=Function.prototype.call,A=re?ie.bind(ie):function(){return ie.apply(ie,arguments)},ae={},oe={}.propertyIsEnumerable,se=Object.getOwnPropertyDescriptor;ae.f=se&&!oe.call({1:2},1)?function(e){var t=se(this,e);return!!t&&t.enumerable}:oe;var ce=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},j=v,le=s,ue=S,de=Object,fe=j(``.split),pe=le(function(){return!de(`z`).propertyIsEnumerable(0)})?function(e){return ue(e)===`String`?fe(e,``):de(e)}:de,me=function(e){return e==null},he=me,ge=TypeError,_e=function(e){if(he(e))throw new ge(`Can't call method on `+e);return e},ve=pe,ye=_e,be=function(e){return ve(ye(e))},xe=D,M=ne,N=M.all,P=M.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:xe(e)||e===N}:function(e){return typeof e==`object`?e!==null:xe(e)},Se={},Ce=Se,we=o,Te=D,F=function(e){return Te(e)?e:void 0},I=function(e,t){return arguments.length<2?F(Ce[e])||F(we[e]):Ce[e]&&Ce[e][t]||we[e]&&we[e][t]},Ee=v({}.isPrototypeOf),De=typeof navigator<`u`&&String(navigator.userAgent)||``,Oe=o,ke=De,Ae=Oe.process,je=Oe.Deno,Me=Ae&&Ae.versions||je&&je.version,Ne=Me&&Me.v8,Pe,Fe;Ne&&(Pe=Ne.split(`.`),Fe=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1])),!Fe&&ke&&(Pe=ke.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=ke.match(/Chrome\/(\d+)/),Pe&&(Fe=+Pe[1])));var Ie=Fe,Le=Ie,Re=s,ze=o.String,Be=!!Object.getOwnPropertySymbols&&!Re(function(){var e=Symbol(`symbol detection`);return!ze(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Le&&Le<41}),Ve=Be&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,He=I,Ue=D,We=Ee,Ge=Ve,Ke=Object,qe=Ge?function(e){return typeof e==`symbol`}:function(e){var t=He(`Symbol`);return Ue(t)&&We(t.prototype,Ke(e))},Je=String,Ye=function(e){try{return Je(e)}catch{return`Object`}},Xe=D,Ze=Ye,Qe=TypeError,$e=function(e){if(Xe(e))return e;throw new Qe(Ze(e)+` is not a function`)},et=$e,tt=me,nt=function(e,t){var n=e[t];return tt(n)?void 0:et(n)},rt=A,it=D,at=P,ot=TypeError,L=function(e,t){var n,r;if(t===`string`&&it(n=e.toString)&&!at(r=rt(n,e))||it(n=e.valueOf)&&!at(r=rt(n,e))||t!==`string`&&it(n=e.toString)&&!at(r=rt(n,e)))return r;throw new ot(`Can't convert object to primitive value`)},st={exports:{}},ct=!0,lt=o,ut=Object.defineProperty,dt=function(e,t){try{ut(lt,e,{value:t,configurable:!0,writable:!0})}catch{lt[e]=t}return t},ft=o,pt=dt,mt=`__core-js_shared__`,ht=ft[mt]||pt(mt,{}),gt=ht;(st.exports=function(e,t){return gt[e]||(gt[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var _t=st.exports,vt=_e,yt=Object,bt=function(e){return yt(vt(e))},xt=v,St=bt,Ct=xt({}.hasOwnProperty),wt=Object.hasOwn||function(e,t){return Ct(St(e),t)},Tt=v,Et=0,Dt=Math.random(),Ot=Tt(1 .toString),kt=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+Ot(++Et+Dt,36)},At=o,jt=_t,Mt=wt,Nt=kt,Pt=Be,Ft=Ve,It=At.Symbol,Lt=jt(`wks`),Rt=Ft?It.for||It:It&&It.withoutSetter||Nt,zt=function(e){return Mt(Lt,e)||(Lt[e]=Pt&&Mt(It,e)?It[e]:Rt(`Symbol.`+e)),Lt[e]},Bt=A,Vt=P,Ht=qe,Ut=nt,Wt=L,Gt=zt,Kt=TypeError,qt=Gt(`toPrimitive`),Jt=function(e,t){if(!Vt(e)||Ht(e))return e;var n=Ut(e,qt),r;if(n){if(t===void 0&&(t=`default`),r=Bt(n,e,t),!Vt(r)||Ht(r))return r;throw new Kt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Wt(e,t)},Yt=qe,Xt=function(e){var t=Jt(e,`string`);return Yt(t)?t:t+``},Zt=o,Qt=P,$t=Zt.document,en=Qt($t)&&Qt($t.createElement),tn=function(e){return en?$t.createElement(e):{}},nn=k,rn=s,an=tn,on=!nn&&!rn(function(){return Object.defineProperty(an(`div`),`a`,{get:function(){return 7}}).a!==7}),sn=k,cn=A,ln=ae,un=ce,dn=be,fn=Xt,pn=wt,mn=on,hn=Object.getOwnPropertyDescriptor;O.f=sn?hn:function(e,t){if(e=dn(e),t=fn(t),mn)try{return hn(e,t)}catch{}if(pn(e,t))return un(!cn(ln.f,e,t),e[t])};var gn=s,_n=D,vn=/#|\.prototype\./,yn=function(e,t){var n=xn[bn(e)];return n===Cn?!0:n===Sn?!1:_n(t)?gn(t):!!t},bn=yn.normalize=function(e){return String(e).replace(vn,`.`).toLowerCase()},xn=yn.data={},Sn=yn.NATIVE=`N`,Cn=yn.POLYFILL=`P`,wn=yn,Tn=te,En=$e,Dn=c,On=Tn(Tn.bind),kn=function(e,t){return En(e),t===void 0?e:Dn?On(e,t):function(){return e.apply(t,arguments)}},An={},jn=k&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Mn=P,Nn=String,Pn=TypeError,Fn=function(e){if(Mn(e))return e;throw new Pn(Nn(e)+` is not an object`)},In=k,Ln=on,Rn=jn,zn=Fn,Bn=Xt,Vn=TypeError,Hn=Object.defineProperty,Un=Object.getOwnPropertyDescriptor,Wn=`enumerable`,R=`configurable`,z=`writable`;An.f=In?Rn?function(e,t,n){if(zn(e),t=Bn(t),zn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&z in n&&!n[z]){var r=Un(e,t);r&&r[z]&&(e[t]=n.value,n={configurable:R in n?n[R]:r[R],enumerable:Wn in n?n[Wn]:r[Wn],writable:!1})}return Hn(e,t,n)}:Hn:function(e,t,n){if(zn(e),t=Bn(t),zn(n),Ln)try{return Hn(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Vn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Gn=k,Kn=An,qn=ce,Jn=Gn?function(e,t,n){return Kn.f(e,t,qn(1,n))}:function(e,t,n){return e[t]=n,e},Yn=o,Xn=p,Zn=te,Qn=D,$n=O.f,er=wn,tr=Se,nr=kn,rr=Jn,ir=wt,ar=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Xn(e,this,arguments)};return t.prototype=e.prototype,t},B=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Yn:i?Yn[n]:(Yn[n]||{}).prototype,s=r?tr:tr[n]||rr(tr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=er(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ir(o,f),m=s[f],u&&(e.dontCallGetSet?(_=$n(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?nr(p,Yn):e.wrap&&u?ar(p):a&&Qn(p)?Zn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&rr(g,`sham`,!0),rr(s,f,g),a&&(d=n+`Prototype`,ir(tr,d)||rr(tr,d,{}),rr(tr[d],f,p),e.real&&c&&(l||!c[f])&&rr(c,f,p)))},or=B,sr=k,cr=An.f;or({target:`Object`,stat:!0,forced:Object.defineProperty!==cr,sham:!sr},{defineProperty:cr});var lr=Se.Object,ur=i.exports=function(e,t,n){return lr.defineProperty(e,t,n)};lr.defineProperty.sham&&(ur.sham=!0);var dr=i.exports,fr=dr,pr=r(fr),mr=S,hr=Array.isArray||function(e){return mr(e)===`Array`},gr=Math.ceil,_r=Math.floor,vr=Math.trunc||function(e){var t=+e;return(t>0?_r:gr)(t)},yr=function(e){var t=+e;return t!==t||t===0?0:vr(t)},br=yr,xr=Math.min,Sr=function(e){return e>0?xr(br(e),9007199254740991):0},Cr=function(e){return Sr(e.length)},wr=TypeError,Tr=9007199254740991,Er=function(e){if(e>Tr)throw wr(`Maximum allowed index exceeded`);return e},Dr=Xt,Or=An,kr=ce,Ar=function(e,t,n){var r=Dr(t);r in e?Or.f(e,r,kr(0,n)):e[r]=n},jr=zt(`toStringTag`),Mr={};Mr[jr]=`z`;var Nr=String(Mr)===`[object z]`,Pr=Nr,Fr=D,Ir=S,Lr=zt(`toStringTag`),Rr=Object,zr=Ir(function(){return arguments}())===`Arguments`,Br=function(e,t){try{return e[t]}catch{}},Vr=Pr?Ir:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Br(t=Rr(e),Lr))==`string`?n:zr?Ir(t):(r=Ir(t))===`Object`&&Fr(t.callee)?`Arguments`:r},Hr=v,Ur=D,Wr=ht,Gr=Hr(Function.toString);Ur(Wr.inspectSource)||(Wr.inspectSource=function(e){return Gr(e)});var Kr=Wr.inspectSource,qr=v,Jr=s,Yr=D,Xr=Vr,Zr=I,V=Kr,Qr=function(){},$r=[],ei=Zr(`Reflect`,`construct`),ti=/^\s*(?:class|function)\b/,ni=qr(ti.exec),ri=!ti.test(Qr),ii=function(e){if(!Yr(e))return!1;try{return ei(Qr,$r,e),!0}catch{return!1}},ai=function(e){if(!Yr(e))return!1;switch(Xr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ri||!!ni(ti,V(e))}catch{return!0}};ai.sham=!0;var oi=!ei||Jr(function(){var e;return ii(ii.call)||!ii(Object)||!ii(function(){e=!0})||e})?ai:ii,si=hr,ci=oi,li=P,ui=zt(`species`),di=Array,fi=function(e){var t;return si(e)&&(t=e.constructor,ci(t)&&(t===di||si(t.prototype))?t=void 0:li(t)&&(t=t[ui],t===null&&(t=void 0))),t===void 0?di:t},pi=function(e,t){return new(fi(e))(t===0?0:t)},mi=s,hi=zt,gi=Ie,_i=hi(`species`),vi=function(e){return gi>=51||!mi(function(){var t=[],n=t.constructor={};return n[_i]=function(){return{foo:1}},t[e](Boolean).foo!==1})},yi=B,bi=s,xi=hr,Si=P,Ci=bt,wi=Cr,Ti=Er,Ei=Ar,Di=pi,Oi=vi,ki=zt,Ai=Ie,ji=ki(`isConcatSpreadable`),Mi=Ai>=51||!bi(function(){var e=[];return e[ji]=!1,e.concat()[0]!==e}),Ni=function(e){if(!Si(e))return!1;var t=e[ji];return t===void 0?xi(e):!!t};yi({target:`Array`,proto:!0,arity:1,forced:!Mi||!Oi(`concat`)},{concat:function(e){var t=Ci(this),n=Di(t,0),r=0,i,a,o,s,c;for(i=-1,o=arguments.length;i<o;i++)if(c=i===-1?t:arguments[i],Ni(c))for(s=wi(c),Ti(r+s),a=0;a<s;a++,r++)a in c&&Ei(n,r,c[a]);else Ti(r+1),Ei(n,r++,c);return n.length=r,n}});var Pi=Vr,Fi=String,Ii=function(e){if(Pi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Fi(e)},Li={},Ri=yr,zi=Math.max,Bi=Math.min,Vi=function(e,t){var n=Ri(e);return n<0?zi(n+t,0):Bi(n,t)},Hi=be,Ui=Vi,Wi=Cr,Gi=function(e){return function(t,n,r){var i=Hi(t),a=Wi(i),o=Ui(r,a),s;if(e&&n!==n){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},Ki={includes:Gi(!0),indexOf:Gi(!1)},qi={},Ji=v,Yi=wt,Xi=be,Zi=Ki.indexOf,Qi=qi,$i=Ji([].push),ea=function(e,t){var n=Xi(e),r=0,i=[],a;for(a in n)!Yi(Qi,a)&&Yi(n,a)&&$i(i,a);for(;t.length>r;)Yi(n,a=t[r++])&&(~Zi(i,a)||$i(i,a));return i},ta=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],na=ea,ra=ta,ia=Object.keys||function(e){return na(e,ra)},aa=k,oa=jn,sa=An,ca=Fn,la=be,ua=ia;Li.f=aa&&!oa?Object.defineProperties:function(e,t){ca(e);for(var n=la(t),r=ua(t),i=r.length,a=0,o;i>a;)sa.f(e,o=r[a++],n[o]);return e};var da=I(`document`,`documentElement`),fa=_t,pa=kt,ma=fa(`keys`),ha=function(e){return ma[e]||(ma[e]=pa(e))},ga=Fn,_a=Li,va=ta,ya=qi,ba=da,xa=tn,Sa=ha,Ca=`>`,wa=`<`,Ta=`prototype`,Ea=`script`,Da=Sa(`IE_PROTO`),Oa=function(){},ka=function(e){return wa+Ea+Ca+e+wa+`/`+Ea+Ca},Aa=function(e){e.write(ka(``)),e.close();var t=e.parentWindow.Object;return e=null,t},ja=function(){var e=xa(`iframe`),t=`java`+Ea+`:`,n;return e.style.display=`none`,ba.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(ka(`document.F=Object`)),n.close(),n.F},Ma,Na=function(){try{Ma=new ActiveXObject(`htmlfile`)}catch{}Na=typeof document<`u`?document.domain&&Ma?Aa(Ma):ja():Aa(Ma);for(var e=va.length;e--;)delete Na[Ta][va[e]];return Na()};ya[Da]=!0;var Pa=Object.create||function(e,t){var n;return e===null?n=Na():(Oa[Ta]=ga(e),n=new Oa,Oa[Ta]=null,n[Da]=e),t===void 0?n:_a.f(n,t)},Fa={},Ia=ea,La=ta.concat(`length`,`prototype`);Fa.f=Object.getOwnPropertyNames||function(e){return Ia(e,La)};var Ra={},za=Vi,Ba=Cr,Va=Ar,Ha=Array,Ua=Math.max,Wa=function(e,t,n){for(var r=Ba(e),i=za(t,r),a=za(n===void 0?r:n,r),o=Ha(Ua(a-i,0)),s=0;i<a;i++,s++)Va(o,s,e[i]);return o.length=s,o},Ga=S,Ka=be,qa=Fa.f,Ja=Wa,Ya=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Xa=function(e){try{return qa(e)}catch{return Ja(Ya)}};Ra.f=function(e){return Ya&&Ga(e)===`Window`?Xa(e):qa(Ka(e))};var Za={};Za.f=Object.getOwnPropertySymbols;var Qa=Jn,$a=function(e,t,n,r){return r&&r.enumerable?e[t]=n:Qa(e,t,n),e},eo=An,to=function(e,t,n){return eo.f(e,t,n)},no={};no.f=zt;var ro=Se,io=wt,ao=no,oo=An.f,so=function(e){var t=ro.Symbol||={};io(t,e)||oo(t,e,{value:ao.f(e)})},co=A,lo=I,uo=zt,fo=$a,po=function(){var e=lo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=uo(`toPrimitive`);t&&!t[r]&&fo(t,r,function(e){return co(n,this)},{arity:1})},mo=Nr,ho=Vr,go=mo?{}.toString:function(){return`[object `+ho(this)+`]`},_o=Nr,vo=An.f,yo=Jn,bo=wt,xo=go,So=zt(`toStringTag`),Co=function(e,t,n,r){if(e){var i=n?e:e.prototype;bo(i,So)||vo(i,So,{configurable:!0,value:t}),r&&!_o&&yo(i,`toString`,xo)}},wo=o,To=D,Eo=wo.WeakMap,Do=To(Eo)&&/native code/.test(String(Eo)),Oo=o,ko=P,Ao=Jn,jo=wt,Mo=ht,No=ha,Po=qi,Fo=`Object already initialized`,Io=Oo.TypeError,Lo=Oo.WeakMap,Ro,zo,Bo,Vo=function(e){return Bo(e)?zo(e):Ro(e,{})},Ho=function(e){return function(t){var n;if(!ko(t)||(n=zo(t)).type!==e)throw new Io(`Incompatible receiver, `+e+` required`);return n}};if(Do||Mo.state){var Uo=Mo.state||=new Lo;Uo.get=Uo.get,Uo.has=Uo.has,Uo.set=Uo.set,Ro=function(e,t){if(Uo.has(e))throw new Io(Fo);return t.facade=e,Uo.set(e,t),t},zo=function(e){return Uo.get(e)||{}},Bo=function(e){return Uo.has(e)}}else{var Wo=No(`state`);Po[Wo]=!0,Ro=function(e,t){if(jo(e,Wo))throw new Io(Fo);return t.facade=e,Ao(e,Wo,t),t},zo=function(e){return jo(e,Wo)?e[Wo]:{}},Bo=function(e){return jo(e,Wo)}}var Go={set:Ro,get:zo,has:Bo,enforce:Vo,getterFor:Ho},Ko=kn,qo=v,Jo=pe,Yo=bt,Xo=Cr,Zo=pi,Qo=qo([].push),$o=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f=Yo(c),p=Jo(f),m=Ko(l,u),h=Xo(p),g=0,_=d||Zo,v=t?_(c,h):n||o?_(c,0):void 0,y,b;h>g;g++)if((s||g in p)&&(y=p[g],b=m(y,g,f),e))if(t)v[g]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return g;case 2:Qo(v,y)}else switch(e){case 4:return!1;case 7:Qo(v,y)}return a?-1:r||i?i:v}},es={forEach:$o(0),map:$o(1),filter:$o(2),some:$o(3),every:$o(4),find:$o(5),findIndex:$o(6),filterReject:$o(7)},ts=B,ns=o,rs=A,is=v,as=k,os=Be,ss=s,cs=wt,ls=Ee,us=Fn,ds=be,fs=Xt,ps=Ii,ms=ce,hs=Pa,gs=ia,_s=Fa,vs=Ra,ys=Za,bs=O,xs=An,Ss=Li,Cs=ae,ws=$a,Ts=to,Es=_t,Ds=ha,Os=qi,ks=kt,As=zt,js=no,Ms=so,Ns=po,Ps=Co,Fs=Go,Is=es.forEach,Ls=Ds(`hidden`),Rs=`Symbol`,zs=`prototype`,Bs=Fs.set,Vs=Fs.getterFor(Rs),Hs=Object[zs],Us=ns.Symbol,Ws=Us&&Us[zs],Gs=ns.RangeError,Ks=ns.TypeError,qs=ns.QObject,Js=bs.f,Ys=xs.f,Xs=vs.f,Zs=Cs.f,Qs=is([].push),$s=Es(`symbols`),ec=Es(`op-symbols`),tc=Es(`wks`),nc=!qs||!qs[zs]||!qs[zs].findChild,rc=function(e,t,n){var r=Js(Hs,t);r&&delete Hs[t],Ys(e,t,n),r&&e!==Hs&&Ys(Hs,t,r)},ic=as&&ss(function(){return hs(Ys({},`a`,{get:function(){return Ys(this,`a`,{value:7}).a}})).a!==7})?rc:Ys,ac=function(e,t){var n=$s[e]=hs(Ws);return Bs(n,{type:Rs,tag:e,description:t}),as||(n.description=t),n},oc=function(e,t,n){e===Hs&&oc(ec,t,n),us(e);var r=fs(t);return us(n),cs($s,r)?(n.enumerable?(cs(e,Ls)&&e[Ls][r]&&(e[Ls][r]=!1),n=hs(n,{enumerable:ms(0,!1)})):(cs(e,Ls)||Ys(e,Ls,ms(1,{})),e[Ls][r]=!0),ic(e,r,n)):Ys(e,r,n)},sc=function(e,t){us(e);var n=ds(t);return Is(gs(n).concat(fc(n)),function(t){(!as||rs(lc,n,t))&&oc(e,t,n[t])}),e},cc=function(e,t){return t===void 0?hs(e):sc(hs(e),t)},lc=function(e){var t=fs(e),n=rs(Zs,this,t);return this===Hs&&cs($s,t)&&!cs(ec,t)?!1:n||!cs(this,t)||!cs($s,t)||cs(this,Ls)&&this[Ls][t]?n:!0},uc=function(e,t){var n=ds(e),r=fs(t);if(!(n===Hs&&cs($s,r)&&!cs(ec,r))){var i=Js(n,r);return i&&cs($s,r)&&!(cs(n,Ls)&&n[Ls][r])&&(i.enumerable=!0),i}},dc=function(e){var t=Xs(ds(e)),n=[];return Is(t,function(e){!cs($s,e)&&!cs(Os,e)&&Qs(n,e)}),n},fc=function(e){var t=e===Hs,n=Xs(t?ec:ds(e)),r=[];return Is(n,function(e){cs($s,e)&&(!t||cs(Hs,e))&&Qs(r,$s[e])}),r};os||(Us=function(){if(ls(Ws,this))throw new Ks(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ps(arguments[0]),t=ks(e),n=function(e){var r=this===void 0?ns:this;r===Hs&&rs(n,ec,e),cs(r,Ls)&&cs(r[Ls],t)&&(r[Ls][t]=!1);var i=ms(1,e);try{ic(r,t,i)}catch(e){if(!(e instanceof Gs))throw e;rc(r,t,i)}};return as&&nc&&ic(Hs,t,{configurable:!0,set:n}),ac(t,e)},Ws=Us[zs],ws(Ws,`toString`,function(){return Vs(this).tag}),ws(Us,`withoutSetter`,function(e){return ac(ks(e),e)}),Cs.f=lc,xs.f=oc,Ss.f=sc,bs.f=uc,_s.f=vs.f=dc,ys.f=fc,js.f=function(e){return ac(As(e),e)},as&&Ts(Ws,`description`,{configurable:!0,get:function(){return Vs(this).description}})),ts({global:!0,constructor:!0,wrap:!0,forced:!os,sham:!os},{Symbol:Us}),Is(gs(tc),function(e){Ms(e)}),ts({target:Rs,stat:!0,forced:!os},{useSetter:function(){nc=!0},useSimple:function(){nc=!1}}),ts({target:`Object`,stat:!0,forced:!os,sham:!as},{create:cc,defineProperty:oc,defineProperties:sc,getOwnPropertyDescriptor:uc}),ts({target:`Object`,stat:!0,forced:!os},{getOwnPropertyNames:dc}),Ns(),Ps(Us,Rs),Os[Ls]=!0;var pc=Be&&!!Symbol.for&&!!Symbol.keyFor,mc=B,hc=I,gc=wt,_c=Ii,vc=_t,yc=pc,bc=vc(`string-to-symbol-registry`),H=vc(`symbol-to-string-registry`);mc({target:`Symbol`,stat:!0,forced:!yc},{for:function(e){var t=_c(e);if(gc(bc,t))return bc[t];var n=hc(`Symbol`)(t);return bc[t]=n,H[n]=t,n}});var xc=B,Sc=wt,Cc=qe,wc=Ye,Tc=_t,Ec=pc,Dc=Tc(`symbol-to-string-registry`);xc({target:`Symbol`,stat:!0,forced:!Ec},{keyFor:function(e){if(!Cc(e))throw TypeError(wc(e)+` is not a symbol`);if(Sc(Dc,e))return Dc[e]}});var Oc=v([].slice),kc=v,Ac=hr,jc=D,Mc=S,Nc=Ii,Pc=kc([].push),Fc=function(e){if(jc(e))return e;if(Ac(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Pc(n,i):(typeof i==`number`||Mc(i)===`Number`||Mc(i)===`String`)&&Pc(n,Nc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(Ac(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Ic=B,Lc=I,Rc=p,zc=A,Bc=v,Vc=s,Hc=D,Uc=qe,Wc=Oc,Gc=Fc,Kc=Be,qc=String,Jc=Lc(`JSON`,`stringify`),Yc=Bc(/./.exec),Xc=Bc(``.charAt),Zc=Bc(``.charCodeAt),Qc=Bc(``.replace),$c=Bc(1 .toString),el=/[\uD800-\uDFFF]/g,tl=/^[\uD800-\uDBFF]$/,nl=/^[\uDC00-\uDFFF]$/,rl=!Kc||Vc(function(){var e=Lc(`Symbol`)(`stringify detection`);return Jc([e])!==`[null]`||Jc({a:e})!==`{}`||Jc(Object(e))!==`{}`}),il=Vc(function(){return Jc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Jc(`\udead`)!==`"\\udead"`}),al=function(e,t){var n=Wc(arguments),r=Gc(t);if(!(!Hc(r)&&(e===void 0||Uc(e))))return n[1]=function(e,t){if(Hc(r)&&(t=zc(r,this,qc(e),t)),!Uc(t))return t},Rc(Jc,null,n)},ol=function(e,t,n){var r=Xc(n,t-1),i=Xc(n,t+1);return Yc(tl,e)&&!Yc(nl,i)||Yc(nl,e)&&!Yc(tl,r)?`\\u`+$c(Zc(e,0),16):e};Jc&&Ic({target:`JSON`,stat:!0,arity:3,forced:rl||il},{stringify:function(e,t,n){var r=Wc(arguments),i=Rc(rl?al:Jc,null,r);return il&&typeof i==`string`?Qc(i,el,ol):i}});var sl=B,cl=Be,ll=s,ul=Za,dl=bt;sl({target:`Object`,stat:!0,forced:!cl||ll(function(){ul.f(1)})},{getOwnPropertySymbols:function(e){var t=ul.f;return t?t(dl(e)):[]}}),so(`asyncIterator`),so(`hasInstance`),so(`isConcatSpreadable`),so(`iterator`),so(`match`),so(`matchAll`),so(`replace`),so(`search`),so(`species`),so(`split`);var fl=so,pl=po;fl(`toPrimitive`),pl();var ml=I,hl=so,gl=Co;hl(`toStringTag`),gl(ml(`Symbol`),`Symbol`),so(`unscopables`),Co(o.JSON,`JSON`,!0);var _l=Se.Symbol,vl={},yl=k,bl=wt,xl=Function.prototype,Sl=yl&&Object.getOwnPropertyDescriptor,Cl=bl(xl,`name`),wl={EXISTS:Cl,PROPER:Cl&&(function(){}).name===`something`,CONFIGURABLE:Cl&&(!yl||yl&&Sl(xl,`name`).configurable)},Tl=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),El=wt,Dl=D,Ol=bt,kl=ha,Al=Tl,jl=kl(`IE_PROTO`),Ml=Object,Nl=Ml.prototype,Pl=Al?Ml.getPrototypeOf:function(e){var t=Ol(e);if(El(t,jl))return t[jl];var n=t.constructor;return Dl(n)&&t instanceof n?n.prototype:t instanceof Ml?Nl:null},Fl=s,Il=D,Ll=P,Rl=Pa,zl=Pl,Bl=$a,Vl=zt(`iterator`),Hl=!1,Ul,Wl,Gl;[].keys&&(Gl=[].keys(),`next`in Gl?(Wl=zl(zl(Gl)),Wl!==Object.prototype&&(Ul=Wl)):Hl=!0),Ul=!Ll(Ul)||Fl(function(){var e={};return Ul[Vl].call(e)!==e})?{}:Rl(Ul),Il(Ul[Vl])||Bl(Ul,Vl,function(){return this});var Kl={IteratorPrototype:Ul,BUGGY_SAFARI_ITERATORS:Hl},ql=Kl.IteratorPrototype,Jl=Pa,Yl=ce,Xl=Co,Zl=vl,Ql=function(){return this},$l=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Jl(ql,{next:Yl(+!r,n)}),Xl(e,i,!1,!0),Zl[i]=Ql,e},eu=v,tu=$e,nu=function(e,t,n){try{return eu(tu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},ru=D,iu=String,au=TypeError,ou=function(e){if(typeof e==`object`||ru(e))return e;throw new au(`Can't set `+iu(e)+` as a prototype`)},su=nu,cu=Fn,lu=ou,uu=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=su(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return cu(t),lu(r),e?n(t,r):t.__proto__=r,t}}():void 0),du=B,fu=A,pu=wl,mu=$l,hu=Pl,gu=Co,_u=$a,vu=zt,yu=vl,bu=Kl,xu=pu.PROPER;pu.CONFIGURABLE,bu.IteratorPrototype;var Su=bu.BUGGY_SAFARI_ITERATORS,Cu=vu(`iterator`),wu=`keys`,Tu=`values`,Eu=`entries`,Du=function(){return this},Ou=function(e,t,n,r,i,a,o){mu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Su&&e&&e in u)return u[e];switch(e){case wu:return function(){return new n(this,e)};case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[Cu]||u[`@@iterator`]||i&&u[i],f=!Su&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=hu(p.call(new e)),m!==Object.prototype&&m.next&&(gu(m,c,!0,!0),yu[c]=Du)),xu&&i===Tu&&d&&d.name!==Tu&&(l=!0,f=function(){return fu(d,this)}),i)if(h={values:s(Tu),keys:a?f:s(wu),entries:s(Eu)},o)for(g in h)(Su||l||!(g in u))&&_u(u,g,h[g]);else du({target:t,proto:!0,forced:Su||l},h);return o&&u[Cu]!==f&&_u(u,Cu,f,{name:i}),yu[t]=f,h},ku=function(e,t){return{value:e,done:t}},Au=be,ju=vl,Mu=Go;An.f;var Nu=Ou,Pu=ku,Fu=`Array Iterator`,Iu=Mu.set,Lu=Mu.getterFor(Fu);Nu(Array,`Array`,function(e,t){Iu(this,{type:Fu,target:Au(e),index:0,kind:t})},function(){var e=Lu(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Pu(void 0,!0);switch(e.kind){case`keys`:return Pu(n,!1);case`values`:return Pu(t[n],!1)}return Pu([n,t[n]],!1)},`values`),ju.Arguments=ju.Array;var Ru={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},zu=o,Bu=Vr,Vu=Jn,Hu=vl,Uu=zt(`toStringTag`);for(var Wu in Ru){var Gu=zu[Wu],Ku=Gu&&Gu.prototype;Ku&&Bu(Ku)!==Uu&&Vu(Ku,Uu,Wu),Hu[Wu]=Hu.Array}var qu=_l,Ju=zt,Yu=An.f,Xu=Ju(`metadata`),Zu=Function.prototype;Zu[Xu]===void 0&&Yu(Zu,Xu,{value:null}),so(`asyncDispose`),so(`dispose`),so(`metadata`);var Qu=qu,$u=I,ed=v,td=$u(`Symbol`),nd=td.keyFor,rd=ed(td.prototype.valueOf),id=td.isRegisteredSymbol||function(e){try{return nd(rd(e))!==void 0}catch{return!1}};B({target:`Symbol`,stat:!0},{isRegisteredSymbol:id});for(var ad=_t,od=I,sd=v,cd=qe,ld=zt,ud=od(`Symbol`),dd=ud.isWellKnownSymbol,fd=od(`Object`,`getOwnPropertyNames`),pd=sd(ud.prototype.valueOf),md=ad(`wks`),hd=0,gd=fd(ud),_d=gd.length;hd<_d;hd++)try{var vd=gd[hd];cd(ud[vd])&&ld(vd)}catch{}var yd=function(e){if(dd&&dd(e))return!0;try{for(var t=pd(e),n=0,r=fd(md),i=r.length;n<i;n++)if(md[r[n]]==t)return!0}catch{}return!1};B({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:yd}),so(`matcher`),so(`observable`),B({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:id}),B({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:yd}),so(`metadataKey`),so(`patternMatch`),so(`replaceAll`);var bd=Qu,xd=r(bd),Sd=v,Cd=yr,wd=Ii,Td=_e,Ed=Sd(``.charAt),Dd=Sd(``.charCodeAt),Od=Sd(``.slice),kd=function(e){return function(t,n){var r=wd(Td(t)),i=Cd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Dd(r,i),o<55296||o>56319||i+1===a||(s=Dd(r,i+1))<56320||s>57343?e?Ed(r,i):o:e?Od(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},Ad={codeAt:kd(!1),charAt:kd(!0)}.charAt,jd=Ii,Md=Go,Nd=Ou,Pd=ku,Fd=`String Iterator`,Id=Md.set,Ld=Md.getterFor(Fd);Nd(String,`String`,function(e){Id(this,{type:Fd,string:jd(e),index:0})},function(){var e=Ld(this),t=e.string,n=e.index,r;return n>=t.length?Pd(void 0,!0):(r=Ad(t,n),e.index+=r.length,Pd(r,!1))});var Rd=no.f(`iterator`),zd=Rd,Bd=r(zd);function Vd(e){"@babel/helpers - typeof";return Vd=typeof xd==`function`&&typeof Bd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof xd==`function`&&e.constructor===xd&&e!==xd.prototype?`symbol`:typeof e},Vd(e)}var Hd=r(no.f(`toPrimitive`));function Ud(e,t){if(Vd(e)!==`object`||e===null)return e;var n=e[Hd];if(n!==void 0){var r=n.call(e,t||`default`);if(Vd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wd(e){var t=Ud(e,`string`);return Vd(t)===`symbol`?t:String(t)}function Gd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),pr(e,Wd(r.key),r)}}function Kd(e,t,n){return t&&Gd(e.prototype,t),n&&Gd(e,n),pr(e,`prototype`,{writable:!1}),e}function qd(e,t,n){return t=Wd(t),t in e?pr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jd=v,Yd=$e,Xd=P,Zd=wt,Qd=Oc,$d=c,ef=Function,tf=Jd([].concat),nf=Jd([].join),rf={},af=function(e,t,n){if(!Zd(rf,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;rf[t]=ef(`C,a`,`return new C(`+nf(r,`,`)+`)`)}return rf[t](e,n)},of=$d?ef.bind:function(e){var t=Yd(this),n=t.prototype,r=Qd(arguments,1),i=function(){var n=tf(r,Qd(arguments));return this instanceof i?af(t,n.length,n):t.apply(e,n)};return Xd(n)&&(i.prototype=n),i},sf=B,cf=of;sf({target:`Function`,proto:!0,forced:Function.bind!==cf},{bind:cf});var lf=o,uf=Se,df=function(e,t){var n=uf[e+`Prototype`],r=n&&n[t];if(r)return r;var i=lf[e],a=i&&i.prototype;return a&&a[t]},ff=df(`Function`,`bind`),pf=Ee,mf=ff,hf=Function.prototype,gf=function(e){var t=e.bind;return e===hf||pf(hf,e)&&t===hf.bind?mf:t},_f=r(gf),vf=$e,yf=bt,bf=pe,xf=Cr,Sf=TypeError,Cf=function(e){return function(t,n,r,i){vf(n);var a=yf(t),o=bf(a),s=xf(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new Sf(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},wf={left:Cf(!1),right:Cf(!0)},U=s,Tf=function(e,t){var n=[][e];return!!n&&U(function(){n.call(null,t||function(){return 1},1)})},Ef=S(o.process)===`process`,Df=B,Of=wf.left,kf=Tf,Af=Ie;Df({target:`Array`,proto:!0,forced:!Ef&&Af>79&&Af<83||!kf(`reduce`)},{reduce:function(e){var t=arguments.length;return Of(this,e,t,t>1?arguments[1]:void 0)}});var jf=df(`Array`,`reduce`),Mf=Ee,Nf=jf,Pf=Array.prototype,Ff=r(function(e){var t=e.reduce;return e===Pf||Mf(Pf,e)&&t===Pf.reduce?Nf:t}),If=B,Lf=es.filter;If({target:`Array`,proto:!0,forced:!vi(`filter`)},{filter:function(e){return Lf(this,e,arguments.length>1?arguments[1]:void 0)}});var Rf=df(`Array`,`filter`),zf=Ee,Bf=Rf,Vf=Array.prototype,Hf=r(function(e){var t=e.filter;return e===Vf||zf(Vf,e)&&t===Vf.filter?Bf:t}),Uf=B,Wf=es.map;Uf({target:`Array`,proto:!0,forced:!vi(`map`)},{map:function(e){return Wf(this,e,arguments.length>1?arguments[1]:void 0)}});var Gf=df(`Array`,`map`),Kf=Ee,qf=Gf,Jf=Array.prototype,Yf=r(function(e){var t=e.map;return e===Jf||Kf(Jf,e)&&t===Jf.map?qf:t}),Xf=hr,Zf=Cr,Qf=Er,$f=kn,ep=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?$f(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Xf(d)?(f=Zf(d),c=ep(e,t,d,f,c,a-1)-1):(Qf(c+1),e[c]=d),c++),l++;return c},tp=ep,np=B,rp=tp,ip=$e,ap=bt,op=Cr,sp=pi;np({target:`Array`,proto:!0},{flatMap:function(e){var t=ap(this),n=op(t),r;return ip(e),r=sp(t,0),r.length=rp(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var cp=df(`Array`,`flatMap`),lp=Ee,up=cp,dp=Array.prototype,fp=r(function(e){var t=e.flatMap;return e===dp||lp(dp,e)&&t===dp.flatMap?up:t});function pp(e){return new hp(e)}var mp=function(){function e(n,r,i){var a,o,s;t(this,e),qd(this,`_listeners`,{add:_f(a=this._add).call(a,this),remove:_f(o=this._remove).call(o,this),update:_f(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return Kd(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return Ff(t=this._transformers).call(t,function(e,t){return t(e)},e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),hp=function(){function e(n){t(this,e),qd(this,`_transformers`,[]),this._source=n}return Kd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Hf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Yf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return fp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new mp(this._source,this._transformers,e)}}]),e}(),gp=A,_p=Fn,vp=nt,yp=function(e,t,n){var r,i;_p(e);try{if(r=vp(e,`return`),!r){if(t===`throw`)throw n;return n}r=gp(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return _p(r),n},bp=Fn,xp=yp,Sp=function(e,t,n,r){try{return r?t(bp(n)[0],n[1]):t(n)}catch(t){xp(e,`throw`,t)}},Cp=zt,wp=vl,Tp=Cp(`iterator`),Ep=Array.prototype,Dp=function(e){return e!==void 0&&(wp.Array===e||Ep[Tp]===e)},Op=Vr,kp=nt,Ap=me,jp=vl,Mp=zt(`iterator`),Np=function(e){if(!Ap(e))return kp(e,Mp)||kp(e,`@@iterator`)||jp[Op(e)]},Pp=A,Fp=$e,Ip=Fn,Lp=Ye,Rp=Np,zp=TypeError,Bp=function(e,t){var n=arguments.length<2?Rp(e):t;if(Fp(n))return Ip(Pp(n,e));throw new zp(Lp(e)+` is not iterable`)},Vp=kn,Hp=A,Up=bt,Wp=Sp,Gp=Dp,Kp=oi,qp=Cr,Jp=Ar,Yp=Bp,Xp=Np,Zp=Array,Qp=function(e){var t=Up(e),n=Kp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Vp(i,r>2?arguments[2]:void 0));var o=Xp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Zp&&Gp(o)))for(d=Yp(t,o),f=d.next,l=n?new this:[];!(u=Hp(f,d)).done;s++)p=a?Wp(d,i,[u.value,s],!0):u.value,Jp(l,s,p);else for(c=qp(t),l=n?new this(c):Zp(c);c>s;s++)p=a?i(t[s],s):t[s],Jp(l,s,p);return l.length=s,l},$p=zt(`iterator`),em=!1;try{var tm=0,nm={next:function(){return{done:!!tm++}},return:function(){em=!0}};nm[$p]=function(){return this},Array.from(nm,function(){throw 2})}catch{}var rm=function(e,t){try{if(!t&&!em)return!1}catch{return!1}var n=!1;try{var r={};r[$p]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},im=B,am=Qp;im({target:`Array`,stat:!0,forced:!rm(function(e){Array.from(e)})},{from:am});var om=Se.Array.from,sm=r(om),cm=Np,lm=r(cm),um=r(cm);B({target:`Array`,stat:!0},{isArray:hr});var dm=Se.Array.isArray,fm=r(dm);function pm(e){if(fm(e))return e}var mm=k,hm=hr,gm=TypeError,_m=Object.getOwnPropertyDescriptor,vm=mm&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(hm(e)&&!_m(e,`length`).writable)throw new gm(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},ym=B,bm=bt,xm=Cr,Sm=vm,Cm=Er;ym({target:`Array`,proto:!0,arity:1,forced:s(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=bm(this),n=xm(t),r=arguments.length;Cm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Sm(t,n),n}});var wm=df(`Array`,`push`),Tm=Ee,Em=wm,Dm=Array.prototype,Om=function(e){var t=e.push;return e===Dm||Tm(Dm,e)&&t===Dm.push?Em:t},km=r(Om);function Am(e,t){var n=e==null?null:xd!==void 0&&lm(e)||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(km(s).call(s,r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}var jm=B,Mm=hr,Nm=oi,Pm=P,Fm=Vi,Im=Cr,Lm=be,Rm=Ar,zm=zt,Bm=vi,Vm=Oc,Hm=Bm(`slice`),Um=zm(`species`),Wm=Array,Gm=Math.max;jm({target:`Array`,proto:!0,forced:!Hm},{slice:function(e,t){var n=Lm(this),r=Im(n),i=Fm(e,r),a=Fm(t===void 0?r:t,r),o,s,c;if(Mm(n)&&(o=n.constructor,Nm(o)&&(o===Wm||Mm(o.prototype))?o=void 0:Pm(o)&&(o=o[Um],o===null&&(o=void 0)),o===Wm||o===void 0))return Vm(n,i,a);for(s=new(o===void 0?Wm:o)(Gm(a-i,0)),c=0;i<a;i++,c++)i in n&&Rm(s,c,n[i]);return s.length=c,s}});var Km=df(`Array`,`slice`),qm=Ee,Jm=Km,Ym=Array.prototype,Xm=function(e){var t=e.slice;return e===Ym||qm(Ym,e)&&t===Ym.slice?Jm:t},Zm=Xm,Qm=r(Zm),$m=r(om);function eh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function th(e,t){var n;if(e){if(typeof e==`string`)return eh(e,t);var r=Qm(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return $m(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eh(e,t)}}function nh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rh(e,t){return pm(e)||Am(e,t)||th(e,t)||nh()}function ih(e){if(fm(e))return eh(e)}function ah(e){if(xd!==void 0&&lm(e)!=null||e[`@@iterator`]!=null)return $m(e)}function oh(){throw TypeError(`Invalid attempt to spread non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sh(e){return ih(e)||ah(e)||th(e)||oh()}var ch=r(qu),lh=df(`Array`,`concat`),uh=Ee,dh=lh,fh=Array.prototype,ph=r(function(e){var t=e.concat;return e===fh||uh(fh,e)&&t===fh.concat?dh:t}),mh=r(Xm),hh=I,gh=v,_h=Fa,vh=Za,yh=Fn,bh=gh([].concat),xh=hh(`Reflect`,`ownKeys`)||function(e){var t=_h.f(yh(e)),n=vh.f;return n?bh(t,n(e)):t};B({target:`Reflect`,stat:!0},{ownKeys:xh});var Sh=Se.Reflect.ownKeys,Ch=r(Sh),wh=r(dm),Th=B,Eh=bt,Dh=ia;Th({target:`Object`,stat:!0,forced:s(function(){Dh(1)})},{keys:function(e){return Dh(Eh(e))}});var Oh=Se.Object.keys,kh=r(Oh),Ah=es.forEach,jh=Tf(`forEach`)?[].forEach:function(e){return Ah(this,e,arguments.length>1?arguments[1]:void 0)},Mh=B,Nh=jh;Mh({target:`Array`,proto:!0,forced:[].forEach!==Nh},{forEach:Nh});var Ph=df(`Array`,`forEach`),Fh=Vr,Ih=wt,Lh=Ee,Rh=Ph,zh=Array.prototype,Bh={DOMTokenList:!0,NodeList:!0},Vh=function(e){var t=e.forEach;return e===zh||Lh(zh,e)&&t===zh.forEach||Ih(Bh,Fh(e))?Rh:t},Hh=r(Vh),Uh=B,Wh=v,Gh=hr,Kh=Wh([].reverse),qh=[1,2];Uh({target:`Array`,proto:!0,forced:String(qh)===String(qh.reverse())},{reverse:function(){return Gh(this)&&(this.length=this.length),Kh(this)}});var Jh=df(`Array`,`reverse`),Yh=Ee,Xh=Jh,Zh=Array.prototype,Qh=function(e){var t=e.reverse;return e===Zh||Yh(Zh,e)&&t===Zh.reverse?Xh:t},$h=r(Qh),eg=Ye,tg=TypeError,ng=function(e,t){if(!delete e[t])throw new tg(`Cannot delete property `+eg(t)+` of `+eg(e))},rg=B,ig=bt,ag=Vi,og=yr,sg=Cr,cg=vm,lg=Er,ug=pi,dg=Ar,fg=ng,pg=vi(`splice`),mg=Math.max,hg=Math.min;rg({target:`Array`,proto:!0,forced:!pg},{splice:function(e,t){var n=ig(this),r=sg(n),i=ag(e,r),a=arguments.length,o,s,c,l,u,d;for(a===0?o=s=0:a===1?(o=0,s=r-i):(o=a-2,s=hg(mg(og(t),0),r-i)),lg(r+o-s),c=ug(n,s),l=0;l<s;l++)u=i+l,u in n&&dg(c,l,n[u]);if(c.length=s,o<s){for(l=i;l<r-s;l++)u=l+s,d=l+o,u in n?n[d]=n[u]:fg(n,d);for(l=r;l>r-s+o;l--)fg(n,l-1)}else if(o>s)for(l=r-s;l>i;l--)u=l+s-1,d=l+o-1,u in n?n[d]=n[u]:fg(n,d);for(l=0;l<o;l++)n[l+i]=arguments[l+2];return cg(n,r-s+o),c}});var gg=df(`Array`,`splice`),_g=Ee,vg=gg,yg=Array.prototype,bg=r(function(e){var t=e.splice;return e===yg||_g(yg,e)&&t===yg.splice?vg:t}),xg=k,Sg=v,Cg=A,wg=s,Tg=ia,Eg=Za,Dg=ae,Og=bt,kg=pe,Ag=Object.assign,jg=Object.defineProperty,Mg=Sg([].concat),Ng=!Ag||wg(function(){if(xg&&Ag({b:1},Ag(jg({},`a`,{enumerable:!0,get:function(){jg(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`),r=`abcdefghijklmnopqrst`;return e[n]=7,r.split(``).forEach(function(e){t[e]=e}),Ag({},e)[n]!==7||Tg(Ag({},t)).join(``)!==r})?function(e,t){for(var n=Og(e),r=arguments.length,i=1,a=Eg.f,o=Dg.f;r>i;)for(var s=kg(arguments[i++]),c=a?Mg(Tg(s),a(s)):Tg(s),l=c.length,u=0,d;l>u;)d=c[u++],(!xg||Cg(o,s,d))&&(n[d]=s[d]);return n}:Ag,Pg=B,Fg=Ng;Pg({target:`Object`,stat:!0,arity:2,forced:Object.assign!==Fg},{assign:Fg});var Ig=Se.Object.assign,Lg=r(Ig),Rg=B,zg=s,Bg=bt,Vg=Pl,Hg=Tl;Rg({target:`Object`,stat:!0,forced:zg(function(){Vg(1)}),sham:!Hg},{getPrototypeOf:function(e){return Vg(Bg(e))}});var Ug=Se.Object.getPrototypeOf;B({target:`Object`,stat:!0,sham:!k},{create:Pa});var Wg=Se.Object,Gg=function(e,t){return Wg.create(e,t)},Kg=r(Gg),qg=Se,Jg=p;qg.JSON||={stringify:JSON.stringify};var Yg=r(function(e,t,n){return Jg(qg.JSON.stringify,null,arguments)}),Xg=typeof Bun==`function`&&Bun&&typeof Bun.version==`string`,Zg=TypeError,Qg=function(e,t){if(e<t)throw new Zg(`Not enough arguments`);return e},$g=o,e_=p,t_=D,n_=Xg,r_=De,i_=Oc,a_=Qg,o_=$g.Function,s_=/MSIE .\./.test(r_)||n_&&(function(){var e=$g.Bun.version.split(`.`);return e.length<3||e[0]===`0`&&(e[1]<3||e[1]===`3`&&e[2]===`0`)})(),c_=function(e,t){var n=t?2:1;return s_?function(r,i){var a=a_(arguments.length,1)>n,o=t_(r)?r:o_(r),s=a?i_(arguments,n):[],c=a?function(){e_(o,this,s)}:o;return t?e(c,i):e(c)}:e},l_=B,u_=o,d_=c_(u_.setInterval,!0);l_({global:!0,bind:!0,forced:u_.setInterval!==d_},{setInterval:d_});var f_=B,p_=o,m_=c_(p_.setTimeout,!0);f_({global:!0,bind:!0,forced:p_.setTimeout!==m_},{setTimeout:m_});var h_=Se.setTimeout,g_=r(h_),__={exports:{}};(function(e){function t(e){if(e)return n(e);this._callbacks=new Map}function n(e){return Object.assign(e,t.prototype),e._callbacks=new Map,e}t.prototype.on=function(e,t){let n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},t.prototype.once=function(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},t.prototype.off=function(e,t){if(e===void 0&&t===void 0)return this._callbacks.clear(),this;if(t===void 0)return this._callbacks.delete(e),this;let n=this._callbacks.get(e);if(n){for(let[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}n.length===0?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},t.prototype.emit=function(e,...t){let n=this._callbacks.get(e);if(n){let e=[...n];for(let n of e)n.apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks.get(e)??[]},t.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(let e of this._callbacks.values())t+=e.length;return t},t.prototype.hasListeners=function(e){return this.listenerCount(e)>0},t.prototype.addEventListener=t.prototype.on,t.prototype.removeListener=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,e.exports=t})(__);var v_=__.exports,y_=r(v_);function b_(){return b_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b_.apply(this,arguments)}function x_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function S_(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var C_=typeof Object.assign==`function`?Object.assign:function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t},w_=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],T_=typeof document>`u`?{style:{}}:document.createElement(`div`),E_=`function`,D_=Math.round,O_=Math.abs,k_=Date.now;function A_(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<w_.length;){if(n=w_[a],r=n?n+i:t,r in e)return r;a++}}var j_=typeof window>`u`?{}:window,M_=A_(T_.style,`touchAction`),N_=M_!==void 0;function P_(){if(!N_)return!1;var e={},t=j_.CSS&&j_.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(n){return e[n]=t?j_.CSS.supports(`touch-action`,n):!0}),e}var F_=`compute`,I_=`auto`,L_=`manipulation`,R_=`none`,z_=`pan-x`,B_=`pan-y`,V_=P_(),H_=/mobile|tablet|ip(ad|hone|od)|android/i,U_=`ontouchstart`in j_,W_=A_(j_,`PointerEvent`)!==void 0,G_=U_&&H_.test(navigator.userAgent),K_=`touch`,q_=`pen`,J_=`mouse`,Y_=`kinect`,X_=25,Z_=1,Q_=2,$_=4,ev=8,tv=1,nv=2,rv=4,iv=8,av=16,ov=nv|rv,sv=iv|av,cv=ov|sv,lv=[`x`,`y`],uv=[`clientX`,`clientY`];function dv(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==void 0)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function fv(e,t){return typeof e===E_?e.apply(t&&t[0]||void 0,t):e}function pv(e,t){return e.indexOf(t)>-1}function mv(e){if(pv(e,R_))return R_;var t=pv(e,z_),n=pv(e,B_);return t&&n?R_:t||n?t?z_:B_:pv(e,L_)?L_:I_}var hv=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===F_&&(e=this.compute()),N_&&this.manager.element.style&&V_[e]&&(this.manager.element.style[M_]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return dv(this.manager.recognizers,function(t){fv(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),mv(e.join(` `))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=pv(r,R_)&&!V_[R_],a=pv(r,B_)&&!V_[B_],o=pv(r,z_)&&!V_[z_];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&ov||o&&n&sv))return this.preventSrc(t)},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function gv(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function _v(e){var t=e.length;if(t===1)return{x:D_(e[0].clientX),y:D_(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:D_(n/t),y:D_(r/t)}}function vv(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:D_(e.pointers[n].clientX),clientY:D_(e.pointers[n].clientY)},n++;return{timeStamp:k_(),pointers:t,center:_v(t),deltaX:e.deltaX,deltaY:e.deltaY}}function yv(e,t,n){n||=lv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function bv(e,t,n){n||=lv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function xv(e,t){return e===t?tv:O_(e)>=O_(t)?e<0?nv:rv:t<0?iv:av}function Sv(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===Z_||a.eventType===$_)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function Cv(e,t,n){return{x:t/e||0,y:n/e||0}}function wv(e,t){return yv(t[0],t[1],uv)/yv(e[0],e[1],uv)}function Tv(e,t){return bv(t[1],t[0],uv)+bv(e[1],e[0],uv)}function Ev(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,i,a,o,s;if(t.eventType!==ev&&(r>X_||n.velocity===void 0)){var c=t.deltaX-n.deltaX,l=t.deltaY-n.deltaY,u=Cv(r,c,l);a=u.x,o=u.y,i=O_(u.x)>O_(u.y)?u.x:u.y,s=xv(c,l),e.lastInterval=t}else i=n.velocity,a=n.velocityX,o=n.velocityY,s=n.direction;t.velocity=i,t.velocityX=a,t.velocityY=o,t.direction=s}function Dv(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=vv(t),i>1&&!n.firstMultiple?n.firstMultiple=vv(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=_v(r);t.timeStamp=k_(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=bv(s,c),t.distance=yv(s,c),Sv(n,t),t.offsetDirection=xv(t.deltaX,t.deltaY);var l=Cv(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=O_(l.x)>O_(l.y)?l.x:l.y,t.scale=o?wv(o.pointers,r):1,t.rotation=o?Tv(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,Ev(n,t);var u=e.element,d=t.srcEvent,f=d.composedPath?d.composedPath()[0]:d.path?d.path[0]:d.target;gv(f,u)&&(u=f),t.target=u}function Ov(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&Z_&&r-i===0,o=t&($_|ev)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,Dv(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function kv(e){return e.trim().split(/\s+/g)}function Av(e,t,n){dv(kv(t),function(t){e.addEventListener(t,n,!1)})}function W(e,t,n){dv(kv(t),function(t){e.removeEventListener(t,n,!1)})}function jv(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var Mv=function(){function e(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){fv(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&Av(this.element,this.evEl,this.domHandler),this.evTarget&&Av(this.target,this.evTarget,this.domHandler),this.evWin&&Av(jv(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&W(this.element,this.evEl,this.domHandler),this.evTarget&&W(this.target,this.evTarget,this.domHandler),this.evWin&&W(jv(this.element),this.evWin,this.domHandler)},e}();function Nv(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}var Pv={pointerdown:Z_,pointermove:Q_,pointerup:$_,pointercancel:ev,pointerout:ev},Fv={2:K_,3:q_,4:J_,5:Y_},Iv=`pointerdown`,Lv=`pointermove pointerup pointercancel`;j_.MSPointerEvent&&!j_.PointerEvent&&(Iv=`MSPointerDown`,Lv=`MSPointerMove MSPointerUp MSPointerCancel`);var Rv=function(e){x_(t,e);function t(){var n,r=t.prototype;return r.evEl=Iv,r.evWin=Lv,n=e.apply(this,arguments)||this,n.store=n.manager.session.pointerEvents=[],n}var n=t.prototype;return n.handler=function(e){var t=this.store,n=!1,r=Pv[e.type.toLowerCase().replace(`ms`,``)],i=Fv[e.pointerType]||e.pointerType,a=i===K_,o=Nv(t,e.pointerId,`pointerId`);r&Z_&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&($_|ev)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))},t}(Mv);function zv(e){return Array.prototype.slice.call(e,0)}function Bv(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];Nv(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}var Vv={touchstart:Z_,touchmove:Q_,touchend:$_,touchcancel:ev},Hv=`touchstart touchmove touchend touchcancel`,Uv=function(e){x_(t,e);function t(){var n;return t.prototype.evTarget=Hv,n=e.apply(this,arguments)||this,n.targetIds={},n}var n=t.prototype;return n.handler=function(e){var t=Vv[e.type],n=Wv.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:K_,srcEvent:e})},t}(Mv);function Wv(e,t){var n=zv(e.touches),r=this.targetIds;if(t&(Z_|Q_)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=zv(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return gv(e.target,c)}),t===Z_)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&($_|ev)&&delete r[o[i].identifier],i++;if(s.length)return[Bv(a.concat(s),`identifier`,!0),s]}var Gv={mousedown:Z_,mousemove:Q_,mouseup:$_},Kv=`mousedown`,qv=`mousemove mouseup`,Jv=function(e){x_(t,e);function t(){var n,r=t.prototype;return r.evEl=Kv,r.evWin=qv,n=e.apply(this,arguments)||this,n.pressed=!1,n}var n=t.prototype;return n.handler=function(e){var t=Gv[e.type];t&Z_&&e.button===0&&(this.pressed=!0),t&Q_&&e.which!==1&&(t=$_),this.pressed&&(t&$_&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:J_,srcEvent:e}))},t}(Mv),Yv=2500,Xv=25;function Zv(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(n),setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},Yv)}}function Qv(e,t){e&Z_?(this.primaryTouch=t.changedPointers[0].identifier,Zv.call(this,t)):e&($_|ev)&&Zv.call(this,t)}function $v(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=Xv&&o<=Xv)return!0}return!1}var ey=function(){return function(e){x_(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.handler=function(e,t,n){var i=n.pointerType===K_,a=n.pointerType===J_;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)Qv.call(S_(S_(r)),t,n);else if(a&&$v.call(S_(S_(r)),n))return;r.callback(e,t,n)}},r.touch=new Uv(r.manager,r.handler),r.mouse=new Jv(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}var n=t.prototype;return n.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Mv)}();function ty(e){var t;return t=e.options.inputClass||(W_?Rv:G_?Uv:U_?ey:Jv),new t(e,Ov)}function ny(e,t,n){return Array.isArray(e)?(dv(e,n[t],n),!0):!1}var ry=1,iy=2,ay=4,oy=8,sy=oy,cy=16,ly=32,uy=1;function dy(){return uy++}function G(e,t){var n=t.manager;return n?n.get(e):e}function K(e){return e&cy?`cancel`:e&oy?`end`:e&ay?`move`:e&iy?`start`:``}var fy=function(){function e(e){e===void 0&&(e={}),this.options=b_({enable:!0},e),this.id=dy(),this.manager=null,this.state=ry,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return C_(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(ny(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=G(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return ny(e,`dropRecognizeWith`,this)?this:(e=G(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(ny(e,`requireFailure`,this))return this;var t=this.requireFail;return e=G(e,this),Nv(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(ny(e,`dropRequireFailure`,this))return this;e=G(e,this);var t=Nv(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<oy&&r(t.options.event+K(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=oy&&r(t.options.event+K(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=ly},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(ly|ry)))return!1;e++}return!0},t.recognize=function(e){var t=C_({},e);if(!fv(this.options.enable,[this,t])){this.reset(),this.state=ly;return}this.state&(sy|cy|ly)&&(this.state=ry),this.state=this.process(t),this.state&(iy|ay|oy|cy)&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),py=function(e){x_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,b_({event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var n=t.prototype;return n.getTouchAction=function(){return[L_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&Z_&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==$_)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<n.interval:!0,s=!this.pCenter||yv(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!s||!o?this.count=1:this.count+=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=sy,t.tryEmit()},n.interval),iy):sy}return ly},n.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=ly},this.options.interval),ly},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===sy&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(fy),my=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({pointers:1},t))||this}var n=t.prototype;return n.attrTest=function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,r=t&(iy|ay),i=this.attrTest(e);return r&&(n&ev||!i)?t|cy:r||i?n&$_?t|oy:t&iy?t|ay:iy:ly},t}(fy);function hy(e){return e===av?`down`:e===iv?`up`:e===nv?`left`:e===rv?`right`:``}var gy=function(e){x_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,b_({event:`pan`,threshold:10,pointers:1,direction:cv},t))||this,n.pX=null,n.pY=null,n}var n=t.prototype;return n.getTouchAction=function(){var e=this.options.direction,t=[];return e&ov&&t.push(B_),e&sv&&t.push(z_),t},n.directionTest=function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&ov?(i=a===0?tv:a<0?nv:rv,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?tv:o<0?iv:av,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return my.prototype.attrTest.call(this,e)&&(this.state&iy||!(this.state&iy)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=hy(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(my),_y=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({event:`swipe`,threshold:10,velocity:.3,direction:ov|sv,pointers:1},t))||this}var n=t.prototype;return n.getTouchAction=function(){return gy.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n=this.options.direction,r;return n&(ov|sv)?r=t.overallVelocity:n&ov?r=t.overallVelocityX:n&sv&&(r=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&O_(r)>this.options.velocity&&t.eventType&$_},n.emit=function(e){var t=hy(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(my),vy=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({event:`pinch`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[R_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&iy)},n.emit=function(t){if(t.scale!==1){var n=t.scale<1?`in`:`out`;t.additionalEvent=this.options.event+n}e.prototype.emit.call(this,t)},t}(my),yy=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({event:`rotate`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[R_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&iy)},t}(my),by=function(e){x_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,b_({event:`press`,pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var n=t.prototype;return n.getTouchAction=function(){return[I_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime>n.time;if(this._input=e,!i||!r||e.eventType&($_|ev)&&!a)this.reset();else if(e.eventType&Z_)this.reset(),this._timer=setTimeout(function(){t.state=sy,t.tryEmit()},n.time);else if(e.eventType&$_)return sy;return ly},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===sy&&(e&&e.eventType&$_?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=k_(),this.manager.emit(this.options.event,this._input)))},t}(fy),xy={domEvents:!1,touchAction:F_,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},Sy=[[yy,{enable:!1}],[vy,{enable:!1},[`rotate`]],[_y,{direction:ov}],[gy,{direction:ov},[`swipe`]],[py],[py,{event:`doubletap`,taps:2},[`tap`]],[by]],Cy=1,wy=2;function Ty(e,t){var n=e.element;if(n.style){var r;dv(e.options.cssProps,function(i,a){r=A_(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function Ey(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var Dy=function(){function e(e,t){var n=this;this.options=C_({},xy,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=ty(this),this.touchAction=new hv(this,this.options.touchAction),Ty(this,!0),dv(this.options.recognizers,function(e){var t=n.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return C_(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?wy:Cy},t.recognize=function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&sy)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==wy&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(iy|ay|oy)&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof fy)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(ny(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(ny(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=Nv(n,t);r!==-1&&(n.splice(r,1),this.touchAction.update())}return this},t.on=function(e,t){if(e===void 0||t===void 0)return this;var n=this.handlers;return dv(kv(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},t.off=function(e,t){if(e===void 0)return this;var n=this.handlers;return dv(kv(e),function(e){t?n[e]&&n[e].splice(Nv(n[e],t),1):delete n[e]}),this},t.emit=function(e,t){this.options.domEvents&&Ey(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(!(!n||!n.length)){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},t.destroy=function(){this.element&&Ty(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),Oy={touchstart:Z_,touchmove:Q_,touchend:$_,touchcancel:ev},ky=`touchstart`,Ay=`touchstart touchmove touchend touchcancel`,jy=function(e){x_(t,e);function t(){var n,r=t.prototype;return r.evTarget=ky,r.evWin=Ay,n=e.apply(this,arguments)||this,n.started=!1,n}var n=t.prototype;return n.handler=function(e){var t=Oy[e.type];if(t===Z_&&(this.started=!0),this.started){var n=My.call(this,e,t);t&($_|ev)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:K_,srcEvent:e})}},t}(Mv);function My(e,t){var n=zv(e.touches),r=zv(e.changedTouches);return t&($_|ev)&&(n=Bv(n.concat(r),`identifier`,!0)),[n,r]}function Ny(e,t,n){var r=`DEPRECATED METHOD: `+t+`
4
4
  `+n+` AT
@@ -46,6 +46,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46
46
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function F_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var I_=Vp(`DELETE`);function L_(){var e=R_.apply(void 0,arguments);return B_(e),e}function R_(){var e=[...arguments];if(e.length<2)return e[0];var t;if(e.length>2)return R_.apply(void 0,Kp(t=[L_(e[0],e[1])]).call(t,Bp(qp(e).call(e,2))));var n=e[0],r=e[1];if(n instanceof Date&&r instanceof Date)return n.setTime(r.getTime()),n;var i,a=P_(em(r));try{for(a.s();!(i=a.n()).done;){var o=i.value;Object.prototype.propertyIsEnumerable.call(r,o)&&(r[o]===I_?delete n[o]:n[o]===null||r[o]===null||typeof n[o]!=`object`||typeof r[o]!=`object`||tm(n[o])||tm(r[o])?n[o]=z_(r[o]):n[o]=R_(n[o],r[o]))}}catch(e){a.e(e)}finally{a.f()}return n}function z_(e){return tm(e)?Wd(e).call(e,(function(e){return z_(e)})):typeof e==`object`&&e?e instanceof Date?new Date(e.getTime()):R_({},e):e}function B_(e){for(var t=0,n=im(e);t<n.length;t++){var r=n[t];e[r]===I_?delete e[r]:typeof e[r]==`object`&&e[r]!==null&&B_(e[r])}}var V_=typeof window<`u`?window.Hammer||N_:function(){return function(){var e=function(){};return{on:e,off:e,destroy:e,emit:e,get:()=>({set:e})}}()};function H_(e){var t,n=this;this._cleanupQueue=[],this.active=!1,this._dom={container:e,overlay:document.createElement(`div`)},this._dom.overlay.classList.add(`vis-overlay`),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push((function(){n._dom.overlay.parentNode.removeChild(n._dom.overlay)}));var r=V_(this._dom.overlay);r.on(`tap`,gd(t=this._onTapOverlay).call(t,this)),this._cleanupQueue.push((function(){r.destroy()}));var i=[`tap`,`doubletap`,`press`,`pinch`,`pan`,`panstart`,`panmove`,`panend`];hm(i).call(i,(function(e){r.on(e,(function(e){e.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=function(t){(function(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1})(t.target,e)||n.deactivate()},document.body.addEventListener(`click`,this._onClick),this._cleanupQueue.push((function(){document.body.removeEventListener(`click`,n._onClick)}))),this._escListener=function(e){(`key`in e?e.key===`Escape`:e.keyCode===27)&&n.deactivate()}}zh(H_.prototype),H_.current=null,H_.prototype.destroy=function(){var e,t;this.deactivate();var n,r=P_(Tm(e=Km(t=this._cleanupQueue).call(t,0)).call(e));try{for(r.s();!(n=r.n()).done;)(0,n.value)()}catch(e){r.e(e)}finally{r.f()}},H_.prototype.activate=function(){H_.current&&H_.current.deactivate(),H_.current=this,this.active=!0,this._dom.overlay.style.display=`none`,this._dom.container.classList.add(`vis-active`),this.emit(`change`),this.emit(`activate`),document.body.addEventListener(`keydown`,this._escListener)},H_.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display=`block`,this._dom.container.classList.remove(`vis-active`),document.body.removeEventListener(`keydown`,this._escListener),this.emit(`change`),this.emit(`deactivate`)},H_.prototype._onTapOverlay=function(e){this.activate(),e.srcEvent.stopPropagation()};var U_=Br,W_=Ge,G_=TypeError,K_=function(e){if(U_(e))return e;throw new G_(W_(e)+` is not a constructor`)},q_=z,J_=p,Y_=od,X_=K_,Z_=bn,Q_=N,$_=aa,ev=s,tv=F(`Reflect`,`construct`),nv=Object.prototype,rv=[].push,iv=ev((function(){function e(){}return!(tv((function(){}),[],e)instanceof e)})),av=!ev((function(){tv((function(){}))})),ov=iv||av;q_({target:`Reflect`,stat:!0,forced:ov,sham:ov},{construct:function(e,t){X_(e),Z_(t);var n=arguments.length<3?e:X_(arguments[2]);if(av&&!iv)return tv(e,t,n);if(e===n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return J_(rv,r,t),new(J_(Y_,e,r))}var i=n.prototype,a=$_(Q_(i)?i:nv),o=J_(e,a,t);return Q_(o)?o:a}});var sv=r(P.Reflect.construct),cv=r(P.Object.getOwnPropertySymbols),lv={exports:{}},uv=z,dv=s,fv=be,pv=D.f,mv=O;uv({target:`Object`,stat:!0,forced:!mv||dv((function(){pv(1)})),sham:!mv},{getOwnPropertyDescriptor:function(e,t){return pv(fv(e),t)}});var hv=P.Object,gv=lv.exports=function(e,t){return hv.getOwnPropertyDescriptor(e,t)};hv.getOwnPropertyDescriptor.sham&&(gv.sham=!0);var _v=r(lv.exports),vv=$p,yv=be,bv=D,xv=pr;z({target:`Object`,stat:!0,sham:!O},{getOwnPropertyDescriptors:function(e){for(var t,n,r=yv(e),i=bv.f,a=vv(r),o={},s=0;a.length>s;)(n=i(r,t=a[s++]))!==void 0&&xv(o,t,n);return o}});var Sv=r(P.Object.getOwnPropertyDescriptors),Cv={exports:{}},wv=z,Tv=O,Ev=mi.f;wv({target:`Object`,stat:!0,forced:Object.defineProperties!==Ev,sham:!Tv},{defineProperties:Ev});var Dv=P.Object,Ov=Cv.exports=function(e,t){return Dv.defineProperties(e,t)};Dv.defineProperties.sham&&(Ov.sham=!0);var kv=r(Cv.exports),Av=r(Xn);function W(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var jv=fh,Mv=r(jv);z({target:`Object`,stat:!0},{setPrototypeOf:hl});var Nv=P.Object.setPrototypeOf,Pv=r(Nv),Fv=r(hd);function Iv(e,t){var n;return Iv=Pv?Fv(n=Pv).call(n):function(e,t){return e.__proto__=t,e},Iv(e,t)}function Lv(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Mv(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Qn(e,`prototype`,{writable:!1}),t&&Iv(e,t)}function Rv(e,t){if(t&&(Wu(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return W(e)}var zv=uh,Bv=r(zv);function Vv(e){var t;return Vv=Pv?Fv(t=Bv).call(t):function(e){return e.__proto__||Bv(e)},Vv(e)}var Hv={exports:{}},Uv={exports:{}};(function(e){var t=Cu,n=Hu;function r(i){return e.exports=r=typeof t==`function`&&typeof n==`symbol`?function(e){return typeof e}:function(e){return e&&typeof t==`function`&&e.constructor===t&&e!==t.prototype?`symbol`:typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Uv);var Wv=Uv.exports,Gv=mm,Kv=ht,qv=$p,Jv=D,Yv=hn,Xv=N,Zv=Pn,Qv=Error,$v=v(``.replace),ey=String(new Qv(`zxcasd`).stack),ty=/\n\s*at [^:]*:[^\n]*/,ny=ty.test(ey),ry=j,iy=!s((function(){var e=Error(`a`);return!(`stack`in e)||(Object.defineProperty(e,`stack`,ry(1,7)),e.stack!==7)})),ay=Pn,oy=function(e,t){if(ny&&typeof e==`string`&&!Qv.prepareStackTrace)for(;t--;)e=$v(e,ty,``);return e},sy=iy,cy=Error.captureStackTrace,ly=mn,uy=ie,dy=bn,G=Ge,K=vf,fy=sr,py=I,my=Af,hy=wf,gy=ff,_y=TypeError,vy=function(e,t){this.stopped=e,this.result=t},yy=vy.prototype,by=function(e,t,n){var r,i,a,o,s,c,l,u=n&&n.that,d=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_RECORD),p=!(!n||!n.IS_ITERATOR),m=!(!n||!n.INTERRUPTED),h=ly(t,u),g=function(e){return r&&gy(r,`normal`,e),new vy(!0,e)},_=function(e){return d?(dy(e),m?h(e[0],e[1],g):h(e[0],e[1])):m?h(e,g):h(e)};if(f)r=e.iterator;else if(p)r=e;else{if(!(i=hy(e)))throw new _y(G(e)+` is not iterable`);if(K(i)){for(a=0,o=fy(e);o>a;a++)if((s=_(e[a]))&&py(yy,s))return s;return new vy(!1)}r=my(e,i)}for(c=f?e.next:r.next;!(l=uy(c,r)).done;){try{s=_(l.value)}catch(e){gy(r,`throw`,e)}if(typeof s==`object`&&s&&py(yy,s))return s}return new vy(!1)},xy=pi,Sy=z,Cy=I,wy=Gc,Ty=hl,Ey=function(e,t,n){for(var r=qv(t),i=Yv.f,a=Jv.f,o=0;o<r.length;o++){var s=r[o];Kv(e,s)||n&&Kv(n,s)||i(e,s,a(t,s))}},Dy=aa,Oy=Pn,ky=j,Ay=function(e,t){Xv(t)&&`cause`in t&&Zv(e,`cause`,t.cause)},jy=function(e,t,n,r){sy&&(cy?cy(e,t):ay(e,`stack`,oy(n,r)))},My=by,Ny=function(e,t){return e===void 0?arguments.length<2?``:t:xy(e)},Py=kt(`toStringTag`),Fy=Error,Iy=[].push,Ly=function(e,t){var n,r=Cy(Ry,this);Ty?n=Ty(new Fy,r?wy(this):Ry):(n=r?this:Dy(Ry),Oy(n,Py,`Error`)),t!==void 0&&Oy(n,`message`,Ny(t)),jy(n,Ly,n.stack,1),arguments.length>2&&Ay(n,arguments[2]);var i=[];return My(e,Iy,{that:i}),Oy(n,`errors`,i),n};Ty?Ty(Ly,Fy):Ey(Ly,Fy,{name:!0});var Ry=Ly.prototype=Dy(Fy.prototype,{constructor:ky(1,Ly),message:ky(1,``),name:ky(1,`AggregateError`)});Sy({global:!0,constructor:!0,arity:2},{AggregateError:Ly});var zy,By,Vy,Hy,Uy=F,Wy=Ta,Gy=O,Ky=kt(`species`),qy=function(e){var t=Uy(e);Gy&&t&&!t[Ky]&&Wy(t,Ky,{configurable:!0,get:function(){return this}})},Jy=I,Yy=TypeError,Xy=function(e,t){if(Jy(t,e))return e;throw new Yy(`Incorrect invocation`)},Zy=bn,Qy=K_,$y=me,eb=kt(`species`),tb=function(e,t){var n,r=Zy(e).constructor;return r===void 0||$y(n=Zy(r)[eb])?t:Qy(n)},nb=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ee),rb=o,ib=p,ab=mn,ob=E,sb=ht,cb=s,lb=Hi,ub=Gs,db=Ut,fb=yh,pb=nb,mb=Ed,hb=rb.setImmediate,gb=rb.clearImmediate,_b=rb.process,vb=rb.Dispatch,yb=rb.Function,bb=rb.MessageChannel,xb=rb.String,Sb=0,Cb={},wb=`onreadystatechange`;cb((function(){zy=rb.location}));var Tb=function(e){if(sb(Cb,e)){var t=Cb[e];delete Cb[e],t()}},Eb=function(e){return function(){Tb(e)}},Db=function(e){Tb(e.data)},Ob=function(e){rb.postMessage(xb(e),zy.protocol+`//`+zy.host)};hb&&gb||(hb=function(e){fb(arguments.length,1);var t=ob(e)?e:yb(e),n=ub(arguments,1);return Cb[++Sb]=function(){ib(t,void 0,n)},By(Sb),Sb},gb=function(e){delete Cb[e]},mb?By=function(e){_b.nextTick(Eb(e))}:vb&&vb.now?By=function(e){vb.now(Eb(e))}:bb&&!pb?(Hy=(Vy=new bb).port2,Vy.port1.onmessage=Db,By=ab(Hy.postMessage,Hy)):rb.addEventListener&&ob(rb.postMessage)&&!rb.importScripts&&zy&&zy.protocol!==`file:`&&!cb(Ob)?(By=Ob,rb.addEventListener(`message`,Db,!1)):By=wb in db(`script`)?function(e){lb.appendChild(db(`script`))[wb]=function(){lb.removeChild(this),Tb(e)}}:function(e){setTimeout(Eb(e),0)});var kb={set:hb,clear:gb},Ab=function(){this.head=null,this.tail=null};Ab.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return(this.head=e.next)===null&&(this.tail=null),e.item}};var jb,Mb,Nb,Pb,Fb,Ib=Ab,Lb=/ipad|iphone|ipod/i.test(Ee)&&typeof Pebble<`u`,Rb=/web0s(?!.*chrome)/i.test(Ee),zb=o,Bb=mn,Vb=D.f,Hb=kb.set,Ub=Ib,Wb=nb,Gb=Lb,Kb=Rb,qb=Ed,Jb=zb.MutationObserver||zb.WebKitMutationObserver,Yb=zb.document,Xb=zb.process,Zb=zb.Promise,Qb=Vb(zb,`queueMicrotask`),$b=Qb&&Qb.value;if(!$b){var ex=new Ub,tx=function(){var e,t;for(qb&&(e=Xb.domain)&&e.exit();t=ex.get();)try{t()}catch(e){throw ex.head&&jb(),e}e&&e.enter()};Wb||qb||Kb||!Jb||!Yb?!Gb&&Zb&&Zb.resolve?((Pb=Zb.resolve(void 0)).constructor=Zb,Fb=Bb(Pb.then,Pb),jb=function(){Fb(tx)}):qb?jb=function(){Xb.nextTick(tx)}:(Hb=Bb(Hb,zb),jb=function(){Hb(tx)}):(Mb=!0,Nb=Yb.createTextNode(``),new Jb(tx).observe(Nb,{characterData:!0}),jb=function(){Nb.data=Mb=!Mb}),$b=function(e){ex.head||jb(),ex.add(e)}}var nx=$b,rx=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},ix=o.Promise,ax=typeof Deno==`object`&&Deno&&typeof Deno.version==`object`,ox=!ax&&!Ed&&typeof window==`object`&&typeof document==`object`,sx=o,cx=ix,lx=E,ux=un,dx=Er,fx=kt,px=ox,mx=ax,hx=Ne,gx=cx&&cx.prototype,_x=fx(`species`),vx=!1,yx=lx(sx.PromiseRejectionEvent),bx={CONSTRUCTOR:ux(`Promise`,(function(){var e=dx(cx),t=e!==String(cx);if(!t&&hx===66||!gx.catch||!gx.finally)return!0;if(!hx||hx<51||!/native code/.test(e)){var n=new cx((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[_x]=r,!(vx=n.then((function(){}))instanceof r))return!0}return!t&&(px||mx)&&!yx})),REJECTION_EVENT:yx,SUBCLASSING:vx},xx={},Sx=Ye,Cx=TypeError,wx=function(e){var t,n;this.promise=new e((function(e,r){if(t!==void 0||n!==void 0)throw new Cx(`Bad Promise constructor`);t=e,n=r})),this.resolve=Sx(t),this.reject=Sx(n)};xx.f=function(e){return new wx(e)};var Tx,Ex,Dx=z,Ox=Ed,kx=o,Ax=ie,jx=Ca,Mx=Ja,Nx=qy,Px=Ye,Fx=E,Ix=N,Lx=Xy,Rx=tb,zx=kb.set,Bx=nx,Vx=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},Hx=rx,Ux=Ib,Wx=uo,Gx=ix,Kx=bx,qx=xx,Jx=`Promise`,Yx=Kx.CONSTRUCTOR,Xx=Kx.REJECTION_EVENT,Zx=Wx.getterFor(Jx),Qx=Wx.set,$x=Gx&&Gx.prototype,eS=Gx,tS=$x,nS=kx.TypeError,rS=kx.document,iS=kx.process,aS=qx.f,oS=aS,sS=!!(rS&&rS.createEvent&&kx.dispatchEvent),cS=`unhandledrejection`,lS=function(e){var t;return!(!Ix(e)||!Fx(t=e.then))&&t},uS=function(e,t){var n,r,i,a=t.value,o=t.state===1,s=o?e.ok:e.fail,c=e.resolve,l=e.reject,u=e.domain;try{s?(o||(t.rejection===2&&hS(t),t.rejection=1),!0===s?n=a:(u&&u.enter(),n=s(a),u&&(u.exit(),i=!0)),n===e.promise?l(new nS(`Promise-chain cycle`)):(r=lS(n))?Ax(r,n,c,l):c(n)):l(a)}catch(e){u&&!i&&u.exit(),l(e)}},dS=function(e,t){e.notified||(e.notified=!0,Bx((function(){for(var n,r=e.reactions;n=r.get();)uS(n,e);e.notified=!1,t&&!e.rejection&&pS(e)})))},fS=function(e,t,n){var r,i;sS?((r=rS.createEvent(`Event`)).promise=t,r.reason=n,r.initEvent(e,!1,!0),kx.dispatchEvent(r)):r={promise:t,reason:n},!Xx&&(i=kx[`on`+e])?i(r):e===cS&&Vx(`Unhandled promise rejection`,n)},pS=function(e){Ax(zx,kx,(function(){var t,n=e.facade,r=e.value;if(mS(e)&&(t=Hx((function(){Ox?iS.emit(`unhandledRejection`,r,n):fS(cS,n,r)})),e.rejection=Ox||mS(e)?2:1,t.error))throw t.value}))},mS=function(e){return e.rejection!==1&&!e.parent},hS=function(e){Ax(zx,kx,(function(){var t=e.facade;Ox?iS.emit(`rejectionHandled`,t):fS(`rejectionhandled`,t,e.value)}))},gS=function(e,t,n){return function(r){e(t,r,n)}},_S=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,dS(e,!0))},vS=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new nS(`Promise can't be resolved itself`);var r=lS(t);r?Bx((function(){var n={done:!1};try{Ax(r,t,gS(vS,n,e),gS(_S,n,e))}catch(t){_S(n,t,e)}})):(e.value=t,e.state=1,dS(e,!1))}catch(t){_S({done:!1},t,e)}}};Yx&&(tS=(eS=function(e){Lx(this,tS),Px(e),Ax(Tx,this);var t=Zx(this);try{e(gS(vS,t),gS(_S,t))}catch(e){_S(t,e)}}).prototype,(Tx=function(e){Qx(this,{type:Jx,done:!1,notified:!1,parent:!1,reactions:new Ux,rejection:!1,state:0,value:void 0})}).prototype=jx(tS,`then`,(function(e,t){var n=Zx(this),r=aS(Rx(this,eS));return n.parent=!0,r.ok=!Fx(e)||e,r.fail=Fx(t)&&t,r.domain=Ox?iS.domain:void 0,n.state===0?n.reactions.add(r):Bx((function(){uS(r,n)})),r.promise})),Ex=function(){var e=new Tx,t=Zx(e);this.promise=e,this.resolve=gS(vS,t),this.reject=gS(_S,t)},qx.f=aS=function(e){return e===eS||e===void 0?new Ex(e):oS(e)}),Dx({global:!0,constructor:!0,wrap:!0,forced:Yx},{Promise:eS}),Mx(eS,Jx,!1,!0),Nx(Jx);var yS=ix,bS=bx.CONSTRUCTOR||!Kf((function(e){yS.all(e).then(void 0,(function(){}))})),xS=ie,SS=Ye,CS=xx,wS=rx,TS=by;z({target:`Promise`,stat:!0,forced:bS},{all:function(e){var t=this,n=CS.f(t),r=n.resolve,i=n.reject,a=wS((function(){var n=SS(t.resolve),a=[],o=0,s=1;TS(e,(function(e){var c=o++,l=!1;s++,xS(n,t,e).then((function(e){l||(l=!0,a[c]=e,--s||r(a))}),i)})),--s||r(a)}));return a.error&&i(a.value),n.promise}});var ES=z,DS=bx.CONSTRUCTOR;ix&&ix.prototype,ES({target:`Promise`,proto:!0,forced:DS,real:!0},{catch:function(e){return this.then(void 0,e)}});var OS=ie,kS=Ye,AS=xx,jS=rx,MS=by;z({target:`Promise`,stat:!0,forced:bS},{race:function(e){var t=this,n=AS.f(t),r=n.reject,i=jS((function(){var i=kS(t.resolve);MS(e,(function(e){OS(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var NS=ie,PS=xx;z({target:`Promise`,stat:!0,forced:bx.CONSTRUCTOR},{reject:function(e){var t=PS.f(this);return NS(t.reject,void 0,e),t.promise}});var FS=bn,IS=N,LS=xx,RS=function(e,t){if(FS(e),IS(t)&&t.constructor===e)return t;var n=LS.f(e);return(0,n.resolve)(t),n.promise},zS=z,BS=ix,VS=bx.CONSTRUCTOR,HS=RS,q=F(`Promise`),US=!VS;zS({target:`Promise`,stat:!0,forced:!0},{resolve:function(e){return HS(US&&this===q?BS:this,e)}});var WS=ie,GS=Ye,KS=xx,qS=rx,JS=by;z({target:`Promise`,stat:!0,forced:bS},{allSettled:function(e){var t=this,n=KS.f(t),r=n.resolve,i=n.reject,a=qS((function(){var n=GS(t.resolve),i=[],a=0,o=1;JS(e,(function(e){var s=a++,c=!1;o++,WS(n,t,e).then((function(e){c||(c=!0,i[s]={status:`fulfilled`,value:e},--o||r(i))}),(function(e){c||(c=!0,i[s]={status:`rejected`,reason:e},--o||r(i))}))})),--o||r(i)}));return a.error&&i(a.value),n.promise}});var YS=ie,J=Ye,XS=F,ZS=xx,QS=rx,$S=by,eC=`No one promise resolved`;z({target:`Promise`,stat:!0,forced:bS},{any:function(e){var t=this,n=XS(`AggregateError`),r=ZS.f(t),i=r.resolve,a=r.reject,o=QS((function(){var r=J(t.resolve),o=[],s=0,c=1,l=!1;$S(e,(function(e){var u=s++,d=!1;c++,YS(r,t,e).then((function(e){d||l||(l=!0,i(e))}),(function(e){d||l||(d=!0,o[u]=e,--c||a(new n(o,eC)))}))})),--c||a(new n(o,eC))}));return o.error&&a(o.value),r.promise}});var tC=z,nC=ix,rC=s,iC=F,aC=E,oC=tb,sC=RS,cC=nC&&nC.prototype;tC({target:`Promise`,proto:!0,real:!0,forced:!!nC&&rC((function(){cC.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=oC(this,iC(`Promise`)),n=aC(e);return this.then(n?function(n){return sC(t,e()).then((function(){return n}))}:e,n?function(n){return sC(t,e()).then((function(){throw n}))}:e)}});var lC=P.Promise,uC=xx;z({target:`Promise`,stat:!0},{withResolvers:function(){var e=uC.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}});var dC=lC,fC=xx,pC=rx;z({target:`Promise`,stat:!0,forced:!0},{try:function(e){var t=fC.f(this),n=pC(e);return(n.error?t.reject:t.resolve)(n.value),t.promise}});var mC=dC,hC=wm;(function(e){var t=Wv.default,n=Zn,r=Cu,i=jv,a=zv,o=Gv,s=pp,c=Nv,l=mC,u=hC,d=Pp;function f(){e.exports=f=function(){return m},e.exports.__esModule=!0,e.exports.default=e.exports;var p,m={},h=Object.prototype,g=h.hasOwnProperty,_=n||function(e,t,n){e[t]=n.value},v=typeof r==`function`?r:{},y=v.iterator||`@@iterator`,b=v.asyncIterator||`@@asyncIterator`,x=v.toStringTag||`@@toStringTag`;function S(e,t,r){return n(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{S({},``)}catch{S=function(e,t,n){return e[t]=n}}function ee(e,t,n,r){var a=i((t&&t.prototype instanceof D?t:D).prototype);return _(a,`_invoke`,{value:se(e,n,new ue(r||[]))}),a}function C(e,t,n){try{return{type:`normal`,arg:e.call(t,n)}}catch(e){return{type:`throw`,arg:e}}}m.wrap=ee;var te=`suspendedStart`,w=`suspendedYield`,ne=`executing`,T=`completed`,E={};function D(){}function O(){}function k(){}var re={};S(re,y,(function(){return this}));var ie=a&&a(a(de([])));ie&&ie!==h&&g.call(ie,y)&&(re=ie);var A=k.prototype=D.prototype=i(re);function ae(e){var t;o(t=[`next`,`throw`,`return`]).call(t,(function(t){S(e,t,(function(e){return this._invoke(t,e)}))}))}function oe(e,n){function r(i,a,o,s){var c=C(e[i],e,a);if(c.type!==`throw`){var l=c.arg,u=l.value;return u&&t(u)==`object`&&g.call(u,`__await`)?n.resolve(u.__await).then((function(e){r(`next`,e,o,s)}),(function(e){r(`throw`,e,o,s)})):n.resolve(u).then((function(e){l.value=e,o(l)}),(function(e){return r(`throw`,e,o,s)}))}s(c.arg)}var i;_(this,`_invoke`,{value:function(e,t){function a(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(a,a):a()}})}function se(e,t,n){var r=te;return function(i,a){if(r===ne)throw Error(`Generator is already running`);if(r===T){if(i===`throw`)throw a;return{value:p,done:!0}}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=ce(o,n);if(s){if(s===E)continue;return s}}if(n.method===`next`)n.sent=n._sent=n.arg;else if(n.method===`throw`){if(r===te)throw r=T,n.arg;n.dispatchException(n.arg)}else n.method===`return`&&n.abrupt(`return`,n.arg);r=ne;var c=C(e,t,n);if(c.type===`normal`){if(r=n.done?T:w,c.arg===E)continue;return{value:c.arg,done:n.done}}c.type===`throw`&&(r=T,n.method=`throw`,n.arg=c.arg)}}}function ce(e,t){var n=t.method,r=e.iterator[n];if(r===p)return t.delegate=null,n===`throw`&&e.iterator.return&&(t.method=`return`,t.arg=p,ce(e,t),t.method===`throw`)||n!==`return`&&(t.method=`throw`,t.arg=TypeError(`The iterator does not provide a '`+n+`' method`)),E;var i=C(r,e.iterator,t.arg);if(i.type===`throw`)return t.method=`throw`,t.arg=i.arg,t.delegate=null,E;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,t.method!==`return`&&(t.method=`next`,t.arg=p),t.delegate=null,E):a:(t.method=`throw`,t.arg=TypeError(`iterator result is not an object`),t.delegate=null,E)}function j(e){var t,n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),s(t=this.tryEntries).call(t,n)}function le(e){var t=e.completion||{};t.type=`normal`,delete t.arg,e.completion=t}function ue(e){this.tryEntries=[{tryLoc:`root`}],o(e).call(e,j,this),this.reset(!0)}function de(e){if(e||e===``){var n=e[y];if(n)return n.call(e);if(typeof e.next==`function`)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(g.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=p,t.done=!0,t};return i.next=i}}throw TypeError(t(e)+` is not iterable`)}return O.prototype=k,_(A,`constructor`,{value:k,configurable:!0}),_(k,`constructor`,{value:O,configurable:!0}),O.displayName=S(k,x,`GeneratorFunction`),m.isGeneratorFunction=function(e){var t=typeof e==`function`&&e.constructor;return!!t&&(t===O||(t.displayName||t.name)===`GeneratorFunction`)},m.mark=function(e){return c?c(e,k):(e.__proto__=k,S(e,x,`GeneratorFunction`)),e.prototype=i(A),e},m.awrap=function(e){return{__await:e}},ae(oe.prototype),S(oe.prototype,b,(function(){return this})),m.AsyncIterator=oe,m.async=function(e,t,n,r,i){i===void 0&&(i=l);var a=new oe(ee(e,t,n,r),i);return m.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},ae(A),S(A,x,`Generator`),S(A,y,(function(){return this})),S(A,`toString`,(function(){return`[object Generator]`})),m.keys=function(e){var t=Object(e),n=[];for(var r in t)s(n).call(n,r);return u(n).call(n),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},m.values=de,ue.prototype={constructor:ue,reset:function(e){var t;if(this.prev=0,this.next=0,this.sent=this._sent=p,this.done=!1,this.delegate=null,this.method=`next`,this.arg=p,o(t=this.tryEntries).call(t,le),!e)for(var n in this)n.charAt(0)===`t`&&g.call(this,n)&&!isNaN(+d(n).call(n,1))&&(this[n]=p)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type===`throw`)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type=`throw`,a.arg=e,t.next=n,r&&(t.method=`next`,t.arg=p),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if(i.tryLoc===`root`)return n(`end`);if(i.tryLoc<=this.prev){var o=g.call(i,`catchLoc`),s=g.call(i,`finallyLoc`);if(o&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw Error(`try statement without catch or finally`);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,`finallyLoc`)&&this.prev<r.finallyLoc){var i=r;break}}i&&(e===`break`||e===`continue`)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method=`next`,this.next=i.finallyLoc,E):this.complete(a)},complete:function(e,t){if(e.type===`throw`)throw e.arg;return e.type===`break`||e.type===`continue`?this.next=e.arg:e.type===`return`?(this.rval=this.arg=e.arg,this.method=`return`,this.next=`end`):e.type===`normal`&&t&&(this.next=t),E},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),le(n),E}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type===`throw`){var i=r.arg;le(n)}return i}}throw Error(`illegal catch attempt`)},delegateYield:function(e,t,n){return this.delegate={iterator:de(e),resultName:t,nextLoc:n},this.method===`next`&&(this.arg=p),E}},m}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports})(Hv);var gC=(0,Hv.exports)(),_C=gC;try{regeneratorRuntime=gC}catch{typeof globalThis==`object`?globalThis.regeneratorRuntime=gC:Function(`r`,`regeneratorRuntime = r`)(gC)}var vC=r(_C),yC={exports:{}},bC=s((function(){if(typeof ArrayBuffer==`function`){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,`a`,{value:8})}})),xC=s,SC=N,CC=S,wC=bC,TC=Object.isExtensible,EC=xC((function(){TC(1)}))||wC?function(e){return!!SC(e)&&(!wC||CC(e)!==`ArrayBuffer`)&&(!TC||TC(e))}:TC,DC=!s((function(){return Object.isExtensible(Object.preventExtensions({}))})),OC=z,kC=v,AC=wi,jC=N,MC=ht,NC=hn.f,PC=oa,FC=la,IC=EC,LC=DC,RC=!1,zC=bt(`meta`),BC=0,VC=function(e){NC(e,zC,{value:{objectID:`O`+ BC++,weakData:{}}})},HC=yC.exports={enable:function(){HC.enable=function(){},RC=!0;var e=PC.f,t=kC([].splice),n={};n[zC]=1,e(n).length&&(PC.f=function(n){for(var r=e(n),i=0,a=r.length;i<a;i++)if(r[i]===zC){t(r,i,1);break}return r},OC({target:`Object`,stat:!0,forced:!0},{getOwnPropertyNames:FC.f}))},fastKey:function(e,t){if(!jC(e))return typeof e==`symbol`?e:(typeof e==`string`?`S`:`P`)+e;if(!MC(e,zC)){if(!IC(e))return`F`;if(!t)return`E`;VC(e)}return e[zC].objectID},getWeakData:function(e,t){if(!MC(e,zC)){if(!IC(e))return!0;if(!t)return!1;VC(e)}return e[zC].weakData},onFreeze:function(e){return LC&&RC&&IC(e)&&!MC(e,zC)&&VC(e),e}};AC[zC]=!0;var UC=yC.exports,WC=z,GC=o,KC=UC,qC=s,JC=Pn,YC=by,XC=Xy,ZC=E,QC=N,$C=me,ew=Ja,tw=hn.f,nw=yo.forEach,rw=O,iw=uo.set,aw=uo.getterFor,ow=function(e,t,n){var r,i=e.indexOf(`Map`)!==-1,a=e.indexOf(`Weak`)!==-1,o=i?`set`:`add`,s=GC[e],c=s&&s.prototype,l={};if(rw&&ZC(s)&&(a||c.forEach&&!qC((function(){new s().entries().next()})))){var u=(r=t((function(t,n){iw(XC(t,u),{type:e,collection:new s}),$C(n)||YC(n,t[o],{that:t,AS_ENTRIES:i})}))).prototype,d=aw(e);nw([`add`,`clear`,`delete`,`forEach`,`get`,`has`,`set`,`keys`,`values`,`entries`],(function(e){var t=e===`add`||e===`set`;!(e in c)||a&&e===`clear`||JC(u,e,(function(n,r){var i=d(this).collection;if(!t&&a&&!QC(n))return e===`get`&&void 0;var o=i[e](n===0?0:n,r);return t?this:o}))})),a||tw(u,`size`,{configurable:!0,get:function(){return d(this).collection.size}})}else r=n.getConstructor(t,e,i,o),KC.enable();return ew(r,e,!1,!0),l[e]=r,WC({global:!0,forced:!0},l),a||n.setStrong(r,e,i),r},sw=Ca,cw=aa,lw=Ta,uw=function(e,t,n){for(var r in t)n&&n.unsafe&&e[r]?e[r]=t[r]:sw(e,r,t[r],n);return e},dw=mn,fw=Xy,pw=me,mw=by,hw=Ml,gw=Nl,_w=qy,vw=O,yw=UC.fastKey,bw=uo.set,xw=uo.getterFor,Sw={getConstructor:function(e,t,n,r){var i=e((function(e,i){fw(e,a),bw(e,{type:t,index:cw(null),first:void 0,last:void 0,size:0}),vw||(e.size=0),pw(i)||mw(i,e[r],{that:e,AS_ENTRIES:n})})),a=i.prototype,o=xw(t),s=function(e,t,n){var r,i,a=o(e),s=c(e,t);return s?s.value=n:(a.last=s={index:i=yw(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||=s,r&&(r.next=s),vw?a.size++:e.size++,i!==`F`&&(a.index[i]=s)),e},c=function(e,t){var n,r=o(e),i=yw(t);if(i!==`F`)return r.index[i];for(n=r.first;n;n=n.next)if(n.key===t)return n};return uw(a,{clear:function(){for(var e=o(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&=n.previous.next=void 0,delete t[n.index],n=n.next;e.first=e.last=void 0,vw?e.size=0:this.size=0},delete:function(e){var t=this,n=o(t),r=c(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),vw?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=o(this),r=dw(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),uw(a,n?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,e===0?0:e,t)}}:{add:function(e){return s(this,e=e===0?0:e,e)}}),vw&&lw(a,`size`,{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(e,t,n){var r=t+` Iterator`,i=xw(t),a=xw(r);hw(e,t,(function(e,t){bw(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?gw(t===`keys`?n.key:t===`values`?n.value:[n.key,n.value],!1):(e.target=void 0,gw(void 0,!0))}),n?`entries`:`values`,!n,!0),_w(t)}};ow(`Map`,(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Sw);var Cw=r(P.Map),ww=yo.some;z({target:`Array`,proto:!0,forced:!Td(`some`)},{some:function(e){return ww(this,e,arguments.length>1?arguments[1]:void 0)}});var Tw=ud(`Array`,`some`),Ew=I,Dw=Tw,Ow=Array.prototype,kw=r((function(e){var t=e.some;return e===Ow||Ew(Ow,e)&&t===Ow.some?Dw:t})),Aw=ud(`Array`,`keys`),jw=Sr,Mw=ht,Nw=I,Pw=Aw,Fw=Array.prototype,Iw={DOMTokenList:!0,NodeList:!0},Lw=r((function(e){var t=e.keys;return e===Fw||Nw(Fw,e)&&t===Fw.keys||Mw(Iw,jw(e))?Pw:t})),Rw=ha,zw=Math.floor,Bw=function(e,t){var n=e.length,r=zw(n/2);return n<8?Vw(e,t):Hw(e,Bw(Rw(e,0,r),t),Bw(Rw(e,r),t),t)},Vw=function(e,t){for(var n,r,i=e.length,a=1;a<i;){for(r=a,n=e[a];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==a++&&(e[r]=n)}return e},Hw=function(e,t,n,r){for(var i=t.length,a=n.length,o=0,s=0;o<i||s<a;)e[o+s]=o<i&&s<a?r(t[o],n[s])<=0?t[o++]:n[s++]:o<i?t[o++]:n[s++];return e},Uw=Bw,Ww=Ee.match(/firefox\/(\d+)/i),Gw=!!Ww&&+Ww[1],Kw=/MSIE|Trident/.test(Ee),qw=Ee.match(/AppleWebKit\/(\d+)\./),Jw=!!qw&&+qw[1],Yw=z,Xw=v,Zw=Ye,Qw=ft,$w=sr,eT=Om,tT=pi,nT=s,rT=Uw,iT=Td,aT=Gw,oT=Kw,sT=Ne,cT=Jw,lT=[],uT=Xw(lT.sort),dT=Xw(lT.push),fT=nT((function(){lT.sort(void 0)})),pT=nT((function(){lT.sort(null)})),mT=iT(`sort`),hT=!nT((function(){if(sT)return sT<70;if(!(aT&&aT>3)){if(oT)return!0;if(cT)return cT<603;var e,t,n,r,i=``;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)lT.push({k:t+r,v:n})}for(lT.sort((function(e,t){return t.v-e.v})),r=0;r<lT.length;r++)t=lT[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return i!==`DGBEFHACIJK`}}));Yw({target:`Array`,proto:!0,forced:fT||!pT||!mT||!hT},{sort:function(e){e!==void 0&&Zw(e);var t=Qw(this);if(hT)return e===void 0?uT(t):uT(t,e);var n,r,i=[],a=$w(t);for(r=0;r<a;r++)r in t&&dT(i,t[r]);for(rT(i,function(e){return function(t,n){return n===void 0?-1:t===void 0?1:e===void 0?tT(t)>tT(n)?1:-1:+e(t,n)||0}}(e)),n=$w(i),r=0;r<n;)t[r]=i[r++];for(;r<a;)eT(t,r++);return t}});var gT=ud(`Array`,`sort`),_T=I,vT=gT,yT=Array.prototype,bT=r((function(e){var t=e.sort;return e===yT||_T(yT,e)&&t===yT.sort?vT:t})),xT=ud(`Array`,`values`),ST=Sr,CT=ht,wT=I,TT=xT,ET=Array.prototype,DT={DOMTokenList:!0,NodeList:!0},OT=r((function(e){var t=e.values;return e===ET||wT(ET,e)&&t===ET.values||CT(DT,ST(e))?TT:t})),kT=r(Vu),AT=ud(`Array`,`entries`),jT=Sr,MT=ht,NT=I,PT=AT,FT=Array.prototype,IT={DOMTokenList:!0,NodeList:!0},LT=r((function(e){var t=e.entries;return e===FT||NT(FT,e)&&t===FT.entries||MT(IT,jT(e))?PT:t}));let RT,zT=new Uint8Array(16);function BT(){if(!RT&&(RT=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!RT))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return RT(zT)}let VT=[];for(let e=0;e<256;++e)VT.push((e+256).toString(16).slice(1));var HT={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function UT(e,t,n){if(HT.randomUUID&&!t&&!e)return HT.randomUUID();let r=(e||={}).random||(e.rng||BT)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n||=0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return VT[e[t+0]]+VT[e[t+1]]+VT[e[t+2]]+VT[e[t+3]]+`-`+VT[e[t+4]]+VT[e[t+5]]+`-`+VT[e[t+6]]+VT[e[t+7]]+`-`+VT[e[t+8]]+VT[e[t+9]]+`-`+VT[e[t+10]]+VT[e[t+11]]+VT[e[t+12]]+VT[e[t+13]]+VT[e[t+14]]+VT[e[t+15]]}(r)}function WT(e){return typeof e==`string`||typeof e==`number`}var GT=function(){function e(n){t(this,e),Yu(this,`_queue`,[]),Yu(this,`_timeout`,null),Yu(this,`_extended`,null),this.delay=null,this.max=1/0,this.setOptions(n)}return Ju(e,[{key:`setOptions`,value:function(e){e&&e.delay!==void 0&&(this.delay=e.delay),e&&e.max!==void 0&&(this.max=e.max),this._flushIfNeeded()}},{key:`destroy`,value:function(){if(this.flush(),this._extended){for(var e=this._extended.object,t=this._extended.methods,n=0;n<t.length;n++){var r=t[n];r.original?e[r.name]=r.original:delete e[r.name]}this._extended=null}}},{key:`replace`,value:function(e,t){var n=this,r=e[t];if(!r)throw Error(`Method `+t+` undefined`);e[t]=function(){var e=[...arguments];n.queue({args:e,fn:r,context:this})}}},{key:`queue`,value:function(e){typeof e==`function`?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}},{key:`_flushIfNeeded`,value:function(){var e=this;this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay==`number`&&(this._timeout=Ih((function(){e.flush()}),this.delay))}},{key:`flush`,value:function(){var e,t;hm(e=Km(t=this._queue).call(t,0)).call(e,(function(e){e.fn.apply(e.context||e.fn,e.args||[])}))}}],[{key:`extend`,value:function(t,n){var r=new e(n);if(t.flush!==void 0)throw Error(`Target object already has a property flush`);t.flush=function(){r.flush()};var i=[{name:`flush`,original:void 0}];if(n&&n.replace)for(var a=0;a<n.replace.length;a++){var o=n.replace[a];i.push({name:o,original:t[o]}),r.replace(t,o)}return r._extended={object:t,methods:i},r}}]),e}(),KT=function(){function e(){t(this,e),Yu(this,`_subscribers`,{"*":[],add:[],remove:[],update:[]}),Yu(this,`subscribe`,e.prototype.on),Yu(this,`unsubscribe`,e.prototype.off)}return Ju(e,[{key:`_trigger`,value:function(e,t,n){var r,i;if(e===`*`)throw Error(`Cannot trigger event *`);hm(r=Kp(i=[]).call(i,Bp(this._subscribers[e]),Bp(this._subscribers[`*`]))).call(r,(function(r){r(e,t,n??null)}))}},{key:`on`,value:function(e,t){typeof t==`function`&&this._subscribers[e].push(t)}},{key:`off`,value:function(e,t){var n;this._subscribers[e]=Rd(n=this._subscribers[e]).call(n,(function(e){return e!==t}))}}]),e}();ow(`Set`,(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Sw);var qT=r(P.Set),JT=r(Af);function YT(e,t){var n=Vp!==void 0&&Zf(e)||e[`@@iterator`];if(!n){if(tm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return XT(e,t);var r=qp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Jf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return XT(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
47
47
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function XT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ZT=function(e){function n(e){t(this,n),this._pairs=e}return Ju(n,[{key:e,value:vC.mark((function e(){var t,n,r,i,a;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=zp(n.value,2),i=r[0],a=r[1],e.next=7,[i,a];case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`entries`,value:vC.mark((function e(){var t,n,r,i,a;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=zp(n.value,2),i=r[0],a=r[1],e.next=7,[i,a];case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`keys`,value:vC.mark((function e(){var t,n,r,i;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=zp(n.value,1),i=r[0],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`values`,value:vC.mark((function e(){var t,n,r,i;return vC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=YT(this._pairs),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=9;break}return r=zp(n.value,2),i=r[1],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case`end`:return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:`toIdArray`,value:function(){var e;return Wd(e=Bp(this._pairs)).call(e,(function(e){return e[0]}))}},{key:`toItemArray`,value:function(){var e;return Wd(e=Bp(this._pairs)).call(e,(function(e){return e[1]}))}},{key:`toEntryArray`,value:function(){return Bp(this._pairs)}},{key:`toObjectMap`,value:function(){var e,t=ph(null),n=YT(this._pairs);try{for(n.s();!(e=n.n()).done;){var r=zp(e.value,2),i=r[0];t[i]=r[1]}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`toMap`,value:function(){return new Cw(this._pairs)}},{key:`toIdSet`,value:function(){return new qT(this.toIdArray())}},{key:`toItemSet`,value:function(){return new qT(this.toItemArray())}},{key:`cache`,value:function(){return new n(Bp(this._pairs))}},{key:`distinct`,value:function(e){var t,n=new qT,r=YT(this._pairs);try{for(r.s();!(t=r.n()).done;){var i=zp(t.value,2),a=i[0],o=i[1];n.add(e(o,a))}}catch(e){r.e(e)}finally{r.f()}return n}},{key:`filter`,value:function(e){var t=this._pairs;return new n({[kT]:()=>vC.mark((function n(){var r,i,a,o,s;return vC.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=YT(t),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=10;break}if(a=zp(i.value,2),o=a[0],s=a[1],!e(s,o)){n.next=8;break}return n.next=8,[o,s];case 8:n.next=3;break;case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(1),r.e(n.t0);case 15:return n.prev=15,r.f(),n.finish(15);case 18:case`end`:return n.stop()}}),n,null,[[1,12,15,18]])}))()})}},{key:`forEach`,value:function(e){var t,n=YT(this._pairs);try{for(n.s();!(t=n.n()).done;){var r=zp(t.value,2),i=r[0];e(r[1],i)}}catch(e){n.e(e)}finally{n.f()}}},{key:`map`,value:function(e){var t=this._pairs;return new n({[kT]:()=>vC.mark((function n(){var r,i,a,o,s;return vC.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=YT(t),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=9;break}return a=zp(i.value,2),o=a[0],s=a[1],n.next=7,[o,e(s,o)];case 7:n.next=3;break;case 9:n.next=14;break;case 11:n.prev=11,n.t0=n.catch(1),r.e(n.t0);case 14:return n.prev=14,r.f(),n.finish(14);case 17:case`end`:return n.stop()}}),n,null,[[1,11,14,17]])}))()})}},{key:`max`,value:function(e){var t=JT(this._pairs),n=t.next();if(n.done)return null;for(var r=n.value[1],i=e(n.value[1],n.value[0]);!(n=t.next()).done;){var a=zp(n.value,2),o=a[0],s=a[1],c=e(s,o);c>i&&(i=c,r=s)}return r}},{key:`min`,value:function(e){var t=JT(this._pairs),n=t.next();if(n.done)return null;for(var r=n.value[1],i=e(n.value[1],n.value[0]);!(n=t.next()).done;){var a=zp(n.value,2),o=a[0],s=a[1],c=e(s,o);c<i&&(i=c,r=s)}return r}},{key:`reduce`,value:function(e,t){var n,r=YT(this._pairs);try{for(r.s();!(n=r.n()).done;){var i=zp(n.value,2),a=i[0];t=e(t,i[1],a)}}catch(e){r.e(e)}finally{r.f()}return t}},{key:`sort`,value:function(e){var t=this;return new n({[kT]:function(){var n;return JT(bT(n=Bp(t._pairs)).call(n,(function(t,n){var r=zp(t,2),i=r[0],a=r[1],o=zp(n,2),s=o[0],c=o[1];return e(a,c,i,s)})))}})}}]),n}(kT);function QT(e,t){var n=im(e);if(cv){var r=cv(e);t&&(r=Rd(r).call(r,(function(t){return _v(e,t).enumerable}))),n.push.apply(n,r)}return n}function $T(e){for(var t=1;t<arguments.length;t++){var n,r,i=arguments[t]==null?{}:arguments[t];t%2?hm(n=QT(Object(i),!0)).call(n,(function(t){Yu(e,t,i[t])})):Sv?kv(e,Sv(i)):hm(r=QT(Object(i))).call(r,(function(t){Av(e,t,_v(i,t))}))}return e}function eE(e,t){var n=Vp!==void 0&&Zf(e)||e[`@@iterator`];if(!n){if(tm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return tE(e,t);var r=qp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Jf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tE(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
48
48
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function tE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nE(e){var t=function(){if(typeof Reflect>`u`||!sv||sv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(sv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Vv(e);if(t){var i=Vv(this).constructor;n=sv(r,arguments,i)}else n=r.apply(this,arguments);return Rv(this,n)}}var rE=function(e){Lv(r,e);var n=nE(r);function r(e,i){var a;return t(this,r),Yu(W(a=n.call(this)),`_queue`,null),e&&!tm(e)&&(i=e,e=[]),a._options=i||{},a._data=new Cw,a.length=0,a._idProp=a._options.fieldId||`id`,e&&e.length&&a.add(e),a.setOptions(i),a}return Ju(r,[{key:`idProp`,get:function(){return this._idProp}},{key:`setOptions`,value:function(e){e&&e.queue!==void 0&&(!1===e.queue?this._queue&&=(this._queue.destroy(),null):(this._queue||=GT.extend(this,{replace:[`add`,`update`,`remove`]}),e.queue&&typeof e.queue==`object`&&this._queue.setOptions(e.queue)))}},{key:`add`,value:function(e,t){var n,r=this,i=[];if(tm(e)){var a=Wd(e).call(e,(function(e){return e[r._idProp]}));if(kw(a).call(a,(function(e){return r._data.has(e)})))throw Error(`A duplicate id was found in the parameter array.`);for(var o=0,s=e.length;o<s;o++)n=this._addItem(e[o]),i.push(n)}else{if(!e||typeof e!=`object`)throw Error(`Unknown dataType`);n=this._addItem(e),i.push(n)}return i.length&&this._trigger(`add`,{items:i},t),i}},{key:`update`,value:function(e,t){var n=this,r=[],i=[],a=[],o=[],s=this._idProp,c=function(e){var t=e[s];if(t!=null&&n._data.has(t)){var c=e,l=oh({},n._data.get(t)),u=n._updateItem(c);i.push(u),o.push(c),a.push(l)}else{var d=n._addItem(e);r.push(d)}};if(tm(e))for(var l=0,u=e.length;l<u;l++)e[l]&&typeof e[l]==`object`?c(e[l]):console.warn(`Ignoring input item, which is not an object at index `+l);else{if(!e||typeof e!=`object`)throw Error(`Unknown dataType`);c(e)}if(r.length&&this._trigger(`add`,{items:r},t),i.length){var d={items:i,oldData:a,data:o};this._trigger(`update`,d,t)}return Kp(r).call(r,i)}},{key:`updateOnly`,value:function(e,t){var n,r=this;tm(e)||(e=[e]);var i=Wd(n=Wd(e).call(e,(function(e){var t=r._data.get(e[r._idProp]);if(t==null)throw Error(`Updating non-existent items is not allowed.`);return{oldData:t,update:e}}))).call(n,(function(e){var t=e.oldData,n=e.update,i=t[r._idProp],a=function(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return L_.apply(void 0,Kp(t=[{},e]).call(t,r))}(t,n);return r._data.set(i,a),{id:i,oldData:t,updatedData:a}}));if(i.length){var a={items:Wd(i).call(i,(function(e){return e.id})),oldData:Wd(i).call(i,(function(e){return e.oldData})),data:Wd(i).call(i,(function(e){return e.updatedData}))};return this._trigger(`update`,a,t),a.items}return[]}},{key:`get`,value:function(e,t){var n=void 0,r=void 0,i=void 0;WT(e)?(n=e,i=t):tm(e)?(r=e,i=t):i=e;var a=i&&i.returnType===`Object`?`Object`:`Array`,o=i&&Rd(i),s=[],c=void 0,l=void 0,u=void 0;if(n!=null)(c=this._data.get(n))&&o&&!o(c)&&(c=void 0);else if(r!=null)for(var d=0,f=r.length;d<f;d++)(c=this._data.get(r[d]))==null||o&&!o(c)||s.push(c);else for(var p,m=0,h=(l=Bp(Lw(p=this._data).call(p))).length;m<h;m++)u=l[m],(c=this._data.get(u))==null||o&&!o(c)||s.push(c);if(i&&i.order&&n==null&&this._sort(s,i.order),i&&i.fields){var g=i.fields;if(n!=null&&c!=null)c=this._filterFields(c,g);else for(var _=0,v=s.length;_<v;_++)s[_]=this._filterFields(s[_],g)}if(a==`Object`){for(var y={},b=0,x=s.length;b<x;b++){var S=s[b];y[S[this._idProp]]=S}return y}return n==null?s:c??null}},{key:`getIds`,value:function(e){var t=this._data,n=e&&Rd(e),r=e&&e.order,i=Bp(Lw(t).call(t)),a=[];if(n)if(r){for(var o=[],s=0,c=i.length;s<c;s++){var l=i[s],u=this._data.get(l);u!=null&&n(u)&&o.push(u)}this._sort(o,r);for(var d=0,f=o.length;d<f;d++)a.push(o[d][this._idProp])}else for(var p=0,m=i.length;p<m;p++){var h=i[p],g=this._data.get(h);g!=null&&n(g)&&a.push(g[this._idProp])}else if(r){for(var _=[],v=0,y=i.length;v<y;v++){var b=i[v];_.push(t.get(b))}this._sort(_,r);for(var x=0,S=_.length;x<S;x++)a.push(_[x][this._idProp])}else for(var ee=0,C=i.length;ee<C;ee++){var te=i[ee],w=t.get(te);w!=null&&a.push(w[this._idProp])}return a}},{key:`getDataSet`,value:function(){return this}},{key:`forEach`,value:function(e,t){var n=t&&Rd(t),r=this._data,i=Bp(Lw(r).call(r));if(t&&t.order)for(var a=this.get(t),o=0,s=a.length;o<s;o++){var c=a[o];e(c,c[this._idProp])}else for(var l=0,u=i.length;l<u;l++){var d=i[l],f=this._data.get(d);f==null||n&&!n(f)||e(f,d)}}},{key:`map`,value:function(e,t){for(var n=t&&Rd(t),r=[],i=this._data,a=Bp(Lw(i).call(i)),o=0,s=a.length;o<s;o++){var c=a[o],l=this._data.get(c);l==null||n&&!n(l)||r.push(e(l,c))}return t&&t.order&&this._sort(r,t.order),r}},{key:`_filterFields`,value:function(e,t){var n;return e&&Md(n=tm(t)?t:im(t)).call(n,(function(t,n){return t[n]=e[n],t}),{})}},{key:`_sort`,value:function(e,t){if(typeof t==`string`){var n=t;bT(e).call(e,(function(e,t){var r=e[n],i=t[n];return r>i?1:r<i?-1:0}))}else{if(typeof t!=`function`)throw TypeError(`Order must be a function or a string`);bT(e).call(e,t)}}},{key:`remove`,value:function(e,t){for(var n=[],r=[],i=tm(e)?e:[e],a=0,o=i.length;a<o;a++){var s=this._remove(i[a]);if(s){var c=s[this._idProp];c!=null&&(n.push(c),r.push(s))}}return n.length&&this._trigger(`remove`,{items:n,oldData:r},t),n}},{key:`_remove`,value:function(e){var t;if(WT(e)?t=e:e&&typeof e==`object`&&(t=e[this._idProp]),t!=null&&this._data.has(t)){var n=this._data.get(t)||null;return this._data.delete(t),--this.length,n}return null}},{key:`clear`,value:function(e){for(var t,n=Bp(Lw(t=this._data).call(t)),r=[],i=0,a=n.length;i<a;i++)r.push(this._data.get(n[i]));return this._data.clear(),this.length=0,this._trigger(`remove`,{items:n,oldData:r},e),n}},{key:`max`,value:function(e){var t,n,r=null,i=null,a=eE(OT(t=this._data).call(t));try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o[e];typeof s==`number`&&(i==null||s>i)&&(r=o,i=s)}}catch(e){a.e(e)}finally{a.f()}return r||null}},{key:`min`,value:function(e){var t,n,r=null,i=null,a=eE(OT(t=this._data).call(t));try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o[e];typeof s==`number`&&(i==null||s<i)&&(r=o,i=s)}}catch(e){a.e(e)}finally{a.f()}return r||null}},{key:`distinct`,value:function(e){for(var t=this._data,n=Bp(Lw(t).call(t)),r=[],i=0,a=0,o=n.length;a<o;a++){for(var s=n[a],c=t.get(s)[e],l=!1,u=0;u<i;u++)if(r[u]==c){l=!0;break}l||c===void 0||(r[i]=c,i++)}return r}},{key:`_addItem`,value:function(e){var t=function(e,t){return e[t]??(e[t]=UT()),e}(e,this._idProp),n=t[this._idProp];if(this._data.has(n))throw Error(`Cannot add item: item with id `+n+` already exists`);return this._data.set(n,t),++this.length,n}},{key:`_updateItem`,value:function(e){var t=e[this._idProp];if(t==null)throw Error(`Cannot update item: item has no id (item: `+gh(e)+`)`);var n=this._data.get(t);if(!n)throw Error(`Cannot update item: no item with id `+t+` found`);return this._data.set(t,$T($T({},n),e)),t}},{key:`stream`,value:function(e){if(e){var t=this._data;return new ZT({[kT]:()=>vC.mark((function n(){var r,i,a,o;return vC.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=eE(e),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=11;break}if(a=i.value,(o=t.get(a))==null){n.next=9;break}return n.next=9,[a,o];case 9:n.next=3;break;case 11:n.next=16;break;case 13:n.prev=13,n.t0=n.catch(1),r.e(n.t0);case 16:return n.prev=16,r.f(),n.finish(16);case 19:case`end`:return n.stop()}}),n,null,[[1,13,16,19]])}))()})}var n;return new ZT({[kT]:gd(n=LT(this._data)).call(n,this._data)})}}]),r}(KT);function iE(e,t){var n=Vp!==void 0&&Zf(e)||e[`@@iterator`];if(!n){if(tm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return aE(e,t);var r=qp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Jf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aE(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
49
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function aE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oE(e){var t=function(){if(typeof Reflect>`u`||!sv||sv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(sv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Vv(e);if(t){var i=Vv(this).constructor;n=sv(r,arguments,i)}else n=r.apply(this,arguments);return Rv(this,n)}}var sE=function(e){Lv(r,e);var n=oE(r);function r(e,i){var a,o;return t(this,r),Yu(W(o=n.call(this)),`length`,0),Yu(W(o),`_ids`,new qT),o._options=i||{},o._listener=gd(a=o._onEvent).call(a,W(o)),o.setData(e),o}return Ju(r,[{key:`idProp`,get:function(){return this.getDataSet().idProp}},{key:`setData`,value:function(e){if(this._data){this._data.off&&this._data.off(`*`,this._listener);var t=this._data.getIds({filter:Rd(this._options)}),n=this._data.get(t);this._ids.clear(),this.length=0,this._trigger(`remove`,{items:t,oldData:n})}if(e!=null){this._data=e;for(var r=this._data.getIds({filter:Rd(this._options)}),i=0,a=r.length;i<a;i++){var o=r[i];this._ids.add(o)}this.length=r.length,this._trigger(`add`,{items:r})}else this._data=new rE;this._data.on&&this._data.on(`*`,this._listener)}},{key:`refresh`,value:function(){for(var e=this._data.getIds({filter:Rd(this._options)}),t=Bp(this._ids),n={},r=[],i=[],a=[],o=0,s=e.length;o<s;o++){var c=e[o];n[c]=!0,this._ids.has(c)||(r.push(c),this._ids.add(c))}for(var l=0,u=t.length;l<u;l++){var d=t[l],f=this._data.get(d);f==null?console.error(`If you see this, report it please.`):n[d]||(i.push(d),a.push(f),this._ids.delete(d))}this.length+=r.length-i.length,r.length&&this._trigger(`add`,{items:r}),i.length&&this._trigger(`remove`,{items:i,oldData:a})}},{key:`get`,value:function(e,t){if(this._data==null)return null;var n,r=null;WT(e)||tm(e)?(r=e,n=t):n=e;var i=oh({},this._options,n),a=Rd(this._options),o=n&&Rd(n);return a&&o&&(i.filter=function(e){return a(e)&&o(e)}),r==null?this._data.get(i):this._data.get(r,i)}},{key:`getIds`,value:function(e){if(this._data.length){var t,n=Rd(this._options),r=e==null?null:Rd(e);return t=r?n?function(e){return n(e)&&r(e)}:r:n,this._data.getIds({filter:t,order:e&&e.order})}return[]}},{key:`forEach`,value:function(e,t){if(this._data){var n,r,i=Rd(this._options),a=t&&Rd(t);r=a?i?function(e){return i(e)&&a(e)}:a:i,hm(n=this._data).call(n,e,{filter:r,order:t&&t.order})}}},{key:`map`,value:function(e,t){if(this._data){var n,r,i=Rd(this._options),a=t&&Rd(t);return r=a?i?function(e){return i(e)&&a(e)}:a:i,Wd(n=this._data).call(n,e,{filter:r,order:t&&t.order})}return[]}},{key:`getDataSet`,value:function(){return this._data.getDataSet()}},{key:`stream`,value:function(e){var t;return this._data.stream(e||{[kT]:gd(t=Lw(this._ids)).call(t,this._ids)})}},{key:`dispose`,value:function(){var e;(e=this._data)!=null&&e.off&&this._data.off(`*`,this._listener);var t,n=`This data view has already been disposed of.`,i={get:function(){throw Error(n)},set:function(){throw Error(n)},configurable:!1},a=iE(em(r.prototype));try{for(a.s();!(t=a.n()).done;){var o=t.value;Av(this,o,i)}}catch(e){a.e(e)}finally{a.f()}}},{key:`_onEvent`,value:function(e,t,n){if(t&&t.items&&this._data){var r=t.items,i=[],a=[],o=[],s=[],c=[],l=[];switch(e){case`add`:for(var u=0,d=r.length;u<d;u++){var f=r[u];this.get(f)&&(this._ids.add(f),i.push(f))}break;case`update`:for(var p=0,m=r.length;p<m;p++){var h=r[p];this.get(h)?this._ids.has(h)?(a.push(h),c.push(t.data[p]),s.push(t.oldData[p])):(this._ids.add(h),i.push(h)):this._ids.has(h)&&(this._ids.delete(h),o.push(h),l.push(t.oldData[p]))}break;case`remove`:for(var g=0,_=r.length;g<_;g++){var v=r[g];this._ids.has(v)&&(this._ids.delete(v),o.push(v),l.push(t.oldData[g]))}}this.length+=i.length-o.length,i.length&&this._trigger(`add`,{items:i},n),a.length&&this._trigger(`update`,{items:a,oldData:s,data:c},n),o.length&&this._trigger(`remove`,{items:o,oldData:l},n)}}}]),r}(KT);function cE(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof t.add==`function`&&typeof t.clear==`function`&&typeof t.distinct==`function`&&typeof hm(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Wd(t)==`function`&&typeof t.max==`function`&&typeof t.min==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.remove==`function`&&typeof t.setOptions==`function`&&typeof t.stream==`function`&&typeof t.update==`function`&&typeof t.updateOnly==`function`}e.DELETE=I_,e.DataSet=rE,e.DataStream=ZT,e.DataView=sE,e.Queue=GT,e.createNewDataPipeFrom=function(e){return new cf(e)},e.isDataSetLike=cE,e.isDataViewLike=function(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof hm(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Wd(t)==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.stream==`function`&&cE(e,t.getDataSet())}}))}))(),se=ae(),ce=c(),j=e(i(),1);function le(e){let t=new Map,n=e=>t.set(e,(t.get(e)??0)+1);for(let t of e)t.from===t.to?n(t.from):(n(t.from),n(t.to));return t}function ue(e,t=14,n=40,r=25){if(e<=0)return t;let i=Math.min(1,Math.sqrt(e/r));return Math.round(t+(n-t)*i)}var de=ne();function fe(e){let t=new Map;for(let n of e){let e=(0,de.pickDisplayLabel)(n.labels);e&&t.set(e,(t.get(e)??0)+1)}return[...t.entries()].map(([e,t])=>({label:e,count:t,colour:(0,de.colourForLabel)(e),shape:(0,de.shapeForLabel)(e)})).sort((e,t)=>e.label.localeCompare(t.label))}var pe=new Set([`Conversation`,`AdminConversation`,`PublicConversation`]),me=/^(\d{4}-\d{2}-\d{2})T/,he=24;function ge(e){let t=e.match(me);return t?t[1]:null}function _e(e,t){if(e.length===0)return``;let n=e.split(/\s+/).filter(e=>e.length>0);if(n.length===0)return``;if(n.length===1){let e=n[0];return e.length<=he?e:e.slice(0,he-1)+`…`}let r=[],i=0;for(;r.length<t&&i<n.length;){let e=``;for(;i<n.length;){let t=e.length===0?n[i]:`${e} ${n[i]}`;if(t.length<=he)e=t,i++;else break}e.length===0&&(e=n[i].slice(0,he-1)+`…`,i++),r.push(e)}if(i<n.length&&r.length>0){let e=n.slice(i).join(` `),t=r.length-1;r[t]=(r[t].length===0?e:`${r[t]} ${e}`).slice(0,he-1)+`…`}return r.join(`
49
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function aE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oE(e){var t=function(){if(typeof Reflect>`u`||!sv||sv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(sv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Vv(e);if(t){var i=Vv(this).constructor;n=sv(r,arguments,i)}else n=r.apply(this,arguments);return Rv(this,n)}}var sE=function(e){Lv(r,e);var n=oE(r);function r(e,i){var a,o;return t(this,r),Yu(W(o=n.call(this)),`length`,0),Yu(W(o),`_ids`,new qT),o._options=i||{},o._listener=gd(a=o._onEvent).call(a,W(o)),o.setData(e),o}return Ju(r,[{key:`idProp`,get:function(){return this.getDataSet().idProp}},{key:`setData`,value:function(e){if(this._data){this._data.off&&this._data.off(`*`,this._listener);var t=this._data.getIds({filter:Rd(this._options)}),n=this._data.get(t);this._ids.clear(),this.length=0,this._trigger(`remove`,{items:t,oldData:n})}if(e!=null){this._data=e;for(var r=this._data.getIds({filter:Rd(this._options)}),i=0,a=r.length;i<a;i++){var o=r[i];this._ids.add(o)}this.length=r.length,this._trigger(`add`,{items:r})}else this._data=new rE;this._data.on&&this._data.on(`*`,this._listener)}},{key:`refresh`,value:function(){for(var e=this._data.getIds({filter:Rd(this._options)}),t=Bp(this._ids),n={},r=[],i=[],a=[],o=0,s=e.length;o<s;o++){var c=e[o];n[c]=!0,this._ids.has(c)||(r.push(c),this._ids.add(c))}for(var l=0,u=t.length;l<u;l++){var d=t[l],f=this._data.get(d);f==null?console.error(`If you see this, report it please.`):n[d]||(i.push(d),a.push(f),this._ids.delete(d))}this.length+=r.length-i.length,r.length&&this._trigger(`add`,{items:r}),i.length&&this._trigger(`remove`,{items:i,oldData:a})}},{key:`get`,value:function(e,t){if(this._data==null)return null;var n,r=null;WT(e)||tm(e)?(r=e,n=t):n=e;var i=oh({},this._options,n),a=Rd(this._options),o=n&&Rd(n);return a&&o&&(i.filter=function(e){return a(e)&&o(e)}),r==null?this._data.get(i):this._data.get(r,i)}},{key:`getIds`,value:function(e){if(this._data.length){var t,n=Rd(this._options),r=e==null?null:Rd(e);return t=r?n?function(e){return n(e)&&r(e)}:r:n,this._data.getIds({filter:t,order:e&&e.order})}return[]}},{key:`forEach`,value:function(e,t){if(this._data){var n,r,i=Rd(this._options),a=t&&Rd(t);r=a?i?function(e){return i(e)&&a(e)}:a:i,hm(n=this._data).call(n,e,{filter:r,order:t&&t.order})}}},{key:`map`,value:function(e,t){if(this._data){var n,r,i=Rd(this._options),a=t&&Rd(t);return r=a?i?function(e){return i(e)&&a(e)}:a:i,Wd(n=this._data).call(n,e,{filter:r,order:t&&t.order})}return[]}},{key:`getDataSet`,value:function(){return this._data.getDataSet()}},{key:`stream`,value:function(e){var t;return this._data.stream(e||{[kT]:gd(t=Lw(this._ids)).call(t,this._ids)})}},{key:`dispose`,value:function(){var e;(e=this._data)!=null&&e.off&&this._data.off(`*`,this._listener);var t,n=`This data view has already been disposed of.`,i={get:function(){throw Error(n)},set:function(){throw Error(n)},configurable:!1},a=iE(em(r.prototype));try{for(a.s();!(t=a.n()).done;){var o=t.value;Av(this,o,i)}}catch(e){a.e(e)}finally{a.f()}}},{key:`_onEvent`,value:function(e,t,n){if(t&&t.items&&this._data){var r=t.items,i=[],a=[],o=[],s=[],c=[],l=[];switch(e){case`add`:for(var u=0,d=r.length;u<d;u++){var f=r[u];this.get(f)&&(this._ids.add(f),i.push(f))}break;case`update`:for(var p=0,m=r.length;p<m;p++){var h=r[p];this.get(h)?this._ids.has(h)?(a.push(h),c.push(t.data[p]),s.push(t.oldData[p])):(this._ids.add(h),i.push(h)):this._ids.has(h)&&(this._ids.delete(h),o.push(h),l.push(t.oldData[p]))}break;case`remove`:for(var g=0,_=r.length;g<_;g++){var v=r[g];this._ids.has(v)&&(this._ids.delete(v),o.push(v),l.push(t.oldData[g]))}}this.length+=i.length-o.length,i.length&&this._trigger(`add`,{items:i},n),a.length&&this._trigger(`update`,{items:a,oldData:s,data:c},n),o.length&&this._trigger(`remove`,{items:o,oldData:l},n)}}}]),r}(KT);function cE(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof t.add==`function`&&typeof t.clear==`function`&&typeof t.distinct==`function`&&typeof hm(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Wd(t)==`function`&&typeof t.max==`function`&&typeof t.min==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.remove==`function`&&typeof t.setOptions==`function`&&typeof t.stream==`function`&&typeof t.update==`function`&&typeof t.updateOnly==`function`}e.DELETE=I_,e.DataSet=rE,e.DataStream=ZT,e.DataView=sE,e.Queue=GT,e.createNewDataPipeFrom=function(e){return new cf(e)},e.isDataSetLike=cE,e.isDataViewLike=function(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof hm(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Wd(t)==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.stream==`function`&&cE(e,t.getDataSet())}}))}))(),se=ae(),ce=c(),j=e(r(),1);function le(e){let t=new Map,n=e=>t.set(e,(t.get(e)??0)+1);for(let t of e)t.from===t.to?n(t.from):(n(t.from),n(t.to));return t}function ue(e,t=14,n=40,r=25){if(e<=0)return t;let i=Math.min(1,Math.sqrt(e/r));return Math.round(t+(n-t)*i)}var de=ne();function fe(e){let t=new Map;for(let n of e){let e=(0,de.pickDisplayLabel)(n.labels);e&&t.set(e,(t.get(e)??0)+1)}return[...t.entries()].map(([e,t])=>({label:e,count:t,colour:(0,de.colourForLabel)(e),shape:(0,de.shapeForLabel)(e)})).sort((e,t)=>e.label.localeCompare(t.label))}var pe=new Set([`Conversation`,`AdminConversation`,`PublicConversation`]),me=/^(\d{4}-\d{2}-\d{2})T/,he=24;function ge(e){let t=e.match(me);return t?t[1]:null}function _e(e,t){if(e.length===0)return``;let n=e.split(/\s+/).filter(e=>e.length>0);if(n.length===0)return``;if(n.length===1){let e=n[0];return e.length<=he?e:e.slice(0,he-1)+`…`}let r=[],i=0;for(;r.length<t&&i<n.length;){let e=``;for(;i<n.length;){let t=e.length===0?n[i]:`${e} ${n[i]}`;if(t.length<=he)e=t,i++;else break}e.length===0&&(e=n[i].slice(0,he-1)+`…`,i++),r.push(e)}if(i<n.length&&r.length>0){let e=n.slice(i).join(` `),t=r.length-1;r[t]=(r[t].length===0?e:`${r[t]} ${e}`).slice(0,he-1)+`…`}return r.join(`
50
50
  `)}function ve(e){return _e(e,2)}function ye(e,t){let n=e.labels[0];if(!n||!pe.has(n)||t<.7)return(0,de.pickShortLabel)(e);let r=ve((0,de.pickDisplayName)(e));if(t<1.3)return r;let i=e.properties,a=typeof i.createdAt==`string`?i.createdAt:``,o=typeof i.messageCount==`number`?i.messageCount:null;if(a.length===0||o===null)return r;let s=ge(a);return s===null?r:`${r}\n${s} · ${o} msgs`}var be=new Set([`Person`,`Organization`,`Concept`]),xe=80;function M(e,t){let n=(0,de.pickDisplayName)(e);if(t<1.3)return _e(n,3);let r=n.length<=24?n:n.slice(0,23)+`…`,i=e.properties.compiledTruth;if(typeof i!=`string`||i.length===0)return _e((0,de.pickDisplayName)(e),3);let a=_e(i.length>xe?i.slice(0,xe-1)+`…`:i,2);return a.length===0?r:`${r}\n${a}`}function N(e,t){if(t<.7)return(0,de.pickShortLabel)(e);let n=e.labels[0];return n&&pe.has(n)?ye(e,t):n&&be.has(n)?M(e,t):_e((0,de.pickDisplayName)(e),3)}function P(e){let t=e.properties,n=typeof t.createdAt==`string`?t.createdAt:``,r=typeof t.updatedAt==`string`?t.updatedAt:``,i=e.labels.join(` · `);return[(0,de.pickDisplayName)(e),i,`id: ${e.id}`,n?`createdAt: ${n}`:``,r?`updatedAt: ${r}`:``].filter(e=>e.length>0).join(`
51
- `)}function Se(e){let{node:t,degree:n,revealed:r}=e,i=e.scale??1,a=t.labels[0]??`Unknown`,o=(0,w.resolveNodeColour)(t.labels),s=o.displayLabel,c=o.colour,l=s??a,u=(0,w.nodeImageDataUri)(l),d=u===null?l:null,f=ue(n),p=r?N(t,i):``,m=P(t),h=e.position?{x:e.position.x,y:e.position.y,physics:!1}:{},g;return g=t.trashed?u===null?{id:t.id,label:p,title:m,color:{background:`${c}40`,border:c},borderWidth:2,shapeProperties:{borderDashes:[6,4]},shape:(0,w.shapeForLabel)(l),size:f,group:a,...h}:{id:t.id,label:p,title:m,shape:`image`,image:u,size:f,opacity:.35,group:a,...h}:u===null?{id:t.id,label:p,title:m,color:c,shape:(0,w.shapeForLabel)(l),size:f,group:a,...h}:{id:t.id,label:p,title:m,shape:`image`,image:u,size:f,group:a,...h},{visNode:g,iconFallbackLabel:d}}function Ce(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(n[i]!==r[i]||JSON.stringify(e[n[i]])!==JSON.stringify(t[r[i]]))return!1;return!0}function we(e,t){if(!!e.trashed!=!!t.trashed||e.labels.length!==t.labels.length)return!1;for(let n=0;n<e.labels.length;n++)if(e.labels[n]!==t.labels[n])return!1;return Ce(e.properties,t.properties)}function Te(e,t){let n=[],r=[],i=new Set;for(let a of t){i.add(a.id);let t=e.get(a.id);t===void 0?n.push(a):we(t,a)||r.push(a)}let a=[];for(let t of e.keys())i.has(t)||a.push(t);return{added:n,updated:r,removed:a}}function F(e,t){let n=[],r=new Set;for(let i of t)r.add(i.id),e.has(i.id)||n.push(i);let i=[];for(let t of e.keys())r.has(t)||i.push(t);return{added:n,removed:i}}function I(e,t){return e.added.length>0||e.updated.length>0||e.removed.length>0||t.added.length>0||t.removed.length>0}function Ee(e){let t=new URLSearchParams(e),n=t.get(`nodeId`);if(n)return{kind:`focus`,nodeId:n,nodeLabel:t.get(`label`)};let r=t.get(`label`);return r?{kind:`labels`,labels:[r]}:null}function De(e){return!e.inNeighbourhood&&!e.searchActive&&e.selectedLabelsCount===0&&e.topLevelTotal!==null&&e.nodeCount>0}function Oe(e,t){let n=t===1?`node`:`nodes`;return`Showing ${e.toLocaleString()} of ${t.toLocaleString()} top-level ${n}`}function ke(e){return typeof e.total==`number`?e.total:null}function Ae(e){return(e.loading||e.rendering)&&!e.searchActive}function je(e){return!e.inNeighbourhood&&!e.searchActive}function Me(e,t){let n=`/api/admin/graph-subgraph`,r=t.includeAgentActions?`&includeAgentActions=1`:``;if(e.kind===`neighbourhood`){let i=t.search&&t.search.q?`&q=${encodeURIComponent(t.search.q)}&limit=${t.search.limit}`:``;return`${n}?mode=neighbourhood&elementId=${encodeURIComponent(e.rootElementId)}${r}${i}`}let i=e.includeTrashed?`&includeTrashed=1`:``;return e.selectedLabels.length===0?`${n}?mode=default&topLevel=1${i}${r}`:`${n}?mode=default&labels=${encodeURIComponent(e.selectedLabels.join(`,`))}${i}${r}`}function Ne(e,t){return e.length<10?[...e,t]:[e[0],...e.slice(e.length-8),t]}function Pe(e){return e.length<=1?e:e.slice(0,-1)}function Fe(e){return[e]}function Ie(e){let t=e[e.length-1];return t.kind===`filter`?`f:${[...t.selectedLabels].sort().join(`,`)}:${t.includeTrashed?1:0}:${t.includeAgentActions?1:0}`:`n:${t.rootElementId}`}function Le(e){let t=e[0];if(t.kind!==`filter`)throw Error(`view-stack invariant: root must be filter view`);return t}var Re=`admin-sessions`;function ze(){if(typeof window>`u`)return null;if(typeof BroadcastChannel>`u`)return console.warn(`[admin-sessions/broadcast] unsupported — manual refresh only`),null;try{return new BroadcastChannel(Re)}catch(e){return console.warn(`[admin-sessions/broadcast] ctor failed: ${e instanceof Error?e.message:String(e)} — manual refresh only`),null}}function Be(e){let t=ze();if(t)try{let n={type:`mutated`,reason:e};t.postMessage(n)}catch(e){console.warn(`[admin-sessions/broadcast] postMessage failed: ${e instanceof Error?e.message:String(e)}`)}finally{try{t.close()}catch{}}}function Ve(e){return e.trashed===!0?`skip-trashed`:`pivot`}function He(e,t,n,r){let i=[],a=[];for(let o of e){let e=t.get(o.nodeId);if(!e)continue;a.push(o.nodeId);let{colour:s}=n(e.labels),c=e.trashed?`${s}40`:s;i.push({id:o.nodeId,borderWidth:3,color:{background:c,border:r}})}return{updates:i,inWindow:a}}function Ue(e,t){let n=t.length>0?new Set(t):null,r=new Map,i=new Set,a=[];for(let t of e)n&&!t.labels.some(e=>n.has(e))||r.set(t.nodeId,{id:t.nodeId,labels:t.labels,properties:t.properties});for(let t of e)if(r.has(t.nodeId))for(let e of t.related){if(n&&!e.labels.some(e=>n.has(e)))continue;r.has(e.nodeId)||r.set(e.nodeId,{id:e.nodeId,labels:e.labels,properties:e.properties});let[o,s]=e.direction===`outgoing`?[t.nodeId,e.nodeId]:[e.nodeId,t.nodeId],c=`${o}|${s}|${e.relationship}`;i.has(c)||(i.add(c),a.push({id:c,from:o,to:s,type:e.relationship}))}return{nodes:[...r.values()],edges:a}}var We=2e3;function Ge(e){let t=typeof e==`number`?e:Number(e);return!Number.isFinite(t)||t<=0?100:Math.min(Math.max(Math.floor(t),1),We)}function Ke(e,t,n,r){let i=encodeURIComponent(t.join(`,`));return`/api/admin/graph-search?q=${encodeURIComponent(e)}&labels=${i}&limit=${n}${r?`&threshold=0`:``}`}var qe={solver:`forceAtlas2Based`,forceAtlas2Based:{gravitationalConstant:-50,centralGravity:.01,springLength:100,springConstant:.08,damping:.4,avoidOverlap:0},stabilization:{iterations:2e3}},Je=220,Ye=3;function Xe(e){if(!(e.nodes.length<=5))return{physics:qe,nodePositions:new Map};let t=new Map,n=(Ye-1)*Je/2,r=(Math.ceil(e.nodes.length/Ye)-1)*Je/2;for(let i=0;i<e.nodes.length;i++){let a=i%Ye,o=Math.floor(i/Ye);t.set(e.nodes[i].id,{x:a*Je-n,y:o*Je-r})}return{physics:!1,nodePositions:t}}function Ze(e,t){let n=(t.t-e.t)/1e3;if(n<=0)return 0;let r=0,i=0;for(let n of Object.keys(t.positions)){let a=e.positions[n];if(!a)continue;let o=t.positions[n];r+=Math.hypot(o.x-a.x,o.y-a.y),i++}return i===0?0:r/i/n}function Qe(e,t,n){if(t>n.threshold)return{belowCount:0,freeze:!1};let r=e+1;return{belowCount:r,freeze:r>=n.needed}}function $e(e,t){let n=Date.now(),r=null,i=0,a=null,o=()=>{a!==null&&(clearInterval(a),a=null)},s=(r,i,a)=>{o();try{e.setOptions({physics:!1})}catch{}t.report?.({avgMotion:r,settleMs:Date.now()-n,capped:a,nodeCount:i})};return a=setInterval(()=>{let t;try{t=e.getPositions()}catch{o();return}let a={t:Date.now(),positions:t},c=Object.keys(t).length;if(r){let e=Ze(r,a),t=Qe(i,e,{threshold:5,needed:2});if(i=t.belowCount,t.freeze){s(e,c,!1);return}if(Date.now()-n>=3e4){s(e,c,!0);return}}r=a},250),o}var et=`graph-side-panel-size`;function tt(e,t){let n=Math.max(280,t.maxWidth),r=Math.max(240,t.maxHeight),i=Math.min(Math.max(e.width,280),n),a=Math.min(Math.max(e.height,240),r);return{width:i,height:a,clampedW:i!==e.width,clampedH:a!==e.height}}function nt(e){try{localStorage.setItem(et,JSON.stringify({width:e.width,height:e.height}))}catch{}}function rt(){try{let e=localStorage.getItem(et);if(!e)return{size:null,source:`default`};let t=JSON.parse(e);return t&&typeof t==`object`&&typeof t.width==`number`&&typeof t.height==`number`&&Number.isFinite(t.width)&&Number.isFinite(t.height)?{size:{width:t.width,height:t.height},source:`storage`}:{size:null,source:`default`}}catch{return{size:null,source:`default`}}}function it(e){return typeof e==`string`?/^https?:\/\/\S+$/i.test(e.trim()):!1}function at(e){let t=t=>{let n=e[t];if(n&&typeof n==`object`&&`low`in n){let e=n.low;return typeof e==`number`?e:null}return null},n=t(`year`),r=t(`month`),i=t(`day`);if(n===null||r===null||i===null)return null;let a=`${String(n).padStart(4,`0`)}-${String(r).padStart(2,`0`)}-${String(i).padStart(2,`0`)}`;if(!(`hour`in e))return a;let o=t(`hour`),s=t(`minute`),c=t(`second`);return o===null||s===null||c===null?a:`${a} ${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}:${String(c).padStart(2,`0`)}`}function ot(e){if(e==null)return``;if(Array.isArray(e))return e.length>8?`[${e.length} items]`:e.map(String).join(`, `);if(typeof e==`object`){if(`year`in e&&`month`in e&&`day`in e&&typeof e.year==`object`){let t=at(e);if(t)return t}return JSON.stringify(e)}return String(e)}var L=n(),st=76,ct=36,lt=16,ut=520;function dt(e){let t=e?.offsetParent??null,n=t?.clientWidth??0,r=t?.clientHeight??0;return{maxWidth:n-ct-lt,maxHeight:r-st-lt}}function ft(e){return typeof e==`string`?e:ot(e)}function pt(e){return it(e)?(0,L.jsx)(`a`,{className:`graph-side-link`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:e}):ot(e)}function mt({value:e,label:t,field:n}){let{status:r,copy:i}=T({onResult:e=>{e?console.log(`[graph-panel] op=copy result=ok field=${n}`):console.warn(`[graph-panel] op=copy result=error field=${n} msg=clipboard-write-failed`)}}),a=r===`ok`?`Copied`:r===`fail`?`Copy failed`:`Copy ${t}`;return(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-copy${r===`ok`?` graph-side-copy-ok`:``}${r===`fail`?` graph-side-copy-fail`:``}`,onClick:()=>i(e),"aria-label":a,title:a,children:[r===`ok`?(0,L.jsx)(o,{size:12}):(0,L.jsx)(S,{size:12}),r!==`idle`&&(0,L.jsx)(`span`,{className:`graph-side-copy-feedback`,children:r===`ok`?`Copied`:`Copy failed`})]})}function ht({node:e,edges:t,nodesById:n,adminFetch:r,onClose:i,onRestored:a,onTrashed:o}){let c=Object.entries(e.properties).filter(([,e])=>e!=null),u=t.filter(t=>t.from===e.id||t.to===e.id),f=u.length>0,[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(null),[v,y]=(0,j.useState)(!1),[b,x]=(0,j.useState)(null),[S,ee]=(0,j.useState)(`properties`),te=_(`(max-width: 640px)`),w=(0,j.useRef)(null),ne=(0,j.useRef)(rt()),[T,E]=(0,j.useState)(()=>ne.current.size??{width:280,height:ut}),D=(0,j.useRef)(!1),O=(0,j.useRef)(null);(0,j.useEffect)(()=>()=>{O.current?.()},[]),(0,j.useEffect)(()=>{m(!1),g(null),y(!1),x(null),ee(`properties`)},[e.id]),(0,j.useLayoutEffect)(()=>{if(D.current)return;D.current=!0;let e=dt(w.current),t=tt(ne.current.size??{width:280,height:ut},e);E({width:t.width,height:t.height}),console.log(`[graph-panel] op=restore-size w=${t.width} h=${t.height} source=${ne.current.source}`)},[]);let k=(0,j.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=e.clientY,r=T.width,i=T.height,a=dt(w.current);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}let o={width:r,height:i,clampedW:!1,clampedH:!1},s=e=>{o=tt({width:r+(t-e.clientX),height:i+(e.clientY-n)},a),E({width:o.width,height:o.height})},c=()=>{window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l),O.current=null},l=()=>{c(),nt({width:o.width,height:o.height}),console.log(`[graph-panel] op=resize w=${o.width} h=${o.height} clampedW=${o.clampedW} clampedH=${o.clampedH}`)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l),O.current=c},[T.width,T.height]),re=(0,j.useCallback)(()=>{m(!0),g(null),r(`/api/admin/graph-restore`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);a()}).catch(e=>{g(e instanceof Error?e.message:String(e)),m(!1)})},[e.id,a,r]),ie=(0,j.useCallback)(()=>{y(!0),x(null),r(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id,by:`graph-side-panel-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);o()}).catch(e=>{x(e instanceof Error?e.message:String(e)),y(!1)})},[e.id,o,r]),A=S===`connections`&&f?`connections`:`properties`,ae=te?void 0:{width:`${T.width}px`,height:`${T.height}px`};return(0,L.jsxs)(`aside`,{ref:w,className:`graph-side-panel${e.trashed?` graph-side-panel-trashed`:``}`,style:ae,children:[!te&&(0,L.jsx)(`div`,{className:`graph-side-resize-handle`,role:`separator`,"aria-label":`Resize panel`,"aria-orientation":`vertical`,onPointerDown:k}),(0,L.jsxs)(`header`,{className:`graph-side-header`,children:[(0,L.jsx)(`div`,{children:(()=>{if(e.labels.some(e=>pe.has(e))){let t=(0,de.pickDisplayName)(e),n=e.properties.createdAt,r=typeof n==`string`?n:``,i=r?(0,de.formatRunTimestamp)(r):null,a=e.labels.join(` · `)+(e.trashed?` · Trashed`:``)+` · ${e.id}`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`h2`,{className:`graph-side-name`,title:t,children:t}),i&&(0,L.jsx)(`div`,{className:`graph-side-created`,children:i}),(0,L.jsxs)(`div`,{className:`graph-side-meta`,children:[(0,L.jsx)(`span`,{children:a}),(0,L.jsx)(mt,{value:e.id,label:`id`,field:`id`})]})]})}return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`graph-side-labels`,children:[e.labels.join(` · `),e.trashed?` · Trashed`:``]}),(0,L.jsxs)(`div`,{className:`graph-side-id-row`,children:[(0,L.jsx)(`span`,{className:`graph-side-id`,children:e.id}),(0,L.jsx)(mt,{value:e.id,label:`id`,field:`id`})]})]})})()}),(0,L.jsx)(`button`,{type:`button`,className:`graph-side-close`,onClick:i,"aria-label":`Close`,children:(0,L.jsx)(d,{size:14})})]}),e.trashed&&(0,L.jsxs)(`dl`,{className:`graph-side-props graph-side-trash-meta`,children:[(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:`trashedAt`}),(0,L.jsx)(`dd`,{children:ot(e.properties.trashedAt)})]}),(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:`trashedBy`}),(0,L.jsx)(`dd`,{children:ot(e.properties.trashedBy)})]})]}),(0,L.jsxs)(`div`,{className:`graph-side-tabs`,role:`tablist`,"aria-label":`Node detail sections`,children:[(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`properties`,className:`graph-side-tab${A===`properties`?` graph-side-tab-on`:``}`,onClick:()=>ee(`properties`),children:`Properties`}),f&&(0,L.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`connections`,className:`graph-side-tab${A===`connections`?` graph-side-tab-on`:``}`,onClick:()=>ee(`connections`),children:[`Connections (`,u.length,`)`]})]}),(0,L.jsxs)(`div`,{className:`graph-side-body`,children:[A===`properties`&&(0,L.jsxs)(`dl`,{className:`graph-side-props`,children:[c.length===0&&(0,L.jsx)(`div`,{className:`graph-side-empty`,children:`No properties.`}),c.map(([e,t])=>(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:e}),(0,L.jsxs)(`dd`,{children:[(0,L.jsx)(`span`,{className:`graph-side-prop-value`,children:pt(t)}),(0,L.jsx)(mt,{value:ft(t),label:e,field:`prop`})]})]},e))]}),A===`connections`&&f&&(0,L.jsx)(`section`,{className:`graph-side-edges`,children:u.map(t=>{let r=t.from===e.id,i=r?t.to:t.from,a=n.get(i),o=a?(0,de.pickShortLabel)(a):i,s=r?`→`:`←`,c=Object.entries(t.properties??{}).filter(([,e])=>e!=null&&e!==``);return(0,L.jsxs)(`div`,{className:`graph-side-edge`,children:[(0,L.jsxs)(`div`,{className:`graph-side-edge-header`,children:[(0,L.jsx)(`span`,{className:`graph-side-edge-type`,children:t.type}),(0,L.jsx)(`span`,{className:`graph-side-edge-arrow`,children:s}),(0,L.jsx)(`span`,{className:`graph-side-edge-other`,title:o,children:o})]}),c.length>0&&(0,L.jsx)(`dl`,{className:`graph-side-edge-props`,children:c.map(([e,t])=>(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:e}),(0,L.jsxs)(`dd`,{children:[(0,L.jsx)(`span`,{className:`graph-side-prop-value`,children:pt(t)}),(0,L.jsx)(mt,{value:ft(t),label:e,field:`edge-prop`})]})]},e))})]},t.id)})})]}),e.trashed&&(0,L.jsxs)(`footer`,{className:`graph-side-footer`,children:[!p&&!h&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-restore`,onClick:re,children:[(0,L.jsx)(C,{size:14}),` Restore`]}),p&&(0,L.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,L.jsxs)(`p`,{children:[(0,L.jsx)(s,{size:14,className:`spin`}),` Restoring…`]})}),h&&(0,L.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,L.jsxs)(`p`,{children:[`Restore failed: `,h]}),(0,L.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{g(null)},children:`Close`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:re,children:`Retry`})]})]})]}),!e.trashed&&(0,L.jsxs)(`footer`,{className:`graph-side-footer`,children:[!v&&!b&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-trash`,onClick:ie,children:[(0,L.jsx)(l,{size:14}),` Trash`]}),v&&(0,L.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,L.jsxs)(`p`,{children:[(0,L.jsx)(s,{size:14,className:`spin`}),` Trashing…`]})}),b&&(0,L.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,L.jsxs)(`p`,{children:[`Trash failed: `,b]}),(0,L.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{x(null)},children:`Close`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:ie,children:`Retry`})]})]})]})]})}var gt=`graph-shell`,_t=`graph-shell--fullscreen`;function vt(e,t){return t&&e?`${gt} ${_t}`:gt}function yt(e){return e}function bt(e){return e.isFullscreen&&!e.filterOpen}function xt(e){return e<.7?`compact`:e<1.3?`wrapped`:`detailed`}var St=150,Ct=`#FBBF24`;function wt(e,t,n){let r=getComputedStyle(e).getPropertyValue(t).trim();return r.length>0?r:n}var Tt=`#0F172A`,Et=`#475569`,Dt=`#CBD5E1`;function Ot(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}var kt=`maxy-graph-search-limit-v1`,At=250,jt=12e3,Mt=1200;function Nt(){let[e,t]=(0,j.useState)(null),[n,r]=(0,j.useState)(!1),[i,a]=(0,j.useState)(void 0),[o,c]=(0,j.useState)(null),[l,u]=(0,j.useState)(void 0),[d,p]=(0,j.useState)(null),[g,_]=(0,j.useState)(null),v=(0,j.useMemo)(()=>typeof window>`u`?null:Ee(window.location.search),[]),b=(0,j.useMemo)(()=>v?.kind===`focus`?{nodeId:v.nodeId,nodeLabel:v.nodeLabel}:null,[v]),x=(0,j.useMemo)(()=>v?.kind===`labels`?v.labels:null,[v]);(0,j.useEffect)(()=>{b&&zt(`deep-link`,{nodeId:b.nodeId.length>16?b.nodeId.slice(0,16)+`…`:b.nodeId,label:b.nodeLabel??``})},[b]),(0,j.useEffect)(()=>{!x||x.length===0||zt(`label-seed`,{label:x[0]})},[x]),(0,j.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&a(e.businessName),e.sessionId!==void 0&&c(e.sessionId??null),_(e.role??null),u(e.userName===void 0?null:e.userName),p(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let S=(0,j.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[ee,C]=(0,j.useState)(!1),te=(0,j.useCallback)(async()=>{C(!0);try{let e=await h();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{C(!1)}},[]);return n?e?(0,L.jsx)(f,{cacheKey:e,surface:`graph`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=graph`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,L.jsx)(y,{cacheKey:e,businessName:i,sessionId:o,onLogout:S,onDisconnect:te,disconnecting:ee,userName:l,userAvatar:d,role:g,children:(0,L.jsxs)(`div`,{className:`data-page graph-page`,children:[(0,L.jsx)(`header`,{className:`data-header`,children:(0,L.jsxs)(`h1`,{className:`data-title`,children:[(0,L.jsx)(m,{size:18}),` Graph`]})}),(0,L.jsx)(`main`,{className:`graph-main`,children:(0,L.jsx)(It,{cacheKey:e,initialFocus:b,initialLabels:x,allowFullscreen:!0})})]})})}):(0,L.jsxs)(`div`,{className:`data-page`,children:[(0,L.jsx)(`header`,{className:`data-header`,children:(0,L.jsxs)(`h1`,{className:`data-title`,children:[(0,L.jsx)(m,{size:18}),` Graph`]})}),(0,L.jsxs)(`div`,{className:`data-empty`,children:[(0,L.jsx)(`p`,{children:`You are not signed in.`}),(0,L.jsxs)(`p`,{children:[`Open the `,(0,L.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,L.jsx)(`div`,{className:`data-page`,children:(0,L.jsxs)(`div`,{className:`data-loading`,children:[(0,L.jsx)(s,{size:18,className:`spin`}),` Loading…`]})})}var Pt={triangle:`7,1 13,13 1,13`,triangleDown:`1,1 13,1 7,13`,square:`2,2 12,2 12,12 2,12`,diamond:`7,1 13,7 7,13 1,7`,star:`7,1 8.8,5.2 13,5.2 9.6,8 10.9,12.4 7,9.7 3.1,12.4 4.4,8 1,5.2 5.2,5.2`,hexagon:`4,1.5 10,1.5 13,7 10,12.5 4,12.5 1,7`};function Ft({label:e,shape:t,colour:n}){let r=(0,w.nodeImageDataUri)(e);return r===null?(0,L.jsx)(`svg`,{className:`graph-legend-swatch`,viewBox:`0 0 14 14`,width:`14`,height:`14`,"aria-hidden":`true`,children:t===`dot`?(0,L.jsx)(`circle`,{cx:`7`,cy:`7`,r:`6`,fill:n}):(0,L.jsx)(`polygon`,{points:Pt[t],fill:n})}):(0,L.jsx)(`img`,{className:`graph-legend-swatch`,src:r,width:14,height:14,alt:``,"aria-hidden":`true`})}function It({cacheKey:e,initialFocus:t=null,initialLabels:n=null,allowFullscreen:r=!1}){let{adminFetch:i,cacheKey:o,sessionRefetchNonce:c}=a({initialCacheKey:e,surface:`graph`}),f=(0,j.useRef)(null),m=(0,j.useRef)(null),[h,_]=(0,j.useState)(!1),y=(0,j.useRef)(null),S=(0,j.useRef)(null),C=(0,j.useRef)(null),ne=(0,j.useRef)(null),T=(0,j.useRef)(new Map),A=(0,j.useRef)([]),ae=(0,j.useRef)(null),ce=(0,j.useRef)(null),de=(0,j.useRef)(null),pe=(0,j.useRef)([]),me=(0,j.useRef)(null),he=(0,j.useRef)(null),ge=(0,j.useRef)(null),_e=(0,j.useRef)(null),ve=(0,j.useRef)(!1),ye=(0,j.useRef)(new Set),be=(0,j.useCallback)(e=>{if(e===null)return;let t=ye.current;if(!t.has(e)){t.add(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-style`,op:`icon-fallback`,distinctFallback:t.size,labels:Array.from(t).sort().join(`,`)}),keepalive:!0}).catch(()=>{})}catch{}}},[]),xe=(0,j.useRef)(!1),[M,P]=(0,j.useState)([{kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}]);(0,j.useEffect)(()=>{t?.nodeId&&P(e=>{let n=e[e.length-1];return n.kind===`neighbourhood`&&n.rootElementId===t.nodeId?e:[e[0],{kind:`neighbourhood`,rootElementId:t.nodeId,rootLabel:t.nodeLabel}]})},[t?.nodeId,t?.nodeLabel]);let Ce=n&&n.length>0?[...n].sort().join(`,`):null;(0,j.useEffect)(()=>{Ce&&(sn.current=!0,P([{kind:`filter`,selectedLabels:Ce.split(`,`),includeTrashed:!1,includeAgentActions:!1}]))},[Ce]);let[we,Ee]=(0,j.useState)(!1),[Re,ze]=(0,j.useState)(!1),[We,qe]=(0,j.useState)(null),[Je,Ye]=(0,j.useState)(null),[Ze,Qe]=(0,j.useState)(0),[et,tt]=(0,j.useState)(null),[nt,rt]=(0,j.useState)(null),[it,at]=(0,j.useState)(!1),[ot,st]=(0,j.useState)(!1),[ct,lt]=(0,j.useState)(null),[ut,dt]=(0,j.useState)(``),[ft,pt]=(0,j.useState)(``),[mt,gt]=(0,j.useState)(null),[_t,Nt]=(0,j.useState)(null),[Pt,It]=(0,j.useState)(()=>{if(typeof window>`u`)return 100;let e=window.localStorage.getItem(kt);return e?Ge(e):100}),[Bt,Vt]=(0,j.useState)(Pt),[Ht,Ut]=(0,j.useState)(`hybrid`),[Wt,Gt]=(0,j.useState)(0),[Kt,qt]=(0,j.useState)(!1),[Jt,Yt]=(0,j.useState)(0),[Xt,Zt]=(0,j.useState)(0),[Qt,$t]=(0,j.useState)([]),[en,tn]=(0,j.useState)({labels:[],includeTrashed:!1}),[nn,rn]=(0,j.useState)(!1),[an,on]=(0,j.useState)(!1),sn=(0,j.useRef)(!1),cn=(0,j.useRef)(null),ln=(0,j.useRef)(null),un=(0,j.useRef)(null),[dn,fn]=(0,j.useState)(null),[pn,mn]=(0,j.useState)(!1),hn=(0,j.useCallback)(e=>{let t=ln.current;if(!t)return;let n=t.getBoundingClientRect();un.current={dx:e.clientX-n.left,dy:e.clientY-n.top};try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}},[]),gn=(0,j.useCallback)(e=>{let t=un.current,n=ln.current,r=n?.offsetParent;if(!t||!n||!r)return;let i=r.getBoundingClientRect(),a=Math.max(0,r.clientWidth-n.offsetWidth),o=Math.max(0,r.clientHeight-n.offsetHeight);fn({x:Math.min(Math.max(0,e.clientX-i.left-t.dx),a),y:Math.min(Math.max(0,e.clientY-i.top-t.dy),o)})},[]),_n=(0,j.useCallback)(e=>{un.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),vn=(0,j.useMemo)(()=>fe(T.current.values()),[Ze]);(0,j.useEffect)(()=>{let e=!1,t=i(`/api/admin/graph-labels-in-graph`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[]}}),n=i(`/api/admin/graph-default-view`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[],includeTrashed:!1}});return Promise.all([t,n]).then(([t,n])=>{if(!e&&($t(t.labels),tn(n),!sn.current)){sn.current=!0;let e=new Set(t.labels.map(e=>e.label)),r=n.labels.filter(t=>e.has(t));(r.length>0||n.includeTrashed)&&P(e=>[{kind:`filter`,selectedLabels:r,includeTrashed:n.includeTrashed,includeAgentActions:!1},...e.slice(1)])}}),()=>{e=!0}},[o,c,i]);let yn=M[0].kind===`filter`?M[0].includeAgentActions:!1;(0,j.useEffect)(()=>{if(!sn.current)return;let e=!1;return i(`/api/admin/graph-labels-in-graph?includeAgentActions=${yn?`1`:`0`}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).then(t=>{e||$t(t.labels)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph-refetch`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}),()=>{e=!0}},[o,c,yn,Xt,i]),(0,j.useEffect)(()=>{if(!nn)return;let e=e=>{cn.current&&(cn.current.contains(e.target)||rn(!1))},t=e=>{e.key===`Escape`&&rn(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[nn]);let bn=(0,j.useCallback)((e,t)=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:e,msg:t}),keepalive:!0}).catch(()=>{})}catch{}},[]),xn=(0,j.useCallback)(e=>{console.log(`[graph-fullscreen] op=exit reason=${e}`),_(!1)},[]);(0,j.useEffect)(()=>{if(!r||!h)return;let e=e=>{e.key===`Escape`&&bt({isFullscreen:h,filterOpen:nn})&&xn(`escape`)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r,h,nn,xn]);let Sn=(0,j.useRef)(h);(0,j.useEffect)(()=>{if(!r)return;let e=Sn.current!==h;if(Sn.current=h,!e)return;let t=requestAnimationFrame(()=>{let e=m.current;try{e?.redraw()}catch{}if(!h)return;let t=y.current?.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=t?Math.round(t.width):0,a=t?Math.round(t.height):0;console.log(`[graph-fullscreen] op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`),t&&(t.width<n-2||t.height<r-2)&&bn(`graph-fullscreen-not-covering`,`op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`);try{let t=e?.canvas?.frame?.canvas,n=f.current;if(t&&n){let e=t.clientWidth,r=t.clientHeight,i=n.clientWidth,a=n.clientHeight;console.log(`[graph-fullscreen] op=resized canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`),(Math.abs(e-i)>2||Math.abs(r-a)>2)&&bn(`graph-fullscreen-canvas-mismatch`,`canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`)}}catch{}});return()=>cancelAnimationFrame(t)},[r,h,bn]);let Cn=(0,j.useCallback)(()=>{if(C.current)try{C.current.clear()}catch{}if(ne.current)try{ne.current.clear()}catch{}},[]),wn=(0,j.useCallback)((e,t)=>{lt(null),i(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);rt(null);try{m.current?.unselectAll()}catch{}P(e=>[Le(e)]),Yt(e=>e+1),Be(`graph-trash`)}).catch(n=>{let r=n instanceof Error?n.message:String(n);lt(`Failed to delete: ${r}`),st(!0),window.setTimeout(()=>st(!1),Mt);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete`,elementId:e,label:t,msg:r}),keepalive:!0}).catch(()=>{})}catch{}})},[i]),Tn=(0,j.useCallback)(e=>{lt(null);let t=e.length;Promise.allSettled(e.map(e=>i(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async t=>{let n=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(n.error??`HTTP ${t.status}`);return e}))).then(e=>{let n=e.filter(e=>e.status===`rejected`);rt(null);try{m.current?.unselectAll()}catch{}if(P(e=>[Le(e)]),Yt(e=>e+1),Be(`graph-trash`),n.length>0){let e=t-n.length;lt(e===0?`Failed to delete ${t} node${t===1?``:`s`}.`:`Deleted ${e} of ${t}; ${n.length} failed.`),st(!0),window.setTimeout(()=>st(!1),Mt);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete-batch`,total:t,failed:n.length}),keepalive:!0}).catch(()=>{})}catch{}}})},[i]),En=M[M.length-1],Dn=(0,j.useMemo)(()=>Ie(M),[M]),On=(0,j.useRef)(Dn);(0,j.useEffect)(()=>{On.current=Dn},[Dn]);let kn=(0,j.useRef)(M);(0,j.useEffect)(()=>{kn.current=M},[M]),(0,j.useEffect)(()=>{if(ft){ae.current?.abort(),ae.current=null;return}let e=window.setTimeout(()=>{ae.current?.abort();let e=new AbortController;ae.current=e,Ee(!0),console.log(`[graph-page] op=render-spinner state=shown reason=fetch-start`),qe(null),Ye(null),i(Me(En,{includeAgentActions:Le(M).includeAgentActions,search:null}),{signal:e.signal}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(e.status===413)throw new Lt(t);if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{e.signal.aborted||(T.current=new Map(t.nodes.map(e=>[e.id,e])),Qe(t.nodes.length),tt(ke(t)),jn(t.nodes,t.edges))}).catch(t=>{if(!e.signal.aborted){if(ze(!1),t instanceof Lt){console.log(`[graph-page] op=render-spinner state=hidden reason=ceiling`),Ye(t.body),Qe(0),T.current=new Map,Cn();return}console.log(`[graph-page] op=render-spinner state=hidden reason=error`),qe(t instanceof Error?t.message:String(t))}}).finally(()=>{e.signal.aborted||Ee(!1)})},At);return()=>{window.clearTimeout(e)}},[o,Dn,Jt,c,ft,Bt]),(0,j.useEffect)(()=>{xe.current=we},[we]);let An=(0,j.useCallback)((e,t)=>{let n=C.current,r=ne.current;if(!n||!r||!m.current)return{added:0,updated:0,removed:0,edgesAdded:0,edgesRemoved:0,maxDegree:0};let i=Te(T.current,e),a=F(new Map(A.current.map(e=>[e.id,e])),t);if(!I(i,a))return{added:0,updated:0,removed:0,edgesAdded:0,edgesRemoved:0,maxDegree:0};let o=le(t),s=0;for(let e of o.values())e>s&&(s=e);let c=(()=>{try{return m.current.getScale()||1}catch{return 1}})();a.removed.length>0&&r.remove(a.removed);let l=new Set(e.map(e=>e.id)),u=a.added.filter(e=>e.type!==`PART_OF`||l.has(e.from)&&l.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type}));u.length>0&&r.add(u),i.removed.length>0&&n.remove(i.removed);let d=i.updated.map(e=>e.id),f=d.length>0?(()=>{try{return m.current.getPositions(d)}catch{return{}}})():{},p=new Set(i.added.map(e=>e.id)),h=[...i.added,...i.updated];for(let e of h){let{visNode:t,iconFallbackLabel:r}=Se({node:e,degree:o.get(e.id)??0,revealed:ve.current,scale:c,position:p.has(e.id)?void 0:f[e.id]});be(r),n.update(t)}let g=new Set(h.map(e=>e.id));for(let t of e){if(g.has(t.id))continue;let e=ue(o.get(t.id)??0),r=n.get(t.id);r&&r.size!==e&&n.update({id:t.id,size:e})}return T.current=new Map(e.map(e=>[e.id,e])),A.current=t,Qe(e.length),{added:i.added.length,updated:i.updated.length,removed:i.removed.length,edgesAdded:u.length,edgesRemoved:a.removed.length,maxDegree:s}},[Qe]);(0,j.useEffect)(()=>{if(En.kind!==`filter`||ft)return;let e=Me(En,{includeAgentActions:Le(M).includeAgentActions,search:null}),t=!1,n=null,r=(e,t)=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-poll`,op:e,view:En.kind,...t}),keepalive:!0}).catch(()=>{})}catch{}},a=()=>{if(document.hidden||xe.current)return;n?.abort();let a=new AbortController;n=a;let o=Date.now();i(e,{signal:a.signal}).then(e=>e.ok?e.json():null).then(e=>{if(t||a.signal.aborted||!e||!Array.isArray(e.nodes))return;let n=An(e.nodes,e.edges??[]),i=ke(e);tt(i),r(`tick`,{fetchMs:Date.now()-o,total:i,...n})}).catch(e=>{a.signal.aborted||r(`poll-error`,{msg:e instanceof Error?e.message:String(e)})})};r(`start`,{intervalMs:jt});let o=window.setInterval(a,jt),s=()=>{document.visibilityState===`visible`?(r(`resume`,{}),a()):r(`pause`,{})};return document.addEventListener(`visibilitychange`,s),()=>{t=!0,n?.abort(),window.clearInterval(o),document.removeEventListener(`visibilitychange`,s),r(`stop`,{})}},[o,Dn,ft,c,En.kind]),(0,j.useEffect)(()=>()=>{ae.current?.abort(),S.current?.(),S.current=null,m.current?.destroy(),m.current=null,_e.current!==null&&(clearTimeout(_e.current),_e.current=null)},[]);let jn=(0,j.useCallback)((e,t)=>{if(!f.current)return;ze(!0),A.current=t;let n=new Set([`Message`,`UserMessage`,`AssistantMessage`]),r=e=>e.labels.some(e=>n.has(e)),i=new Map,a=e.filter(r);if(a.length>0){let e=new Set(a.map(e=>e.id)),n=new Map,r=new Set;for(let i of t)i.type===`NEXT`&&e.has(i.from)&&e.has(i.to)&&(n.set(i.from,i.to),r.add(i.to));let o=[],s=new Set;for(let e of a){if(r.has(e.id))continue;let t=e.id;for(;t&&!s.has(t);)s.add(t),o.push(t),t=n.get(t)}for(let e of a)s.has(e.id)||(o.push(e.id),s.add(e.id));let c=f.current?.clientWidth??1200,l=Math.max(c-160,300),u=Math.max(Math.floor(l/150),2);o.forEach((e,t)=>{let n=t%u,r=Math.floor(t/u);i.set(e,{x:n*150,y:r*90})})}let o=le(t),s=0,c=e.map(e=>{(0,w.resolveNodeColour)(e.labels).driftCandidates;let t=o.get(e.id)??0;t>s&&(s=t);let{visNode:n,iconFallbackLabel:r}=Se({node:e,degree:t,revealed:ve.current,scale:1,position:i.get(e.id)});return be(r),n}),l=new Set(c.map(e=>e.id)),u=t.filter(e=>e.type!==`PART_OF`||l.has(e.from)&&l.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type})),d=Xe({nodes:e,edges:t});C.current=new oe.DataSet(d.nodePositions.size>0?c.map(e=>{if(e.x!==void 0||e.y!==void 0)return e;let t=d.nodePositions.get(e.id);return t?{...e,x:t.x,y:t.y,physics:!1}:e}):c),ne.current=new oe.DataSet(u);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-style`,op:`degree-size`,nodes:c.length,maxDegree:s,minPx:14,maxPx:40}),keepalive:!0}).catch(()=>{})}catch{}let p=wt(f.current,`--accent-brand`,Tt),h=wt(f.current,`--border-strong`,Et),g=wt(f.current,`--border`,Dt),_={autoResize:!0,layout:{improvedLayout:!1,randomSeed:Ot(On.current)},physics:d.physics===!1?!1:{solver:d.physics.solver,forceAtlas2Based:d.physics.forceAtlas2Based,stabilization:d.physics.stabilization},nodes:{shape:`dot`,size:18,font:{color:`#1F2937`,size:12,face:`DM Sans, sans-serif`},scaling:{label:{enabled:!0,min:12,max:30,drawThreshold:0}},borderWidth:0,chosen:{node:e=>{e.size=Math.round(e.size*1.2),e.borderWidth=3,e.borderColor=p,e.shadow=!0,e.shadowColor=`rgba(15, 23, 42, 0.55)`,e.shadowSize=8,e.shadowX=0,e.shadowY=0},label:e=>{e.size=14}}},edges:{arrows:{to:{enabled:!0,scaleFactor:.4}},color:{color:g,highlight:h},font:{color:`#64748B`,size:9,face:`DM Sans, sans-serif`,align:`middle`,strokeWidth:0},smooth:{enabled:!0,type:`continuous`,roundness:.4},width:1,chosen:{edge:!0,label:!1}},interaction:{hover:!0,tooltipDelay:150,multiselect:!0}};try{S.current?.(),S.current=null,m.current?.destroy(),_e.current!==null&&(clearTimeout(_e.current),_e.current=null),ge.current=null;let e=new se.Network(f.current,{nodes:C.current,edges:ne.current},_);m.current=e,d.physics===!1?(ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=no-physics`)):S.current=$e(e,{report:({avgMotion:e,settleMs:t,capped:n,nodeCount:r})=>{ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=${n?`settle-capped`:`settled`}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-settle`,avgMotion:Math.round(e*100)/100,settleMs:t,capped:n,nodeCount:r}),keepalive:!0}).catch(()=>{})}catch{}}}),e.on(`zoom`,()=>{_e.current!==null&&clearTimeout(_e.current),_e.current=setTimeout(()=>{_e.current=null;let e=m.current,t=C.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=xt(n);if(r===ge.current)return;ge.current=r;let i=[];for(let e of T.current.values()){if(!e.labels[0])continue;let{colour:t}=(0,w.resolveNodeColour)(e.labels),r=e.trashed?{background:`${t}40`,border:t}:t,a=ve.current?N(e,n):``;i.push({id:e.id,label:a,color:r})}i.length>0&&t.update(i),console.error(`[graph-page] zoom-tier scale=${n.toFixed(3)} tier=${r} nodes=${i.length}`)},St)}),e.on(`click`,e=>{let t=e.nodes[0];if(!t)return;let n=T.current.get(t);if(!n)return;if(Ve(n)===`skip-trashed`){rt(n);return}let r=kn.current[kn.current.length-1];if(r.kind===`neighbourhood`&&r.rootElementId===t){rt(e=>e?.id===t?null:n);return}rt(null);let i={kind:`neighbourhood`,rootElementId:t,rootLabel:n.labels[0]??null};P(e=>{let n=Ne(e,i),r=n.length-1;return n.length>e.length&&zt(`nav-push`,{depth:r,kind:i.kind,rootElementId:t}),n.length===10&&e.length===10&&zt(`view-stack-cap-hit`,{depth:10,rootElementId:t}),n})}),e.on(`deselectNode`,()=>{rt(null)});let t=e=>{let t=f.current,n=ce.current;if(!t||!n)return!1;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=r.left+e.x,o=r.top+e.y;return a>=i.left&&a<=i.right&&o>=i.top&&o<=i.bottom},n=f.current?.parentElement??null;e.on(`dragStart`,e=>{if(e.nodes.length===0){de.current=null,pe.current=[];return}pe.current=[...e.nodes],de.current=e.nodes[0],n?.classList.add(`graph-dragging`)}),e.on(`dragging`,e=>{if(pe.current.length===0)return;let n=t(e.pointer.DOM);at(e=>e===n?e:n)}),e.on(`dragEnd`,e=>{let r=pe.current;if(pe.current=[],de.current=null,at(!1),n?.classList.remove(`graph-dragging`),r.length!==0&&t(e.pointer.DOM))if(r.length===1){let e=T.current.get(r[0])?.labels[0]??`Unknown`;wn(r[0],e)}else Tn(r)})}catch(e){ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=render-error`);let t=e instanceof Error?e.message:String(e);qe(`Visualisation failed to load: ${t}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-render`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}},[]),Mn=(0,j.useCallback)(()=>{let e=m.current,t=C.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=[];for(let e of T.current.values()){if(!e.labels[0])continue;let{colour:t}=(0,w.resolveNodeColour)(e.labels),i=e.trashed?{background:`${t}40`,border:t}:t;r.push({id:e.id,label:ve.current?N(e,n):``,color:i})}r.length>0&&t.update(r)},[]),Nn=(0,j.useCallback)(()=>{ve.current||(ve.current=!0,Mn())},[Mn]);(0,j.useEffect)(()=>{let e=y.current;if(!e)return;let t=()=>Nn();return e.addEventListener(`pointerdown`,t,!0),e.addEventListener(`wheel`,t,!0),e.addEventListener(`keydown`,t,!0),()=>{e.removeEventListener(`pointerdown`,t,!0),e.removeEventListener(`wheel`,t,!0),e.removeEventListener(`keydown`,t,!0)}},[Nn]),(0,j.useEffect)(()=>{let e=f.current;if(!e)return;let t=t=>{let n=he.current,r=me.current,i=e.parentElement;if(!n||!r||!i)return;let a=i.getBoundingClientRect(),o=Math.min(n.clientX,t.clientX)-a.left,s=Math.min(n.clientY,t.clientY)-a.top,c=Math.max(n.clientX,t.clientX)-a.left,l=Math.max(n.clientY,t.clientY)-a.top;r.style.left=`${o}px`,r.style.top=`${s}px`,r.style.width=`${c-o}px`,r.style.height=`${l-s}px`},n=r=>{document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0);let i=he.current;he.current=null;let a=me.current;a&&(a.style.display=`none`);let o=m.current;if(!i||!o)return;let s=e.getBoundingClientRect(),c=i.clientX-s.left,l=i.clientY-s.top,u=r.clientX-s.left,d=r.clientY-s.top,f=Math.min(c,u),p=Math.min(l,d),h=Math.max(c,u),g=Math.max(l,d);if(h-f<3&&g-p<3)return;let _=o.getPositions(),v=[];for(let[e,t]of Object.entries(_)){let n=o.canvasToDOM(t);n.x>=f&&n.x<=h&&n.y>=p&&n.y<=g&&v.push(e)}try{o.selectNodes(v,!1)}catch{}},r=r=>{if(!r.shiftKey||r.button!==0)return;let i=m.current,a=e.parentElement;if(!i||!a)return;let o=e.getBoundingClientRect(),s={x:r.clientX-o.left,y:r.clientY-o.top};if(i.getNodeAt(s))return;r.preventDefault(),r.stopImmediatePropagation(),he.current={clientX:r.clientX,clientY:r.clientY};let c=me.current,l=a.getBoundingClientRect();c&&(c.style.display=`block`,c.style.left=`${r.clientX-l.left}px`,c.style.top=`${r.clientY-l.top}px`,c.style.width=`0px`,c.style.height=`0px`),document.addEventListener(`mousemove`,t,!0),document.addEventListener(`mouseup`,n,!0)};return e.addEventListener(`mousedown`,r,!0),()=>{e.removeEventListener(`mousedown`,r,!0),document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0)}},[]),(0,j.useEffect)(()=>{let e=ut.trim();if(!e){pt(``),gt(null),Nt(null),Ut(`hybrid`),Gt(0),qt(!1),m.current?.unselectAll();return}qt(!1);let t=setTimeout(()=>pt(e),300);return()=>clearTimeout(t)},[ut]),(0,j.useEffect)(()=>{let e=setTimeout(()=>{let e=Ge(Pt);Vt(e);try{window.localStorage.setItem(kt,String(e))}catch{}},200);return()=>clearTimeout(e)},[Pt]);let Pn=(0,j.useCallback)(e=>{let t=m.current,n=C.current;if(!t||!n)return;let{updates:r,inWindow:i}=He(e,T.current,w.resolveNodeColour,Ct);r.length>0&&(n.update(r),t.fit({nodes:i,animation:{duration:400,easingFunction:`easeInOutQuad`}}))},[]),Fn=Le(M);(0,j.useEffect)(()=>{if(!ft)return;let e=!1;return Nt(null),i(Ke(ft,Fn.selectedLabels,Bt,Kt)).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{if(e)return;gt(t.results);let n=t.mode===`bm25`?`bm25`:`hybrid`;if(Ut(n),Gt(typeof t.suppressed==`number`?t.suppressed:0),n===`bm25`)try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-page`,msg:`[graph-page] search-result-degraded mode=bm25 query="${ft}"`}),keepalive:!0}).catch(()=>{})}catch{}let{nodes:r,edges:i}=Ue(t.results,Fn.selectedLabels);T.current=new Map(r.map(e=>[e.id,e])),Qe(r.length),Ye(null),jn(r,i),Pn(t.results),console.info(`[graph-page] search-applied view=${En.kind} q="${ft}" labels=${Fn.selectedLabels.join(`|`)} hits=${r.length}`)}).catch(t=>{e||Nt(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[ft,Bt,o,c,i,Pn,En.kind,Fn.selectedLabels,jn,Kt]);let In=(0,j.useCallback)(e=>{P(t=>{let n=Le(t),r=new Set(n.selectedLabels);return r.has(e)?r.delete(e):r.add(e),Fe({kind:`filter`,selectedLabels:[...r].sort(),includeTrashed:n.includeTrashed,includeAgentActions:n.includeAgentActions})})},[]),Ln=(0,j.useCallback)(()=>{P(e=>{let t=Le(e);return Fe({...t,includeTrashed:!t.includeTrashed})})},[]),Rn=(0,j.useCallback)(()=>{P(e=>{let t=Le(e);return Fe({...t,includeAgentActions:!t.includeAgentActions})})},[]),zn=(0,j.useCallback)(()=>{dt(``),pt(``),gt(null),Nt(null),Ut(`hybrid`),Gt(0),qt(!1);try{m.current?.unselectAll()}catch{}},[]),Bn=(0,j.useCallback)(()=>{P(()=>Fe({kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}))},[]),Vn=(0,j.useCallback)(()=>{rt(null);try{m.current?.unselectAll()}catch{}P(e=>{let t=Pe(e);return t!==e&&zt(`nav-pop`,{depth:t.length-1}),t})},[]),Hn=(0,j.useCallback)(()=>{rt(null);try{m.current?.unselectAll()}catch{}P(e=>e.length<=1?e:(zt(`nav-home`,{depth:0,popped:e.length-1}),[Le(e)]))},[]),Un=(0,j.useCallback)(()=>{let e=Le(M),t={labels:[...e.selectedLabels].sort(),includeTrashed:e.includeTrashed};on(!0),i(`/api/admin/graph-default-view`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}).then(async e=>{if(!e.ok){let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));throw Error(t.error??`HTTP ${e.status}`)}tn(t)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view-save`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}).finally(()=>on(!1))},[i,M]),Wn=(0,j.useCallback)(()=>{rt(null);try{m.current?.unselectAll()}catch{}Yt(e=>e+1),Be(`graph-restore`)},[]),R=(0,j.useCallback)(()=>{rt(null);try{m.current?.unselectAll()}catch{}P(e=>[Le(e)]),Yt(e=>e+1),Be(`graph-trash`)},[]),z=(0,j.useCallback)(()=>{Yt(e=>e+1),Zt(e=>e+1)},[]),Gn=En.kind===`neighbourhood`,Kn=Le(M),qn=Kn.selectedLabels,Jn=Kn.includeTrashed,Yn=Kn.includeAgentActions,Xn=je({inNeighbourhood:Gn,searchActive:!!ft}),Zn=(0,j.useMemo)(()=>{if(Jn!==en.includeTrashed||qn.length!==en.labels.length)return!0;for(let e=0;e<qn.length;e++)if(qn[e]!==en.labels[e])return!0;return!1},[Jn,qn,en]);return(0,L.jsxs)(`div`,{ref:y,className:vt(h,r),children:[(0,L.jsxs)(`div`,{className:`graph-toolbar`,children:[M.length>1&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-desktop`,onClick:Hn,title:`Clear breadcrumb — return to filter root`,children:[(0,L.jsx)(k,{size:12}),` Home`]}),(0,L.jsx)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-mobile`,onClick:Hn,"aria-label":`Home`,title:`Clear breadcrumb — return to filter root`,children:(0,L.jsx)(k,{size:14})}),(0,L.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-desktop`,onClick:Vn,children:`← Back`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-mobile`,onClick:Vn,"aria-label":`Back`,children:(0,L.jsx)(x,{size:16})})]}),(0,L.jsxs)(`div`,{className:`data-search-input graph-search-input`,children:[(0,L.jsx)(te,{size:14}),(0,L.jsx)(`input`,{type:`text`,placeholder:`Search nodes…`,value:ut,onChange:e=>dt(e.target.value),autoComplete:`off`,spellCheck:!1}),ft&&!mt&&!_t&&(0,L.jsx)(s,{size:14,className:`spin`}),ut.length>0&&(0,L.jsx)(`button`,{type:`button`,className:`graph-search-clear`,onClick:zn,"aria-label":`Clear search`,title:`Clear search`,children:(0,L.jsx)(d,{size:14})})]}),ft&&(0,L.jsxs)(`div`,{className:`graph-search-limit`,title:`Show top ${Pt} matches (1-2000)`,children:[(0,L.jsx)(`label`,{htmlFor:`graph-search-limit-input`,className:`graph-search-limit-label`,children:`Top`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>It(Ge(Pt-1)),disabled:Pt<=1,"aria-label":`Decrement search limit`,title:`Decrement`,children:(0,L.jsx)(ie,{size:12})}),(0,L.jsx)(`input`,{id:`graph-search-limit-input`,type:`number`,min:1,max:2e3,step:1,value:Pt,onChange:e=>It(Ge(e.target.value)),className:`graph-search-limit-number`,"aria-label":`Maximum search results to render`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>It(Ge(Pt+1)),disabled:Pt>=2e3,"aria-label":`Increment search limit`,title:`Increment`,children:(0,L.jsx)(p,{size:12})}),(0,L.jsx)(`input`,{id:`graph-search-limit-slider`,type:`range`,min:1,max:2e3,step:1,value:Pt,onChange:e=>It(Ge(e.target.value)),"aria-label":`Maximum search results to render (drag for ballpark)`})]}),(0,L.jsx)(`button`,{type:`button`,className:`graph-refresh-button`,onClick:z,disabled:we,"aria-label":`Refresh graph`,title:`Refresh graph`,children:(0,L.jsx)(u,{size:14,className:we?`spin`:void 0})}),yt(r)&&(0,L.jsx)(`button`,{type:`button`,className:`graph-fullscreen-toggle`,onClick:()=>{h?xn(`button`):_(!0)},"aria-label":h?`Exit full screen`:`Full screen`,title:h?`Exit full screen`:`Full screen`,"aria-pressed":h,children:h?(0,L.jsx)(re,{size:14}):(0,L.jsx)(ee,{size:14})}),!Gn&&(0,L.jsxs)(`div`,{className:`graph-filter-wrap`,ref:cn,children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-filter-toggle${nn?` is-open`:``}${qn.length>0||Jn||Yn?` has-selection`:``}`,onClick:()=>rn(e=>!e),"aria-haspopup":`true`,"aria-expanded":nn,"aria-label":`Filter node types`,children:[(0,L.jsx)(v,{size:14}),(0,L.jsx)(`span`,{children:`Filter`}),qn.length>0&&(0,L.jsx)(`span`,{className:`graph-filter-count`,children:qn.length})]}),nn&&(0,L.jsxs)(`div`,{className:`graph-filter-popover`,role:`dialog`,"aria-label":`Node type filter`,children:[(0,L.jsxs)(`div`,{className:`graph-filter-popover-header`,children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-toggle-trashed${Jn?` active`:``}`,onClick:Ln,"aria-pressed":Jn,title:`Show trashed nodes — restored with Restore button on each node`,children:[(0,L.jsx)(D,{size:14}),` Show trashed`]}),(qn.length>0||Jn||Yn)&&(0,L.jsx)(`button`,{type:`button`,className:`graph-filter-clear`,onClick:Bn,"aria-label":`Clear filter selection`,title:`Clear filter selection`,children:(0,L.jsx)(d,{size:14})})]}),(0,L.jsx)(`div`,{className:`graph-toggle-agent-actions`,title:`Hide ToolCall, StepResult, WorkflowStep, WorkflowRun — agent-execution telemetry. Flip on for audit/debug.`,children:(0,L.jsx)(g,{checked:Yn,onChange:Rn,label:`Include agent actions`})}),Qt.length===0&&(0,L.jsx)(`p`,{className:`graph-filter-popover-empty`,children:`No node types in your graph yet.`}),(0,L.jsx)(`div`,{className:`graph-filter-rows`,role:`group`,"aria-label":`Node type filter`,children:Qt.map(({label:e,nodeCount:t})=>{let n=qn.includes(e),r=(0,w.colourForLabel)(e);return(0,L.jsxs)(`button`,{type:`button`,className:`graph-filter-row${n?` active`:``}`,onClick:()=>In(e),"aria-pressed":n,children:[(0,L.jsx)(`span`,{className:`graph-filter-row-swatch`,style:{backgroundColor:r}}),(0,L.jsx)(`span`,{className:`graph-filter-row-label`,children:e}),(0,L.jsx)(`span`,{className:`graph-filter-row-count`,children:t})]},e)})}),(0,L.jsx)(`div`,{className:`graph-filter-popover-footer`,children:(0,L.jsx)(`button`,{type:`button`,className:`graph-filter-set-default`,onClick:Un,disabled:!Zn||an,children:an?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(s,{size:12,className:`spin`}),` Saving…`]}):`Set default view`})})]})]}),(0,L.jsx)(`div`,{className:`graph-meta`,children:De({inNeighbourhood:Gn,searchActive:!!ft,selectedLabelsCount:qn.length,topLevelTotal:et,nodeCount:Ze})?(0,L.jsx)(`span`,{className:`graph-meta-count`,children:Oe(Ze,et)}):Ze>0&&(0,L.jsxs)(`span`,{className:`graph-meta-count`,children:[Ze,` node`,Ze===1?``:`s`]})})]}),M.length>1&&(0,L.jsx)(Rt,{viewStack:M}),ft&&Ht===`bm25`&&!_t&&(0,L.jsx)(`div`,{className:`graph-error-banner graph-search-degraded`,role:`status`,children:`Vector ranking unavailable — showing keyword-only results.`}),_t&&(0,L.jsxs)(`div`,{className:`data-error graph-error-banner`,children:[`Search unavailable: `,_t]}),ft&&Wt>0&&!Kt&&!_t&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>qt(!0),children:[Wt,` low-confidence match`,Wt===1?``:`es`,` hidden — show all`]}),ft&&Kt&&!_t&&(0,L.jsx)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>qt(!1),children:`Showing all matches — hide low-confidence`}),mt&&mt.length===0&&!_t&&(0,L.jsx)(`div`,{className:`graph-search-status`,children:`No matches in your graph.`}),(0,L.jsxs)(`div`,{className:`graph-canvas-wrap`,children:[Ae({loading:we,rendering:Re,searchActive:!!ft})&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,L.jsx)(s,{size:20,className:`spin`}),` Loading your graph…`]}),We&&!we&&!Re&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,L.jsx)(`p`,{children:We}),(0,L.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:()=>{qe(null),Yt(e=>e+1)},children:`Retry`})]}),Je&&!we&&!Re&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,L.jsxs)(`p`,{children:[`Refine your filter — `,(0,L.jsx)(`strong`,{children:Je.matched}),` matches exceed the 2000 cap.`]}),(0,L.jsx)(`p`,{className:`graph-canvas-hint`,children:`Pick a more specific label combination, or narrow your brand's data.`})]}),!we&&!Re&&!We&&!Je&&Ze===0&&!Gn&&qn.length===0&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,L.jsx)(v,{size:20}),(0,L.jsx)(`p`,{children:`No nodes in your graph yet.`})]}),!we&&!Re&&!We&&!Je&&Ze===0&&!Gn&&qn.length>0&&(0,L.jsx)(`div`,{className:`graph-canvas-overlay`,children:(0,L.jsxs)(`p`,{children:[`No `,qn.join(`, `),` nodes match this view.`]})}),(0,L.jsx)(`div`,{ref:f,className:`graph-canvas`}),(0,L.jsx)(`div`,{ref:me,className:`graph-marquee`,"aria-hidden":`true`}),Ze>0&&(0,L.jsx)(`div`,{ref:ce,className:`graph-trash-drop-zone${it?` is-hover`:``}${ot?` is-error`:``}`,"aria-hidden":`true`,children:(0,L.jsx)(l,{size:18})}),ct&&(0,L.jsxs)(`div`,{className:`graph-drag-error-banner`,role:`alert`,children:[(0,L.jsx)(`span`,{children:ct}),(0,L.jsx)(`button`,{type:`button`,className:`graph-drag-error-dismiss`,onClick:()=>lt(null),"aria-label":`Dismiss`,children:(0,L.jsx)(d,{size:14})})]}),Ze>0&&vn.length>0&&(0,L.jsxs)(`div`,{ref:ln,className:`graph-legend${pn?` is-collapsed`:``}`,style:dn?{"--legend-x":`${dn.x}px`,"--legend-y":`${dn.y}px`}:void 0,children:[(0,L.jsxs)(`div`,{className:`graph-legend-header`,onPointerDown:hn,onPointerMove:gn,onPointerUp:_n,children:[(0,L.jsx)(O,{size:13,className:`graph-legend-grip`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`graph-legend-title`,children:`Legend`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-legend-collapse`,onPointerDown:e=>e.stopPropagation(),onClick:()=>mn(e=>!e),"aria-label":pn?`Expand legend`:`Collapse legend`,"aria-expanded":!pn,children:pn?(0,L.jsx)(E,{size:14}):(0,L.jsx)(b,{size:14})})]}),(0,L.jsx)(`div`,{className:`graph-legend-body`,children:vn.map(e=>{let t=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Ft,{label:e.label,shape:e.shape,colour:e.colour}),(0,L.jsx)(`span`,{className:`graph-legend-label`,children:e.label}),(0,L.jsx)(`span`,{className:`graph-legend-count`,children:e.count})]});if(!Xn)return(0,L.jsx)(`div`,{className:`graph-legend-item`,children:t},e.label);let n=qn.includes(e.label);return(0,L.jsx)(`button`,{type:`button`,className:`graph-legend-item graph-legend-item--interactive${n?` is-selected`:``}`,"aria-pressed":n,onClick:()=>{let t=n?`remove`:`add`,r=n?qn.length-1:qn.length+1;console.log(`[graph-page] op=legend-filter label=${e.label} action=${t} selected=${r}`),In(e.label)},children:t},e.label)})})]})]}),nt&&(0,L.jsx)(ht,{node:nt,edges:A.current,nodesById:T.current,adminFetch:i,onClose:()=>{rt(null);try{m.current?.unselectAll()}catch{}},onRestored:Wn,onTrashed:R})]})}var Lt=class extends Error{body;constructor(e){super(e.error),this.body=e}};function Rt({viewStack:e}){let t=e.map(e=>e.kind===`filter`?`Filter`:e.rootLabel??`Node`);return(0,L.jsx)(`div`,{className:`graph-breadcrumb`,role:`navigation`,"aria-label":`Graph navigation breadcrumb`,children:t.map((e,n)=>(0,L.jsxs)(`span`,{className:`graph-breadcrumb-item`,children:[n>0&&(0,L.jsx)(`span`,{className:`graph-breadcrumb-separator`,"aria-hidden":`true`,children:`›`}),(0,L.jsx)(`span`,{className:`graph-breadcrumb-label${n===t.length-1?` is-current`:``}`,children:e})]},n))})}function zt(e,t){let n=`[graph-page] ${e} ${Object.entries(t).map(([e,t])=>`${e}=${String(t)}`).join(` `)}`;try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-nav`,msg:n}),keepalive:!0}).catch(()=>{})}catch{}}(0,ce.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(Nt,{}));
51
+ `)}function Se(e){let{node:t,degree:n,revealed:r}=e,i=e.scale??1,a=t.labels[0]??`Unknown`,o=(0,w.resolveNodeColour)(t.labels),s=o.displayLabel,c=o.colour,l=s??a,u=(0,w.nodeImageDataUri)(l),d=u===null?l:null,f=ue(n),p=r?N(t,i):``,m=P(t),h=e.position?{x:e.position.x,y:e.position.y,physics:!1}:{},g;return g=t.trashed?u===null?{id:t.id,label:p,title:m,color:{background:`${c}40`,border:c},borderWidth:2,shapeProperties:{borderDashes:[6,4]},shape:(0,w.shapeForLabel)(l),size:f,group:a,...h}:{id:t.id,label:p,title:m,shape:`image`,image:u,size:f,opacity:.35,group:a,...h}:u===null?{id:t.id,label:p,title:m,color:c,shape:(0,w.shapeForLabel)(l),size:f,group:a,...h}:{id:t.id,label:p,title:m,shape:`image`,image:u,size:f,group:a,...h},{visNode:g,iconFallbackLabel:d}}function Ce(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(n[i]!==r[i]||JSON.stringify(e[n[i]])!==JSON.stringify(t[r[i]]))return!1;return!0}function we(e,t){if(!!e.trashed!=!!t.trashed||e.labels.length!==t.labels.length)return!1;for(let n=0;n<e.labels.length;n++)if(e.labels[n]!==t.labels[n])return!1;return Ce(e.properties,t.properties)}function Te(e,t){let n=[],r=[],i=new Set;for(let a of t){i.add(a.id);let t=e.get(a.id);t===void 0?n.push(a):we(t,a)||r.push(a)}let a=[];for(let t of e.keys())i.has(t)||a.push(t);return{added:n,updated:r,removed:a}}function F(e,t){let n=[],r=new Set;for(let i of t)r.add(i.id),e.has(i.id)||n.push(i);let i=[];for(let t of e.keys())r.has(t)||i.push(t);return{added:n,removed:i}}function I(e,t){return e.added.length>0||e.updated.length>0||e.removed.length>0||t.added.length>0||t.removed.length>0}function Ee(e){let t=new URLSearchParams(e),n=t.get(`nodeId`);if(n)return{kind:`focus`,nodeId:n,nodeLabel:t.get(`label`)};let r=t.get(`label`);return r?{kind:`labels`,labels:[r]}:null}function De(e){return!e.inNeighbourhood&&!e.searchActive&&e.selectedLabelsCount===0&&e.topLevelTotal!==null&&e.nodeCount>0}function Oe(e,t){let n=t===1?`node`:`nodes`;return`Showing ${e.toLocaleString()} of ${t.toLocaleString()} top-level ${n}`}function ke(e){return typeof e.total==`number`?e.total:null}function Ae(e){return(e.loading||e.rendering)&&!e.searchActive}function je(e){return!e.inNeighbourhood&&!e.searchActive}function Me(e,t){let n=`/api/admin/graph-subgraph`,r=t.includeAgentActions?`&includeAgentActions=1`:``;if(e.kind===`neighbourhood`){let i=t.search&&t.search.q?`&q=${encodeURIComponent(t.search.q)}&limit=${t.search.limit}`:``;return`${n}?mode=neighbourhood&elementId=${encodeURIComponent(e.rootElementId)}${r}${i}`}let i=e.includeTrashed?`&includeTrashed=1`:``;return e.selectedLabels.length===0?`${n}?mode=default&topLevel=1${i}${r}`:`${n}?mode=default&labels=${encodeURIComponent(e.selectedLabels.join(`,`))}${i}${r}`}function Ne(e,t){return e.length<10?[...e,t]:[e[0],...e.slice(e.length-8),t]}function Pe(e){return e.length<=1?e:e.slice(0,-1)}function Fe(e){return[e]}function Ie(e){let t=e[e.length-1];return t.kind===`filter`?`f:${[...t.selectedLabels].sort().join(`,`)}:${t.includeTrashed?1:0}:${t.includeAgentActions?1:0}`:`n:${t.rootElementId}`}function Le(e){let t=e[0];if(t.kind!==`filter`)throw Error(`view-stack invariant: root must be filter view`);return t}var Re=`admin-sessions`;function ze(){if(typeof window>`u`)return null;if(typeof BroadcastChannel>`u`)return console.warn(`[admin-sessions/broadcast] unsupported — manual refresh only`),null;try{return new BroadcastChannel(Re)}catch(e){return console.warn(`[admin-sessions/broadcast] ctor failed: ${e instanceof Error?e.message:String(e)} — manual refresh only`),null}}function Be(e){let t=ze();if(t)try{let n={type:`mutated`,reason:e};t.postMessage(n)}catch(e){console.warn(`[admin-sessions/broadcast] postMessage failed: ${e instanceof Error?e.message:String(e)}`)}finally{try{t.close()}catch{}}}function Ve(e){return e.trashed===!0?`skip-trashed`:`pivot`}function He(e,t,n,r){let i=[],a=[];for(let o of e){let e=t.get(o.nodeId);if(!e)continue;a.push(o.nodeId);let{colour:s}=n(e.labels),c=e.trashed?`${s}40`:s;i.push({id:o.nodeId,borderWidth:3,color:{background:c,border:r}})}return{updates:i,inWindow:a}}function Ue(e,t){let n=t.length>0?new Set(t):null,r=new Map,i=new Set,a=[];for(let t of e)n&&!t.labels.some(e=>n.has(e))||r.set(t.nodeId,{id:t.nodeId,labels:t.labels,properties:t.properties});for(let t of e)if(r.has(t.nodeId))for(let e of t.related){if(n&&!e.labels.some(e=>n.has(e)))continue;r.has(e.nodeId)||r.set(e.nodeId,{id:e.nodeId,labels:e.labels,properties:e.properties});let[o,s]=e.direction===`outgoing`?[t.nodeId,e.nodeId]:[e.nodeId,t.nodeId],c=`${o}|${s}|${e.relationship}`;i.has(c)||(i.add(c),a.push({id:c,from:o,to:s,type:e.relationship}))}return{nodes:[...r.values()],edges:a}}var We=2e3;function Ge(e){let t=typeof e==`number`?e:Number(e);return!Number.isFinite(t)||t<=0?100:Math.min(Math.max(Math.floor(t),1),We)}function Ke(e,t,n,r){let i=encodeURIComponent(t.join(`,`));return`/api/admin/graph-search?q=${encodeURIComponent(e)}&labels=${i}&limit=${n}${r?`&threshold=0`:``}`}var qe={solver:`forceAtlas2Based`,forceAtlas2Based:{gravitationalConstant:-50,centralGravity:.01,springLength:100,springConstant:.08,damping:.4,avoidOverlap:0},stabilization:{iterations:2e3}},Je=220,Ye=3;function Xe(e){if(!(e.nodes.length<=5))return{physics:qe,nodePositions:new Map};let t=new Map,n=(Ye-1)*Je/2,r=(Math.ceil(e.nodes.length/Ye)-1)*Je/2;for(let i=0;i<e.nodes.length;i++){let a=i%Ye,o=Math.floor(i/Ye);t.set(e.nodes[i].id,{x:a*Je-n,y:o*Je-r})}return{physics:!1,nodePositions:t}}function Ze(e,t){let n=(t.t-e.t)/1e3;if(n<=0)return 0;let r=0,i=0;for(let n of Object.keys(t.positions)){let a=e.positions[n];if(!a)continue;let o=t.positions[n];r+=Math.hypot(o.x-a.x,o.y-a.y),i++}return i===0?0:r/i/n}function Qe(e,t,n){if(t>n.threshold)return{belowCount:0,freeze:!1};let r=e+1;return{belowCount:r,freeze:r>=n.needed}}function $e(e,t){let n=Date.now(),r=null,i=0,a=null,o=()=>{a!==null&&(clearInterval(a),a=null)},s=(r,i,a)=>{o();try{e.setOptions({physics:!1})}catch{}t.report?.({avgMotion:r,settleMs:Date.now()-n,capped:a,nodeCount:i})};return a=setInterval(()=>{let t;try{t=e.getPositions()}catch{o();return}let a={t:Date.now(),positions:t},c=Object.keys(t).length;if(r){let e=Ze(r,a),t=Qe(i,e,{threshold:5,needed:2});if(i=t.belowCount,t.freeze){s(e,c,!1);return}if(Date.now()-n>=3e4){s(e,c,!0);return}}r=a},250),o}var et=`graph-side-panel-size`;function tt(e,t){let n=Math.max(280,t.maxWidth),r=Math.max(240,t.maxHeight),i=Math.min(Math.max(e.width,280),n),a=Math.min(Math.max(e.height,240),r);return{width:i,height:a,clampedW:i!==e.width,clampedH:a!==e.height}}function nt(e){try{localStorage.setItem(et,JSON.stringify({width:e.width,height:e.height}))}catch{}}function rt(){try{let e=localStorage.getItem(et);if(!e)return{size:null,source:`default`};let t=JSON.parse(e);return t&&typeof t==`object`&&typeof t.width==`number`&&typeof t.height==`number`&&Number.isFinite(t.width)&&Number.isFinite(t.height)?{size:{width:t.width,height:t.height},source:`storage`}:{size:null,source:`default`}}catch{return{size:null,source:`default`}}}function it(e){return typeof e==`string`?/^https?:\/\/\S+$/i.test(e.trim()):!1}function at(e){let t=t=>{let n=e[t];if(n&&typeof n==`object`&&`low`in n){let e=n.low;return typeof e==`number`?e:null}return null},n=t(`year`),r=t(`month`),i=t(`day`);if(n===null||r===null||i===null)return null;let a=`${String(n).padStart(4,`0`)}-${String(r).padStart(2,`0`)}-${String(i).padStart(2,`0`)}`;if(!(`hour`in e))return a;let o=t(`hour`),s=t(`minute`),c=t(`second`);return o===null||s===null||c===null?a:`${a} ${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}:${String(c).padStart(2,`0`)}`}function ot(e){if(e==null)return``;if(Array.isArray(e))return e.length>8?`[${e.length} items]`:e.map(String).join(`, `);if(typeof e==`object`){if(`year`in e&&`month`in e&&`day`in e&&typeof e.year==`object`){let t=at(e);if(t)return t}return JSON.stringify(e)}return String(e)}var L=s(),st=76,ct=36,lt=16,ut=520;function dt(e){let t=e?.offsetParent??null,n=t?.clientWidth??0,r=t?.clientHeight??0;return{maxWidth:n-ct-lt,maxHeight:r-st-lt}}function ft(e){return typeof e==`string`?e:ot(e)}function pt(e){return it(e)?(0,L.jsx)(`a`,{className:`graph-side-link`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:e}):ot(e)}function mt({value:e,label:t,field:n}){let{status:r,copy:a}=T({onResult:e=>{e?console.log(`[graph-panel] op=copy result=ok field=${n}`):console.warn(`[graph-panel] op=copy result=error field=${n} msg=clipboard-write-failed`)}}),o=r===`ok`?`Copied`:r===`fail`?`Copy failed`:`Copy ${t}`;return(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-copy${r===`ok`?` graph-side-copy-ok`:``}${r===`fail`?` graph-side-copy-fail`:``}`,onClick:()=>a(e),"aria-label":o,title:o,children:[r===`ok`?(0,L.jsx)(i,{size:12}):(0,L.jsx)(S,{size:12}),r!==`idle`&&(0,L.jsx)(`span`,{className:`graph-side-copy-feedback`,children:r===`ok`?`Copied`:`Copy failed`})]})}function ht({node:e,edges:t,nodesById:n,adminFetch:r,onClose:i,onRestored:o,onTrashed:s}){let c=Object.entries(e.properties).filter(([,e])=>e!=null),u=t.filter(t=>t.from===e.id||t.to===e.id),f=u.length>0,[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(null),[v,y]=(0,j.useState)(!1),[b,x]=(0,j.useState)(null),[S,ee]=(0,j.useState)(`properties`),te=_(`(max-width: 640px)`),w=(0,j.useRef)(null),ne=(0,j.useRef)(rt()),[T,E]=(0,j.useState)(()=>ne.current.size??{width:280,height:ut}),D=(0,j.useRef)(!1),O=(0,j.useRef)(null);(0,j.useEffect)(()=>()=>{O.current?.()},[]),(0,j.useEffect)(()=>{m(!1),g(null),y(!1),x(null),ee(`properties`)},[e.id]),(0,j.useLayoutEffect)(()=>{if(D.current)return;D.current=!0;let e=dt(w.current),t=tt(ne.current.size??{width:280,height:ut},e);E({width:t.width,height:t.height}),console.log(`[graph-panel] op=restore-size w=${t.width} h=${t.height} source=${ne.current.source}`)},[]);let k=(0,j.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=e.clientY,r=T.width,i=T.height,a=dt(w.current);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}let o={width:r,height:i,clampedW:!1,clampedH:!1},s=e=>{o=tt({width:r+(t-e.clientX),height:i+(e.clientY-n)},a),E({width:o.width,height:o.height})},c=()=>{window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l),O.current=null},l=()=>{c(),nt({width:o.width,height:o.height}),console.log(`[graph-panel] op=resize w=${o.width} h=${o.height} clampedW=${o.clampedW} clampedH=${o.clampedH}`)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l),O.current=c},[T.width,T.height]),re=(0,j.useCallback)(()=>{m(!0),g(null),r(`/api/admin/graph-restore`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);o()}).catch(e=>{g(e instanceof Error?e.message:String(e)),m(!1)})},[e.id,o,r]),ie=(0,j.useCallback)(()=>{y(!0),x(null),r(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id,by:`graph-side-panel-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);s()}).catch(e=>{x(e instanceof Error?e.message:String(e)),y(!1)})},[e.id,s,r]),A=S===`connections`&&f?`connections`:`properties`,ae=te?void 0:{width:`${T.width}px`,height:`${T.height}px`};return(0,L.jsxs)(`aside`,{ref:w,className:`graph-side-panel${e.trashed?` graph-side-panel-trashed`:``}`,style:ae,children:[!te&&(0,L.jsx)(`div`,{className:`graph-side-resize-handle`,role:`separator`,"aria-label":`Resize panel`,"aria-orientation":`vertical`,onPointerDown:k}),(0,L.jsxs)(`header`,{className:`graph-side-header`,children:[(0,L.jsx)(`div`,{children:(()=>{if(e.labels.some(e=>pe.has(e))){let t=(0,de.pickDisplayName)(e),n=e.properties.createdAt,r=typeof n==`string`?n:``,i=r?(0,de.formatRunTimestamp)(r):null,a=e.labels.join(` · `)+(e.trashed?` · Trashed`:``)+` · ${e.id}`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`h2`,{className:`graph-side-name`,title:t,children:t}),i&&(0,L.jsx)(`div`,{className:`graph-side-created`,children:i}),(0,L.jsxs)(`div`,{className:`graph-side-meta`,children:[(0,L.jsx)(`span`,{children:a}),(0,L.jsx)(mt,{value:e.id,label:`id`,field:`id`})]})]})}return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`graph-side-labels`,children:[e.labels.join(` · `),e.trashed?` · Trashed`:``]}),(0,L.jsxs)(`div`,{className:`graph-side-id-row`,children:[(0,L.jsx)(`span`,{className:`graph-side-id`,children:e.id}),(0,L.jsx)(mt,{value:e.id,label:`id`,field:`id`})]})]})})()}),(0,L.jsx)(`button`,{type:`button`,className:`graph-side-close`,onClick:i,"aria-label":`Close`,children:(0,L.jsx)(d,{size:14})})]}),e.trashed&&(0,L.jsxs)(`dl`,{className:`graph-side-props graph-side-trash-meta`,children:[(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:`trashedAt`}),(0,L.jsx)(`dd`,{children:ot(e.properties.trashedAt)})]}),(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:`trashedBy`}),(0,L.jsx)(`dd`,{children:ot(e.properties.trashedBy)})]})]}),(0,L.jsxs)(`div`,{className:`graph-side-tabs`,role:`tablist`,"aria-label":`Node detail sections`,children:[(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`properties`,className:`graph-side-tab${A===`properties`?` graph-side-tab-on`:``}`,onClick:()=>ee(`properties`),children:`Properties`}),f&&(0,L.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`connections`,className:`graph-side-tab${A===`connections`?` graph-side-tab-on`:``}`,onClick:()=>ee(`connections`),children:[`Connections (`,u.length,`)`]})]}),(0,L.jsxs)(`div`,{className:`graph-side-body`,children:[A===`properties`&&(0,L.jsxs)(`dl`,{className:`graph-side-props`,children:[c.length===0&&(0,L.jsx)(`div`,{className:`graph-side-empty`,children:`No properties.`}),c.map(([e,t])=>(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:e}),(0,L.jsxs)(`dd`,{children:[(0,L.jsx)(`span`,{className:`graph-side-prop-value`,children:pt(t)}),(0,L.jsx)(mt,{value:ft(t),label:e,field:`prop`})]})]},e))]}),A===`connections`&&f&&(0,L.jsx)(`section`,{className:`graph-side-edges`,children:u.map(t=>{let r=t.from===e.id,i=r?t.to:t.from,a=n.get(i),o=a?(0,de.pickShortLabel)(a):i,s=r?`→`:`←`,c=Object.entries(t.properties??{}).filter(([,e])=>e!=null&&e!==``);return(0,L.jsxs)(`div`,{className:`graph-side-edge`,children:[(0,L.jsxs)(`div`,{className:`graph-side-edge-header`,children:[(0,L.jsx)(`span`,{className:`graph-side-edge-type`,children:t.type}),(0,L.jsx)(`span`,{className:`graph-side-edge-arrow`,children:s}),(0,L.jsx)(`span`,{className:`graph-side-edge-other`,title:o,children:o})]}),c.length>0&&(0,L.jsx)(`dl`,{className:`graph-side-edge-props`,children:c.map(([e,t])=>(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:e}),(0,L.jsxs)(`dd`,{children:[(0,L.jsx)(`span`,{className:`graph-side-prop-value`,children:pt(t)}),(0,L.jsx)(mt,{value:ft(t),label:e,field:`edge-prop`})]})]},e))})]},t.id)})})]}),e.trashed&&(0,L.jsxs)(`footer`,{className:`graph-side-footer`,children:[!p&&!h&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-restore`,onClick:re,children:[(0,L.jsx)(C,{size:14}),` Restore`]}),p&&(0,L.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,L.jsxs)(`p`,{children:[(0,L.jsx)(a,{size:14,className:`spin`}),` Restoring…`]})}),h&&(0,L.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,L.jsxs)(`p`,{children:[`Restore failed: `,h]}),(0,L.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{g(null)},children:`Close`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:re,children:`Retry`})]})]})]}),!e.trashed&&(0,L.jsxs)(`footer`,{className:`graph-side-footer`,children:[!v&&!b&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-trash`,onClick:ie,children:[(0,L.jsx)(l,{size:14}),` Trash`]}),v&&(0,L.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,L.jsxs)(`p`,{children:[(0,L.jsx)(a,{size:14,className:`spin`}),` Trashing…`]})}),b&&(0,L.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,L.jsxs)(`p`,{children:[`Trash failed: `,b]}),(0,L.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{x(null)},children:`Close`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:ie,children:`Retry`})]})]})]})]})}var gt=`graph-shell`,_t=`graph-shell--fullscreen`;function vt(e,t){return t&&e?`${gt} ${_t}`:gt}function yt(e){return e}function bt(e){return e.isFullscreen&&!e.filterOpen}function xt(e){return e<.7?`compact`:e<1.3?`wrapped`:`detailed`}var St=150,Ct=`#FBBF24`;function wt(e,t,n){let r=getComputedStyle(e).getPropertyValue(t).trim();return r.length>0?r:n}var Tt=`#0F172A`,Et=`#475569`,Dt=`#CBD5E1`;function Ot(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}var kt=`maxy-graph-search-limit-v1`,At=250,jt=12e3,Mt=1200;function Nt(){let[e,t]=(0,j.useState)(null),[n,r]=(0,j.useState)(!1),[i,o]=(0,j.useState)(void 0),[s,c]=(0,j.useState)(null),[l,u]=(0,j.useState)(void 0),[d,p]=(0,j.useState)(null),[g,_]=(0,j.useState)(null),v=(0,j.useMemo)(()=>typeof window>`u`?null:Ee(window.location.search),[]),b=(0,j.useMemo)(()=>v?.kind===`focus`?{nodeId:v.nodeId,nodeLabel:v.nodeLabel}:null,[v]),x=(0,j.useMemo)(()=>v?.kind===`labels`?v.labels:null,[v]);(0,j.useEffect)(()=>{b&&zt(`deep-link`,{nodeId:b.nodeId.length>16?b.nodeId.slice(0,16)+`…`:b.nodeId,label:b.nodeLabel??``})},[b]),(0,j.useEffect)(()=>{!x||x.length===0||zt(`label-seed`,{label:x[0]})},[x]),(0,j.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&o(e.businessName),e.sessionId!==void 0&&c(e.sessionId??null),_(e.role??null),u(e.userName===void 0?null:e.userName),p(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let S=(0,j.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[ee,C]=(0,j.useState)(!1),te=(0,j.useCallback)(async()=>{C(!0);try{let e=await h();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{C(!1)}},[]);return n?e?(0,L.jsx)(f,{cacheKey:e,surface:`graph`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=graph`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,L.jsx)(y,{cacheKey:e,businessName:i,sessionId:s,onLogout:S,onDisconnect:te,disconnecting:ee,userName:l,userAvatar:d,role:g,children:(0,L.jsxs)(`div`,{className:`data-page graph-page`,children:[(0,L.jsx)(`header`,{className:`data-header`,children:(0,L.jsxs)(`h1`,{className:`data-title`,children:[(0,L.jsx)(m,{size:18}),` Graph`]})}),(0,L.jsx)(`main`,{className:`graph-main`,children:(0,L.jsx)(It,{cacheKey:e,initialFocus:b,initialLabels:x,allowFullscreen:!0})})]})})}):(0,L.jsxs)(`div`,{className:`data-page`,children:[(0,L.jsx)(`header`,{className:`data-header`,children:(0,L.jsxs)(`h1`,{className:`data-title`,children:[(0,L.jsx)(m,{size:18}),` Graph`]})}),(0,L.jsxs)(`div`,{className:`data-empty`,children:[(0,L.jsx)(`p`,{children:`You are not signed in.`}),(0,L.jsxs)(`p`,{children:[`Open the `,(0,L.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,L.jsx)(`div`,{className:`data-page`,children:(0,L.jsxs)(`div`,{className:`data-loading`,children:[(0,L.jsx)(a,{size:18,className:`spin`}),` Loading…`]})})}var Pt={triangle:`7,1 13,13 1,13`,triangleDown:`1,1 13,1 7,13`,square:`2,2 12,2 12,12 2,12`,diamond:`7,1 13,7 7,13 1,7`,star:`7,1 8.8,5.2 13,5.2 9.6,8 10.9,12.4 7,9.7 3.1,12.4 4.4,8 1,5.2 5.2,5.2`,hexagon:`4,1.5 10,1.5 13,7 10,12.5 4,12.5 1,7`};function Ft({label:e,shape:t,colour:n}){let r=(0,w.nodeImageDataUri)(e);return r===null?(0,L.jsx)(`svg`,{className:`graph-legend-swatch`,viewBox:`0 0 14 14`,width:`14`,height:`14`,"aria-hidden":`true`,children:t===`dot`?(0,L.jsx)(`circle`,{cx:`7`,cy:`7`,r:`6`,fill:n}):(0,L.jsx)(`polygon`,{points:Pt[t],fill:n})}):(0,L.jsx)(`img`,{className:`graph-legend-swatch`,src:r,width:14,height:14,alt:``,"aria-hidden":`true`})}function It({cacheKey:e,initialFocus:t=null,initialLabels:n=null,allowFullscreen:r=!1}){let{adminFetch:i,cacheKey:s,sessionRefetchNonce:c}=o({initialCacheKey:e,surface:`graph`}),f=(0,j.useRef)(null),m=(0,j.useRef)(null),[h,_]=(0,j.useState)(!1),y=(0,j.useRef)(null),S=(0,j.useRef)(null),C=(0,j.useRef)(null),ne=(0,j.useRef)(null),T=(0,j.useRef)(new Map),A=(0,j.useRef)([]),ae=(0,j.useRef)(null),ce=(0,j.useRef)(null),de=(0,j.useRef)(null),pe=(0,j.useRef)([]),me=(0,j.useRef)(null),he=(0,j.useRef)(null),ge=(0,j.useRef)(null),_e=(0,j.useRef)(null),ve=(0,j.useRef)(!1),ye=(0,j.useRef)(new Set),be=(0,j.useCallback)(e=>{if(e===null)return;let t=ye.current;if(!t.has(e)){t.add(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-style`,op:`icon-fallback`,distinctFallback:t.size,labels:Array.from(t).sort().join(`,`)}),keepalive:!0}).catch(()=>{})}catch{}}},[]),xe=(0,j.useRef)(!1),[M,P]=(0,j.useState)([{kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}]);(0,j.useEffect)(()=>{t?.nodeId&&P(e=>{let n=e[e.length-1];return n.kind===`neighbourhood`&&n.rootElementId===t.nodeId?e:[e[0],{kind:`neighbourhood`,rootElementId:t.nodeId,rootLabel:t.nodeLabel}]})},[t?.nodeId,t?.nodeLabel]);let Ce=n&&n.length>0?[...n].sort().join(`,`):null;(0,j.useEffect)(()=>{Ce&&(sn.current=!0,P([{kind:`filter`,selectedLabels:Ce.split(`,`),includeTrashed:!1,includeAgentActions:!1}]))},[Ce]);let[we,Ee]=(0,j.useState)(!1),[Re,ze]=(0,j.useState)(!1),[We,qe]=(0,j.useState)(null),[Je,Ye]=(0,j.useState)(null),[Ze,Qe]=(0,j.useState)(0),[et,tt]=(0,j.useState)(null),[nt,rt]=(0,j.useState)(null),[it,at]=(0,j.useState)(!1),[ot,st]=(0,j.useState)(!1),[ct,lt]=(0,j.useState)(null),[ut,dt]=(0,j.useState)(``),[ft,pt]=(0,j.useState)(``),[mt,gt]=(0,j.useState)(null),[_t,Nt]=(0,j.useState)(null),[Pt,It]=(0,j.useState)(()=>{if(typeof window>`u`)return 100;let e=window.localStorage.getItem(kt);return e?Ge(e):100}),[Bt,Vt]=(0,j.useState)(Pt),[Ht,Ut]=(0,j.useState)(`hybrid`),[Wt,Gt]=(0,j.useState)(0),[Kt,qt]=(0,j.useState)(!1),[Jt,Yt]=(0,j.useState)(0),[Xt,Zt]=(0,j.useState)(0),[Qt,$t]=(0,j.useState)([]),[en,tn]=(0,j.useState)({labels:[],includeTrashed:!1}),[nn,rn]=(0,j.useState)(!1),[an,on]=(0,j.useState)(!1),sn=(0,j.useRef)(!1),cn=(0,j.useRef)(null),ln=(0,j.useRef)(null),un=(0,j.useRef)(null),[dn,fn]=(0,j.useState)(null),[pn,mn]=(0,j.useState)(!1),hn=(0,j.useCallback)(e=>{let t=ln.current;if(!t)return;let n=t.getBoundingClientRect();un.current={dx:e.clientX-n.left,dy:e.clientY-n.top};try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}},[]),gn=(0,j.useCallback)(e=>{let t=un.current,n=ln.current,r=n?.offsetParent;if(!t||!n||!r)return;let i=r.getBoundingClientRect(),a=Math.max(0,r.clientWidth-n.offsetWidth),o=Math.max(0,r.clientHeight-n.offsetHeight);fn({x:Math.min(Math.max(0,e.clientX-i.left-t.dx),a),y:Math.min(Math.max(0,e.clientY-i.top-t.dy),o)})},[]),_n=(0,j.useCallback)(e=>{un.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),vn=(0,j.useMemo)(()=>fe(T.current.values()),[Ze]);(0,j.useEffect)(()=>{let e=!1,t=i(`/api/admin/graph-labels-in-graph`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[]}}),n=i(`/api/admin/graph-default-view`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[],includeTrashed:!1}});return Promise.all([t,n]).then(([t,n])=>{if(!e&&($t(t.labels),tn(n),!sn.current)){sn.current=!0;let e=new Set(t.labels.map(e=>e.label)),r=n.labels.filter(t=>e.has(t));(r.length>0||n.includeTrashed)&&P(e=>[{kind:`filter`,selectedLabels:r,includeTrashed:n.includeTrashed,includeAgentActions:!1},...e.slice(1)])}}),()=>{e=!0}},[s,c,i]);let yn=M[0].kind===`filter`?M[0].includeAgentActions:!1;(0,j.useEffect)(()=>{if(!sn.current)return;let e=!1;return i(`/api/admin/graph-labels-in-graph?includeAgentActions=${yn?`1`:`0`}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).then(t=>{e||$t(t.labels)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph-refetch`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}),()=>{e=!0}},[s,c,yn,Xt,i]),(0,j.useEffect)(()=>{if(!nn)return;let e=e=>{cn.current&&(cn.current.contains(e.target)||rn(!1))},t=e=>{e.key===`Escape`&&rn(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[nn]);let bn=(0,j.useCallback)((e,t)=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:e,msg:t}),keepalive:!0}).catch(()=>{})}catch{}},[]),xn=(0,j.useCallback)(e=>{console.log(`[graph-fullscreen] op=exit reason=${e}`),_(!1)},[]);(0,j.useEffect)(()=>{if(!r||!h)return;let e=e=>{e.key===`Escape`&&bt({isFullscreen:h,filterOpen:nn})&&xn(`escape`)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r,h,nn,xn]);let Sn=(0,j.useRef)(h);(0,j.useEffect)(()=>{if(!r)return;let e=Sn.current!==h;if(Sn.current=h,!e)return;let t=requestAnimationFrame(()=>{let e=m.current;try{e?.redraw()}catch{}if(!h)return;let t=y.current?.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=t?Math.round(t.width):0,a=t?Math.round(t.height):0;console.log(`[graph-fullscreen] op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`),t&&(t.width<n-2||t.height<r-2)&&bn(`graph-fullscreen-not-covering`,`op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`);try{let t=e?.canvas?.frame?.canvas,n=f.current;if(t&&n){let e=t.clientWidth,r=t.clientHeight,i=n.clientWidth,a=n.clientHeight;console.log(`[graph-fullscreen] op=resized canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`),(Math.abs(e-i)>2||Math.abs(r-a)>2)&&bn(`graph-fullscreen-canvas-mismatch`,`canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`)}}catch{}});return()=>cancelAnimationFrame(t)},[r,h,bn]);let Cn=(0,j.useCallback)(()=>{if(C.current)try{C.current.clear()}catch{}if(ne.current)try{ne.current.clear()}catch{}},[]),wn=(0,j.useCallback)((e,t)=>{lt(null),i(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);rt(null);try{m.current?.unselectAll()}catch{}P(e=>[Le(e)]),Yt(e=>e+1),Be(`graph-trash`)}).catch(n=>{let r=n instanceof Error?n.message:String(n);lt(`Failed to delete: ${r}`),st(!0),window.setTimeout(()=>st(!1),Mt);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete`,elementId:e,label:t,msg:r}),keepalive:!0}).catch(()=>{})}catch{}})},[i]),Tn=(0,j.useCallback)(e=>{lt(null);let t=e.length;Promise.allSettled(e.map(e=>i(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async t=>{let n=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(n.error??`HTTP ${t.status}`);return e}))).then(e=>{let n=e.filter(e=>e.status===`rejected`);rt(null);try{m.current?.unselectAll()}catch{}if(P(e=>[Le(e)]),Yt(e=>e+1),Be(`graph-trash`),n.length>0){let e=t-n.length;lt(e===0?`Failed to delete ${t} node${t===1?``:`s`}.`:`Deleted ${e} of ${t}; ${n.length} failed.`),st(!0),window.setTimeout(()=>st(!1),Mt);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete-batch`,total:t,failed:n.length}),keepalive:!0}).catch(()=>{})}catch{}}})},[i]),En=M[M.length-1],Dn=(0,j.useMemo)(()=>Ie(M),[M]),On=(0,j.useRef)(Dn);(0,j.useEffect)(()=>{On.current=Dn},[Dn]);let kn=(0,j.useRef)(M);(0,j.useEffect)(()=>{kn.current=M},[M]),(0,j.useEffect)(()=>{if(ft){ae.current?.abort(),ae.current=null;return}let e=window.setTimeout(()=>{ae.current?.abort();let e=new AbortController;ae.current=e,Ee(!0),console.log(`[graph-page] op=render-spinner state=shown reason=fetch-start`),qe(null),Ye(null),i(Me(En,{includeAgentActions:Le(M).includeAgentActions,search:null}),{signal:e.signal}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(e.status===413)throw new Lt(t);if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{e.signal.aborted||(T.current=new Map(t.nodes.map(e=>[e.id,e])),Qe(t.nodes.length),tt(ke(t)),jn(t.nodes,t.edges))}).catch(t=>{if(!e.signal.aborted){if(ze(!1),t instanceof Lt){console.log(`[graph-page] op=render-spinner state=hidden reason=ceiling`),Ye(t.body),Qe(0),T.current=new Map,Cn();return}console.log(`[graph-page] op=render-spinner state=hidden reason=error`),qe(t instanceof Error?t.message:String(t))}}).finally(()=>{e.signal.aborted||Ee(!1)})},At);return()=>{window.clearTimeout(e)}},[s,Dn,Jt,c,ft,Bt]),(0,j.useEffect)(()=>{xe.current=we},[we]);let An=(0,j.useCallback)((e,t)=>{let n=C.current,r=ne.current;if(!n||!r||!m.current)return{added:0,updated:0,removed:0,edgesAdded:0,edgesRemoved:0,maxDegree:0};let i=Te(T.current,e),a=F(new Map(A.current.map(e=>[e.id,e])),t);if(!I(i,a))return{added:0,updated:0,removed:0,edgesAdded:0,edgesRemoved:0,maxDegree:0};let o=le(t),s=0;for(let e of o.values())e>s&&(s=e);let c=(()=>{try{return m.current.getScale()||1}catch{return 1}})();a.removed.length>0&&r.remove(a.removed);let l=new Set(e.map(e=>e.id)),u=a.added.filter(e=>e.type!==`PART_OF`||l.has(e.from)&&l.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type}));u.length>0&&r.add(u),i.removed.length>0&&n.remove(i.removed);let d=i.updated.map(e=>e.id),f=d.length>0?(()=>{try{return m.current.getPositions(d)}catch{return{}}})():{},p=new Set(i.added.map(e=>e.id)),h=[...i.added,...i.updated];for(let e of h){let{visNode:t,iconFallbackLabel:r}=Se({node:e,degree:o.get(e.id)??0,revealed:ve.current,scale:c,position:p.has(e.id)?void 0:f[e.id]});be(r),n.update(t)}let g=new Set(h.map(e=>e.id));for(let t of e){if(g.has(t.id))continue;let e=ue(o.get(t.id)??0),r=n.get(t.id);r&&r.size!==e&&n.update({id:t.id,size:e})}return T.current=new Map(e.map(e=>[e.id,e])),A.current=t,Qe(e.length),{added:i.added.length,updated:i.updated.length,removed:i.removed.length,edgesAdded:u.length,edgesRemoved:a.removed.length,maxDegree:s}},[Qe]);(0,j.useEffect)(()=>{if(En.kind!==`filter`||ft)return;let e=Me(En,{includeAgentActions:Le(M).includeAgentActions,search:null}),t=!1,n=null,r=(e,t)=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-poll`,op:e,view:En.kind,...t}),keepalive:!0}).catch(()=>{})}catch{}},a=()=>{if(document.hidden||xe.current)return;n?.abort();let a=new AbortController;n=a;let o=Date.now();i(e,{signal:a.signal}).then(e=>e.ok?e.json():null).then(e=>{if(t||a.signal.aborted||!e||!Array.isArray(e.nodes))return;let n=An(e.nodes,e.edges??[]),i=ke(e);tt(i),r(`tick`,{fetchMs:Date.now()-o,total:i,...n})}).catch(e=>{a.signal.aborted||r(`poll-error`,{msg:e instanceof Error?e.message:String(e)})})};r(`start`,{intervalMs:jt});let o=window.setInterval(a,jt),s=()=>{document.visibilityState===`visible`?(r(`resume`,{}),a()):r(`pause`,{})};return document.addEventListener(`visibilitychange`,s),()=>{t=!0,n?.abort(),window.clearInterval(o),document.removeEventListener(`visibilitychange`,s),r(`stop`,{})}},[s,Dn,ft,c,En.kind]),(0,j.useEffect)(()=>()=>{ae.current?.abort(),S.current?.(),S.current=null,m.current?.destroy(),m.current=null,_e.current!==null&&(clearTimeout(_e.current),_e.current=null)},[]);let jn=(0,j.useCallback)((e,t)=>{if(!f.current)return;ze(!0),A.current=t;let n=new Set([`Message`,`UserMessage`,`AssistantMessage`]),r=e=>e.labels.some(e=>n.has(e)),i=new Map,a=e.filter(r);if(a.length>0){let e=new Set(a.map(e=>e.id)),n=new Map,r=new Set;for(let i of t)i.type===`NEXT`&&e.has(i.from)&&e.has(i.to)&&(n.set(i.from,i.to),r.add(i.to));let o=[],s=new Set;for(let e of a){if(r.has(e.id))continue;let t=e.id;for(;t&&!s.has(t);)s.add(t),o.push(t),t=n.get(t)}for(let e of a)s.has(e.id)||(o.push(e.id),s.add(e.id));let c=f.current?.clientWidth??1200,l=Math.max(c-160,300),u=Math.max(Math.floor(l/150),2);o.forEach((e,t)=>{let n=t%u,r=Math.floor(t/u);i.set(e,{x:n*150,y:r*90})})}let o=le(t),s=0,c=e.map(e=>{(0,w.resolveNodeColour)(e.labels).driftCandidates;let t=o.get(e.id)??0;t>s&&(s=t);let{visNode:n,iconFallbackLabel:r}=Se({node:e,degree:t,revealed:ve.current,scale:1,position:i.get(e.id)});return be(r),n}),l=new Set(c.map(e=>e.id)),u=t.filter(e=>e.type!==`PART_OF`||l.has(e.from)&&l.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type})),d=Xe({nodes:e,edges:t});C.current=new oe.DataSet(d.nodePositions.size>0?c.map(e=>{if(e.x!==void 0||e.y!==void 0)return e;let t=d.nodePositions.get(e.id);return t?{...e,x:t.x,y:t.y,physics:!1}:e}):c),ne.current=new oe.DataSet(u);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-style`,op:`degree-size`,nodes:c.length,maxDegree:s,minPx:14,maxPx:40}),keepalive:!0}).catch(()=>{})}catch{}let p=wt(f.current,`--accent-brand`,Tt),h=wt(f.current,`--border-strong`,Et),g=wt(f.current,`--border`,Dt),_={autoResize:!0,layout:{improvedLayout:!1,randomSeed:Ot(On.current)},physics:d.physics===!1?!1:{solver:d.physics.solver,forceAtlas2Based:d.physics.forceAtlas2Based,stabilization:d.physics.stabilization},nodes:{shape:`dot`,size:18,font:{color:`#1F2937`,size:12,face:`DM Sans, sans-serif`},scaling:{label:{enabled:!0,min:12,max:30,drawThreshold:0}},borderWidth:0,chosen:{node:e=>{e.size=Math.round(e.size*1.2),e.borderWidth=3,e.borderColor=p,e.shadow=!0,e.shadowColor=`rgba(15, 23, 42, 0.55)`,e.shadowSize=8,e.shadowX=0,e.shadowY=0},label:e=>{e.size=14}}},edges:{arrows:{to:{enabled:!0,scaleFactor:.4}},color:{color:g,highlight:h},font:{color:`#64748B`,size:9,face:`DM Sans, sans-serif`,align:`middle`,strokeWidth:0},smooth:{enabled:!0,type:`continuous`,roundness:.4},width:1,chosen:{edge:!0,label:!1}},interaction:{hover:!0,tooltipDelay:150,multiselect:!0}};try{S.current?.(),S.current=null,m.current?.destroy(),_e.current!==null&&(clearTimeout(_e.current),_e.current=null),ge.current=null;let e=new se.Network(f.current,{nodes:C.current,edges:ne.current},_);m.current=e,d.physics===!1?(ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=no-physics`)):S.current=$e(e,{report:({avgMotion:e,settleMs:t,capped:n,nodeCount:r})=>{ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=${n?`settle-capped`:`settled`}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-settle`,avgMotion:Math.round(e*100)/100,settleMs:t,capped:n,nodeCount:r}),keepalive:!0}).catch(()=>{})}catch{}}}),e.on(`zoom`,()=>{_e.current!==null&&clearTimeout(_e.current),_e.current=setTimeout(()=>{_e.current=null;let e=m.current,t=C.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=xt(n);if(r===ge.current)return;ge.current=r;let i=[];for(let e of T.current.values()){if(!e.labels[0])continue;let{colour:t}=(0,w.resolveNodeColour)(e.labels),r=e.trashed?{background:`${t}40`,border:t}:t,a=ve.current?N(e,n):``;i.push({id:e.id,label:a,color:r})}i.length>0&&t.update(i),console.error(`[graph-page] zoom-tier scale=${n.toFixed(3)} tier=${r} nodes=${i.length}`)},St)}),e.on(`click`,e=>{let t=e.nodes[0];if(!t)return;let n=T.current.get(t);if(!n)return;if(Ve(n)===`skip-trashed`){rt(n);return}let r=kn.current[kn.current.length-1];if(r.kind===`neighbourhood`&&r.rootElementId===t){rt(e=>e?.id===t?null:n);return}rt(null);let i={kind:`neighbourhood`,rootElementId:t,rootLabel:n.labels[0]??null};P(e=>{let n=Ne(e,i),r=n.length-1;return n.length>e.length&&zt(`nav-push`,{depth:r,kind:i.kind,rootElementId:t}),n.length===10&&e.length===10&&zt(`view-stack-cap-hit`,{depth:10,rootElementId:t}),n})}),e.on(`deselectNode`,()=>{rt(null)});let t=e=>{let t=f.current,n=ce.current;if(!t||!n)return!1;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=r.left+e.x,o=r.top+e.y;return a>=i.left&&a<=i.right&&o>=i.top&&o<=i.bottom},n=f.current?.parentElement??null;e.on(`dragStart`,e=>{if(e.nodes.length===0){de.current=null,pe.current=[];return}pe.current=[...e.nodes],de.current=e.nodes[0],n?.classList.add(`graph-dragging`)}),e.on(`dragging`,e=>{if(pe.current.length===0)return;let n=t(e.pointer.DOM);at(e=>e===n?e:n)}),e.on(`dragEnd`,e=>{let r=pe.current;if(pe.current=[],de.current=null,at(!1),n?.classList.remove(`graph-dragging`),r.length!==0&&t(e.pointer.DOM))if(r.length===1){let e=T.current.get(r[0])?.labels[0]??`Unknown`;wn(r[0],e)}else Tn(r)})}catch(e){ze(!1),console.log(`[graph-page] op=render-spinner state=hidden reason=render-error`);let t=e instanceof Error?e.message:String(e);qe(`Visualisation failed to load: ${t}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-render`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}},[]),Mn=(0,j.useCallback)(()=>{let e=m.current,t=C.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=[];for(let e of T.current.values()){if(!e.labels[0])continue;let{colour:t}=(0,w.resolveNodeColour)(e.labels),i=e.trashed?{background:`${t}40`,border:t}:t;r.push({id:e.id,label:ve.current?N(e,n):``,color:i})}r.length>0&&t.update(r)},[]),Nn=(0,j.useCallback)(()=>{ve.current||(ve.current=!0,Mn())},[Mn]);(0,j.useEffect)(()=>{let e=y.current;if(!e)return;let t=()=>Nn();return e.addEventListener(`pointerdown`,t,!0),e.addEventListener(`wheel`,t,!0),e.addEventListener(`keydown`,t,!0),()=>{e.removeEventListener(`pointerdown`,t,!0),e.removeEventListener(`wheel`,t,!0),e.removeEventListener(`keydown`,t,!0)}},[Nn]),(0,j.useEffect)(()=>{let e=f.current;if(!e)return;let t=t=>{let n=he.current,r=me.current,i=e.parentElement;if(!n||!r||!i)return;let a=i.getBoundingClientRect(),o=Math.min(n.clientX,t.clientX)-a.left,s=Math.min(n.clientY,t.clientY)-a.top,c=Math.max(n.clientX,t.clientX)-a.left,l=Math.max(n.clientY,t.clientY)-a.top;r.style.left=`${o}px`,r.style.top=`${s}px`,r.style.width=`${c-o}px`,r.style.height=`${l-s}px`},n=r=>{document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0);let i=he.current;he.current=null;let a=me.current;a&&(a.style.display=`none`);let o=m.current;if(!i||!o)return;let s=e.getBoundingClientRect(),c=i.clientX-s.left,l=i.clientY-s.top,u=r.clientX-s.left,d=r.clientY-s.top,f=Math.min(c,u),p=Math.min(l,d),h=Math.max(c,u),g=Math.max(l,d);if(h-f<3&&g-p<3)return;let _=o.getPositions(),v=[];for(let[e,t]of Object.entries(_)){let n=o.canvasToDOM(t);n.x>=f&&n.x<=h&&n.y>=p&&n.y<=g&&v.push(e)}try{o.selectNodes(v,!1)}catch{}},r=r=>{if(!r.shiftKey||r.button!==0)return;let i=m.current,a=e.parentElement;if(!i||!a)return;let o=e.getBoundingClientRect(),s={x:r.clientX-o.left,y:r.clientY-o.top};if(i.getNodeAt(s))return;r.preventDefault(),r.stopImmediatePropagation(),he.current={clientX:r.clientX,clientY:r.clientY};let c=me.current,l=a.getBoundingClientRect();c&&(c.style.display=`block`,c.style.left=`${r.clientX-l.left}px`,c.style.top=`${r.clientY-l.top}px`,c.style.width=`0px`,c.style.height=`0px`),document.addEventListener(`mousemove`,t,!0),document.addEventListener(`mouseup`,n,!0)};return e.addEventListener(`mousedown`,r,!0),()=>{e.removeEventListener(`mousedown`,r,!0),document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0)}},[]),(0,j.useEffect)(()=>{let e=ut.trim();if(!e){pt(``),gt(null),Nt(null),Ut(`hybrid`),Gt(0),qt(!1),m.current?.unselectAll();return}qt(!1);let t=setTimeout(()=>pt(e),300);return()=>clearTimeout(t)},[ut]),(0,j.useEffect)(()=>{let e=setTimeout(()=>{let e=Ge(Pt);Vt(e);try{window.localStorage.setItem(kt,String(e))}catch{}},200);return()=>clearTimeout(e)},[Pt]);let Pn=(0,j.useCallback)(e=>{let t=m.current,n=C.current;if(!t||!n)return;let{updates:r,inWindow:i}=He(e,T.current,w.resolveNodeColour,Ct);r.length>0&&(n.update(r),t.fit({nodes:i,animation:{duration:400,easingFunction:`easeInOutQuad`}}))},[]),Fn=Le(M);(0,j.useEffect)(()=>{if(!ft)return;let e=!1;return Nt(null),i(Ke(ft,Fn.selectedLabels,Bt,Kt)).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{if(e)return;gt(t.results);let n=t.mode===`bm25`?`bm25`:`hybrid`;if(Ut(n),Gt(typeof t.suppressed==`number`?t.suppressed:0),n===`bm25`)try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-page`,msg:`[graph-page] search-result-degraded mode=bm25 query="${ft}"`}),keepalive:!0}).catch(()=>{})}catch{}let{nodes:r,edges:i}=Ue(t.results,Fn.selectedLabels);T.current=new Map(r.map(e=>[e.id,e])),Qe(r.length),Ye(null),jn(r,i),Pn(t.results),console.info(`[graph-page] search-applied view=${En.kind} q="${ft}" labels=${Fn.selectedLabels.join(`|`)} hits=${r.length}`)}).catch(t=>{e||Nt(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[ft,Bt,s,c,i,Pn,En.kind,Fn.selectedLabels,jn,Kt]);let In=(0,j.useCallback)(e=>{P(t=>{let n=Le(t),r=new Set(n.selectedLabels);return r.has(e)?r.delete(e):r.add(e),Fe({kind:`filter`,selectedLabels:[...r].sort(),includeTrashed:n.includeTrashed,includeAgentActions:n.includeAgentActions})})},[]),Ln=(0,j.useCallback)(()=>{P(e=>{let t=Le(e);return Fe({...t,includeTrashed:!t.includeTrashed})})},[]),Rn=(0,j.useCallback)(()=>{P(e=>{let t=Le(e);return Fe({...t,includeAgentActions:!t.includeAgentActions})})},[]),zn=(0,j.useCallback)(()=>{dt(``),pt(``),gt(null),Nt(null),Ut(`hybrid`),Gt(0),qt(!1);try{m.current?.unselectAll()}catch{}},[]),Bn=(0,j.useCallback)(()=>{P(()=>Fe({kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}))},[]),Vn=(0,j.useCallback)(()=>{rt(null);try{m.current?.unselectAll()}catch{}P(e=>{let t=Pe(e);return t!==e&&zt(`nav-pop`,{depth:t.length-1}),t})},[]),Hn=(0,j.useCallback)(()=>{rt(null);try{m.current?.unselectAll()}catch{}P(e=>e.length<=1?e:(zt(`nav-home`,{depth:0,popped:e.length-1}),[Le(e)]))},[]),Un=(0,j.useCallback)(()=>{let e=Le(M),t={labels:[...e.selectedLabels].sort(),includeTrashed:e.includeTrashed};on(!0),i(`/api/admin/graph-default-view`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}).then(async e=>{if(!e.ok){let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));throw Error(t.error??`HTTP ${e.status}`)}tn(t)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view-save`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}).finally(()=>on(!1))},[i,M]),Wn=(0,j.useCallback)(()=>{rt(null);try{m.current?.unselectAll()}catch{}Yt(e=>e+1),Be(`graph-restore`)},[]),R=(0,j.useCallback)(()=>{rt(null);try{m.current?.unselectAll()}catch{}P(e=>[Le(e)]),Yt(e=>e+1),Be(`graph-trash`)},[]),z=(0,j.useCallback)(()=>{Yt(e=>e+1),Zt(e=>e+1)},[]),Gn=En.kind===`neighbourhood`,Kn=Le(M),qn=Kn.selectedLabels,Jn=Kn.includeTrashed,Yn=Kn.includeAgentActions,Xn=je({inNeighbourhood:Gn,searchActive:!!ft}),Zn=(0,j.useMemo)(()=>{if(Jn!==en.includeTrashed||qn.length!==en.labels.length)return!0;for(let e=0;e<qn.length;e++)if(qn[e]!==en.labels[e])return!0;return!1},[Jn,qn,en]);return(0,L.jsxs)(`div`,{ref:y,className:vt(h,r),children:[(0,L.jsxs)(`div`,{className:`graph-toolbar`,children:[M.length>1&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-desktop`,onClick:Hn,title:`Clear breadcrumb — return to filter root`,children:[(0,L.jsx)(k,{size:12}),` Home`]}),(0,L.jsx)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-mobile`,onClick:Hn,"aria-label":`Home`,title:`Clear breadcrumb — return to filter root`,children:(0,L.jsx)(k,{size:14})}),(0,L.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-desktop`,onClick:Vn,children:`← Back`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-mobile`,onClick:Vn,"aria-label":`Back`,children:(0,L.jsx)(x,{size:16})})]}),(0,L.jsxs)(`div`,{className:`data-search-input graph-search-input`,children:[(0,L.jsx)(te,{size:14}),(0,L.jsx)(`input`,{type:`text`,placeholder:`Search nodes…`,value:ut,onChange:e=>dt(e.target.value),autoComplete:`off`,spellCheck:!1}),ft&&!mt&&!_t&&(0,L.jsx)(a,{size:14,className:`spin`}),ut.length>0&&(0,L.jsx)(`button`,{type:`button`,className:`graph-search-clear`,onClick:zn,"aria-label":`Clear search`,title:`Clear search`,children:(0,L.jsx)(d,{size:14})})]}),ft&&(0,L.jsxs)(`div`,{className:`graph-search-limit`,title:`Show top ${Pt} matches (1-2000)`,children:[(0,L.jsx)(`label`,{htmlFor:`graph-search-limit-input`,className:`graph-search-limit-label`,children:`Top`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>It(Ge(Pt-1)),disabled:Pt<=1,"aria-label":`Decrement search limit`,title:`Decrement`,children:(0,L.jsx)(ie,{size:12})}),(0,L.jsx)(`input`,{id:`graph-search-limit-input`,type:`number`,min:1,max:2e3,step:1,value:Pt,onChange:e=>It(Ge(e.target.value)),className:`graph-search-limit-number`,"aria-label":`Maximum search results to render`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>It(Ge(Pt+1)),disabled:Pt>=2e3,"aria-label":`Increment search limit`,title:`Increment`,children:(0,L.jsx)(p,{size:12})}),(0,L.jsx)(`input`,{id:`graph-search-limit-slider`,type:`range`,min:1,max:2e3,step:1,value:Pt,onChange:e=>It(Ge(e.target.value)),"aria-label":`Maximum search results to render (drag for ballpark)`})]}),(0,L.jsx)(`button`,{type:`button`,className:`graph-refresh-button`,onClick:z,disabled:we,"aria-label":`Refresh graph`,title:`Refresh graph`,children:(0,L.jsx)(u,{size:14,className:we?`spin`:void 0})}),yt(r)&&(0,L.jsx)(`button`,{type:`button`,className:`graph-fullscreen-toggle`,onClick:()=>{h?xn(`button`):_(!0)},"aria-label":h?`Exit full screen`:`Full screen`,title:h?`Exit full screen`:`Full screen`,"aria-pressed":h,children:h?(0,L.jsx)(re,{size:14}):(0,L.jsx)(ee,{size:14})}),!Gn&&(0,L.jsxs)(`div`,{className:`graph-filter-wrap`,ref:cn,children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-filter-toggle${nn?` is-open`:``}${qn.length>0||Jn||Yn?` has-selection`:``}`,onClick:()=>rn(e=>!e),"aria-haspopup":`true`,"aria-expanded":nn,"aria-label":`Filter node types`,children:[(0,L.jsx)(v,{size:14}),(0,L.jsx)(`span`,{children:`Filter`}),qn.length>0&&(0,L.jsx)(`span`,{className:`graph-filter-count`,children:qn.length})]}),nn&&(0,L.jsxs)(`div`,{className:`graph-filter-popover`,role:`dialog`,"aria-label":`Node type filter`,children:[(0,L.jsxs)(`div`,{className:`graph-filter-popover-header`,children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-toggle-trashed${Jn?` active`:``}`,onClick:Ln,"aria-pressed":Jn,title:`Show trashed nodes — restored with Restore button on each node`,children:[(0,L.jsx)(D,{size:14}),` Show trashed`]}),(qn.length>0||Jn||Yn)&&(0,L.jsx)(`button`,{type:`button`,className:`graph-filter-clear`,onClick:Bn,"aria-label":`Clear filter selection`,title:`Clear filter selection`,children:(0,L.jsx)(d,{size:14})})]}),(0,L.jsx)(`div`,{className:`graph-toggle-agent-actions`,title:`Hide ToolCall, StepResult, WorkflowStep, WorkflowRun — agent-execution telemetry. Flip on for audit/debug.`,children:(0,L.jsx)(g,{checked:Yn,onChange:Rn,label:`Include agent actions`})}),Qt.length===0&&(0,L.jsx)(`p`,{className:`graph-filter-popover-empty`,children:`No node types in your graph yet.`}),(0,L.jsx)(`div`,{className:`graph-filter-rows`,role:`group`,"aria-label":`Node type filter`,children:Qt.map(({label:e,nodeCount:t})=>{let n=qn.includes(e),r=(0,w.colourForLabel)(e);return(0,L.jsxs)(`button`,{type:`button`,className:`graph-filter-row${n?` active`:``}`,onClick:()=>In(e),"aria-pressed":n,children:[(0,L.jsx)(`span`,{className:`graph-filter-row-swatch`,style:{backgroundColor:r}}),(0,L.jsx)(`span`,{className:`graph-filter-row-label`,children:e}),(0,L.jsx)(`span`,{className:`graph-filter-row-count`,children:t})]},e)})}),(0,L.jsx)(`div`,{className:`graph-filter-popover-footer`,children:(0,L.jsx)(`button`,{type:`button`,className:`graph-filter-set-default`,onClick:Un,disabled:!Zn||an,children:an?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(a,{size:12,className:`spin`}),` Saving…`]}):`Set default view`})})]})]}),(0,L.jsx)(`div`,{className:`graph-meta`,children:De({inNeighbourhood:Gn,searchActive:!!ft,selectedLabelsCount:qn.length,topLevelTotal:et,nodeCount:Ze})?(0,L.jsx)(`span`,{className:`graph-meta-count`,children:Oe(Ze,et)}):Ze>0&&(0,L.jsxs)(`span`,{className:`graph-meta-count`,children:[Ze,` node`,Ze===1?``:`s`]})})]}),M.length>1&&(0,L.jsx)(Rt,{viewStack:M}),ft&&Ht===`bm25`&&!_t&&(0,L.jsx)(`div`,{className:`graph-error-banner graph-search-degraded`,role:`status`,children:`Vector ranking unavailable — showing keyword-only results.`}),_t&&(0,L.jsxs)(`div`,{className:`data-error graph-error-banner`,children:[`Search unavailable: `,_t]}),ft&&Wt>0&&!Kt&&!_t&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>qt(!0),children:[Wt,` low-confidence match`,Wt===1?``:`es`,` hidden — show all`]}),ft&&Kt&&!_t&&(0,L.jsx)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>qt(!1),children:`Showing all matches — hide low-confidence`}),mt&&mt.length===0&&!_t&&(0,L.jsx)(`div`,{className:`graph-search-status`,children:`No matches in your graph.`}),(0,L.jsxs)(`div`,{className:`graph-canvas-wrap`,children:[Ae({loading:we,rendering:Re,searchActive:!!ft})&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,L.jsx)(a,{size:20,className:`spin`}),` Loading your graph…`]}),We&&!we&&!Re&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,L.jsx)(`p`,{children:We}),(0,L.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:()=>{qe(null),Yt(e=>e+1)},children:`Retry`})]}),Je&&!we&&!Re&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,L.jsxs)(`p`,{children:[`Refine your filter — `,(0,L.jsx)(`strong`,{children:Je.matched}),` matches exceed the 2000 cap.`]}),(0,L.jsx)(`p`,{className:`graph-canvas-hint`,children:`Pick a more specific label combination, or narrow your brand's data.`})]}),!we&&!Re&&!We&&!Je&&Ze===0&&!Gn&&qn.length===0&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,L.jsx)(v,{size:20}),(0,L.jsx)(`p`,{children:`No nodes in your graph yet.`})]}),!we&&!Re&&!We&&!Je&&Ze===0&&!Gn&&qn.length>0&&(0,L.jsx)(`div`,{className:`graph-canvas-overlay`,children:(0,L.jsxs)(`p`,{children:[`No `,qn.join(`, `),` nodes match this view.`]})}),(0,L.jsx)(`div`,{ref:f,className:`graph-canvas`}),(0,L.jsx)(`div`,{ref:me,className:`graph-marquee`,"aria-hidden":`true`}),Ze>0&&(0,L.jsx)(`div`,{ref:ce,className:`graph-trash-drop-zone${it?` is-hover`:``}${ot?` is-error`:``}`,"aria-hidden":`true`,children:(0,L.jsx)(l,{size:18})}),ct&&(0,L.jsxs)(`div`,{className:`graph-drag-error-banner`,role:`alert`,children:[(0,L.jsx)(`span`,{children:ct}),(0,L.jsx)(`button`,{type:`button`,className:`graph-drag-error-dismiss`,onClick:()=>lt(null),"aria-label":`Dismiss`,children:(0,L.jsx)(d,{size:14})})]}),Ze>0&&vn.length>0&&(0,L.jsxs)(`div`,{ref:ln,className:`graph-legend${pn?` is-collapsed`:``}`,style:dn?{"--legend-x":`${dn.x}px`,"--legend-y":`${dn.y}px`}:void 0,children:[(0,L.jsxs)(`div`,{className:`graph-legend-header`,onPointerDown:hn,onPointerMove:gn,onPointerUp:_n,children:[(0,L.jsx)(O,{size:13,className:`graph-legend-grip`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`graph-legend-title`,children:`Legend`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-legend-collapse`,onPointerDown:e=>e.stopPropagation(),onClick:()=>mn(e=>!e),"aria-label":pn?`Expand legend`:`Collapse legend`,"aria-expanded":!pn,children:pn?(0,L.jsx)(E,{size:14}):(0,L.jsx)(b,{size:14})})]}),(0,L.jsx)(`div`,{className:`graph-legend-body`,children:vn.map(e=>{let t=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Ft,{label:e.label,shape:e.shape,colour:e.colour}),(0,L.jsx)(`span`,{className:`graph-legend-label`,children:e.label}),(0,L.jsx)(`span`,{className:`graph-legend-count`,children:e.count})]});if(!Xn)return(0,L.jsx)(`div`,{className:`graph-legend-item`,children:t},e.label);let n=qn.includes(e.label);return(0,L.jsx)(`button`,{type:`button`,className:`graph-legend-item graph-legend-item--interactive${n?` is-selected`:``}`,"aria-pressed":n,onClick:()=>{let t=n?`remove`:`add`,r=n?qn.length-1:qn.length+1;console.log(`[graph-page] op=legend-filter label=${e.label} action=${t} selected=${r}`),In(e.label)},children:t},e.label)})})]})]}),nt&&(0,L.jsx)(ht,{node:nt,edges:A.current,nodesById:T.current,adminFetch:i,onClose:()=>{rt(null);try{m.current?.unselectAll()}catch{}},onRestored:Wn,onTrashed:R})]})}var Lt=class extends Error{body;constructor(e){super(e.error),this.body=e}};function Rt({viewStack:e}){let t=e.map(e=>e.kind===`filter`?`Filter`:e.rootLabel??`Node`);return(0,L.jsx)(`div`,{className:`graph-breadcrumb`,role:`navigation`,"aria-label":`Graph navigation breadcrumb`,children:t.map((e,n)=>(0,L.jsxs)(`span`,{className:`graph-breadcrumb-item`,children:[n>0&&(0,L.jsx)(`span`,{className:`graph-breadcrumb-separator`,"aria-hidden":`true`,children:`›`}),(0,L.jsx)(`span`,{className:`graph-breadcrumb-label${n===t.length-1?` is-current`:``}`,children:e})]},n))})}function zt(e,t){let n=`[graph-page] ${e} ${Object.entries(t).map(([e,t])=>`${e}=${String(t)}`).join(` `)}`;try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-nav`,msg:n}),keepalive:!0}).catch(()=>{})}catch{}}(0,ce.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(Nt,{}));