@tung-engineering/agent-platform-web-sdk 0.0.88 → 0.0.90

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.
package/dist/web-sdk.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Gu=Object.defineProperty,Wu=Object.defineProperties;var Ju=Object.getOwnPropertyDescriptors;var Mi=Object.getOwnPropertySymbols;var Vu=Object.prototype.hasOwnProperty,Yu=Object.prototype.propertyIsEnumerable;var ji=Math.pow,gs=(e,t,n)=>t in e?Gu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,y=(e,t)=>{for(var n in t||(t={}))Vu.call(t,n)&&gs(e,n,t[n]);if(Mi)for(var n of Mi(t))Yu.call(t,n)&&gs(e,n,t[n]);return e},D=(e,t)=>Wu(e,Ju(t));var ie=(e,t,n)=>gs(e,typeof t!="symbol"?t+"":t,n);var z=(e,t,n)=>new Promise((r,o)=>{var i=l=>{try{d(n.next(l))}catch(p){o(p)}},a=l=>{try{d(n.throw(l))}catch(p){o(p)}},d=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,a);d((n=n.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Xu=`
1
+ "use strict";var Wg=Object.defineProperty,Jg=Object.defineProperties;var jg=Object.getOwnPropertyDescriptors;var pl=Object.getOwnPropertySymbols;var Yg=Object.prototype.hasOwnProperty,qg=Object.prototype.propertyIsEnumerable;var we=Math.pow,Oi=(A,e,t)=>e in A?Wg(A,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):A[e]=t,k=(A,e)=>{for(var t in e||(e={}))Yg.call(e,t)&&Oi(A,t,e[t]);if(pl)for(var t of pl(e))qg.call(e,t)&&Oi(A,t,e[t]);return A},$=(A,e)=>Jg(A,jg(e));var dA=(A,e,t)=>Oi(A,typeof e!="symbol"?e+"":e,t);var T=(A,e,t)=>new Promise((n,r)=>{var s=i=>{try{a(t.next(i))}catch(c){r(c)}},o=i=>{try{a(t.throw(i))}catch(c){r(c)}},a=i=>i.done?n(i.value):Promise.resolve(i.value).then(s,o);a((t=t.apply(A,e)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const AB=`
2
2
  :where([data-ap-sdk][popover]) {
3
3
  position: fixed;
4
4
  margin: 0;
@@ -9,7 +9,7 @@
9
9
  overflow: visible;
10
10
  inset: auto;
11
11
  }
12
- `,Ku=`
12
+ `,eB=`
13
13
  @keyframes ap-sdk-panel-in {
14
14
  from { opacity: 0; transform: translateY(-50%) translateX(16px) scale(0.98); }
15
15
  to { opacity: 1; transform: translateY(-50%) translateX(0) scale(1); }
@@ -45,6 +45,8 @@
45
45
  justify-content: space-between;
46
46
  padding: 14px 16px 10px;
47
47
  border-bottom: 1px solid #f3f4f6;
48
+ cursor: move;
49
+ touch-action: none;
48
50
  }
49
51
 
50
52
  .ap-sdk-panel__title {
@@ -110,6 +112,23 @@
110
112
  background: oklch(95% 0.035 50);
111
113
  }
112
114
 
115
+ .ap-sdk-panel__clear {
116
+ background: none;
117
+ border: none;
118
+ padding: 4px;
119
+ cursor: pointer;
120
+ color: oklch(58% 0.13 42);
121
+ font-size: 14px;
122
+ line-height: 1;
123
+ border-radius: 4px;
124
+ transition: color 0.15s, background 0.15s;
125
+ }
126
+
127
+ .ap-sdk-panel__clear:hover {
128
+ color: oklch(47% 0.13 40);
129
+ background: oklch(95% 0.035 50);
130
+ }
131
+
113
132
  .ap-sdk-panel__body {
114
133
  padding: 14px 16px;
115
134
  display: flex;
@@ -303,7 +322,7 @@
303
322
  color: #991b1b;
304
323
  border: 1px solid #fca5a5;
305
324
  }
306
- `,Qu=`
325
+ `,tB=`
307
326
  .ap-sdk-highlight {
308
327
  position: fixed;
309
328
  pointer-events: none;
@@ -314,7 +333,7 @@
314
333
  z-index: 2147483645;
315
334
  transition: top 60ms ease, left 60ms ease, width 60ms ease, height 60ms ease;
316
335
  }
317
- `,ed=`
336
+ `,nB=`
318
337
  .ap-sdk-picker-cursor {
319
338
  position: fixed;
320
339
  bottom: 16px;
@@ -388,7 +407,7 @@
388
407
  background: rgba(255, 255, 255, 0.12);
389
408
  opacity: 1;
390
409
  }
391
- `,td=`
410
+ `,rB=`
392
411
  .ap-sdk-recorder-bar {
393
412
  position: fixed;
394
413
  bottom: 16px;
@@ -442,7 +461,7 @@
442
461
  .ap-sdk-recorder-bar__btn--stop:hover {
443
462
  background: oklch(95% 0.035 50);
444
463
  }
445
- `,nd=`
464
+ `,sB=`
446
465
  .ap-sdk-panel__context {
447
466
  padding: 10px 16px;
448
467
  background: #f9fafb;
@@ -521,6 +540,60 @@
521
540
  white-space: nowrap;
522
541
  }
523
542
 
543
+ /* ── Screenshot preview (see screenshot.ts / panel.ts's captureScreenshotFor) ──────── */
544
+
545
+ .ap-sdk-panel__screenshot {
546
+ padding: 10px 16px;
547
+ border-bottom: 1px solid #f3f4f6;
548
+ }
549
+
550
+ .ap-sdk-screenshot__status {
551
+ font-size: 12px;
552
+ color: oklch(47% 0.13 40);
553
+ }
554
+
555
+ .ap-sdk-screenshot__status--muted {
556
+ color: #9ca3af;
557
+ font-style: italic;
558
+ }
559
+
560
+ .ap-sdk-screenshot__error {
561
+ margin-top: 4px;
562
+ font-size: 11px;
563
+ font-family: ui-monospace, monospace;
564
+ color: #b91c1c;
565
+ word-break: break-word;
566
+ }
567
+
568
+ .ap-sdk-screenshot__toggle {
569
+ display: flex;
570
+ align-items: center;
571
+ gap: 6px;
572
+ font-size: 12px;
573
+ color: oklch(47% 0.13 40);
574
+ cursor: pointer;
575
+ margin-bottom: 8px;
576
+ }
577
+
578
+ .ap-sdk-screenshot__toggle input {
579
+ cursor: pointer;
580
+ }
581
+
582
+ .ap-sdk-screenshot__thumb {
583
+ display: block;
584
+ max-width: 100%;
585
+ max-height: 140px;
586
+ border-radius: 7px;
587
+ border: 1px solid #e5e7eb;
588
+ object-fit: contain;
589
+ background: #f9fafb;
590
+ transition: opacity 0.15s;
591
+ }
592
+
593
+ .ap-sdk-screenshot--excluded .ap-sdk-screenshot__thumb {
594
+ opacity: 0.4;
595
+ }
596
+
524
597
  .ap-sdk-credentials-section {
525
598
  padding: 0 16px 12px;
526
599
  border-bottom: 1px solid #f3f4f6;
@@ -553,6 +626,7 @@
553
626
 
554
627
  .ap-sdk-panel--success .ap-sdk-pick-list,
555
628
  .ap-sdk-panel--success .ap-sdk-credentials-section,
629
+ .ap-sdk-panel--success .ap-sdk-panel__pick-actions,
556
630
  .ap-sdk-panel--success .ap-sdk-panel__body,
557
631
  .ap-sdk-panel--success .ap-sdk-panel__footer {
558
632
  display: none !important;
@@ -672,7 +746,7 @@
672
746
  font-style: italic;
673
747
  white-space: normal;
674
748
  }
675
- `,rd=`
749
+ `,oB=`
676
750
  .ap-sdk-fab {
677
751
  position: fixed;
678
752
  bottom: 20px;
@@ -802,7 +876,7 @@
802
876
  line-height: 1;
803
877
  pointer-events: none;
804
878
  }
805
- `,od=`
879
+ `,iB=`
806
880
  .ap-sdk-advanced {
807
881
  border-top: 1px solid #f3f4f6;
808
882
  padding-top: 8px;
@@ -858,7 +932,7 @@
858
932
  color: #9ca3af;
859
933
  margin-top: 2px;
860
934
  }
861
- `,sd=`
935
+ `,aB=`
862
936
  .ap-sdk-list-body {
863
937
  padding: 8px 0;
864
938
  max-height: 320px;
@@ -983,7 +1057,7 @@ button.ap-sdk-list-item__link {
983
1057
  .ap-sdk-status-link:hover {
984
1058
  color: oklch(47% 0.13 40);
985
1059
  }
986
- `,id=`
1060
+ `,cB=`
987
1061
  .ap-sdk-record-review__list {
988
1062
  max-height: 320px;
989
1063
  overflow-y: auto;
@@ -1044,7 +1118,7 @@ button.ap-sdk-list-item__link {
1044
1118
  color: #ef4444;
1045
1119
  background: #fee2e2;
1046
1120
  }
1047
- `,ad=`
1121
+ `,lB=`
1048
1122
  @keyframes ap-sdk-card-in {
1049
1123
  from { opacity: 0; transform: scale(0.97); }
1050
1124
  to { opacity: 1; transform: scale(1); }
@@ -1123,7 +1197,7 @@ button.ap-sdk-list-item__link {
1123
1197
  flex: 1;
1124
1198
  white-space: nowrap;
1125
1199
  }
1126
- `,cd=`
1200
+ `,uB=`
1127
1201
  .ap-sdk-runner__approval {
1128
1202
  margin-top: 14px;
1129
1203
  display: flex;
@@ -1445,7 +1519,7 @@ button.ap-sdk-list-item__link {
1445
1519
  font-style: italic;
1446
1520
  padding: 4px 0;
1447
1521
  }
1448
- `,ld=`
1522
+ `,dB=`
1449
1523
  .ap-sdk-resize-handle {
1450
1524
  position: absolute;
1451
1525
  bottom: 2px;
@@ -1467,193 +1541,88 @@ button.ap-sdk-list-item__link {
1467
1541
  border-right: 2px solid #d1d5db;
1468
1542
  border-bottom: 2px solid #d1d5db;
1469
1543
  }
1470
- `,ud=[Xu,Ku,Qu,ed,td,nd,rd,od,sd,id,ad,cd,ld].join(`
1471
- `);let Ui=!1;function Fr(){if(Ui)return;const e=document.createElement("style");e.setAttribute("data-ap-sdk","1"),e.textContent=ud,document.head.appendChild(e),Ui=!0}function yo(e){if(e===document.body)return"body";const t=[];let n=e;for(;n&&n!==document.body;){if(n.id){t.unshift(`#${CSS.escape(n.id)}`);break}let r=n.tagName.toLowerCase();const o=n.parentElement;if(o){const i=Array.from(o.children).filter(a=>a.tagName===n.tagName);if(i.length>1){const a=i.indexOf(n)+1;r+=`:nth-of-type(${a})`}}t.unshift(r),n=n.parentElement}return t.join(" > ")||e.tagName.toLowerCase()}function $o(e,t=200){var r;const n=((r=e.textContent)!=null?r:"").replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t)+"…":n}const dd=["role","type","name","href","src","alt","title","for","placeholder","data-testid"];function wo(e){const t=e.tagName.toLowerCase(),n=e.id?`#${e.id}`:"",r=e.classList.length?"."+Array.from(e.classList).join("."):"",o=[],i=new Set,a=d=>{if(i.has(d)||o.length>=8)return;const l=e.getAttribute(d);if(!l)return;i.add(d);const p=l.length>80?l.slice(0,80)+"…":l;o.push(`[${d}="${p}"]`)};for(const d of Array.from(e.attributes))d.name.startsWith("aria-")&&a(d.name);for(const d of dd)a(d);return`${t}${n}${r}${o.join("")}`}function pd(e,t=80){const n=Array.from(e.childNodes).filter(r=>r.nodeType===Node.TEXT_NODE).map(r=>{var o;return((o=r.textContent)!=null?o:"").trim()}).filter(Boolean).join(" ");return n.length>t?n.slice(0,t)+"…":n}function hd(e,t=5,n=10){function r(o,i){const a=wo(o),d=" ".repeat(i),l=Array.from(o.children).slice(0,n);if(i>=t||l.length===0){const p=pd(o);return p?`${d}${a} "${p}"`:`${d}${a}`}return[`${d}${a}`,...l.map(p=>r(p,i+1))].join(`
1472
- `)}return r(e,0)}const fd='section, article, aside, nav, main, header, footer, form, fieldset, dialog, [role="region"], [role="navigation"], [role="main"], [role="complementary"], [role="banner"], [role="contentinfo"], [role="form"], [role="search"], [role="dialog"]',gd={fieldset:"legend",table:"caption",figure:"figcaption",details:"summary"};function co(e,t){const n=e.replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t)+"…":n}function md(e){var n;const t=e.querySelectorAll('h1, h2, h3, h4, h5, h6, [role="heading"]');for(const r of Array.from(t)){let o=r.parentElement;for(;o&&o!==e&&!o.matches(fd);)o=o.parentElement;if(o===e){const i=((n=r.textContent)!=null?n:"").trim();if(i)return i}}return""}function bd(e,t=80){var a,d,l;const n=gd[e.tagName.toLowerCase()];if(n){const p=(d=(a=e.querySelector(n))==null?void 0:a.textContent)==null?void 0:d.trim();if(p)return co(p,t)}const r=md(e);if(r)return co(r,t);const o=(l=e.getAttribute("aria-label"))==null?void 0:l.trim();if(o)return co(o,t);const i=e.getAttribute("aria-labelledby");if(i){const p=i.split(/\s+/).map(h=>{var g,m,k;return(k=(m=(g=document.getElementById(h))==null?void 0:g.textContent)==null?void 0:m.trim())!=null?k:""}).filter(Boolean).join(" ");if(p)return co(p,t)}return""}function kd(e,t=6){const n=[],r=new Set;let o=e;for(;o&&o!==document.body&&n.length<t;){const i=o===e?"":bd(o),a=i&&!r.has(i)?`${wo(o)} ["${i}"]`:wo(o);i&&r.add(i),n.unshift(a),o=o.parentElement}return n.join(" > ")||wo(e)}function Ja(e,t){return e.length>t?e.slice(0,t)+"… (truncated)":e}function Tr(e){var r;const t=document.querySelector(e);return((r=t==null?void 0:t.content)==null?void 0:r.trim())||void 0}function Va(){const e=t=>{try{return t()}catch(n){return}};return{description:e(()=>Tr('meta[name="description"]')),canonicalUrl:e(()=>{var t;return((t=document.querySelector('link[rel="canonical"]'))==null?void 0:t.href)||void 0}),lang:e(()=>document.documentElement.lang||void 0),ogTitle:e(()=>Tr('meta[property="og:title"]')),ogDescription:e(()=>Tr('meta[property="og:description"]')),ogType:e(()=>Tr('meta[property="og:type"]')),ogSiteName:e(()=>Tr('meta[property="og:site_name"]')),viewportWidth:e(()=>window.innerWidth),viewportHeight:e(()=>window.innerHeight),scrollX:e(()=>Math.round(window.scrollX)),scrollY:e(()=>Math.round(window.scrollY)),selectionText:e(()=>{var n;const t=(n=window.getSelection())==null?void 0:n.toString().trim();return t?Ja(t,1e3):void 0}),capturedAt:new Date().toISOString()}}function _d(e){const t=[];let n=e;for(;n&&t.length<6;){let r=n.tagName.toLowerCase();n.id?r+=`#${n.id}`:n.classList.length&&(r+=`.${Array.from(n.classList).slice(0,2).join(".")}`),t.unshift(r),n=n.parentElement}return t.join(" > ")}function vd(e){const t=e.getAttribute("role")||void 0,n=e.getAttribute("aria-label")||void 0;let r;const o=e.closest("section, article, main, nav, aside, header, footer, [role]");if(o){const i=o.querySelector("h1, h2, h3, h4, h5, h6"),a=o.getAttribute("aria-label")||((i==null?void 0:i.textContent)||"").trim(),d=o.tagName.toLowerCase();r=a?`${d}: ${Ja(a,120)}`:d}return{elementRole:t,elementAriaLabel:n,enclosingSection:r}}function yd(e,t){const n=[e.trim(),"",`Page: ${t.pageTitle} (${t.pageUrl})`];return t.description&&n.push(`Description: ${t.description}`),t.selectionText&&n.push(`Selection: ${t.selectionText}`),t.elementText&&n.push(`Selected element: ${t.elementText}`),t.elementRole&&n.push(` Role: ${t.elementRole}`),t.elementAriaLabel&&n.push(` ARIA label: ${t.elementAriaLabel}`),t.enclosingSection&&n.push(`Section: ${t.enclosingSection}`),t.ancestry&&n.push(`Ancestry: ${t.ancestry}`),t.cssSelector&&n.push(`Selector: ${t.cssSelector}`),n.join(`
1473
- `)}const sr=new Set;let Qn=null,Oo=!1,Rs=!1;function wd(e){if(e.getAttribute("aria-modal")==="false")return!1;const t=getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function xd(){const e=document.querySelectorAll("dialog[open]");for(let n=0;n<e.length;n++)try{if(e[n].matches(":modal"))return!0}catch(r){}const t=document.querySelectorAll('[role="dialog"], [role="alertdialog"]');for(let n=0;n<t.length;n++){const r=t[n];if(!(sr.has(r)||r.hasAttribute("data-ap-sdk"))&&r.isConnected&&wd(r))return!0}return!1}function Ya(){const e=xd(),t=e&&!Rs;Rs=e;for(const n of sr){n.hasAttribute("inert")&&n.removeAttribute("inert"),n.getAttribute("aria-hidden")==="true"&&n.removeAttribute("aria-hidden");const r=n.contains(document.activeElement);if(n.matches(":popover-open")){if(t&&!r){try{n.hidePopover()}catch(o){}try{n.showPopover()}catch(o){}}}else try{n.showPopover()}catch(o){}}}function Zi(e){if(!(e instanceof Node))return!1;for(const t of sr)if(t===e||t.contains(e))return!0;return!1}function er(e){(Zi(e.target)||"relatedTarget"in e&&Zi(e.relatedTarget))&&e.stopPropagation()}function Sd(){Oo||(window.addEventListener("focusin",er,!0),window.addEventListener("focusout",er,!0),window.addEventListener("pointerdown",er,!0),Oo=!0),!Qn&&(Qn=new MutationObserver(e=>{e.some(n=>n.type==="childList"||n.attributeName==="open"&&n.target.tagName==="DIALOG"||n.attributeName==="inert"||n.attributeName==="aria-hidden"||n.attributeName==="role")&&Ya()}),Qn.observe(document.documentElement,{attributes:!0,attributeFilter:["open","inert","aria-hidden","role"],childList:!0,subtree:!0}))}function Qt(e){"showPopover"in e&&(e.setAttribute("popover","manual"),sr.add(e),Sd(),Ya())}function en(e){if(sr.delete(e),sr.size===0&&(Qn&&(Qn.disconnect(),Qn=null),Oo&&(window.removeEventListener("focusin",er,!0),window.removeEventListener("focusout",er,!0),window.removeEventListener("pointerdown",er,!0),Oo=!1),Rs=!1),"hidePopover"in e)try{e.hidePopover()}catch(t){}}function Gs(e="ap-sdk-highlight"){const t=document.createElement("div");return t.className=e,t.setAttribute("data-ap-sdk","1"),t.style.display="none",document.body.appendChild(t),Qt(t),{el:t,update:i=>{const a=i.getBoundingClientRect();t.style.top=`${a.top}px`,t.style.left=`${a.left}px`,t.style.width=`${a.width}px`,t.style.height=`${a.height}px`,t.style.display="block"},hide:()=>{t.style.display="none"},destroy:()=>{en(t),t.remove()}}}const Xa=/^cc-|current-password|new-password/i,Td=/token|secret|password|apikey|auth/i,ms="[redacted]";function Ed(e){if(e instanceof HTMLInputElement&&e.type==="password")return!0;const t=e.getAttribute("autocomplete");return!!t&&Xa.test(t)}function Ka(e){const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){n instanceof HTMLInputElement&&n.type==="password"&&n.setAttribute("value",ms);const r=n.getAttribute("autocomplete");r&&Xa.test(r)&&n.setAttribute("value",ms);for(const o of Array.from(n.attributes))Td.test(o.name)&&n.setAttribute(o.name,ms)}}const Cd="🎯 Click any element to capture";let mn=null,$e=null,qe=null;function $r(e){return e instanceof Element?e.closest("[data-ap-sdk]")!==null||e.closest(".ap-sdk-panel")!==null||e.closest(".ap-sdk-highlight")!==null||e.closest(".ap-sdk-picker-cursor")!==null:!1}function Ad(){var e,t;return((t=(e=window.matchMedia)==null?void 0:e.call(window,"(pointer: coarse)").matches)!=null?t:!1)||"ontouchstart"in window}function qi(e){mn==null||mn.update(e)}function Qa(e){const t=Va(),n=_d(e),r=vd(e);let o;try{const i=e.cloneNode(!0);Ka(i),o=i.outerHTML.slice(0,4e3)}catch(i){}return y(y({pageUrl:window.location.href,pageTitle:document.title,elementText:$o(e),cssSelector:yo(e),innerTree:hd(e),outerTree:kd(e),elementOuterHtml:o,ancestry:n},r),t)}function bs(e,t){qe&&qe();const n=Ad();mn=Gs(),$e=document.createElement("div"),$e.className="ap-sdk-picker-cursor",$e.setAttribute("data-ap-sdk","1"),$e.textContent=n?"Tap any element to preview":Cd,document.body.appendChild($e),Qt($e);let r=null,o=null;const i=h=>{qe==null||qe(),e(Qa(h),h)},a=h=>{if(o=h,qi(h),!$e)return;$e.classList.add("ap-sdk-picker-cursor--confirm"),$e.innerHTML="";const g=document.createElement("span");g.className="ap-sdk-picker-cursor__label",g.textContent=`<${h.tagName.toLowerCase()}>`;const m=document.createElement("button");m.type="button",m.className="ap-sdk-picker-cursor__btn ap-sdk-picker-cursor__btn--cancel",m.textContent="✕ Cancel",m.setAttribute("data-ap-sdk","1"),m.setAttribute("aria-label","Cancel picking"),m.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation(),qe==null||qe(),t()});const k=document.createElement("button");k.type="button",k.className="ap-sdk-picker-cursor__btn",k.textContent="⬆ Parent",k.setAttribute("data-ap-sdk","1"),k.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation(),o!=null&&o.parentElement&&a(o.parentElement)});const w=document.createElement("button");w.type="button",w.className="ap-sdk-picker-cursor__btn ap-sdk-picker-cursor__btn--primary",w.textContent="✓ Select",w.setAttribute("data-ap-sdk","1"),w.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation(),o&&i(o)}),$e.appendChild(g),$e.appendChild(m),$e.appendChild(k),$e.appendChild(w)},d=h=>{$r(h.target)||(r=h.target,qi(r))},l=h=>{var m;if($r(h.target))return;h.preventDefault(),h.stopImmediatePropagation();const g=(m=h.target)!=null?m:r;if(g){if(n){a(g);return}i(g)}},p=h=>{h.key==="Escape"&&(qe==null||qe(),t())};n||document.addEventListener("mouseover",d,{capture:!0}),document.addEventListener("click",l,{capture:!0}),document.addEventListener("keydown",p,{capture:!0}),qe=()=>{n||document.removeEventListener("mouseover",d,{capture:!0}),document.removeEventListener("click",l,{capture:!0}),document.removeEventListener("keydown",p,{capture:!0}),$e&&en($e),$e==null||$e.remove(),mn==null||mn.destroy(),mn=null,$e=null,o=null,qe=null}}function Ws(){qe==null||qe()}function tr(){return qe!==null}const lo={TASK_STATUS_UPDATED:"task:status:updated",TASK_INTERACTION_CREATED:"task:interaction:created",TASK_INTERACTION_ANSWERED:"task:interaction:answered",TASK_BROWSER_COMMAND_CREATED:"task:browser-command:created"};function x(e,t,n){var d;function r(l,p){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:p,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,p);const h=a.prototype,g=Object.keys(h);for(let m=0;m<g.length;m++){const k=g[m];k in l||(l[k]=h[k].bind(l))}}const o=(d=n==null?void 0:n.Parent)!=null?d:Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(l){var g;var p;const h=n!=null&&n.Parent?new i:this;r(h,l),(g=(p=h._zod).deferred)!=null||(p.deferred=[]);for(const m of h._zod.deferred)m();return h}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>{var p,h;return n!=null&&n.Parent&&l instanceof n.Parent?!0:(h=(p=l==null?void 0:l._zod)==null?void 0:p.traits)==null?void 0:h.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}class nr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ec extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const tc={};function bn(e){return tc}function nc(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Ls(e,t){return typeof t=="bigint"?t.toString():t}function Ko(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Js(e){return e==null}function Vs(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Pd(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l!=null&&l[1]&&(o=Number.parseInt(l[1]))}const i=n>o?n:o,a=Number.parseInt(e.toFixed(i).replace(".","")),d=Number.parseInt(t.toFixed(i).replace(".",""));return a%d/ji(10,i)}const Hi=Symbol("evaluating");function ne(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Hi)return r===void 0&&(r=Hi,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Nn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function _n(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Fi(e){return JSON.stringify(e)}function Rd(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const rc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Ld=Ko(()=>{var e;if(typeof navigator!="undefined"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch(t){return!1}});function ir(e){if(Ur(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Ur(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function oc(e){return ir(e)?y({},e):Array.isArray(e)?[...e]:e}const zd=new Set(["string","number","symbol"]);function ar(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vn(e,t,n){const r=new e._zod.constr(t!=null?t:e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function U(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?D(y({},t),{error:()=>t.error}):t}function Id(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const $d={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Od(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=_n(e._zod.def,{get shape(){const a={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(a[d]=n.shape[d])}return Nn(this,"shape",a),a},checks:[]});return vn(e,i)}function Nd(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=_n(e._zod.def,{get shape(){const a=y({},e._zod.def.shape);for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete a[d]}return Nn(this,"shape",a),a},checks:[]});return vn(e,i)}function Dd(e,t){if(!ir(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=_n(e._zod.def,{get shape(){const i=y(y({},e._zod.def.shape),t);return Nn(this,"shape",i),i}});return vn(e,o)}function Md(e,t){if(!ir(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=_n(e._zod.def,{get shape(){const r=y(y({},e._zod.def.shape),t);return Nn(this,"shape",r),r}});return vn(e,n)}function jd(e,t){const n=_n(e._zod.def,{get shape(){const r=y(y({},e._zod.def.shape),t._zod.def.shape);return Nn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return vn(e,n)}function Ud(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=_n(t._zod.def,{get shape(){const d=t._zod.def.shape,l=y({},d);if(n)for(const p in n){if(!(p in d))throw new Error(`Unrecognized key: "${p}"`);n[p]&&(l[p]=e?new e({type:"optional",innerType:d[p]}):d[p])}else for(const p in d)l[p]=e?new e({type:"optional",innerType:d[p]}):d[p];return Nn(this,"shape",l),l},checks:[]});return vn(t,a)}function Zd(e,t,n){const r=_n(t._zod.def,{get shape(){const o=t._zod.def.shape,i=y({},o);if(n)for(const a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)i[a]=new e({type:"nonoptional",innerType:o[a]});return Nn(this,"shape",i),i}});return vn(t,r)}function Vn(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function Yn(e,t){return t.map(n=>{var o;var r;return(o=(r=n).path)!=null||(r.path=[]),n.path.unshift(e),n})}function uo(e){return typeof e=="string"?e:e==null?void 0:e.message}function kn(e,t,n){var o,i,a,d,l,p,h,g,m,k,w;const r=D(y({},e),{path:(o=e.path)!=null?o:[]});if(!e.message){const v=(w=(k=(g=(p=uo((d=(a=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:a.error)==null?void 0:d.call(a,e)))!=null?p:uo((l=t==null?void 0:t.error)==null?void 0:l.call(t,e)))!=null?g:uo((h=n.customError)==null?void 0:h.call(n,e)))!=null?k:uo((m=n.localeError)==null?void 0:m.call(n,e)))!=null?w:"Invalid input";r.message=v}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function Ys(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Zr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:y({},t)}const sc=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ls,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ic=x("$ZodError",sc),ac=x("$ZodError",sc,{Parent:Error});function qd(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function Hd(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let a=n,d=0;for(;d<i.path.length;){const l=i.path[d];d===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(i))):a[l]=a[l]||{_errors:[]},a=a[l],d++}}};return r(e),n}const Xs=e=>(t,n,r,o)=>{var d;const i=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new nr;if(a.issues.length){const l=new((d=o==null?void 0:o.Err)!=null?d:e)(a.issues.map(p=>kn(p,i,bn())));throw rc(l,o==null?void 0:o.callee),l}return a.value},Ks=e=>(t,n,r,o)=>z(null,null,function*(){var d;const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=yield a),a.issues.length){const l=new((d=o==null?void 0:o.Err)!=null?d:e)(a.issues.map(p=>kn(p,i,bn())));throw rc(l,o==null?void 0:o.callee),l}return a.value}),Qo=e=>(t,n,r)=>{const o=r?D(y({},r),{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new nr;return i.issues.length?{success:!1,error:new(e!=null?e:ic)(i.issues.map(a=>kn(a,o,bn())))}:{success:!0,data:i.value}},Fd=Qo(ac),es=e=>(t,n,r)=>z(null,null,function*(){const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=yield i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>kn(a,o,bn())))}:{success:!0,data:i.value}}),Bd=es(ac),Gd=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xs(e)(t,n,o)},Wd=e=>(t,n,r)=>Xs(e)(t,n,r),Jd=e=>(t,n,r)=>z(null,null,function*(){const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ks(e)(t,n,o)}),Vd=e=>(t,n,r)=>z(null,null,function*(){return Ks(e)(t,n,r)}),Yd=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Qo(e)(t,n,o)},Xd=e=>(t,n,r)=>Qo(e)(t,n,r),Kd=e=>(t,n,r)=>z(null,null,function*(){const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return es(e)(t,n,o)}),Qd=e=>(t,n,r)=>z(null,null,function*(){return es(e)(t,n,r)}),ep=/^[cC][^\s-]{8,}$/,tp=/^[0-9a-z]+$/,np=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rp=/^[0-9a-vA-V]{20}$/,op=/^[A-Za-z0-9]{27}$/,sp=/^[a-zA-Z0-9_-]{21}$/,ip=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ap=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Bi=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,cp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function up(){return new RegExp(lp,"u")}const dp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,hp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,fp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cc=/^[A-Za-z0-9_-]*$/,mp=/^\+[1-9]\d{6,14}$/,lc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",bp=new RegExp(`^${lc}$`);function uc(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function kp(e){return new RegExp(`^${uc(e)}$`)}function _p(e){const t=uc({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${lc}T(?:${r})$`)}const vp=e=>{var n,r;const t=e?`[\\s\\S]{${(n=e==null?void 0:e.minimum)!=null?n:0},${(r=e==null?void 0:e.maximum)!=null?r:""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},yp=/^-?\d+$/,dc=/^-?\d+(?:\.\d+)?$/,wp=/^(?:true|false)$/i,xp=/^[^A-Z]*$/,Sp=/^[^a-z]*$/,at=x("$ZodCheck",(e,t)=>{var r,o;var n;(r=e._zod)!=null||(e._zod={}),e._zod.def=t,(o=(n=e._zod).onattach)!=null||(n.onattach=[])}),pc={number:"number",bigint:"bigint",object:"date"},hc=x("$ZodCheckLessThan",(e,t)=>{at.init(e,t);const n=pc[typeof t.value];e._zod.onattach.push(r=>{var a;const o=r._zod.bag,i=(a=t.inclusive?o.maximum:o.exclusiveMaximum)!=null?a:Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fc=x("$ZodCheckGreaterThan",(e,t)=>{at.init(e,t);const n=pc[typeof t.value];e._zod.onattach.push(r=>{var a;const o=r._zod.bag,i=(a=t.inclusive?o.minimum:o.exclusiveMinimum)!=null?a:Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tp=x("$ZodCheckMultipleOf",(e,t)=>{at.init(e,t),e._zod.onattach.push(n=>{var o;var r;(o=(r=n._zod.bag).multipleOf)!=null||(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Pd(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ep=x("$ZodCheckNumberFormat",(e,t)=>{var a;at.init(e,t),t.format=t.format||"float64";const n=(a=t.format)==null?void 0:a.includes("int"),r=n?"int":"number",[o,i]=$d[t.format];e._zod.onattach.push(d=>{const l=d._zod.bag;l.format=t.format,l.minimum=o,l.maximum=i,n&&(l.pattern=yp)}),e._zod.check=d=>{const l=d.value;if(n){if(!Number.isInteger(l)){d.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?d.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):d.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}l<o&&d.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>i&&d.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Cp=x("$ZodCheckMaxLength",(e,t)=>{var r;var n;at.init(e,t),(r=(n=e._zod.def).when)!=null||(n.when=o=>{const i=o.value;return!Js(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{var a;const i=(a=o._zod.bag.maximum)!=null?a:Number.POSITIVE_INFINITY;t.maximum<i&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const i=o.value;if(i.length<=t.maximum)return;const d=Ys(i);o.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ap=x("$ZodCheckMinLength",(e,t)=>{var r;var n;at.init(e,t),(r=(n=e._zod.def).when)!=null||(n.when=o=>{const i=o.value;return!Js(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{var a;const i=(a=o._zod.bag.minimum)!=null?a:Number.NEGATIVE_INFINITY;t.minimum>i&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const i=o.value;if(i.length>=t.minimum)return;const d=Ys(i);o.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Pp=x("$ZodCheckLengthEquals",(e,t)=>{var r;var n;at.init(e,t),(r=(n=e._zod.def).when)!=null||(n.when=o=>{const i=o.value;return!Js(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=o=>{const i=o.value,a=i.length;if(a===t.length)return;const d=Ys(i),l=a>t.length;o.issues.push(D(y({origin:d},l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length}),{inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort}))}}),ts=x("$ZodCheckStringFormat",(e,t)=>{var o,i;var n,r;at.init(e,t),e._zod.onattach.push(a=>{var l;const d=a._zod.bag;d.format=t.format,t.pattern&&((l=d.patterns)!=null||(d.patterns=new Set),d.patterns.add(t.pattern))}),t.pattern?(o=(n=e._zod).check)!=null||(n.check=a=>{t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push(D(y({origin:"string",code:"invalid_format",format:t.format,input:a.value},t.pattern?{pattern:t.pattern.toString()}:{}),{inst:e,continue:!t.abort}))}):(i=(r=e._zod).check)!=null||(r.check=()=>{})}),Rp=x("$ZodCheckRegex",(e,t)=>{ts.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Lp=x("$ZodCheckLowerCase",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=xp),ts.init(e,t)}),zp=x("$ZodCheckUpperCase",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Sp),ts.init(e,t)}),Ip=x("$ZodCheckIncludes",(e,t)=>{at.init(e,t);const n=ar(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{var a;const i=o._zod.bag;(a=i.patterns)!=null||(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),$p=x("$ZodCheckStartsWith",(e,t)=>{var r;at.init(e,t);const n=new RegExp(`^${ar(t.prefix)}.*`);(r=t.pattern)!=null||(t.pattern=n),e._zod.onattach.push(o=>{var a;const i=o._zod.bag;(a=i.patterns)!=null||(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Op=x("$ZodCheckEndsWith",(e,t)=>{var r;at.init(e,t);const n=new RegExp(`.*${ar(t.suffix)}$`);(r=t.pattern)!=null||(t.pattern=n),e._zod.onattach.push(o=>{var a;const i=o._zod.bag;(a=i.patterns)!=null||(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),Np=x("$ZodCheckOverwrite",(e,t)=>{at.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Dp{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
1474
- `).filter(a=>a),o=Math.min(...r.map(a=>a.length-a.trimStart().length)),i=r.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of i)this.content.push(a)}compile(){var i;const t=Function,n=this==null?void 0:this.args,o=[...((i=this==null?void 0:this.content)!=null?i:[""]).map(a=>` ${a}`)];return new t(...n,o.join(`
1475
- `))}}const Mp={major:4,minor:3,patch:5},me=x("$ZodType",(e,t)=>{var o,i,a;var n;e!=null||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Mp;const r=[...(o=e._zod.def.checks)!=null?o:[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const d of r)for(const l of d._zod.onattach)l(e);if(r.length===0)(i=(n=e._zod).deferred)!=null||(n.deferred=[]),(a=e._zod.deferred)==null||a.push(()=>{e._zod.run=e._zod.parse});else{const d=(p,h,g)=>{let m=Vn(p),k;for(const w of h){if(w._zod.def.when){if(!w._zod.def.when(p))continue}else if(m)continue;const v=p.issues.length,Z=w._zod.check(p);if(Z instanceof Promise&&(g==null?void 0:g.async)===!1)throw new nr;if(k||Z instanceof Promise)k=(k!=null?k:Promise.resolve()).then(()=>z(null,null,function*(){yield Z,p.issues.length!==v&&(m||(m=Vn(p,v)))}));else{if(p.issues.length===v)continue;m||(m=Vn(p,v))}}return k?k.then(()=>p):p},l=(p,h,g)=>{if(Vn(p))return p.aborted=!0,p;const m=d(h,r,g);if(m instanceof Promise){if(g.async===!1)throw new nr;return m.then(k=>e._zod.parse(k,g))}return e._zod.parse(m,g)};e._zod.run=(p,h)=>{if(h.skipChecks)return e._zod.parse(p,h);if(h.direction==="backward"){const m=e._zod.parse({value:p.value,issues:[]},D(y({},h),{skipChecks:!0}));return m instanceof Promise?m.then(k=>l(k,p,h)):l(m,p,h)}const g=e._zod.parse(p,h);if(g instanceof Promise){if(h.async===!1)throw new nr;return g.then(m=>d(m,r,h))}return d(g,r,h)}}ne(e,"~standard",()=>({validate:d=>{var l;try{const p=Fd(e,d);return p.success?{value:p.data}:{issues:(l=p.error)==null?void 0:l.issues}}catch(p){return Bd(e,d).then(h=>{var g;return h.success?{value:h.data}:{issues:(g=h.error)==null?void 0:g.issues}})}},vendor:"zod",version:1}))}),Qs=x("$ZodString",(e,t)=>{var n,r,o;me.init(e,t),e._zod.pattern=(o=[...(r=(n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)!=null?r:[]].pop())!=null?o:vp(e._zod.bag),e._zod.parse=(i,a)=>{if(t.coerce)try{i.value=String(i.value)}catch(d){}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),be=x("$ZodStringFormat",(e,t)=>{ts.init(e,t),Qs.init(e,t)}),jp=x("$ZodGUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=ap),be.init(e,t)}),Up=x("$ZodUUID",(e,t)=>{var n,r;if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);(n=t.pattern)!=null||(t.pattern=Bi(i))}else(r=t.pattern)!=null||(t.pattern=Bi());be.init(e,t)}),Zp=x("$ZodEmail",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=cp),be.init(e,t)}),qp=x("$ZodURL",(e,t)=>{be.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Hp=x("$ZodEmoji",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=up()),be.init(e,t)}),Fp=x("$ZodNanoID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=sp),be.init(e,t)}),Bp=x("$ZodCUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=ep),be.init(e,t)}),Gp=x("$ZodCUID2",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=tp),be.init(e,t)}),Wp=x("$ZodULID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=np),be.init(e,t)}),Jp=x("$ZodXID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=rp),be.init(e,t)}),Vp=x("$ZodKSUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=op),be.init(e,t)}),Yp=x("$ZodISODateTime",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=_p(t)),be.init(e,t)}),Xp=x("$ZodISODate",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=bp),be.init(e,t)}),Kp=x("$ZodISOTime",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=kp(t)),be.init(e,t)}),Qp=x("$ZodISODuration",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=ip),be.init(e,t)}),eh=x("$ZodIPv4",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=dp),be.init(e,t),e._zod.bag.format="ipv4"}),th=x("$ZodIPv6",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=pp),be.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch(o){r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),nh=x("$ZodCIDRv4",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=hp),be.init(e,t)}),rh=x("$ZodCIDRv6",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=fp),be.init(e,t),e._zod.check=r=>{const o=r.value.split("/");try{if(o.length!==2)throw new Error;const[i,a]=o;if(!a)throw new Error;const d=Number(a);if(`${d}`!==a)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${i}]`)}catch(i){r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function gc(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch(t){return!1}}const oh=x("$ZodBase64",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=gp),be.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{gc(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function sh(e){if(!cc.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return gc(n)}const ih=x("$ZodBase64URL",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=cc),be.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{sh(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),ah=x("$ZodE164",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=mp),be.init(e,t)});function ch(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch(n){return!1}}const lh=x("$ZodJWT",(e,t)=>{be.init(e,t),e._zod.check=n=>{ch(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),mc=x("$ZodNumber",(e,t)=>{var n;me.init(e,t),e._zod.pattern=(n=e._zod.bag.pattern)!=null?n:dc,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(d){}const i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push(y({expected:"number",code:"invalid_type",input:i,inst:e},a?{received:a}:{})),r}}),uh=x("$ZodNumberFormat",(e,t)=>{Ep.init(e,t),mc.init(e,t)}),dh=x("$ZodBoolean",(e,t)=>{me.init(e,t),e._zod.pattern=wp,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(i){}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),ph=x("$ZodAny",(e,t)=>{me.init(e,t),e._zod.parse=n=>n}),hh=x("$ZodUnknown",(e,t)=>{me.init(e,t),e._zod.parse=n=>n}),fh=x("$ZodNever",(e,t)=>{me.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Gi(e,t,n){e.issues.length&&t.issues.push(...Yn(n,e.issues)),t.value[n]=e.value}const gh=x("$ZodArray",(e,t)=>{me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let a=0;a<o.length;a++){const d=o[a],l=t.element._zod.run({value:d,issues:[]},r);l instanceof Promise?i.push(l.then(p=>Gi(p,n,a))):Gi(l,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function No(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...Yn(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function bc(e){var r,o,i,a;const t=Object.keys(e.shape);for(const d of t)if(!((a=(i=(o=(r=e.shape)==null?void 0:r[d])==null?void 0:o._zod)==null?void 0:i.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${d}": expected a Zod schema`);const n=Id(e.shape);return D(y({},e),{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)})}function kc(e,t,n,r,o,i){const a=[],d=o.keySet,l=o.catchall._zod,p=l.def.type,h=l.optout==="optional";for(const g in t){if(d.has(g))continue;if(p==="never"){a.push(g);continue}const m=l.run({value:t[g],issues:[]},r);m instanceof Promise?e.push(m.then(k=>No(k,n,g,t,h))):No(m,n,g,t,h)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const mh=x("$ZodObject",(e,t)=>{me.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l=y({},d);return Object.defineProperty(t,"shape",{value:l}),l}})}const r=Ko(()=>bc(t));ne(e._zod,"propValues",()=>{var p;const d=t.shape,l={};for(const h in d){const g=d[h]._zod;if(g.values){(p=l[h])!=null||(l[h]=new Set);for(const m of g.values)l[h].add(m)}}return l});const o=Ur,i=t.catchall;let a;e._zod.parse=(d,l)=>{a!=null||(a=r.value);const p=d.value;if(!o(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d;d.value={};const h=[],g=a.shape;for(const m of a.keys){const k=g[m],w=k._zod.optout==="optional",v=k._zod.run({value:p[m],issues:[]},l);v instanceof Promise?h.push(v.then(Z=>No(Z,d,m,p,w))):No(v,d,m,p,w)}return i?kc(h,p,d,l,r.value,e):h.length?Promise.all(h).then(()=>d):d}}),bh=x("$ZodObjectJIT",(e,t)=>{mh.init(e,t);const n=e._zod.parse,r=Ko(()=>bc(t)),o=m=>{var E;const k=new Dp(["shape","payload","ctx"]),w=r.value,v=T=>{const C=Fi(T);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};k.write("const input = payload.value;");const Z=Object.create(null);let K=0;for(const T of w.keys)Z[T]=`key_${K++}`;k.write("const newResult = {};");for(const T of w.keys){const C=Z[T],N=Fi(T),J=m[T],ye=((E=J==null?void 0:J._zod)==null?void 0:E.optout)==="optional";k.write(`const ${C} = ${v(T)};`),ye?k.write(`
1476
- if (${C}.issues.length) {
1477
- if (${N} in input) {
1478
- payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
1544
+ `,pB=`
1545
+ .ap-sdk-resume-banner {
1546
+ position: fixed;
1547
+ bottom: 84px;
1548
+ right: 20px;
1549
+ display: flex;
1550
+ flex-direction: column;
1551
+ gap: 10px;
1552
+ width: 240px;
1553
+ max-width: calc(100vw - 40px);
1554
+ background: #fff;
1555
+ color: #1f2937;
1556
+ font-family: system-ui, -apple-system, sans-serif;
1557
+ padding: 14px;
1558
+ border-radius: 12px;
1559
+ box-shadow: 0 4px 16px rgba(0,0,0,0.18);
1560
+ z-index: 2147483646;
1561
+ animation: ap-sdk-card-in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
1562
+ }
1563
+
1564
+ .ap-sdk-resume-banner__title {
1565
+ display: block;
1566
+ font-size: 14px;
1567
+ font-weight: 600;
1568
+ }
1569
+
1570
+ .ap-sdk-resume-banner__summary {
1571
+ display: block;
1572
+ margin-top: 2px;
1573
+ font-size: 13px;
1574
+ color: #6b7280;
1575
+ overflow: hidden;
1576
+ text-overflow: ellipsis;
1577
+ white-space: nowrap;
1578
+ }
1579
+
1580
+ .ap-sdk-resume-banner__actions {
1581
+ display: flex;
1582
+ gap: 8px;
1583
+ }
1584
+ `,hB=[AB,eB,tB,nB,rB,sB,oB,iB,aB,cB,lB,uB,dB,pB].join(`
1585
+ `);let hl=!1;function ws(){if(hl)return;const A=document.createElement("style");A.setAttribute("data-ap-sdk","1"),A.textContent=hB,document.head.appendChild(A),hl=!0}function bo(A){if(A===document.body)return"body";const e=[];let t=A;for(;t&&t!==document.body;){if(t.id){e.unshift(`#${CSS.escape(t.id)}`);break}let n=t.tagName.toLowerCase();const r=t.parentElement;if(r){const s=Array.from(r.children).filter(o=>o.tagName===t.tagName);if(s.length>1){const o=s.indexOf(t)+1;n+=`:nth-of-type(${o})`}}e.unshift(n),t=t.parentElement}return e.join(" > ")||A.tagName.toLowerCase()}function Do(A,e=200){var n;const t=((n=A.textContent)!=null?n:"").replace(/\s+/g," ").trim();return t.length>e?t.slice(0,e)+"…":t}const fB=["role","type","name","href","src","alt","title","for","placeholder","data-testid"];function Qo(A){const e=A.tagName.toLowerCase(),t=A.id?`#${A.id}`:"",n=A.classList.length?"."+Array.from(A.classList).join("."):"",r=[],s=new Set,o=a=>{if(s.has(a)||r.length>=8)return;const i=A.getAttribute(a);if(!i)return;s.add(a);const c=i.length>80?i.slice(0,80)+"…":i;r.push(`[${a}="${c}"]`)};for(const a of Array.from(A.attributes))a.name.startsWith("aria-")&&o(a.name);for(const a of fB)o(a);return`${e}${t}${n}${r.join("")}`}function gB(A,e=80){const t=Array.from(A.childNodes).filter(n=>n.nodeType===Node.TEXT_NODE).map(n=>{var r;return((r=n.textContent)!=null?r:"").trim()}).filter(Boolean).join(" ");return t.length>e?t.slice(0,e)+"…":t}function BB(A,e=5,t=10){function n(r,s){const o=Qo(r),a=" ".repeat(s),i=Array.from(r.children).slice(0,t);if(s>=e||i.length===0){const c=gB(r);return c?`${a}${o} "${c}"`:`${a}${o}`}return[`${a}${o}`,...i.map(c=>n(c,s+1))].join(`
1586
+ `)}return n(A,0)}const wB='section, article, aside, nav, main, header, footer, form, fieldset, dialog, [role="region"], [role="navigation"], [role="main"], [role="complementary"], [role="banner"], [role="contentinfo"], [role="form"], [role="search"], [role="dialog"]',mB={fieldset:"legend",table:"caption",figure:"figcaption",details:"summary"};function Ks(A,e){const t=A.replace(/\s+/g," ").trim();return t.length>e?t.slice(0,e)+"…":t}function CB(A){var t;const e=A.querySelectorAll('h1, h2, h3, h4, h5, h6, [role="heading"]');for(const n of Array.from(e)){let r=n.parentElement;for(;r&&r!==A&&!r.matches(wB);)r=r.parentElement;if(r===A){const s=((t=n.textContent)!=null?t:"").trim();if(s)return s}}return""}function bB(A,e=80){var o,a,i;const t=mB[A.tagName.toLowerCase()];if(t){const c=(a=(o=A.querySelector(t))==null?void 0:o.textContent)==null?void 0:a.trim();if(c)return Ks(c,e)}const n=CB(A);if(n)return Ks(n,e);const r=(i=A.getAttribute("aria-label"))==null?void 0:i.trim();if(r)return Ks(r,e);const s=A.getAttribute("aria-labelledby");if(s){const c=s.split(/\s+/).map(u=>{var h,f,g;return(g=(f=(h=document.getElementById(u))==null?void 0:h.textContent)==null?void 0:f.trim())!=null?g:""}).filter(Boolean).join(" ");if(c)return Ks(c,e)}return""}function QB(A,e=6){const t=[],n=new Set;let r=A;for(;r&&r!==document.body&&t.length<e;){const s=r===A?"":bB(r),o=s&&!n.has(s)?`${Qo(r)} ["${s}"]`:Qo(r);s&&n.add(s),t.unshift(o),r=r.parentElement}return t.join(" > ")||Qo(A)}function Id(A,e){return A.length>e?A.slice(0,e)+"… (truncated)":A}function _r(A){var n;const e=document.querySelector(A);return((n=e==null?void 0:e.content)==null?void 0:n.trim())||void 0}function Td(){const A=e=>{try{return e()}catch(t){return}};return{description:A(()=>_r('meta[name="description"]')),canonicalUrl:A(()=>{var e;return((e=document.querySelector('link[rel="canonical"]'))==null?void 0:e.href)||void 0}),lang:A(()=>document.documentElement.lang||void 0),ogTitle:A(()=>_r('meta[property="og:title"]')),ogDescription:A(()=>_r('meta[property="og:description"]')),ogType:A(()=>_r('meta[property="og:type"]')),ogSiteName:A(()=>_r('meta[property="og:site_name"]')),viewportWidth:A(()=>window.innerWidth),viewportHeight:A(()=>window.innerHeight),scrollX:A(()=>Math.round(window.scrollX)),scrollY:A(()=>Math.round(window.scrollY)),selectionText:A(()=>{var t;const e=(t=window.getSelection())==null?void 0:t.toString().trim();return e?Id(e,1e3):void 0}),capturedAt:new Date().toISOString()}}function yB(A){const e=[];let t=A;for(;t&&e.length<6;){let n=t.tagName.toLowerCase();t.id?n+=`#${t.id}`:t.classList.length&&(n+=`.${Array.from(t.classList).slice(0,2).join(".")}`),e.unshift(n),t=t.parentElement}return e.join(" > ")}function UB(A){const e=A.getAttribute("role")||void 0,t=A.getAttribute("aria-label")||void 0;let n;const r=A.closest("section, article, main, nav, aside, header, footer, [role]");if(r){const s=r.querySelector("h1, h2, h3, h4, h5, h6"),o=r.getAttribute("aria-label")||((s==null?void 0:s.textContent)||"").trim(),a=r.tagName.toLowerCase();n=o?`${a}: ${Id(o,120)}`:a}return{elementRole:e,elementAriaLabel:t,enclosingSection:n}}function EB(A,e){const t=[A.trim(),"",`Page: ${e.pageTitle} (${e.pageUrl})`];return e.description&&t.push(`Description: ${e.description}`),e.selectionText&&t.push(`Selection: ${e.selectionText}`),e.elementText&&t.push(`Selected element: ${e.elementText}`),e.elementRole&&t.push(` Role: ${e.elementRole}`),e.elementAriaLabel&&t.push(` ARIA label: ${e.elementAriaLabel}`),e.enclosingSection&&t.push(`Section: ${e.enclosingSection}`),e.ancestry&&t.push(`Ancestry: ${e.ancestry}`),e.cssSelector&&t.push(`Selector: ${e.cssSelector}`),t.join(`
1587
+ `)}const ir=new Set;let Ar=null,Ro=!1,ma=!1;function FB(A){if(A.getAttribute("aria-modal")==="false")return!1;const e=getComputedStyle(A);return e.display!=="none"&&e.visibility!=="hidden"}function kB(){const A=document.querySelectorAll("dialog[open]");for(let t=0;t<A.length;t++)try{if(A[t].matches(":modal"))return!0}catch(n){}const e=document.querySelectorAll('[role="dialog"], [role="alertdialog"]');for(let t=0;t<e.length;t++){const n=e[t];if(!(ir.has(n)||n.hasAttribute("data-ap-sdk"))&&n.isConnected&&FB(n))return!0}return!1}function Hd(){const A=kB(),e=A&&!ma;ma=A;for(const t of ir){t.hasAttribute("inert")&&t.removeAttribute("inert"),t.getAttribute("aria-hidden")==="true"&&t.removeAttribute("aria-hidden");const n=t.contains(document.activeElement);if(t.matches(":popover-open")){if(e&&!n){try{t.hidePopover()}catch(r){}try{t.showPopover()}catch(r){}}}else try{t.showPopover()}catch(r){}}}function fl(A){if(!(A instanceof Node))return!1;for(const e of ir)if(e===A||e.contains(A))return!0;return!1}function er(A){(fl(A.target)||"relatedTarget"in A&&fl(A.relatedTarget))&&A.stopPropagation()}function vB(){Ro||(window.addEventListener("focusin",er,!0),window.addEventListener("focusout",er,!0),window.addEventListener("pointerdown",er,!0),Ro=!0),!Ar&&(Ar=new MutationObserver(A=>{A.some(t=>t.type==="childList"||t.attributeName==="open"&&t.target.tagName==="DIALOG"||t.attributeName==="inert"||t.attributeName==="aria-hidden"||t.attributeName==="role")&&Hd()}),Ar.observe(document.documentElement,{attributes:!0,attributeFilter:["open","inert","aria-hidden","role"],childList:!0,subtree:!0}))}function dt(A){"showPopover"in A&&(A.setAttribute("popover","manual"),ir.add(A),vB(),Hd())}function pt(A){if(ir.delete(A),ir.size===0&&(Ar&&(Ar.disconnect(),Ar=null),Ro&&(window.removeEventListener("focusin",er,!0),window.removeEventListener("focusout",er,!0),window.removeEventListener("pointerdown",er,!0),Ro=!1),ma=!1),"hidePopover"in A)try{A.hidePopover()}catch(e){}}function uc(A="ap-sdk-highlight"){const e=document.createElement("div");return e.className=A,e.setAttribute("data-ap-sdk","1"),e.style.display="none",document.body.appendChild(e),dt(e),{el:e,update:s=>{const o=s.getBoundingClientRect();e.style.top=`${o.top}px`,e.style.left=`${o.left}px`,e.style.width=`${o.width}px`,e.style.height=`${o.height}px`,e.style.display="block"},hide:()=>{e.style.display="none"},destroy:()=>{pt(e),e.remove()}}}const Ld=/^cc-|current-password|new-password/i,_B=/token|secret|password|apikey|auth/i,Mi="[redacted]",xB="data-ap-sdk-exclude",Oo=`[${xB}]`;let Ca=null;function SB(A){Ca=(A==null?void 0:A.trim())||null}function Dd(){return Ca?`${Oo}, ${Ca}`:Oo}function dc(A){let e;try{if(e=Dd(),A.matches(e)){A.textContent="";return}for(const t of Array.from(A.querySelectorAll(e)))t.remove()}catch(t){for(const n of Array.from(A.querySelectorAll(Oo)))n.remove()}}function Rd(A){if(A instanceof HTMLInputElement&&A.type==="password")return!0;const e=A.getAttribute("autocomplete");return!!e&&Ld.test(e)}function gl(A){if(Rd(A))return!0;try{return A.closest(Dd())!==null}catch(e){return A.closest(Oo)!==null}}function Od(A){const e=[A,...Array.from(A.querySelectorAll("*"))];for(const t of e){t instanceof HTMLInputElement&&t.type==="password"&&t.setAttribute("value",Mi);const n=t.getAttribute("autocomplete");n&&Ld.test(n)&&t.setAttribute("value",Mi);for(const r of Array.from(t.attributes))_B.test(r.name)&&t.setAttribute(r.name,Mi)}}const IB="🎯 Click any element to capture";let Mt=null,zA=null,WA=null;function rs(A){return A instanceof Element?A.closest("[data-ap-sdk]")!==null||A.closest(".ap-sdk-panel")!==null||A.closest(".ap-sdk-highlight")!==null||A.closest(".ap-sdk-picker-cursor")!==null:!1}function TB(){var A,e;return((e=(A=window.matchMedia)==null?void 0:A.call(window,"(pointer: coarse)").matches)!=null?e:!1)||"ontouchstart"in window}function Bl(A){Mt==null||Mt.update(A)}function Md(A){const e=Td(),t=yB(A),n=UB(A);let r=A,s;try{const o=A.cloneNode(!0);Od(o),dc(o),r=o,s=o.outerHTML.slice(0,4e3)}catch(o){}return k(k({pageUrl:window.location.href,pageTitle:document.title,elementText:Do(r),cssSelector:bo(A),innerTree:BB(r),outerTree:QB(A),elementOuterHtml:s,ancestry:t},n),e)}function ba(A,e){WA&&WA();const t=TB();Mt=uc(),zA=document.createElement("div"),zA.className="ap-sdk-picker-cursor",zA.setAttribute("data-ap-sdk","1"),zA.textContent=t?"Tap any element to preview":IB,document.body.appendChild(zA),dt(zA);let n=null,r=null;const s=u=>{WA==null||WA(),A(Md(u),u)},o=u=>{if(r=u,Bl(u),!zA)return;zA.classList.add("ap-sdk-picker-cursor--confirm"),zA.innerHTML="";const h=document.createElement("span");h.className="ap-sdk-picker-cursor__label",h.textContent=`<${u.tagName.toLowerCase()}>`;const f=document.createElement("button");f.type="button",f.className="ap-sdk-picker-cursor__btn ap-sdk-picker-cursor__btn--cancel",f.textContent="✕ Cancel",f.setAttribute("data-ap-sdk","1"),f.setAttribute("aria-label","Cancel picking"),f.addEventListener("click",Q=>{Q.preventDefault(),Q.stopPropagation(),WA==null||WA(),e()});const g=document.createElement("button");g.type="button",g.className="ap-sdk-picker-cursor__btn",g.textContent="⬆ Parent",g.setAttribute("data-ap-sdk","1"),g.addEventListener("click",Q=>{Q.preventDefault(),Q.stopPropagation(),r!=null&&r.parentElement&&o(r.parentElement)});const m=document.createElement("button");m.type="button",m.className="ap-sdk-picker-cursor__btn ap-sdk-picker-cursor__btn--primary",m.textContent="✓ Select",m.setAttribute("data-ap-sdk","1"),m.addEventListener("click",Q=>{Q.preventDefault(),Q.stopPropagation(),r&&s(r)}),zA.appendChild(h),zA.appendChild(f),zA.appendChild(g),zA.appendChild(m)},a=u=>{rs(u.target)||(n=u.target,Bl(n))},i=u=>{var f;if(rs(u.target))return;u.preventDefault(),u.stopImmediatePropagation();const h=(f=u.target)!=null?f:n;if(h){if(t){o(h);return}s(h)}},c=u=>{u.key==="Escape"&&(WA==null||WA(),e())};t||document.addEventListener("mouseover",a,{capture:!0}),document.addEventListener("click",i,{capture:!0}),document.addEventListener("keydown",c,{capture:!0}),WA=()=>{t||document.removeEventListener("mouseover",a,{capture:!0}),document.removeEventListener("click",i,{capture:!0}),document.removeEventListener("keydown",c,{capture:!0}),zA&&pt(zA),zA==null||zA.remove(),Mt==null||Mt.destroy(),Mt=null,zA=null,r=null,WA=null}}function pc(){WA==null||WA()}function tr(){return WA!==null}const Ns={TASK_STATUS_UPDATED:"task:status:updated",TASK_INTERACTION_CREATED:"task:interaction:created",TASK_INTERACTION_ANSWERED:"task:interaction:answered",TASK_BROWSER_COMMAND_CREATED:"task:browser-command:created"};function _(A,e,t){var a;function n(i,c){if(i._zod||Object.defineProperty(i,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),i._zod.traits.has(A))return;i._zod.traits.add(A),e(i,c);const u=o.prototype,h=Object.keys(u);for(let f=0;f<h.length;f++){const g=h[f];g in i||(i[g]=u[g].bind(i))}}const r=(a=t==null?void 0:t.Parent)!=null?a:Object;class s extends r{}Object.defineProperty(s,"name",{value:A});function o(i){var h;var c;const u=t!=null&&t.Parent?new s:this;n(u,i),(h=(c=u._zod).deferred)!=null||(c.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:i=>{var c,u;return t!=null&&t.Parent&&i instanceof t.Parent?!0:(u=(c=i==null?void 0:i._zod)==null?void 0:c.traits)==null?void 0:u.has(A)}}),Object.defineProperty(o,"name",{value:A}),o}class nr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Pd extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Kd={};function zt(A){return Kd}function Nd(A){const e=Object.values(A).filter(n=>typeof n=="number");return Object.entries(A).filter(([n,r])=>e.indexOf(+n)===-1).map(([n,r])=>r)}function Qa(A,e){return typeof e=="bigint"?e.toString():e}function ii(A){return{get value(){{const e=A();return Object.defineProperty(this,"value",{value:e}),e}}}}function hc(A){return A==null}function fc(A){const e=A.startsWith("^")?1:0,t=A.endsWith("$")?A.length-1:A.length;return A.slice(e,t)}function HB(A,e){const t=(A.toString().split(".")[1]||"").length,n=e.toString();let r=(n.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(n)){const i=n.match(/\d?e-(\d?)/);i!=null&&i[1]&&(r=Number.parseInt(i[1]))}const s=t>r?t:r,o=Number.parseInt(A.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return o%a/we(10,s)}const wl=Symbol("evaluating");function aA(A,e,t){let n;Object.defineProperty(A,e,{get(){if(n!==wl)return n===void 0&&(n=wl,n=t()),n},set(r){Object.defineProperty(A,e,{value:r})},configurable:!0})}function Fn(A,e,t){Object.defineProperty(A,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Vt(...A){const e={};for(const t of A){const n=Object.getOwnPropertyDescriptors(t);Object.assign(e,n)}return Object.defineProperties({},e)}function ml(A){return JSON.stringify(A)}function LB(A){return A.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const zd="captureStackTrace"in Error?Error.captureStackTrace:(...A)=>{};function as(A){return typeof A=="object"&&A!==null&&!Array.isArray(A)}const DB=ii(()=>{var A;if(typeof navigator!="undefined"&&((A=navigator==null?void 0:navigator.userAgent)!=null&&A.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch(e){return!1}});function ar(A){if(as(A)===!1)return!1;const e=A.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(as(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function $d(A){return ar(A)?k({},A):Array.isArray(A)?[...A]:A}const RB=new Set(["string","number","symbol"]);function cr(A){return A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zt(A,e,t){const n=new A._zod.constr(e!=null?e:A._zod.def);return(!e||t!=null&&t.parent)&&(n._zod.parent=A),n}function V(A){const e=A;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?$(k({},e),{error:()=>e.error}):e}function OB(A){return Object.keys(A).filter(e=>A[e]._zod.optin==="optional"&&A[e]._zod.optout==="optional")}const MB={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function PB(A,e){const t=A._zod.def,n=t.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Vt(A._zod.def,{get shape(){const o={};for(const a in e){if(!(a in t.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(o[a]=t.shape[a])}return Fn(this,"shape",o),o},checks:[]});return Zt(A,s)}function KB(A,e){const t=A._zod.def,n=t.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Vt(A._zod.def,{get shape(){const o=k({},A._zod.def.shape);for(const a in e){if(!(a in t.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete o[a]}return Fn(this,"shape",o),o},checks:[]});return Zt(A,s)}function NB(A,e){if(!ar(e))throw new Error("Invalid input to extend: expected a plain object");const t=A._zod.def.checks;if(t&&t.length>0){const s=A._zod.def.shape;for(const o in e)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Vt(A._zod.def,{get shape(){const s=k(k({},A._zod.def.shape),e);return Fn(this,"shape",s),s}});return Zt(A,r)}function zB(A,e){if(!ar(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=Vt(A._zod.def,{get shape(){const n=k(k({},A._zod.def.shape),e);return Fn(this,"shape",n),n}});return Zt(A,t)}function $B(A,e){const t=Vt(A._zod.def,{get shape(){const n=k(k({},A._zod.def.shape),e._zod.def.shape);return Fn(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return Zt(A,t)}function GB(A,e,t){const r=e._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Vt(e._zod.def,{get shape(){const a=e._zod.def.shape,i=k({},a);if(t)for(const c in t){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(i[c]=A?new A({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)i[c]=A?new A({type:"optional",innerType:a[c]}):a[c];return Fn(this,"shape",i),i},checks:[]});return Zt(e,o)}function VB(A,e,t){const n=Vt(e._zod.def,{get shape(){const r=e._zod.def.shape,s=k({},r);if(t)for(const o in t){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(s[o]=new A({type:"nonoptional",innerType:r[o]}))}else for(const o in r)s[o]=new A({type:"nonoptional",innerType:r[o]});return Fn(this,"shape",s),s}});return Zt(e,n)}function Wn(A,e=0){var t;if(A.aborted===!0)return!0;for(let n=e;n<A.issues.length;n++)if(((t=A.issues[n])==null?void 0:t.continue)!==!0)return!0;return!1}function Jn(A,e){return e.map(t=>{var r;var n;return(r=(n=t).path)!=null||(n.path=[]),t.path.unshift(A),t})}function zs(A){return typeof A=="string"?A:A==null?void 0:A.message}function $t(A,e,t){var r,s,o,a,i,c,u,h,f,g,m;const n=$(k({},A),{path:(r=A.path)!=null?r:[]});if(!A.message){const Q=(m=(g=(h=(c=zs((a=(o=(s=A.inst)==null?void 0:s._zod.def)==null?void 0:o.error)==null?void 0:a.call(o,A)))!=null?c:zs((i=e==null?void 0:e.error)==null?void 0:i.call(e,A)))!=null?h:zs((u=t.customError)==null?void 0:u.call(t,A)))!=null?g:zs((f=t.localeError)==null?void 0:f.call(t,A)))!=null?m:"Invalid input";n.message=Q}return delete n.inst,delete n.continue,e!=null&&e.reportInput||delete n.input,n}function gc(A){return Array.isArray(A)?"array":typeof A=="string"?"string":"unknown"}function cs(...A){const[e,t,n]=A;return typeof e=="string"?{message:e,code:"custom",input:t,inst:n}:k({},e)}const Gd=(A,e)=>{A.name="$ZodError",Object.defineProperty(A,"_zod",{value:A._zod,enumerable:!1}),Object.defineProperty(A,"issues",{value:e,enumerable:!1}),A.message=JSON.stringify(e,Qa,2),Object.defineProperty(A,"toString",{value:()=>A.message,enumerable:!1})},Vd=_("$ZodError",Gd),Zd=_("$ZodError",Gd,{Parent:Error});function ZB(A,e=t=>t.message){const t={},n=[];for(const r of A.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}function XB(A,e=t=>t.message){const t={_errors:[]},n=r=>{for(const s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>n({issues:o}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)t._errors.push(e(s));else{let o=t,a=0;for(;a<s.path.length;){const i=s.path[a];a===s.path.length-1?(o[i]=o[i]||{_errors:[]},o[i]._errors.push(e(s))):o[i]=o[i]||{_errors:[]},o=o[i],a++}}};return n(A),t}const Bc=A=>(e,t,n,r)=>{var a;const s=n?Object.assign(n,{async:!1}):{async:!1},o=e._zod.run({value:t,issues:[]},s);if(o instanceof Promise)throw new nr;if(o.issues.length){const i=new((a=r==null?void 0:r.Err)!=null?a:A)(o.issues.map(c=>$t(c,s,zt())));throw zd(i,r==null?void 0:r.callee),i}return o.value},wc=A=>(e,t,n,r)=>T(null,null,function*(){var a;const s=n?Object.assign(n,{async:!0}):{async:!0};let o=e._zod.run({value:t,issues:[]},s);if(o instanceof Promise&&(o=yield o),o.issues.length){const i=new((a=r==null?void 0:r.Err)!=null?a:A)(o.issues.map(c=>$t(c,s,zt())));throw zd(i,r==null?void 0:r.callee),i}return o.value}),ai=A=>(e,t,n)=>{const r=n?$(k({},n),{async:!1}):{async:!1},s=e._zod.run({value:t,issues:[]},r);if(s instanceof Promise)throw new nr;return s.issues.length?{success:!1,error:new(A!=null?A:Vd)(s.issues.map(o=>$t(o,r,zt())))}:{success:!0,data:s.value}},WB=ai(Zd),ci=A=>(e,t,n)=>T(null,null,function*(){const r=n?Object.assign(n,{async:!0}):{async:!0};let s=e._zod.run({value:t,issues:[]},r);return s instanceof Promise&&(s=yield s),s.issues.length?{success:!1,error:new A(s.issues.map(o=>$t(o,r,zt())))}:{success:!0,data:s.value}}),JB=ci(Zd),jB=A=>(e,t,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Bc(A)(e,t,r)},YB=A=>(e,t,n)=>Bc(A)(e,t,n),qB=A=>(e,t,n)=>T(null,null,function*(){const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return wc(A)(e,t,r)}),Aw=A=>(e,t,n)=>T(null,null,function*(){return wc(A)(e,t,n)}),ew=A=>(e,t,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ai(A)(e,t,r)},tw=A=>(e,t,n)=>ai(A)(e,t,n),nw=A=>(e,t,n)=>T(null,null,function*(){const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ci(A)(e,t,r)}),rw=A=>(e,t,n)=>T(null,null,function*(){return ci(A)(e,t,n)}),sw=/^[cC][^\s-]{8,}$/,ow=/^[0-9a-z]+$/,iw=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,aw=/^[0-9a-vA-V]{20}$/,cw=/^[A-Za-z0-9]{27}$/,lw=/^[a-zA-Z0-9_-]{21}$/,uw=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dw=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Cl=A=>A?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${A}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,pw=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function fw(){return new RegExp(hw,"u")}const gw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bw=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ww=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,mw=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Cw=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xd=/^[A-Za-z0-9_-]*$/,bw=/^\+[1-9]\d{6,14}$/,Wd="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Qw=new RegExp(`^${Wd}$`);function Jd(A){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof A.precision=="number"?A.precision===-1?`${e}`:A.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${A.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yw(A){return new RegExp(`^${Jd(A)}$`)}function Uw(A){const e=Jd({precision:A.precision}),t=["Z"];A.local&&t.push(""),A.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${e}(?:${t.join("|")})`;return new RegExp(`^${Wd}T(?:${n})$`)}const Ew=A=>{var t,n;const e=A?`[\\s\\S]{${(t=A==null?void 0:A.minimum)!=null?t:0},${(n=A==null?void 0:A.maximum)!=null?n:""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Fw=/^-?\d+$/,jd=/^-?\d+(?:\.\d+)?$/,kw=/^(?:true|false)$/i,vw=/^[^A-Z]*$/,_w=/^[^a-z]*$/,Be=_("$ZodCheck",(A,e)=>{var n,r;var t;(n=A._zod)!=null||(A._zod={}),A._zod.def=e,(r=(t=A._zod).onattach)!=null||(t.onattach=[])}),Yd={number:"number",bigint:"bigint",object:"date"},qd=_("$ZodCheckLessThan",(A,e)=>{Be.init(A,e);const t=Yd[typeof e.value];A._zod.onattach.push(n=>{var o;const r=n._zod.bag,s=(o=e.inclusive?r.maximum:r.exclusiveMaximum)!=null?o:Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),A._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:t,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:A,continue:!e.abort})}}),Ap=_("$ZodCheckGreaterThan",(A,e)=>{Be.init(A,e);const t=Yd[typeof e.value];A._zod.onattach.push(n=>{var o;const r=n._zod.bag,s=(o=e.inclusive?r.minimum:r.exclusiveMinimum)!=null?o:Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),A._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:A,continue:!e.abort})}}),xw=_("$ZodCheckMultipleOf",(A,e)=>{Be.init(A,e),A._zod.onattach.push(t=>{var r;var n;(r=(n=t._zod.bag).multipleOf)!=null||(n.multipleOf=e.value)}),A._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):HB(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:A,continue:!e.abort})}}),Sw=_("$ZodCheckNumberFormat",(A,e)=>{var o;Be.init(A,e),e.format=e.format||"float64";const t=(o=e.format)==null?void 0:o.includes("int"),n=t?"int":"number",[r,s]=MB[e.format];A._zod.onattach.push(a=>{const i=a._zod.bag;i.format=e.format,i.minimum=r,i.maximum=s,t&&(i.pattern=Fw)}),A._zod.check=a=>{const i=a.value;if(t){if(!Number.isInteger(i)){a.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:i,inst:A});return}if(!Number.isSafeInteger(i)){i>0?a.issues.push({input:i,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:A,origin:n,inclusive:!0,continue:!e.abort}):a.issues.push({input:i,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:A,origin:n,inclusive:!0,continue:!e.abort});return}}i<r&&a.issues.push({origin:"number",input:i,code:"too_small",minimum:r,inclusive:!0,inst:A,continue:!e.abort}),i>s&&a.issues.push({origin:"number",input:i,code:"too_big",maximum:s,inclusive:!0,inst:A,continue:!e.abort})}}),Iw=_("$ZodCheckMaxLength",(A,e)=>{var n;var t;Be.init(A,e),(n=(t=A._zod.def).when)!=null||(t.when=r=>{const s=r.value;return!hc(s)&&s.length!==void 0}),A._zod.onattach.push(r=>{var o;const s=(o=r._zod.bag.maximum)!=null?o:Number.POSITIVE_INFINITY;e.maximum<s&&(r._zod.bag.maximum=e.maximum)}),A._zod.check=r=>{const s=r.value;if(s.length<=e.maximum)return;const a=gc(s);r.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:s,inst:A,continue:!e.abort})}}),Tw=_("$ZodCheckMinLength",(A,e)=>{var n;var t;Be.init(A,e),(n=(t=A._zod.def).when)!=null||(t.when=r=>{const s=r.value;return!hc(s)&&s.length!==void 0}),A._zod.onattach.push(r=>{var o;const s=(o=r._zod.bag.minimum)!=null?o:Number.NEGATIVE_INFINITY;e.minimum>s&&(r._zod.bag.minimum=e.minimum)}),A._zod.check=r=>{const s=r.value;if(s.length>=e.minimum)return;const a=gc(s);r.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:s,inst:A,continue:!e.abort})}}),Hw=_("$ZodCheckLengthEquals",(A,e)=>{var n;var t;Be.init(A,e),(n=(t=A._zod.def).when)!=null||(t.when=r=>{const s=r.value;return!hc(s)&&s.length!==void 0}),A._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=e.length,s.maximum=e.length,s.length=e.length}),A._zod.check=r=>{const s=r.value,o=s.length;if(o===e.length)return;const a=gc(s),i=o>e.length;r.issues.push($(k({origin:a},i?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length}),{inclusive:!0,exact:!0,input:r.value,inst:A,continue:!e.abort}))}}),li=_("$ZodCheckStringFormat",(A,e)=>{var r,s;var t,n;Be.init(A,e),A._zod.onattach.push(o=>{var i;const a=o._zod.bag;a.format=e.format,e.pattern&&((i=a.patterns)!=null||(a.patterns=new Set),a.patterns.add(e.pattern))}),e.pattern?(r=(t=A._zod).check)!=null||(t.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push($(k({origin:"string",code:"invalid_format",format:e.format,input:o.value},e.pattern?{pattern:e.pattern.toString()}:{}),{inst:A,continue:!e.abort}))}):(s=(n=A._zod).check)!=null||(n.check=()=>{})}),Lw=_("$ZodCheckRegex",(A,e)=>{li.init(A,e),A._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:A,continue:!e.abort})}}),Dw=_("$ZodCheckLowerCase",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=vw),li.init(A,e)}),Rw=_("$ZodCheckUpperCase",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=_w),li.init(A,e)}),Ow=_("$ZodCheckIncludes",(A,e)=>{Be.init(A,e);const t=cr(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=n,A._zod.onattach.push(r=>{var o;const s=r._zod.bag;(o=s.patterns)!=null||(s.patterns=new Set),s.patterns.add(n)}),A._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:A,continue:!e.abort})}}),Mw=_("$ZodCheckStartsWith",(A,e)=>{var n;Be.init(A,e);const t=new RegExp(`^${cr(e.prefix)}.*`);(n=e.pattern)!=null||(e.pattern=t),A._zod.onattach.push(r=>{var o;const s=r._zod.bag;(o=s.patterns)!=null||(s.patterns=new Set),s.patterns.add(t)}),A._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:A,continue:!e.abort})}}),Pw=_("$ZodCheckEndsWith",(A,e)=>{var n;Be.init(A,e);const t=new RegExp(`.*${cr(e.suffix)}$`);(n=e.pattern)!=null||(e.pattern=t),A._zod.onattach.push(r=>{var o;const s=r._zod.bag;(o=s.patterns)!=null||(s.patterns=new Set),s.patterns.add(t)}),A._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:A,continue:!e.abort})}}),Kw=_("$ZodCheckOverwrite",(A,e)=>{Be.init(A,e),A._zod.check=t=>{t.value=e.tx(t.value)}});class Nw{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const n=e.split(`
1588
+ `).filter(o=>o),r=Math.min(...n.map(o=>o.length-o.trimStart().length)),s=n.map(o=>o.slice(r)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){var s;const e=Function,t=this==null?void 0:this.args,r=[...((s=this==null?void 0:this.content)!=null?s:[""]).map(o=>` ${o}`)];return new e(...t,r.join(`
1589
+ `))}}const zw={major:4,minor:3,patch:5},UA=_("$ZodType",(A,e)=>{var r,s,o;var t;A!=null||(A={}),A._zod.def=e,A._zod.bag=A._zod.bag||{},A._zod.version=zw;const n=[...(r=A._zod.def.checks)!=null?r:[]];A._zod.traits.has("$ZodCheck")&&n.unshift(A);for(const a of n)for(const i of a._zod.onattach)i(A);if(n.length===0)(s=(t=A._zod).deferred)!=null||(t.deferred=[]),(o=A._zod.deferred)==null||o.push(()=>{A._zod.run=A._zod.parse});else{const a=(c,u,h)=>{let f=Wn(c),g;for(const m of u){if(m._zod.def.when){if(!m._zod.def.when(c))continue}else if(f)continue;const Q=c.issues.length,U=m._zod.check(c);if(U instanceof Promise&&(h==null?void 0:h.async)===!1)throw new nr;if(g||U instanceof Promise)g=(g!=null?g:Promise.resolve()).then(()=>T(null,null,function*(){yield U,c.issues.length!==Q&&(f||(f=Wn(c,Q)))}));else{if(c.issues.length===Q)continue;f||(f=Wn(c,Q))}}return g?g.then(()=>c):c},i=(c,u,h)=>{if(Wn(c))return c.aborted=!0,c;const f=a(u,n,h);if(f instanceof Promise){if(h.async===!1)throw new nr;return f.then(g=>A._zod.parse(g,h))}return A._zod.parse(f,h)};A._zod.run=(c,u)=>{if(u.skipChecks)return A._zod.parse(c,u);if(u.direction==="backward"){const f=A._zod.parse({value:c.value,issues:[]},$(k({},u),{skipChecks:!0}));return f instanceof Promise?f.then(g=>i(g,c,u)):i(f,c,u)}const h=A._zod.parse(c,u);if(h instanceof Promise){if(u.async===!1)throw new nr;return h.then(f=>a(f,n,u))}return a(h,n,u)}}aA(A,"~standard",()=>({validate:a=>{var i;try{const c=WB(A,a);return c.success?{value:c.data}:{issues:(i=c.error)==null?void 0:i.issues}}catch(c){return JB(A,a).then(u=>{var h;return u.success?{value:u.data}:{issues:(h=u.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}))}),mc=_("$ZodString",(A,e)=>{var t,n,r;UA.init(A,e),A._zod.pattern=(r=[...(n=(t=A==null?void 0:A._zod.bag)==null?void 0:t.patterns)!=null?n:[]].pop())!=null?r:Ew(A._zod.bag),A._zod.parse=(s,o)=>{if(e.coerce)try{s.value=String(s.value)}catch(a){}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:A}),s}}),EA=_("$ZodStringFormat",(A,e)=>{li.init(A,e),mc.init(A,e)}),$w=_("$ZodGUID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=dw),EA.init(A,e)}),Gw=_("$ZodUUID",(A,e)=>{var t,n;if(e.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(s===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);(t=e.pattern)!=null||(e.pattern=Cl(s))}else(n=e.pattern)!=null||(e.pattern=Cl());EA.init(A,e)}),Vw=_("$ZodEmail",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=pw),EA.init(A,e)}),Zw=_("$ZodURL",(A,e)=>{EA.init(A,e),A._zod.check=t=>{try{const n=t.value.trim(),r=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(r.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:A,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:A,continue:!e.abort})),e.normalize?t.value=r.href:t.value=n;return}catch(n){t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:A,continue:!e.abort})}}}),Xw=_("$ZodEmoji",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=fw()),EA.init(A,e)}),Ww=_("$ZodNanoID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=lw),EA.init(A,e)}),Jw=_("$ZodCUID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=sw),EA.init(A,e)}),jw=_("$ZodCUID2",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=ow),EA.init(A,e)}),Yw=_("$ZodULID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=iw),EA.init(A,e)}),qw=_("$ZodXID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=aw),EA.init(A,e)}),Am=_("$ZodKSUID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=cw),EA.init(A,e)}),em=_("$ZodISODateTime",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Uw(e)),EA.init(A,e)}),tm=_("$ZodISODate",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Qw),EA.init(A,e)}),nm=_("$ZodISOTime",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=yw(e)),EA.init(A,e)}),rm=_("$ZodISODuration",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=uw),EA.init(A,e)}),sm=_("$ZodIPv4",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=gw),EA.init(A,e),A._zod.bag.format="ipv4"}),om=_("$ZodIPv6",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Bw),EA.init(A,e),A._zod.bag.format="ipv6",A._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch(r){n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:A,continue:!e.abort})}}}),im=_("$ZodCIDRv4",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=ww),EA.init(A,e)}),am=_("$ZodCIDRv6",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=mw),EA.init(A,e),A._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,o]=r;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${s}]`)}catch(s){n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:A,continue:!e.abort})}}});function ep(A){if(A==="")return!0;if(A.length%4!==0)return!1;try{return atob(A),!0}catch(e){return!1}}const cm=_("$ZodBase64",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Cw),EA.init(A,e),A._zod.bag.contentEncoding="base64",A._zod.check=n=>{ep(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:A,continue:!e.abort})}});function lm(A){if(!Xd.test(A))return!1;const e=A.replace(/[-_]/g,n=>n==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return ep(t)}const um=_("$ZodBase64URL",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Xd),EA.init(A,e),A._zod.bag.contentEncoding="base64url",A._zod.check=n=>{lm(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:A,continue:!e.abort})}}),dm=_("$ZodE164",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=bw),EA.init(A,e)});function pm(A,e=null){try{const t=A.split(".");if(t.length!==3)return!1;const[n]=t;if(!n)return!1;const r=JSON.parse(atob(n));return!("typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&(!("alg"in r)||r.alg!==e))}catch(t){return!1}}const hm=_("$ZodJWT",(A,e)=>{EA.init(A,e),A._zod.check=t=>{pm(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:A,continue:!e.abort})}}),tp=_("$ZodNumber",(A,e)=>{var t;UA.init(A,e),A._zod.pattern=(t=A._zod.bag.pattern)!=null?t:jd,A._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch(a){}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const o=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push(k({expected:"number",code:"invalid_type",input:s,inst:A},o?{received:o}:{})),n}}),fm=_("$ZodNumberFormat",(A,e)=>{Sw.init(A,e),tp.init(A,e)}),gm=_("$ZodBoolean",(A,e)=>{UA.init(A,e),A._zod.pattern=kw,A._zod.parse=(t,n)=>{if(e.coerce)try{t.value=!!t.value}catch(s){}const r=t.value;return typeof r=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:A}),t}}),Bm=_("$ZodAny",(A,e)=>{UA.init(A,e),A._zod.parse=t=>t}),wm=_("$ZodUnknown",(A,e)=>{UA.init(A,e),A._zod.parse=t=>t}),mm=_("$ZodNever",(A,e)=>{UA.init(A,e),A._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:A}),t)});function bl(A,e,t){A.issues.length&&e.issues.push(...Jn(t,A.issues)),e.value[t]=A.value}const Cm=_("$ZodArray",(A,e)=>{UA.init(A,e),A._zod.parse=(t,n)=>{const r=t.value;if(!Array.isArray(r))return t.issues.push({expected:"array",code:"invalid_type",input:r,inst:A}),t;t.value=Array(r.length);const s=[];for(let o=0;o<r.length;o++){const a=r[o],i=e.element._zod.run({value:a,issues:[]},n);i instanceof Promise?s.push(i.then(c=>bl(c,t,o))):bl(i,t,o)}return s.length?Promise.all(s).then(()=>t):t}});function Mo(A,e,t,n,r){if(A.issues.length){if(r&&!(t in n))return;e.issues.push(...Jn(t,A.issues))}A.value===void 0?t in n&&(e.value[t]=void 0):e.value[t]=A.value}function np(A){var n,r,s,o;const e=Object.keys(A.shape);for(const a of e)if(!((o=(s=(r=(n=A.shape)==null?void 0:n[a])==null?void 0:r._zod)==null?void 0:s.traits)!=null&&o.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const t=OB(A.shape);return $(k({},A),{keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)})}function rp(A,e,t,n,r,s){const o=[],a=r.keySet,i=r.catchall._zod,c=i.def.type,u=i.optout==="optional";for(const h in e){if(a.has(h))continue;if(c==="never"){o.push(h);continue}const f=i.run({value:e[h],issues:[]},n);f instanceof Promise?A.push(f.then(g=>Mo(g,t,h,e,u))):Mo(f,t,h,e,u)}return o.length&&t.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:s}),A.length?Promise.all(A).then(()=>t):t}const bm=_("$ZodObject",(A,e)=>{UA.init(A,e);const t=Object.getOwnPropertyDescriptor(e,"shape");if(!(t!=null&&t.get)){const a=e.shape;Object.defineProperty(e,"shape",{get:()=>{const i=k({},a);return Object.defineProperty(e,"shape",{value:i}),i}})}const n=ii(()=>np(e));aA(A._zod,"propValues",()=>{var c;const a=e.shape,i={};for(const u in a){const h=a[u]._zod;if(h.values){(c=i[u])!=null||(i[u]=new Set);for(const f of h.values)i[u].add(f)}}return i});const r=as,s=e.catchall;let o;A._zod.parse=(a,i)=>{o!=null||(o=n.value);const c=a.value;if(!r(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:A}),a;a.value={};const u=[],h=o.shape;for(const f of o.keys){const g=h[f],m=g._zod.optout==="optional",Q=g._zod.run({value:c[f],issues:[]},i);Q instanceof Promise?u.push(Q.then(U=>Mo(U,a,f,c,m))):Mo(Q,a,f,c,m)}return s?rp(u,c,a,i,n.value,A):u.length?Promise.all(u).then(()=>a):a}}),Qm=_("$ZodObjectJIT",(A,e)=>{bm.init(A,e);const t=A._zod.parse,n=ii(()=>np(e)),r=f=>{var F;const g=new Nw(["shape","payload","ctx"]),m=n.value,Q=y=>{const x=ml(y);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};g.write("const input = payload.value;");const U=Object.create(null);let E=0;for(const y of m.keys)U[y]=`key_${E++}`;g.write("const newResult = {};");for(const y of m.keys){const x=U[y],R=ml(y),I=f[y],K=((F=I==null?void 0:I._zod)==null?void 0:F.optout)==="optional";g.write(`const ${x} = ${Q(y)};`),K?g.write(`
1590
+ if (${x}.issues.length) {
1591
+ if (${R} in input) {
1592
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
1479
1593
  ...iss,
1480
- path: iss.path ? [${N}, ...iss.path] : [${N}]
1594
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
1481
1595
  })));
1482
1596
  }
1483
1597
  }
1484
1598
 
1485
- if (${C}.value === undefined) {
1486
- if (${N} in input) {
1487
- newResult[${N}] = undefined;
1599
+ if (${x}.value === undefined) {
1600
+ if (${R} in input) {
1601
+ newResult[${R}] = undefined;
1488
1602
  }
1489
1603
  } else {
1490
- newResult[${N}] = ${C}.value;
1604
+ newResult[${R}] = ${x}.value;
1491
1605
  }
1492
1606
 
1493
- `):k.write(`
1494
- if (${C}.issues.length) {
1495
- payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
1607
+ `):g.write(`
1608
+ if (${x}.issues.length) {
1609
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
1496
1610
  ...iss,
1497
- path: iss.path ? [${N}, ...iss.path] : [${N}]
1611
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
1498
1612
  })));
1499
1613
  }
1500
1614
 
1501
- if (${C}.value === undefined) {
1502
- if (${N} in input) {
1503
- newResult[${N}] = undefined;
1615
+ if (${x}.value === undefined) {
1616
+ if (${R} in input) {
1617
+ newResult[${R}] = undefined;
1504
1618
  }
1505
1619
  } else {
1506
- newResult[${N}] = ${C}.value;
1620
+ newResult[${R}] = ${x}.value;
1507
1621
  }
1508
1622
 
1509
- `)}k.write("payload.value = newResult;"),k.write("return payload;");const M=k.compile();return(T,C)=>M(m,T,C)};let i;const a=Ur,d=!tc.jitless,p=d&&Ld.value,h=t.catchall;let g;e._zod.parse=(m,k)=>{g!=null||(g=r.value);const w=m.value;return a(w)?d&&p&&(k==null?void 0:k.async)===!1&&k.jitless!==!0?(i||(i=o(t.shape)),m=i(m,k),h?kc([],w,m,k,g,e):m):n(m,k):(m.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),m)}});function Wi(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!Vn(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(a=>kn(a,r,bn())))}),t)}const _c=x("$ZodUnion",(e,t)=>{me.init(e,t),ne(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ne(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ne(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ne(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Vs(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let a=!1;const d=[];for(const l of t.options){const p=l._zod.run({value:o.value,issues:[]},i);if(p instanceof Promise)d.push(p),a=!0;else{if(p.issues.length===0)return p;d.push(p)}}return a?Promise.all(d).then(l=>Wi(l,o,e,i)):Wi(d,o,e,i)}}),kh=x("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,_c.init(e,t);const n=e._zod.parse;ne(e._zod,"propValues",()=>{const o={};for(const i of t.options){const a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[d,l]of Object.entries(a)){o[d]||(o[d]=new Set);for(const p of l)o[d].add(p)}}return o});const r=Ko(()=>{var a;const o=t.options,i=new Map;for(const d of o){const l=(a=d._zod.propValues)==null?void 0:a[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(d)}"`);for(const p of l){if(i.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);i.set(p,d)}}return i});e._zod.parse=(o,i)=>{const a=o.value;if(!Ur(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),o;const d=r.value.get(a==null?void 0:a[t.discriminator]);return d?d._zod.run(o,i):t.unionFallback?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),o)}}),_h=x("$ZodIntersection",(e,t)=>{me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),a=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,p])=>Ji(n,l,p)):Ji(n,i,a)}});function zs(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ir(e)&&ir(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o=y(y({},e),t);for(const i of r){const a=zs(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],a=zs(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ji(e,t,n){const r=new Map;let o;for(const d of t.issues)if(d.code==="unrecognized_keys"){o!=null||(o=d);for(const l of d.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(d);for(const d of n.issues)if(d.code==="unrecognized_keys")for(const l of d.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(d);const i=[...r].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(i.length&&o&&e.issues.push(D(y({},o),{keys:i})),Vn(e))return e;const a=zs(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const vh=x("$ZodRecord",(e,t)=>{me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!ir(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],a=t.keyType._zod.values;if(a){n.value={};const d=new Set;for(const p of a)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){d.add(typeof p=="number"?p.toString():p);const h=t.valueType._zod.run({value:o[p],issues:[]},r);h instanceof Promise?i.push(h.then(g=>{g.issues.length&&n.issues.push(...Yn(p,g.issues)),n.value[p]=g.value})):(h.issues.length&&n.issues.push(...Yn(p,h.issues)),n.value[p]=h.value)}let l;for(const p in o)d.has(p)||(l=l!=null?l:[],l.push(p));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const d of Reflect.ownKeys(o)){if(d==="__proto__")continue;let l=t.keyType._zod.run({value:d,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&dc.test(d)&&l.issues.length&&l.issues.some(g=>g.code==="invalid_type"&&g.expected==="number")){const g=t.keyType._zod.run({value:Number(d),issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(l=g)}if(l.issues.length){t.mode==="loose"?n.value[d]=o[d]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(g=>kn(g,r,bn())),input:d,path:[d],inst:e});continue}const h=t.valueType._zod.run({value:o[d],issues:[]},r);h instanceof Promise?i.push(h.then(g=>{g.issues.length&&n.issues.push(...Yn(d,g.issues)),n.value[l.value]=g.value})):(h.issues.length&&n.issues.push(...Yn(d,h.issues)),n.value[l.value]=h.value)}}return i.length?Promise.all(i).then(()=>n):n}}),yh=x("$ZodEnum",(e,t)=>{me.init(e,t);const n=nc(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>zd.has(typeof o)).map(o=>typeof o=="string"?ar(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const a=o.value;return r.has(a)||o.issues.push({code:"invalid_value",values:n,input:a,inst:e}),o}}),wh=x("$ZodLiteral",(e,t)=>{if(me.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?ar(r):r?ar(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),xh=x("$ZodTransform",(e,t)=>{me.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ec(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new nr;return n.value=o,n}});function Vi(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const vc=x("$ZodOptional",(e,t)=>{me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ne(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Vs(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Vi(i,n.value)):Vi(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Sh=x("$ZodExactOptional",(e,t)=>{vc.init(e,t),ne(e._zod,"values",()=>t.innerType._zod.values),ne(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Th=x("$ZodNullable",(e,t)=>{me.init(e,t),ne(e._zod,"optin",()=>t.innerType._zod.optin),ne(e._zod,"optout",()=>t.innerType._zod.optout),ne(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Vs(n.source)}|null)$`):void 0}),ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Eh=x("$ZodDefault",(e,t)=>{me.init(e,t),e._zod.optin="optional",ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Yi(i,t)):Yi(o,t)}});function Yi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ch=x("$ZodPrefault",(e,t)=>{me.init(e,t),e._zod.optin="optional",ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Ah=x("$ZodNonOptional",(e,t)=>{me.init(e,t),ne(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Xi(i,e)):Xi(o,e)}});function Xi(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ph=x("$ZodCatch",(e,t)=>{me.init(e,t),ne(e._zod,"optin",()=>t.innerType._zod.optin),ne(e._zod,"optout",()=>t.innerType._zod.optout),ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue(D(y({},n),{error:{issues:i.issues.map(a=>kn(a,r,bn()))},input:n.value})),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue(D(y({},n),{error:{issues:o.issues.map(i=>kn(i,r,bn()))},input:n.value})),n.issues=[]),n)}}),Rh=x("$ZodPipe",(e,t)=>{me.init(e,t),ne(e._zod,"values",()=>t.in._zod.values),ne(e._zod,"optin",()=>t.in._zod.optin),ne(e._zod,"optout",()=>t.out._zod.optout),ne(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(a=>po(a,t.in,r)):po(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>po(i,t.out,r)):po(o,t.out,r)}});function po(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Lh=x("$ZodReadonly",(e,t)=>{me.init(e,t),ne(e._zod,"propValues",()=>t.innerType._zod.propValues),ne(e._zod,"values",()=>t.innerType._zod.values),ne(e._zod,"optin",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),ne(e._zod,"optout",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Ki):Ki(o)}});function Ki(e){return e.value=Object.freeze(e.value),e}const zh=x("$ZodCustom",(e,t)=>{at.init(e,t),me.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>Qi(i,n,r,e));Qi(o,n,r,e)}});function Qi(e,t,n,r){var o;if(!e){const i={code:"custom",input:n,inst:r,path:[...(o=r._zod.def.path)!=null?o:[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Zr(i))}}var ea;class Ih{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){var r;const n=t._zod.parent;if(n){const o=y({},(r=this.get(n))!=null?r:{});delete o.id;const i=y(y({},o),this._map.get(t));return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function $h(){return new Ih}var Wa;(Wa=(ea=globalThis).__zod_globalRegistry)!=null||(ea.__zod_globalRegistry=$h());const zr=globalThis.__zod_globalRegistry;function Oh(e,t){return new e(y({type:"string"},U(t)))}function Nh(e,t){return new e(y({type:"string",format:"email",check:"string_format",abort:!1},U(t)))}function ta(e,t){return new e(y({type:"string",format:"guid",check:"string_format",abort:!1},U(t)))}function Dh(e,t){return new e(y({type:"string",format:"uuid",check:"string_format",abort:!1},U(t)))}function Mh(e,t){return new e(y({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4"},U(t)))}function jh(e,t){return new e(y({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6"},U(t)))}function Uh(e,t){return new e(y({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7"},U(t)))}function Zh(e,t){return new e(y({type:"string",format:"url",check:"string_format",abort:!1},U(t)))}function qh(e,t){return new e(y({type:"string",format:"emoji",check:"string_format",abort:!1},U(t)))}function Hh(e,t){return new e(y({type:"string",format:"nanoid",check:"string_format",abort:!1},U(t)))}function Fh(e,t){return new e(y({type:"string",format:"cuid",check:"string_format",abort:!1},U(t)))}function Bh(e,t){return new e(y({type:"string",format:"cuid2",check:"string_format",abort:!1},U(t)))}function Gh(e,t){return new e(y({type:"string",format:"ulid",check:"string_format",abort:!1},U(t)))}function Wh(e,t){return new e(y({type:"string",format:"xid",check:"string_format",abort:!1},U(t)))}function Jh(e,t){return new e(y({type:"string",format:"ksuid",check:"string_format",abort:!1},U(t)))}function Vh(e,t){return new e(y({type:"string",format:"ipv4",check:"string_format",abort:!1},U(t)))}function Yh(e,t){return new e(y({type:"string",format:"ipv6",check:"string_format",abort:!1},U(t)))}function Xh(e,t){return new e(y({type:"string",format:"cidrv4",check:"string_format",abort:!1},U(t)))}function Kh(e,t){return new e(y({type:"string",format:"cidrv6",check:"string_format",abort:!1},U(t)))}function Qh(e,t){return new e(y({type:"string",format:"base64",check:"string_format",abort:!1},U(t)))}function ef(e,t){return new e(y({type:"string",format:"base64url",check:"string_format",abort:!1},U(t)))}function tf(e,t){return new e(y({type:"string",format:"e164",check:"string_format",abort:!1},U(t)))}function nf(e,t){return new e(y({type:"string",format:"jwt",check:"string_format",abort:!1},U(t)))}function rf(e,t){return new e(y({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null},U(t)))}function of(e,t){return new e(y({type:"string",format:"date",check:"string_format"},U(t)))}function sf(e,t){return new e(y({type:"string",format:"time",check:"string_format",precision:null},U(t)))}function af(e,t){return new e(y({type:"string",format:"duration",check:"string_format"},U(t)))}function cf(e,t){return new e(y({type:"number",checks:[]},U(t)))}function lf(e,t){return new e(y({type:"number",check:"number_format",abort:!1,format:"safeint"},U(t)))}function uf(e,t){return new e(y({type:"boolean"},U(t)))}function df(e){return new e({type:"any"})}function pf(e){return new e({type:"unknown"})}function hf(e,t){return new e(y({type:"never"},U(t)))}function na(e,t){return new hc(D(y({check:"less_than"},U(t)),{value:e,inclusive:!1}))}function ks(e,t){return new hc(D(y({check:"less_than"},U(t)),{value:e,inclusive:!0}))}function ra(e,t){return new fc(D(y({check:"greater_than"},U(t)),{value:e,inclusive:!1}))}function _s(e,t){return new fc(D(y({check:"greater_than"},U(t)),{value:e,inclusive:!0}))}function oa(e,t){return new Tp(D(y({check:"multiple_of"},U(t)),{value:e}))}function yc(e,t){return new Cp(D(y({check:"max_length"},U(t)),{maximum:e}))}function Do(e,t){return new Ap(D(y({check:"min_length"},U(t)),{minimum:e}))}function wc(e,t){return new Pp(D(y({check:"length_equals"},U(t)),{length:e}))}function ff(e,t){return new Rp(D(y({check:"string_format",format:"regex"},U(t)),{pattern:e}))}function gf(e){return new Lp(y({check:"string_format",format:"lowercase"},U(e)))}function mf(e){return new zp(y({check:"string_format",format:"uppercase"},U(e)))}function bf(e,t){return new Ip(D(y({check:"string_format",format:"includes"},U(t)),{includes:e}))}function kf(e,t){return new $p(D(y({check:"string_format",format:"starts_with"},U(t)),{prefix:e}))}function _f(e,t){return new Op(D(y({check:"string_format",format:"ends_with"},U(t)),{suffix:e}))}function dr(e){return new Np({check:"overwrite",tx:e})}function vf(e){return dr(t=>t.normalize(e))}function yf(){return dr(e=>e.trim())}function wf(){return dr(e=>e.toLowerCase())}function xf(){return dr(e=>e.toUpperCase())}function Sf(){return dr(e=>Rd(e))}function Tf(e,t,n){return new e(y({type:"array",element:t},U(n)))}function Ef(e,t,n){return new e(y({type:"custom",check:"custom",fn:t},U(n)))}function Cf(e){const t=Af(n=>(n.addIssue=r=>{var o,i,a,d;if(typeof r=="string")n.issues.push(Zr(r,n.value,t._zod.def));else{const l=r;l.fatal&&(l.continue=!1),(o=l.code)!=null||(l.code="custom"),(i=l.input)!=null||(l.input=n.value),(a=l.inst)!=null||(l.inst=t),(d=l.continue)!=null||(l.continue=!t._zod.def.abort),n.issues.push(Zr(l))}},e(n.value,n)));return t}function Af(e,t){const n=new at(y({check:"custom"},U(t)));return n._zod.check=e,n}function xc(e){var n,r,o,i,a,d,l,p,h;let t=(n=e==null?void 0:e.target)!=null?n:"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:(r=e.processors)!=null?r:{},metadataRegistry:(o=e==null?void 0:e.metadata)!=null?o:zr,target:t,unrepresentable:(i=e==null?void 0:e.unrepresentable)!=null?i:"throw",override:(a=e==null?void 0:e.override)!=null?a:(()=>{}),io:(d=e==null?void 0:e.io)!=null?d:"output",counter:0,seen:new Map,cycles:(l=e==null?void 0:e.cycles)!=null?l:"ref",reused:(p=e==null?void 0:e.reused)!=null?p:"inline",external:(h=e==null?void 0:e.external)!=null?h:void 0}}function Le(e,t,n={path:[],schemaPath:[]}){var h,g,m;var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);const d=(g=(h=e._zod).toJSONSchema)==null?void 0:g.call(h);if(d)a.schema=d;else{const k=D(y({},n),{schemaPath:[...n.schemaPath,e],path:n.path});if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,k);else{const v=a.schema,Z=t.processors[o.type];if(!Z)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);Z(e,t,v,k)}const w=e._zod.parent;w&&(a.ref||(a.ref=w),Le(w,t,k),t.seen.get(w).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Qe(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((m=(r=a.schema).default)!=null||(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Sc(e,t){var a,d,l,p;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const h of e.seen.entries()){const g=(a=e.metadataRegistry.get(h[0]))==null?void 0:a.id;if(g){const m=r.get(g);if(m&&m!==h[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(g,h[0])}}const o=h=>{var v,Z,K,M,E;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const T=(v=e.external.registry.get(h[0]))==null?void 0:v.id,C=(Z=e.external.uri)!=null?Z:(J=>J);if(T)return{ref:C(T)};const N=(M=(K=h[1].defId)!=null?K:h[1].schema.id)!=null?M:`schema${e.counter++}`;return h[1].defId=N,{defId:N,ref:`${C("__shared")}#/${g}/${N}`}}if(h[1]===n)return{ref:"#"};const k=`#/${g}/`,w=(E=h[1].schema.id)!=null?E:`__schema${e.counter++}`;return{defId:w,ref:k+w}},i=h=>{if(h[1].schema.$ref)return;const g=h[1],{ref:m,defId:k}=o(h);g.def=y({},g.schema),k&&(g.defId=k);const w=g.schema;for(const v in w)delete w[v];w.$ref=m};if(e.cycles==="throw")for(const h of e.seen.entries()){const g=h[1];if(g.cycle)throw new Error(`Cycle detected: #/${(d=g.cycle)==null?void 0:d.join("/")}/<root>
1510
-
1511
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const h of e.seen.entries()){const g=h[1];if(t===h[0]){i(h);continue}if(e.external){const k=(l=e.external.registry.get(h[0]))==null?void 0:l.id;if(t!==h[0]&&k){i(h);continue}}if((p=e.metadataRegistry.get(h[0]))==null?void 0:p.id){i(h);continue}if(g.cycle){i(h);continue}if(g.count>1&&e.reused==="ref"){i(h);continue}}}function Tc(e,t){var a,d,l,p,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=g=>{var K,M,E;const m=e.seen.get(g);if(m.ref===null)return;const k=(K=m.def)!=null?K:m.schema,w=y({},k),v=m.ref;if(m.ref=null,v){r(v);const T=e.seen.get(v),C=T.schema;if(C.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(k.allOf=(M=k.allOf)!=null?M:[],k.allOf.push(C)):Object.assign(k,C),Object.assign(k,w),g._zod.parent===v)for(const J in k)J==="$ref"||J==="allOf"||J in w||delete k[J];if(C.$ref)for(const J in k)J==="$ref"||J==="allOf"||J in T.def&&JSON.stringify(k[J])===JSON.stringify(T.def[J])&&delete k[J]}const Z=g._zod.parent;if(Z&&Z!==v){r(Z);const T=e.seen.get(Z);if(T!=null&&T.schema.$ref&&(k.$ref=T.schema.$ref,T.def))for(const C in k)C==="$ref"||C==="allOf"||C in T.def&&JSON.stringify(k[C])===JSON.stringify(T.def[C])&&delete k[C]}e.override({zodSchema:g,jsonSchema:k,path:(E=m.path)!=null?E:[]})};for(const g of[...e.seen.entries()].reverse())r(g[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const g=(d=e.external.registry.get(t))==null?void 0:d.id;if(!g)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(g)}Object.assign(o,(l=n.def)!=null?l:n.schema);const i=(h=(p=e.external)==null?void 0:p.defs)!=null?h:{};for(const g of e.seen.entries()){const m=g[1];m.def&&m.defId&&(i[m.defId]=m.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const g=JSON.parse(JSON.stringify(o));return Object.defineProperty(g,"~standard",{value:D(y({},t["~standard"]),{jsonSchema:{input:Mo(t,"input",e.processors),output:Mo(t,"output",e.processors)}}),enumerable:!1,writable:!1}),g}catch(g){throw new Error("Error converting schema to JSON.")}}function Qe(e,t){const n=t!=null?t:{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Qe(r.element,n);if(r.type==="set")return Qe(r.valueType,n);if(r.type==="lazy")return Qe(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Qe(r.innerType,n);if(r.type==="intersection")return Qe(r.left,n)||Qe(r.right,n);if(r.type==="record"||r.type==="map")return Qe(r.keyType,n)||Qe(r.valueType,n);if(r.type==="pipe")return Qe(r.in,n)||Qe(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Qe(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Qe(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Qe(o,n))return!0;return!!(r.rest&&Qe(r.rest,n))}return!1}const Pf=(e,t={})=>n=>{const r=xc(D(y({},n),{processors:t}));return Le(e,r),Sc(r,e),Tc(r,e)},Mo=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r!=null?r:{},a=xc(D(y({},o!=null?o:{}),{target:i,io:t,processors:n}));return Le(e,a),Sc(a,e),Tc(a,e)},Rf={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Lf=(e,t,n,r)=>{var h;const o=n;o.type="string";const{minimum:i,maximum:a,format:d,patterns:l,contentEncoding:p}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof a=="number"&&(o.maxLength=a),d&&(o.format=(h=Rf[d])!=null?h:d,o.format===""&&delete o.format,d==="time"&&delete o.format),p&&(o.contentEncoding=p),l&&l.size>0){const g=[...l];g.length===1?o.pattern=g[0].source:g.length>1&&(o.allOf=[...g.map(m=>D(y({},t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{}),{pattern:m.source}))])}},zf=(e,t,n,r)=>{const o=n,{minimum:i,maximum:a,format:d,multipleOf:l,exclusiveMaximum:p,exclusiveMinimum:h}=e._zod.bag;typeof d=="string"&&d.includes("int")?o.type="integer":o.type="number",typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=h,o.exclusiveMinimum=!0):o.exclusiveMinimum=h),typeof i=="number"&&(o.minimum=i,typeof h=="number"&&t.target!=="draft-04"&&(h>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=p,o.exclusiveMaximum=!0):o.exclusiveMaximum=p),typeof a=="number"&&(o.maximum=a,typeof p=="number"&&t.target!=="draft-04"&&(p<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},If=(e,t,n,r)=>{n.type="boolean"},$f=(e,t,n,r)=>{n.not={}},Of=(e,t,n,r)=>{},Nf=(e,t,n,r)=>{},Df=(e,t,n,r)=>{const o=e._zod.def,i=nc(o.entries);i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),n.enum=i},Mf=(e,t,n,r)=>{const o=e._zod.def,i=[];for(const a of o.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){const a=i[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),i.every(a=>typeof a=="boolean")&&(n.type="boolean"),i.every(a=>a===null)&&(n.type="null"),n.enum=i},jf=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Uf=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Zf=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:a,maximum:d}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof d=="number"&&(o.maxItems=d),o.type="array",o.items=Le(i.element,t,D(y({},r),{path:[...r.path,"items"]}))},qf=(e,t,n,r)=>{var p;const o=n,i=e._zod.def;o.type="object",o.properties={};const a=i.shape;for(const h in a)o.properties[h]=Le(a[h],t,D(y({},r),{path:[...r.path,"properties",h]}));const d=new Set(Object.keys(a)),l=new Set([...d].filter(h=>{const g=i.shape[h]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));l.size>0&&(o.required=Array.from(l)),((p=i.catchall)==null?void 0:p._zod.def.type)==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Le(i.catchall,t,D(y({},r),{path:[...r.path,"additionalProperties"]}))):t.io==="output"&&(o.additionalProperties=!1)},Hf=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,a=o.options.map((d,l)=>Le(d,t,D(y({},r),{path:[...r.path,i?"oneOf":"anyOf",l]})));i?n.oneOf=a:n.anyOf=a},Ff=(e,t,n,r)=>{const o=e._zod.def,i=Le(o.left,t,D(y({},r),{path:[...r.path,"allOf",0]})),a=Le(o.right,t,D(y({},r),{path:[...r.path,"allOf",1]})),d=p=>"allOf"in p&&Object.keys(p).length===1,l=[...d(i)?i.allOf:[i],...d(a)?a.allOf:[a]];n.allOf=l},Bf=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const a=i.keyType,d=a._zod.bag,l=d==null?void 0:d.patterns;if(i.mode==="loose"&&l&&l.size>0){const h=Le(i.valueType,t,D(y({},r),{path:[...r.path,"patternProperties","*"]}));o.patternProperties={};for(const g of l)o.patternProperties[g.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Le(i.keyType,t,D(y({},r),{path:[...r.path,"propertyNames"]}))),o.additionalProperties=Le(i.valueType,t,D(y({},r),{path:[...r.path,"additionalProperties"]}));const p=a._zod.values;if(p){const h=[...p].filter(g=>typeof g=="string"||typeof g=="number");h.length>0&&(o.required=h)}},Gf=(e,t,n,r)=>{const o=e._zod.def,i=Le(o.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},Wf=(e,t,n,r)=>{const o=e._zod.def;Le(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},Jf=(e,t,n,r)=>{const o=e._zod.def;Le(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},Vf=(e,t,n,r)=>{const o=e._zod.def;Le(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Yf=(e,t,n,r)=>{const o=e._zod.def;Le(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch(d){throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},Xf=(e,t,n,r)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Le(i,t,r);const a=t.seen.get(e);a.ref=i},Kf=(e,t,n,r)=>{const o=e._zod.def;Le(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},Ec=(e,t,n,r)=>{const o=e._zod.def;Le(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},Qf=x("ZodISODateTime",(e,t)=>{Yp.init(e,t),ve.init(e,t)});function eg(e){return rf(Qf,e)}const tg=x("ZodISODate",(e,t)=>{Xp.init(e,t),ve.init(e,t)});function ng(e){return of(tg,e)}const rg=x("ZodISOTime",(e,t)=>{Kp.init(e,t),ve.init(e,t)});function og(e){return sf(rg,e)}const sg=x("ZodISODuration",(e,t)=>{Qp.init(e,t),ve.init(e,t)});function ig(e){return af(sg,e)}const ag=(e,t)=>{ic.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Hd(e,n)},flatten:{value:n=>qd(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ls,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ls,2)}},isEmpty:{get(){return e.issues.length===0}}})},_t=x("ZodError",ag,{Parent:Error}),cg=Xs(_t),lg=Ks(_t),ug=Qo(_t),dg=es(_t),pg=Gd(_t),hg=Wd(_t),fg=Jd(_t),gg=Vd(_t),mg=Yd(_t),bg=Xd(_t),kg=Kd(_t),_g=Qd(_t),ke=x("ZodType",(e,t)=>(me.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Mo(e,"input"),output:Mo(e,"output")}}),e.toJSONSchema=Pf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>{var r;return e.clone(_n(t,{checks:[...(r=t.checks)!=null?r:[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},e.with=e.check,e.clone=(n,r)=>vn(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>cg(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>ug(e,n,r),e.parseAsync=(n,r)=>z(null,null,function*(){return lg(e,n,r,{callee:e.parseAsync})}),e.safeParseAsync=(n,r)=>z(null,null,function*(){return dg(e,n,r)}),e.spa=e.safeParseAsync,e.encode=(n,r)=>pg(e,n,r),e.decode=(n,r)=>hg(e,n,r),e.encodeAsync=(n,r)=>z(null,null,function*(){return fg(e,n,r)}),e.decodeAsync=(n,r)=>z(null,null,function*(){return gg(e,n,r)}),e.safeEncode=(n,r)=>mg(e,n,r),e.safeDecode=(n,r)=>bg(e,n,r),e.safeEncodeAsync=(n,r)=>z(null,null,function*(){return kg(e,n,r)}),e.safeDecodeAsync=(n,r)=>z(null,null,function*(){return _g(e,n,r)}),e.refine=(n,r)=>e.check(fm(n,r)),e.superRefine=n=>e.check(gm(n)),e.overwrite=n=>e.check(dr(n)),e.optional=()=>ca(e),e.exactOptional=()=>tm(e),e.nullable=()=>la(e),e.nullish=()=>ca(la(e)),e.nonoptional=n=>am(e,n),e.array=()=>ct(e),e.or=n=>Gg([e,n]),e.and=n=>Vg(e,n),e.transform=n=>ua(e,Qg(n)),e.default=n=>om(e,n),e.prefault=n=>im(e,n),e.catch=n=>lm(e,n),e.pipe=n=>ua(e,n),e.readonly=()=>pm(e),e.describe=n=>{const r=e.clone();return zr.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=zr.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return zr.get(e);const r=e.clone();return zr.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Cc=x("_ZodString",(e,t)=>{var r,o,i;Qs.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(a,d,l)=>Lf(e,a,d);const n=e._zod.bag;e.format=(r=n.format)!=null?r:null,e.minLength=(o=n.minimum)!=null?o:null,e.maxLength=(i=n.maximum)!=null?i:null,e.regex=(...a)=>e.check(ff(...a)),e.includes=(...a)=>e.check(bf(...a)),e.startsWith=(...a)=>e.check(kf(...a)),e.endsWith=(...a)=>e.check(_f(...a)),e.min=(...a)=>e.check(Do(...a)),e.max=(...a)=>e.check(yc(...a)),e.length=(...a)=>e.check(wc(...a)),e.nonempty=(...a)=>e.check(Do(1,...a)),e.lowercase=a=>e.check(gf(a)),e.uppercase=a=>e.check(mf(a)),e.trim=()=>e.check(yf()),e.normalize=(...a)=>e.check(vf(...a)),e.toLowerCase=()=>e.check(wf()),e.toUpperCase=()=>e.check(xf()),e.slugify=()=>e.check(Sf())}),vg=x("ZodString",(e,t)=>{Qs.init(e,t),Cc.init(e,t),e.email=n=>e.check(Nh(yg,n)),e.url=n=>e.check(Zh(wg,n)),e.jwt=n=>e.check(nf(Dg,n)),e.emoji=n=>e.check(qh(xg,n)),e.guid=n=>e.check(ta(sa,n)),e.uuid=n=>e.check(Dh(ho,n)),e.uuidv4=n=>e.check(Mh(ho,n)),e.uuidv6=n=>e.check(jh(ho,n)),e.uuidv7=n=>e.check(Uh(ho,n)),e.nanoid=n=>e.check(Hh(Sg,n)),e.guid=n=>e.check(ta(sa,n)),e.cuid=n=>e.check(Fh(Tg,n)),e.cuid2=n=>e.check(Bh(Eg,n)),e.ulid=n=>e.check(Gh(Cg,n)),e.base64=n=>e.check(Qh($g,n)),e.base64url=n=>e.check(ef(Og,n)),e.xid=n=>e.check(Wh(Ag,n)),e.ksuid=n=>e.check(Jh(Pg,n)),e.ipv4=n=>e.check(Vh(Rg,n)),e.ipv6=n=>e.check(Yh(Lg,n)),e.cidrv4=n=>e.check(Xh(zg,n)),e.cidrv6=n=>e.check(Kh(Ig,n)),e.e164=n=>e.check(tf(Ng,n)),e.datetime=n=>e.check(eg(n)),e.date=n=>e.check(ng(n)),e.time=n=>e.check(og(n)),e.duration=n=>e.check(ig(n))});function P(e){return Oh(vg,e)}const ve=x("ZodStringFormat",(e,t)=>{be.init(e,t),Cc.init(e,t)}),yg=x("ZodEmail",(e,t)=>{Zp.init(e,t),ve.init(e,t)}),sa=x("ZodGUID",(e,t)=>{jp.init(e,t),ve.init(e,t)}),ho=x("ZodUUID",(e,t)=>{Up.init(e,t),ve.init(e,t)}),wg=x("ZodURL",(e,t)=>{qp.init(e,t),ve.init(e,t)}),xg=x("ZodEmoji",(e,t)=>{Hp.init(e,t),ve.init(e,t)}),Sg=x("ZodNanoID",(e,t)=>{Fp.init(e,t),ve.init(e,t)}),Tg=x("ZodCUID",(e,t)=>{Bp.init(e,t),ve.init(e,t)}),Eg=x("ZodCUID2",(e,t)=>{Gp.init(e,t),ve.init(e,t)}),Cg=x("ZodULID",(e,t)=>{Wp.init(e,t),ve.init(e,t)}),Ag=x("ZodXID",(e,t)=>{Jp.init(e,t),ve.init(e,t)}),Pg=x("ZodKSUID",(e,t)=>{Vp.init(e,t),ve.init(e,t)}),Rg=x("ZodIPv4",(e,t)=>{eh.init(e,t),ve.init(e,t)}),Lg=x("ZodIPv6",(e,t)=>{th.init(e,t),ve.init(e,t)}),zg=x("ZodCIDRv4",(e,t)=>{nh.init(e,t),ve.init(e,t)}),Ig=x("ZodCIDRv6",(e,t)=>{rh.init(e,t),ve.init(e,t)}),$g=x("ZodBase64",(e,t)=>{oh.init(e,t),ve.init(e,t)}),Og=x("ZodBase64URL",(e,t)=>{ih.init(e,t),ve.init(e,t)}),Ng=x("ZodE164",(e,t)=>{ah.init(e,t),ve.init(e,t)}),Dg=x("ZodJWT",(e,t)=>{lh.init(e,t),ve.init(e,t)}),Ac=x("ZodNumber",(e,t)=>{var r,o,i,a,d,l,p,h,g;mc.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(m,k,w)=>zf(e,m,k),e.gt=(m,k)=>e.check(ra(m,k)),e.gte=(m,k)=>e.check(_s(m,k)),e.min=(m,k)=>e.check(_s(m,k)),e.lt=(m,k)=>e.check(na(m,k)),e.lte=(m,k)=>e.check(ks(m,k)),e.max=(m,k)=>e.check(ks(m,k)),e.int=m=>e.check(ia(m)),e.safe=m=>e.check(ia(m)),e.positive=m=>e.check(ra(0,m)),e.nonnegative=m=>e.check(_s(0,m)),e.negative=m=>e.check(na(0,m)),e.nonpositive=m=>e.check(ks(0,m)),e.multipleOf=(m,k)=>e.check(oa(m,k)),e.step=(m,k)=>e.check(oa(m,k)),e.finite=()=>e;const n=e._zod.bag;e.minValue=(i=Math.max((r=n.minimum)!=null?r:Number.NEGATIVE_INFINITY,(o=n.exclusiveMinimum)!=null?o:Number.NEGATIVE_INFINITY))!=null?i:null,e.maxValue=(l=Math.min((a=n.maximum)!=null?a:Number.POSITIVE_INFINITY,(d=n.exclusiveMaximum)!=null?d:Number.POSITIVE_INFINITY))!=null?l:null,e.isInt=((p=n.format)!=null?p:"").includes("int")||Number.isSafeInteger((h=n.multipleOf)!=null?h:.5),e.isFinite=!0,e.format=(g=n.format)!=null?g:null});function qt(e){return cf(Ac,e)}const Mg=x("ZodNumberFormat",(e,t)=>{uh.init(e,t),Ac.init(e,t)});function ia(e){return lf(Mg,e)}const jg=x("ZodBoolean",(e,t)=>{dh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>If(e,n,r)});function fe(e){return uf(jg,e)}const Ug=x("ZodAny",(e,t)=>{ph.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Of()});function Pc(){return df(Ug)}const Zg=x("ZodUnknown",(e,t)=>{hh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Nf()});function aa(){return pf(Zg)}const qg=x("ZodNever",(e,t)=>{fh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$f(e,n,r)});function Hg(e){return hf(qg,e)}const Fg=x("ZodArray",(e,t)=>{gh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zf(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Do(n,r)),e.nonempty=n=>e.check(Do(1,n)),e.max=(n,r)=>e.check(yc(n,r)),e.length=(n,r)=>e.check(wc(n,r)),e.unwrap=()=>e.element});function ct(e,t){return Tf(Fg,e,t)}const Bg=x("ZodObject",(e,t)=>{bh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>qf(e,n,r,o),ne(e,"shape",()=>t.shape),e.keyof=()=>mt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone(D(y({},e._zod.def),{catchall:n})),e.passthrough=()=>e.clone(D(y({},e._zod.def),{catchall:aa()})),e.loose=()=>e.clone(D(y({},e._zod.def),{catchall:aa()})),e.strict=()=>e.clone(D(y({},e._zod.def),{catchall:Hg()})),e.strip=()=>e.clone(D(y({},e._zod.def),{catchall:void 0})),e.extend=n=>Dd(e,n),e.safeExtend=n=>Md(e,n),e.merge=n=>jd(e,n),e.pick=n=>Od(e,n),e.omit=n=>Nd(e,n),e.partial=(...n)=>Ud(zc,e,n[0]),e.required=(...n)=>Zd(Ic,e,n[0])});function he(e,t){const n=y({type:"object",shape:e!=null?e:{}},U(t));return new Bg(n)}const Rc=x("ZodUnion",(e,t)=>{_c.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Hf(e,n,r,o),e.options=t.options});function Gg(e,t){return new Rc(y({type:"union",options:e},U(t)))}const Wg=x("ZodDiscriminatedUnion",(e,t)=>{Rc.init(e,t),kh.init(e,t)});function Lc(e,t,n){return new Wg(y({type:"union",options:t,discriminator:e},U(n)))}const Jg=x("ZodIntersection",(e,t)=>{_h.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ff(e,n,r,o)});function Vg(e,t){return new Jg({type:"intersection",left:e,right:t})}const Yg=x("ZodRecord",(e,t)=>{vh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Bf(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function jt(e,t,n){return new Yg(y({type:"record",keyType:e,valueType:t},U(n)))}const Is=x("ZodEnum",(e,t)=>{yh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Df(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const a of r)if(n.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Is(D(y(D(y({},t),{checks:[]}),U(o)),{entries:i}))},e.exclude=(r,o)=>{const i=y({},t.entries);for(const a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Is(D(y(D(y({},t),{checks:[]}),U(o)),{entries:i}))}});function mt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Is(y({type:"enum",entries:n},U(t)))}const Xg=x("ZodLiteral",(e,t)=>{wh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mf(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function gt(e,t){return new Xg(y({type:"literal",values:Array.isArray(e)?e:[e]},U(t)))}const Kg=x("ZodTransform",(e,t)=>{xh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Uf(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ec(e.constructor.name);n.addIssue=i=>{var a,d,l;if(typeof i=="string")n.issues.push(Zr(i,n.value,t));else{const p=i;p.fatal&&(p.continue=!1),(a=p.code)!=null||(p.code="custom"),(d=p.input)!=null||(p.input=n.value),(l=p.inst)!=null||(p.inst=e),n.issues.push(Zr(p))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function Qg(e){return new Kg({type:"transform",transform:e})}const zc=x("ZodOptional",(e,t)=>{vc.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ec(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ca(e){return new zc({type:"optional",innerType:e})}const em=x("ZodExactOptional",(e,t)=>{Sh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ec(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function tm(e){return new em({type:"optional",innerType:e})}const nm=x("ZodNullable",(e,t)=>{Th.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function la(e){return new nm({type:"nullable",innerType:e})}const rm=x("ZodDefault",(e,t)=>{Eh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Jf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function om(e,t){return new rm({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():oc(t)}})}const sm=x("ZodPrefault",(e,t)=>{Ch.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Vf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function im(e,t){return new sm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():oc(t)}})}const Ic=x("ZodNonOptional",(e,t)=>{Ah.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Wf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function am(e,t){return new Ic(y({type:"nonoptional",innerType:e},U(t)))}const cm=x("ZodCatch",(e,t)=>{Ph.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Yf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lm(e,t){return new cm({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const um=x("ZodPipe",(e,t)=>{Rh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Xf(e,n,r,o),e.in=t.in,e.out=t.out});function ua(e,t){return new um({type:"pipe",in:e,out:t})}const dm=x("ZodReadonly",(e,t)=>{Lh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Kf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function pm(e){return new dm({type:"readonly",innerType:e})}const hm=x("ZodCustom",(e,t)=>{zh.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jf(e,n)});function fm(e,t={}){return Ef(hm,e,t)}function gm(e){return Cf(e)}const mm=he({name:P().min(1).max(100).optional(),command:P().min(1).max(500),args:ct(P()).optional(),failOnError:fe().default(!0).optional(),timeout:qt().int().min(1e3).max(3e5).default(3e4).optional(),workingDirectory:P().optional(),env:jt(P(),P()).optional(),runOnBackground:fe().optional(),agentTags:ct(P()).optional()});he({name:P(),command:P(),success:fe(),exitCode:qt().optional(),stdout:P().optional(),stderr:P().optional(),error:P().optional(),duration:qt(),failOnError:fe()});const En=he({path:P(),extraCommands:ct(mm).optional(),id:P().uuid().optional(),rotationKey:P().optional(),usageStatus:mt(["free","in_use"]).optional(),agentTags:ct(P()).optional()}),bm=Lc("operation",[En.extend({operation:gt("create"),content:P().optional(),contentPath:P().optional(),encoding:mt(["utf-8","base64"]).optional()}),En.extend({operation:gt("merge"),data:jt(P(),Pc()),mergeStrategy:mt(["deep","shallow"]).optional(),arrayMergeStrategy:mt(["concat","replace"]).optional()}),En.extend({operation:gt("modify"),content:P().optional(),contentPath:P().optional(),createIfMissing:fe().optional()}),En.extend({operation:gt("delete"),ignoreIfMissing:fe().optional()}),En.extend({operation:gt("createDirectory"),contentPath:P().optional(),mode:qt().optional(),ignoreIfExists:fe().optional()}),En.extend({operation:gt("download"),url:P().url(),headers:jt(P(),P()).optional(),timeout:qt().min(1e3).max(3e5).optional()}),En.extend({operation:gt("gitClone"),gitUrl:P(),gitSecretKey:P().optional(),sourceBranch:P().optional(),targetBranch:P().optional(),originalBranch:P().optional(),defaultBranch:P().optional()})]);var Ee=(e=>(e.PENDING="pending",e.ASSIGNED="assigned",e.IN_PROGRESS="in_progress",e.WAITING_FOR_INPUT="waiting_for_input",e.WAITING_FOR_PLAN_APPROVAL="waiting_for_plan_approval",e.PLAN_APPROVED="plan_approved",e.PLAN_REJECTED="plan_rejected",e.COMPLETED="completed",e.FAILED="failed",e.CANCELLED="cancelled",e.RESULT_REJECTED="result_rejected",e))(Ee||{});const km=he({type:mt(["json","file","regex"]).describe("Extraction method"),source:P().describe("Source to extract from (file path or stdout/stderr)"),schema:he({}).passthrough().optional().describe("JSON schema for validation"),pattern:P().optional().describe("Regex pattern for extraction")}),_m=he({type:mt(["issue_update","bulk_issue_update","notification","webhook"]).describe("Hook type"),config:Pc().describe("Hook-specific configuration")});he({command:P().optional().describe("Legacy — unused in SDK mode"),args:ct(P()).optional().describe("Legacy — unused in SDK mode"),env:jt(P(),P()).optional().describe("Environment variables"),workingDirectory:P().optional().describe("Working directory for command execution"),fileOperations:ct(bm).optional().describe("File operations to perform during setup"),gitUrl:P().optional().describe("Git repository URL (populated from project)"),gitPrivateKey:P().optional().describe("Git SSH private key (populated from project)"),gitCommitMessage:P().optional().describe("Commit message for git operations"),resultExtraction:km.optional().describe("Schema for extracting result data"),postExecutionHooks:ct(_m).optional().describe("Hooks to run after task completion"),executionMode:mt(["claudeAgentSdk","openaiAgentSdk","opencodeSdk","cursorSdk","codexSdk"]).optional().default("claudeAgentSdk").describe("Execution mode (default: claudeAgentSdk)"),executionPlan:Lc("executionMode",[he({executionMode:gt("claudeAgentSdk"),promptText:P(),sdkOptions:he({model:P(),permissionMode:mt(["plan","acceptEdits","bypassPermissions","ask"]),settingSources:ct(P()),allowDangerouslySkipPermissions:fe(),persistSession:fe(),streamSdkEvents:fe().optional(),allowedTools:ct(P()).optional(),settings:he({enabledPlugins:jt(P(),fe())}),env:jt(P(),P()).optional()}),resume:he({sessionId:P().optional(),continue:fe()}).optional()}),he({executionMode:gt("opencodeSdk"),promptText:P(),sdkOptions:he({provider:P(),model:P(),allowedTools:ct(P()).optional(),env:jt(P(),P()).optional()}),resume:he({sessionId:P().optional(),continue:fe()}).optional()}),he({executionMode:gt("openaiAgentSdk"),promptText:P(),sdkOptions:he({model:P(),env:jt(P(),P()).optional()}),resume:he({sessionId:P().optional(),continue:fe()}).optional()}),he({executionMode:gt("codexSdk"),promptText:P(),sdkOptions:he({model:P().optional(),sandboxMode:mt(["read-only","workspace-write","danger-full-access"]).optional(),approvalPolicy:mt(["never","on-request","on-failure","untrusted"]).optional(),env:jt(P(),P()).optional()}),resume:he({sessionId:P().optional(),continue:fe()}).optional()}),he({executionMode:gt("cursorSdk"),promptText:P(),sdkOptions:he({model:P(),env:jt(P(),P()).optional()}),resume:he({sessionId:P().optional(),continue:fe()}).optional()})]).optional().describe("Backend-built prompt + resolved SDK options for this phase"),planEnabled:fe().optional().default(!1).describe("Enable planning phase (computed at runtime for agent)"),planContent:P().optional().describe("Final approved plan content"),planApproved:fe().optional().describe("Plan approval status"),planApprovedAt:P().optional().describe("ISO timestamp of approval"),planRejected:fe().optional().describe("Plan rejection flag"),planRejectionFeedback:P().optional().describe("User rejection feedback"),rejectedPlanContent:P().optional().describe("Previously rejected plan content"),planCompletedAt:P().optional().describe("ISO timestamp when plan was generated"),planRejectedAt:P().optional().describe("ISO timestamp when plan was rejected"),resultRejectionFeedback:P().optional().describe("User feedback when rejecting the result (most recent)"),resultRejectedAt:P().optional().describe("ISO timestamp when result was rejected (most recent)"),resultRejectionHistory:ct(he({feedback:P(),rejectedAt:P()})).optional().describe("All rejection messages in chronological order"),notificationChannelPlanMessageId:qt().optional(),notificationChannelPlanMessageSentAt:P().optional(),notificationChannelCompletedMessageId:qt().optional(),notificationChannelFailedMessageId:qt().optional(),streamSdkEvents:fe().optional().describe("Stream SDK messages (thinking, tool calls, etc.) as sdk_event chunks"),originalTaskSummary:P().optional().describe("Summary from the original task run (passed to retry for historical context)"),planWasApproved:fe().optional().describe("True when planApproved was cleared for rePlan=true retry — indicates the plan had been approved before"),planComments:ct(he({id:P(),selectedText:P(),startOffset:qt(),endOffset:qt(),commentText:P(),createdAt:P()})).optional().describe("Inline review comments attached to the plan"),hasAiConfigSecrets:fe().optional().describe("True when AI Config has secret-backed env vars; agent must fetch resolved values via /tasks/:id/resolve-secrets"),hasCredentials:fe().optional().describe("True when the task has credentials attached; agent must fetch resolved values via /tasks/:id/resolve-credentials"),mcpServersMode:mt(["all","ignoreExistingMcpServers"]).optional().describe("MCP server strategy for this run; 'ignoreExistingMcpServers' overrides the existing .mcp.json with only the template's configured servers plus the agent-platform server"),enableBrowserTools:fe().optional().describe("When true, the MCP server registers browser_interact and browser_get_context (browser_automate tasks only)")});Ee.PENDING+"",Ee.CANCELLED,Ee.ASSIGNED+"",Ee.CANCELLED,Ee.IN_PROGRESS+"",Ee.CANCELLED,Ee.FAILED,Ee.WAITING_FOR_INPUT+"",Ee.CANCELLED,Ee.WAITING_FOR_PLAN_APPROVAL+"",Ee.CANCELLED,Ee.PLAN_APPROVED+"",Ee.CANCELLED,Ee.PLAN_REJECTED+"",Ee.CANCELLED,Ee.COMPLETED+"",Ee.RESULT_REJECTED+"",Ee.CANCELLED,Ee.FAILED+"",Ee.CANCELLED+"";const $c="browser_capture",vm="browser_automate";function da(e){let t=(e||"").trim().toLowerCase();const n=t.indexOf("@");return n>=0&&(t=t.slice(n+1)),t=t.split("/")[0].split(":")[0],t.startsWith("www.")&&(t=t.slice(4)),t}function ym(e,t){const n=da(e),r=(t||"").trim().toLowerCase();if(!n||!r)return!1;if(r.startsWith("*.")){const o=r.slice(2);return n===o||n.endsWith("."+o)}return n===da(r)}function pa(e,t){var i;let n;try{const a=new URL(e);if(a.protocol!=="http:"&&a.protocol!=="https:")return null;n=a.hostname}catch(a){return null}let r=null,o=-1;for(const a of t)for(const d of(i=a.domains)!=null?i:[])ym(n,d)&&d.length>o&&(o=d.length,r=a.id);return r}class Oc extends Error{}function Nc(e){return z(this,null,function*(){if(!e.ok){const t=yield e.json().catch(()=>({message:`HTTP ${e.status}`})),n=t.message||t.error||`HTTP ${e.status}`;throw e.status===401?new Oc(n):new Error(n)}return e.json()})}const wm=3e4;let Dc=wm;function xm(e){Number.isFinite(e)&&e>0&&(Dc=e)}function jo(r){return z(this,arguments,function*(e,t={},n=Dc){const o=new AbortController,i=setTimeout(()=>o.abort(),n);try{return yield fetch(e,D(y({},t),{signal:o.signal}))}catch(a){throw a instanceof DOMException&&a.name==="AbortError"?new Error(`Request timed out after ${Math.round(n/1e3)}s. Please check your connection and try again.`):a}finally{clearTimeout(i)}})}function Fe(e,t,n,r){return z(this,null,function*(){const i=`${e.backendUrl.replace(/\/+$/,"")}/api${n}`,a=yield jo(i,{method:t,headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:r!==void 0?JSON.stringify(r):void 0});return Nc(a)})}function Sm(e,t){return z(this,null,function*(){return Fe(e,"GET",`/projects/by-key/${encodeURIComponent(t)}`)})}const Tm=["project","note","ctx"];function Em(e){var n,r;const t=Tm.filter(o=>e[o]===void 0||e[o]===null);if(t.length>0)throw new Error(`createTask: missing required field(s): ${t.join(", ")}`);if(!((n=e.project)!=null&&n.id)&&!((r=e.project)!=null&&r.key))throw new Error("createTask: project must have an id or key")}function $s(e,t){return z(this,null,function*(){var h,g,m,k,w,v;Em(t);const{project:n,note:r,ctx:o,advancedOpts:i,titleOverride:a,titleInstruction:d,allowSubmit:l,type:p=$c}=t;return Fe(e,"POST","/tasks",D(y(y(y(y(y(y(y(y(y(y(y(y(D(y({type:p,title:a||r.slice(0,120)||o.pageTitle||"Browser capture",titleInstruction:d!=null?d:r},n.id?{projectId:n.id}:{projectKey:n.key}),{autoAssign:!0}),i!=null&&i.claudeTemplateId?{claudeTemplateId:i.claudeTemplateId}:{}),(i==null?void 0:i.quickMode)!==void 0?{quickMode:i.quickMode}:{}),(i==null?void 0:i.modelOverride)!=null?{modelOverride:i.modelOverride}:{}),(i==null?void 0:i.claudeProfileId)!=null?{claudeProfileId:i.claudeProfileId}:{}),(i==null?void 0:i.effort)!=null?{effort:i.effort}:{}),(i==null?void 0:i.executionMode)!=null?{executionMode:i.executionMode}:{}),(h=i==null?void 0:i.selectedPluginIds)!=null&&h.length?{selectedPluginIds:i.selectedPluginIds}:{}),(g=i==null?void 0:i.selectedSkillIds)!=null&&g.length?{selectedSkillIds:i.selectedSkillIds}:{}),(m=i==null?void 0:i.selectedPluginSkillIds)!=null&&m.length?{selectedPluginSkillIds:i.selectedPluginSkillIds}:{}),(k=i==null?void 0:i.selectedMcpServerIds)!=null&&k.length?{selectedMcpServerIds:i.selectedMcpServerIds}:{}),(w=i==null?void 0:i.selectedSlashCommandIds)!=null&&w.length?{selectedSlashCommandIds:i.selectedSlashCommandIds}:{}),(v=i==null?void 0:i.selectedRemoteContextProviderIds)!=null&&v.length?{selectedRemoteContextProviderIds:i.selectedRemoteContextProviderIds}:{}),{metadata:y({type:p,note:r,source:"web-sdk",pageUrl:o.pageUrl,pageTitle:o.pageTitle,elementText:o.elementText,cssSelector:o.cssSelector,elementOuterHtml:o.elementOuterHtml,ancestry:o.ancestry,elementRole:o.elementRole,elementAriaLabel:o.elementAriaLabel,enclosingSection:o.enclosingSection,description:o.description,canonicalUrl:o.canonicalUrl,lang:o.lang,ogTitle:o.ogTitle,ogDescription:o.ogDescription,ogType:o.ogType,ogSiteName:o.ogSiteName,viewportWidth:o.viewportWidth,viewportHeight:o.viewportHeight,scrollX:o.scrollX,scrollY:o.scrollY,selectionText:o.selectionText,capturedAt:o.capturedAt,interactionSteps:o.interactionSteps},l!==void 0?{allowSubmit:l}:{})}))})}function ha(e,t){return z(this,null,function*(){return $s(e,D(y({},t),{type:vm}))})}function fa(e,t,n,r){return z(this,null,function*(){var o;return Fe(e,"POST","/planning-sessions",y(D(y({},t.id?{projectId:t.id}:{projectKey:t.key}),{instruction:n,quickMode:(o=r==null?void 0:r.quickMode)!=null?o:!1}),r!=null&&r.claudeTemplateId?{claudeTemplateId:r.claudeTemplateId}:{}))})}function Cm(e,t){return z(this,null,function*(){const n=t?`?projectId=${encodeURIComponent(t)}`:"";return Fe(e,"GET",`/claude-templates${n}`)})}function Mc(e,t){return z(this,null,function*(){return Fe(e,"GET",`/tasks/${t}`)})}function Am(e,t){return z(this,null,function*(){return Fe(e,"GET",`/planning-sessions/${t}`)})}function ga(e){return z(this,null,function*(){return Fe(e,"GET","/projects")})}function Pm(e){return z(this,null,function*(){return(yield Fe(e,"GET","/tenants/current")).membership})}function ma(e,t){if(!e||e.includes("tenant:*")||e.includes(t))return!0;const n=t.split(":")[0];return e.includes(`${n}:*`)}function Os(e,t,n){return z(this,null,function*(){const o=`${e.backendUrl.replace(/\/+$/,"")}/api/auth/tokens/exchange-code`,i=yield jo(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,origin:n})});return Nc(i)})}function Rm(e,t){return z(this,null,function*(){return Fe(e,"GET",`/tasks/${t}/browser-commands/pending`)})}function Lm(e,t,n,r,o){return z(this,null,function*(){return Fe(e,"POST",`/tasks/${t}/browser-commands/${n}/result`,{status:r,message:o})})}function zm(e,t){return z(this,null,function*(){return Fe(e,"GET",`/tasks/${t}/chunks`)})}function Im(e,t,n){return z(this,null,function*(){return Fe(e,"POST",`/tasks/${t}/instructions`,{content:n})})}function $m(e,t){return z(this,null,function*(){return Fe(e,"POST",`/tasks/${t}/cancel`)})}function Om(e,t){return z(this,null,function*(){return Fe(e,"POST",`/tasks/${t}/approve-result`)})}function Nm(e,t,n){return z(this,null,function*(){return Fe(e,"POST",`/tasks/${t}/reject-result`,{feedback:n})})}function Uo(e,t){return z(this,null,function*(){return Fe(e,"GET",`/tasks/${t}/interactions?filter=unanswered`)})}function jc(e,t,n,r){return z(this,null,function*(){return Fe(e,"POST",`/tasks/${t}/interactions/${n}/answer`,{answer:r})})}function Dm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vs={exports:{}};/*!
1512
- * Pusher JavaScript Library v8.5.0
1513
- * https://pusher.com/
1514
- *
1515
- * Copyright 2020, Pusher
1516
- * Released under the MIT licence.
1517
- */var ba;function Mm(){return ba||(ba=1,(function(e,t){(function(r,o){e.exports=o()})(self,()=>(()=>{var n={594(a,d){var l=this&&this.__extends||(function(){var M=function(E,T){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,N){C.__proto__=N}||function(C,N){for(var J in N)N.hasOwnProperty(J)&&(C[J]=N[J])},M(E,T)};return function(E,T){M(E,T);function C(){this.constructor=E}E.prototype=T===null?Object.create(T):(C.prototype=T.prototype,new C)}})();Object.defineProperty(d,"__esModule",{value:!0});var p=256,h=(function(){function M(E){E===void 0&&(E="="),this._paddingCharacter=E}return M.prototype.encodedLength=function(E){return this._paddingCharacter?(E+2)/3*4|0:(E*8+5)/6|0},M.prototype.encode=function(E){for(var T="",C=0;C<E.length-2;C+=3){var N=E[C]<<16|E[C+1]<<8|E[C+2];T+=this._encodeByte(N>>>18&63),T+=this._encodeByte(N>>>12&63),T+=this._encodeByte(N>>>6&63),T+=this._encodeByte(N>>>0&63)}var J=E.length-C;if(J>0){var N=E[C]<<16|(J===2?E[C+1]<<8:0);T+=this._encodeByte(N>>>18&63),T+=this._encodeByte(N>>>12&63),J===2?T+=this._encodeByte(N>>>6&63):T+=this._paddingCharacter||"",T+=this._paddingCharacter||""}return T},M.prototype.maxDecodedLength=function(E){return this._paddingCharacter?E/4*3|0:(E*6+7)/8|0},M.prototype.decodedLength=function(E){return this.maxDecodedLength(E.length-this._getPaddingLength(E))},M.prototype.decode=function(E){if(E.length===0)return new Uint8Array(0);for(var T=this._getPaddingLength(E),C=E.length-T,N=new Uint8Array(this.maxDecodedLength(C)),J=0,ye=0,Oe=0,Be=0,te=0,we=0,ot=0;ye<C-4;ye+=4)Be=this._decodeChar(E.charCodeAt(ye+0)),te=this._decodeChar(E.charCodeAt(ye+1)),we=this._decodeChar(E.charCodeAt(ye+2)),ot=this._decodeChar(E.charCodeAt(ye+3)),N[J++]=Be<<2|te>>>4,N[J++]=te<<4|we>>>2,N[J++]=we<<6|ot,Oe|=Be&p,Oe|=te&p,Oe|=we&p,Oe|=ot&p;if(ye<C-1&&(Be=this._decodeChar(E.charCodeAt(ye)),te=this._decodeChar(E.charCodeAt(ye+1)),N[J++]=Be<<2|te>>>4,Oe|=Be&p,Oe|=te&p),ye<C-2&&(we=this._decodeChar(E.charCodeAt(ye+2)),N[J++]=te<<4|we>>>2,Oe|=we&p),ye<C-3&&(ot=this._decodeChar(E.charCodeAt(ye+3)),N[J++]=we<<6|ot,Oe|=ot&p),Oe!==0)throw new Error("Base64Coder: incorrect characters for decoding");return N},M.prototype._encodeByte=function(E){var T=E;return T+=65,T+=25-E>>>8&6,T+=51-E>>>8&-75,T+=61-E>>>8&-15,T+=62-E>>>8&3,String.fromCharCode(T)},M.prototype._decodeChar=function(E){var T=p;return T+=(42-E&E-44)>>>8&-p+E-43+62,T+=(46-E&E-48)>>>8&-p+E-47+63,T+=(47-E&E-58)>>>8&-p+E-48+52,T+=(64-E&E-91)>>>8&-p+E-65+0,T+=(96-E&E-123)>>>8&-p+E-97+26,T},M.prototype._getPaddingLength=function(E){var T=0;if(this._paddingCharacter){for(var C=E.length-1;C>=0&&E[C]===this._paddingCharacter;C--)T++;if(E.length<4||T>2)throw new Error("Base64Coder: incorrect padding")}return T},M})();d.Coder=h;var g=new h;function m(M){return g.encode(M)}d.encode=m;function k(M){return g.decode(M)}d.decode=k;var w=(function(M){l(E,M);function E(){return M!==null&&M.apply(this,arguments)||this}return E.prototype._encodeByte=function(T){var C=T;return C+=65,C+=25-T>>>8&6,C+=51-T>>>8&-75,C+=61-T>>>8&-13,C+=62-T>>>8&49,String.fromCharCode(C)},E.prototype._decodeChar=function(T){var C=p;return C+=(44-T&T-46)>>>8&-p+T-45+62,C+=(94-T&T-96)>>>8&-p+T-95+63,C+=(47-T&T-58)>>>8&-p+T-48+52,C+=(64-T&T-91)>>>8&-p+T-65+0,C+=(96-T&T-123)>>>8&-p+T-97+26,C},E})(h);d.URLSafeCoder=w;var v=new w;function Z(M){return v.encode(M)}d.encodeURLSafe=Z;function K(M){return v.decode(M)}d.decodeURLSafe=K,d.encodedLength=function(M){return g.encodedLength(M)},d.maxDecodedLength=function(M){return g.maxDecodedLength(M)},d.decodedLength=function(M){return g.decodedLength(M)}},978(a,d){var l="utf8: invalid source encoding";function p(h){for(var g=[],m=0;m<h.length;m++){var k=h[m];if(k&128){var w=void 0;if(k<224){if(m>=h.length)throw new Error(l);var v=h[++m];if((v&192)!==128)throw new Error(l);k=(k&31)<<6|v&63,w=128}else if(k<240){if(m>=h.length-1)throw new Error(l);var v=h[++m],Z=h[++m];if((v&192)!==128||(Z&192)!==128)throw new Error(l);k=(k&15)<<12|(v&63)<<6|Z&63,w=2048}else if(k<248){if(m>=h.length-2)throw new Error(l);var v=h[++m],Z=h[++m],K=h[++m];if((v&192)!==128||(Z&192)!==128||(K&192)!==128)throw new Error(l);k=(k&15)<<18|(v&63)<<12|(Z&63)<<6|K&63,w=65536}else throw new Error(l);if(k<w||k>=55296&&k<=57343)throw new Error(l);if(k>=65536){if(k>1114111)throw new Error(l);k-=65536,g.push(String.fromCharCode(55296|k>>10)),k=56320|k&1023}}g.push(String.fromCharCode(k))}return g.join("")}d.D4=p},721(a,d,l){a.exports=l(207).default},207(a,d,l){l.d(d,{default:()=>io});class p{constructor(s,c){this.lastId=0,this.prefix=s,this.name=c}create(s){this.lastId++;var c=this.lastId,f=this.prefix+c,b=this.name+"["+c+"]",S=!1,R=function(){S||(s.apply(null,arguments),S=!0)};return this[c]=R,{number:c,id:f,name:b,callback:R}}remove(s){delete this[s.number]}}var h=new p("_pusher_script_","Pusher.ScriptReceivers"),g={VERSION:"8.5.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""};const m=g;class k{constructor(s){this.options=s,this.receivers=s.receivers||h,this.loading={}}load(s,c,f){var b=this;if(b.loading[s]&&b.loading[s].length>0)b.loading[s].push(f);else{b.loading[s]=[f];var S=G.createScriptRequest(b.getPath(s,c)),R=b.receivers.create(function(O){if(b.receivers.remove(R),b.loading[s]){var B=b.loading[s];delete b.loading[s];for(var ee=function(Pe){Pe||S.cleanup()},re=0;re<B.length;re++)B[re](O,ee)}});S.send(R)}}getRoot(s){var c,f=G.getDocument().location.protocol;return s&&s.useTLS||f==="https:"?c=this.options.cdn_https:c=this.options.cdn_http,c.replace(/\/*$/,"")+"/"+this.options.version}getPath(s,c){return this.getRoot(c)+"/"+s+this.options.suffix+".js"}}var w=new p("_pusher_dependencies","Pusher.DependenciesReceivers"),v=new k({cdn_http:m.cdn_http,cdn_https:m.cdn_https,version:m.VERSION,suffix:m.dependency_suffix,receivers:w});const Z={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},M={buildLogSuffix:function(u){const s="See:",c=Z.urls[u];if(!c)return"";let f;return c.fullUrl?f=c.fullUrl:c.path&&(f=Z.baseUrl+c.path),f?`${s} ${f}`:""}};var E;(function(u){u.UserAuthentication="user-authentication",u.ChannelAuthorization="channel-authorization"})(E||(E={}));class T extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class C extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class N extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class J extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class ye extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class Oe extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class Be extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class te extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class we extends Error{constructor(s,c){super(c),this.status=s,Object.setPrototypeOf(this,new.target.prototype)}}const nn=function(u,s,c,f,b){const S=G.createXHR();S.open("POST",c.endpoint,!0),S.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var R in c.headers)S.setRequestHeader(R,c.headers[R]);if(c.headersProvider!=null){let O=c.headersProvider();for(var R in O)S.setRequestHeader(R,O[R])}return S.onreadystatechange=function(){if(S.readyState===4)if(S.status===200){let O,B=!1;try{O=JSON.parse(S.responseText),B=!0}catch(ee){b(new we(200,`JSON returned from ${f.toString()} endpoint was invalid, yet status code was 200. Data was: ${S.responseText}`),null)}B&&b(null,O)}else{let O="";switch(f){case E.UserAuthentication:O=M.buildLogSuffix("authenticationEndpoint");break;case E.ChannelAuthorization:O=`Clients must be authorized to join private or presence channels. ${M.buildLogSuffix("authorizationEndpoint")}`;break}b(new we(S.status,`Unable to retrieve auth string from ${f.toString()} endpoint - received status: ${S.status} from ${c.endpoint}. ${O}`),null)}},S.send(s),S};function rn(u){return pe(sn(u))}var dt=String.fromCharCode,It="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",on=function(u){var s=u.charCodeAt(0);return s<128?u:s<2048?dt(192|s>>>6)+dt(128|s&63):dt(224|s>>>12&15)+dt(128|s>>>6&63)+dt(128|s&63)},sn=function(u){return u.replace(/[^\x00-\x7F]/g,on)},$t=function(u){var s=[0,2,1][u.length%3],c=u.charCodeAt(0)<<16|(u.length>1?u.charCodeAt(1):0)<<8|(u.length>2?u.charCodeAt(2):0),f=[It.charAt(c>>>18),It.charAt(c>>>12&63),s>=2?"=":It.charAt(c>>>6&63),s>=1?"=":It.charAt(c&63)];return f.join("")},pe=window.btoa||function(u){return u.replace(/[\s\S]{1,3}/g,$t)};class vt{constructor(s,c,f,b){this.clear=c,this.timer=s(()=>{this.timer&&(this.timer=b(this.timer))},f)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}const _e=vt;function yn(u){window.clearTimeout(u)}function le(u){window.clearInterval(u)}class Ge extends _e{constructor(s,c){super(setTimeout,yn,s,function(f){return c(),null})}}class an extends _e{constructor(s,c){super(setInterval,le,s,function(f){return c(),f})}}var yt={now(){return Date.now?Date.now():new Date().valueOf()},defer(u){return new Ge(0,u)},method(u,...s){var c=Array.prototype.slice.call(arguments,1);return function(f){return f[u].apply(f,c.concat(arguments))}}};const xe=yt;function Te(u,...s){for(var c=0;c<s.length;c++){var f=s[c];for(var b in f)f[b]&&f[b].constructor&&f[b].constructor===Object?u[b]=Te(u[b]||{},f[b]):u[b]=f[b]}return u}function H(){for(var u=["Pusher"],s=0;s<arguments.length;s++)typeof arguments[s]=="string"?u.push(arguments[s]):u.push(Ae(arguments[s]));return u.join(" : ")}function oe(u,s){var c=Array.prototype.indexOf;if(u===null)return-1;if(c&&u.indexOf===c)return u.indexOf(s);for(var f=0,b=u.length;f<b;f++)if(u[f]===s)return f;return-1}function Q(u,s){for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&s(u[c],c,u)}function Ne(u){var s=[];return Q(u,function(c,f){s.push(f)}),s}function We(u){var s=[];return Q(u,function(c){s.push(c)}),s}function je(u,s,c){for(var f=0;f<u.length;f++)s.call(c||window,u[f],f,u)}function Ft(u,s){for(var c=[],f=0;f<u.length;f++)c.push(s(u[f],f,u,c));return c}function wt(u,s){var c={};return Q(u,function(f,b){c[b]=s(f)}),c}function De(u,s){s=s||function(b){return!!b};for(var c=[],f=0;f<u.length;f++)s(u[f],f,u,c)&&c.push(u[f]);return c}function Ce(u,s){var c={};return Q(u,function(f,b){(s&&s(f,b,u,c)||f)&&(c[b]=f)}),c}function ze(u){var s=[];return Q(u,function(c,f){s.push([f,c])}),s}function Ue(u,s){for(var c=0;c<u.length;c++)if(s(u[c],c,u))return!0;return!1}function fr(u,s){for(var c=0;c<u.length;c++)if(!s(u[c],c,u))return!1;return!0}function Ye(u){return wt(u,function(s){return typeof s=="object"&&(s=Ae(s)),encodeURIComponent(rn(s.toString()))})}function st(u){var s=Ce(u,function(f){return f!==void 0}),c=Ft(ze(Ye(s)),xe.method("join","=")).join("&");return c}function xt(u){var s=[],c=[];return(function f(b,S){var R,O,B;switch(typeof b){case"object":if(!b)return null;for(R=0;R<s.length;R+=1)if(s[R]===b)return{$ref:c[R]};if(s.push(b),c.push(S),Object.prototype.toString.apply(b)==="[object Array]")for(B=[],R=0;R<b.length;R+=1)B[R]=f(b[R],S+"["+R+"]");else{B={};for(O in b)Object.prototype.hasOwnProperty.call(b,O)&&(B[O]=f(b[O],S+"["+JSON.stringify(O)+"]"))}return B;case"number":case"string":case"boolean":return b}})(u,"$")}function Ae(u){try{return JSON.stringify(u)}catch(s){return JSON.stringify(xt(u))}}class gr{constructor(){this.globalLog=s=>{window.console&&window.console.log&&window.console.log(s)}}debug(...s){this.log(this.globalLog,s)}warn(...s){this.log(this.globalLogWarn,s)}error(...s){this.log(this.globalLogError,s)}globalLogWarn(s){window.console&&window.console.warn?window.console.warn(s):this.globalLog(s)}globalLogError(s){window.console&&window.console.error?window.console.error(s):this.globalLogWarn(s)}log(s,...c){var f=H.apply(this,arguments);io.log?io.log(f):io.logToConsole&&s.bind(this)(f)}}const ue=new gr;var Wr=function(u,s,c,f,b){(c.headers!==void 0||c.headersProvider!=null)&&ue.warn(`To send headers with the ${f.toString()} request, you must use AJAX, rather than JSONP.`);var S=u.nextAuthCallbackID.toString();u.nextAuthCallbackID++;var R=u.getDocument(),O=R.createElement("script");u.auth_callbacks[S]=function(re){b(null,re)};var B="Pusher.auth_callbacks['"+S+"']";O.src=c.endpoint+"?callback="+encodeURIComponent(B)+"&"+s;var ee=R.getElementsByTagName("head")[0]||R.documentElement;ee.insertBefore(O,ee.firstChild)};const mr=Wr;class Jr{constructor(s){this.src=s}send(s){var c=this,f="Error loading "+c.src;c.script=document.createElement("script"),c.script.id=s.id,c.script.src=c.src,c.script.type="text/javascript",c.script.charset="UTF-8",c.script.addEventListener?(c.script.onerror=function(){s.callback(f)},c.script.onload=function(){s.callback(null)}):c.script.onreadystatechange=function(){(c.script.readyState==="loaded"||c.script.readyState==="complete")&&s.callback(null)},c.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(c.errorScript=document.createElement("script"),c.errorScript.id=s.id+"_error",c.errorScript.text=s.name+"('"+f+"');",c.script.async=c.errorScript.async=!1):c.script.async=!0;var b=document.getElementsByTagName("head")[0];b.insertBefore(c.script,b.firstChild),c.errorScript&&b.insertBefore(c.errorScript,c.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Mn{constructor(s,c){this.url=s,this.data=c}send(s){if(!this.request){var c=st(this.data),f=this.url+"/"+s.number+"?"+c;this.request=G.createScriptRequest(f),this.request.send(s)}}cleanup(){this.request&&this.request.cleanup()}}var jn=function(u,s){return function(c,f){var b="http"+(s?"s":"")+"://",S=b+(u.host||u.options.host)+u.options.path,R=G.createJSONPRequest(S,c),O=G.ScriptReceivers.create(function(B,ee){h.remove(O),R.cleanup(),ee&&ee.host&&(u.host=ee.host),f&&f(B,ee)});R.send(O)}},St={name:"jsonp",getAgent:jn};const cn=St;function wn(u,s,c){var f=u+(s.useTLS?"s":""),b=s.useTLS?s.hostTLS:s.hostNonTLS;return f+"://"+b+c}function xn(u,s){var c="/app/"+u,f="?protocol="+m.PROTOCOL+"&client=js&version="+m.VERSION+(s?"&"+s:"");return c+f}var ss={getInitial:function(u,s){var c=(s.httpPath||"")+xn(u,"flash=false");return wn("ws",s,c)}},Un={getInitial:function(u,s){var c=(s.httpPath||"/pusher")+xn(u);return wn("http",s,c)}},Zn={getInitial:function(u,s){return wn("http",s,s.httpPath||"/pusher")},getPath:function(u,s){return xn(u)}};class is{constructor(){this._callbacks={}}get(s){return this._callbacks[Bt(s)]}add(s,c,f){var b=Bt(s);this._callbacks[b]=this._callbacks[b]||[],this._callbacks[b].push({fn:c,context:f})}remove(s,c,f){if(!s&&!c&&!f){this._callbacks={};return}var b=s?[Bt(s)]:Ne(this._callbacks);c||f?this.removeCallback(b,c,f):this.removeAllCallbacks(b)}removeCallback(s,c,f){je(s,function(b){this._callbacks[b]=De(this._callbacks[b]||[],function(S){return c&&c!==S.fn||f&&f!==S.context}),this._callbacks[b].length===0&&delete this._callbacks[b]},this)}removeAllCallbacks(s){je(s,function(c){delete this._callbacks[c]},this)}}function Bt(u){return"_"+u}class Tt{constructor(s){this.callbacks=new is,this.global_callbacks=[],this.failThrough=s}bind(s,c,f){return this.callbacks.add(s,c,f),this}bind_global(s){return this.global_callbacks.push(s),this}unbind(s,c,f){return this.callbacks.remove(s,c,f),this}unbind_global(s){return s?(this.global_callbacks=De(this.global_callbacks||[],c=>c!==s),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(s,c,f){for(var b=0;b<this.global_callbacks.length;b++)this.global_callbacks[b](s,c);var S=this.callbacks.get(s),R=[];if(f?R.push(c,f):c&&R.push(c),S&&S.length>0)for(var b=0;b<S.length;b++)S[b].fn.apply(S[b].context||window,R);else this.failThrough&&this.failThrough(s,c);return this}}class as extends Tt{constructor(s,c,f,b,S){super(),this.initialize=G.transportConnectionInitializer,this.hooks=s,this.name=c,this.priority=f,this.key=b,this.options=S,this.state="new",this.timeline=S.timeline,this.activityTimeout=S.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var s=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(s,this.options)}catch(c){return xe.defer(()=>{this.onError(c),this.changeState("closed")}),!1}return this.bindListeners(),ue.debug("Connecting",{transport:this.name,url:s}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(s){return this.state==="open"?(xe.defer(()=>{this.socket&&this.socket.send(s)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(s){this.emit("error",{type:"WebSocketError",error:s}),this.timeline.error(this.buildTimelineMessage({error:s.toString()}))}onClose(s){s?this.changeState("closed",{code:s.code,reason:s.reason,wasClean:s.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(s){this.emit("message",s)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=s=>{this.onError(s)},this.socket.onclose=s=>{this.onClose(s)},this.socket.onmessage=s=>{this.onMessage(s)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(s,c){this.state=s,this.timeline.info(this.buildTimelineMessage({state:s,params:c})),this.emit(s,c)}buildTimelineMessage(s){return Te({cid:this.id},s)}}class de{constructor(s){this.hooks=s}isSupported(s){return this.hooks.isSupported(s)}createConnection(s,c,f,b){return new as(this.hooks,s,c,f,b)}}var ln=new de({urls:ss,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!G.getWebSocketAPI()},isSupported:function(){return!!G.getWebSocketAPI()},getSocket:function(u){return G.createWebSocket(u)}}),Vr={urls:Un,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},br=Te({getSocket:function(u){return G.HTTPFactory.createStreamingSocket(u)}},Vr),qn=Te({getSocket:function(u){return G.HTTPFactory.createPollingSocket(u)}},Vr),kr={isSupported:function(){return G.isXHRSupported()}},Yr=new de(Te({},br,kr)),cs=new de(Te({},qn,kr)),pt={ws:ln,xhr_streaming:Yr,xhr_polling:cs};const ht=pt;var Xr=new de({file:"sockjs",urls:Zn,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(u,s){return new window.SockJS(u,null,{js_path:v.getPath("sockjs",{useTLS:s.useTLS}),ignore_null_origin:s.ignoreNullOrigin})},beforeOpen:function(u,s){u.send(JSON.stringify({path:s}))}}),_r={isSupported:function(u){var s=G.isXDRSupported(u.useTLS);return s}},vr=new de(Te({},br,_r)),Kr=new de(Te({},qn,_r));ht.xdr_streaming=vr,ht.xdr_polling=Kr,ht.sockjs=Xr;const Et=ht;class Qr extends Tt{constructor(){super();var s=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){s.emit("online")},!1),window.addEventListener("offline",function(){s.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var eo=new Qr;class to{constructor(s,c,f){this.manager=s,this.transport=c,this.minPingDelay=f.minPingDelay,this.maxPingDelay=f.maxPingDelay,this.pingDelay=void 0}createConnection(s,c,f,b){b=Te({},b,{activityTimeout:this.pingDelay});var S=this.transport.createConnection(s,c,f,b),R=null,O=function(){S.unbind("open",O),S.bind("closed",B),R=xe.now()},B=ee=>{if(S.unbind("closed",B),ee.code===1002||ee.code===1003)this.manager.reportDeath();else if(!ee.wasClean&&R){var re=xe.now()-R;re<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(re/2,this.minPingDelay))}};return S.bind("open",O),S}isSupported(s){return this.manager.isAlive()&&this.transport.isSupported(s)}}const yr={decodeMessage:function(u){try{var s=JSON.parse(u.data),c=s.data;if(typeof c=="string")try{c=JSON.parse(s.data)}catch(b){}var f={event:s.event,channel:s.channel,data:c};return s.user_id&&(f.user_id=s.user_id),f}catch(b){throw{type:"MessageParseError",error:b,data:u.data}}},encodeMessage:function(u){return JSON.stringify(u)},processHandshake:function(u){var s=yr.decodeMessage(u);if(s.event==="pusher:connection_established"){if(!s.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:s.data.socket_id,activityTimeout:s.data.activity_timeout*1e3}}else{if(s.event==="pusher:error")return{action:this.getCloseAction(s.data),error:this.getCloseError(s.data)};throw"Invalid handshake"}},getCloseAction:function(u){return u.code<4e3?u.code>=1002&&u.code<=1004?"backoff":null:u.code===4e3?"tls_only":u.code<4100?"refused":u.code<4200?"backoff":u.code<4300?"retry":"refused"},getCloseError:function(u){return u.code!==1e3&&u.code!==1001?{type:"PusherError",data:{code:u.code,message:u.reason||u.message}}:null}},Gt=yr;class j extends Tt{constructor(s,c){super(),this.id=s,this.transport=c,this.activityTimeout=c.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(s){return this.transport.send(s)}send_event(s,c,f){var b={event:s,data:c};return f&&(b.channel=f),ue.debug("Event sent",b),this.send(Gt.encodeMessage(b))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var s={message:f=>{var b;try{b=Gt.decodeMessage(f)}catch(S){this.emit("error",{type:"MessageParseError",error:S,data:f.data})}if(b!==void 0){switch(ue.debug("Event recd",b),b.event){case"pusher:error":this.emit("error",{type:"PusherError",data:b.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",b)}},activity:()=>{this.emit("activity")},error:f=>{this.emit("error",f)},closed:f=>{c(),f&&f.code&&this.handleCloseEvent(f),this.transport=null,this.emit("closed")}},c=()=>{Q(s,(f,b)=>{this.transport.unbind(b,f)})};Q(s,(f,b)=>{this.transport.bind(b,f)})}handleCloseEvent(s){var c=Gt.getCloseAction(s),f=Gt.getCloseError(s);f&&this.emit("error",f),c&&this.emit(c,{action:c,error:f})}}class _{constructor(s,c){this.transport=s,this.callback=c,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=s=>{this.unbindListeners();var c;try{c=Gt.processHandshake(s)}catch(f){this.finish("error",{error:f}),this.transport.close();return}c.action==="connected"?this.finish("connected",{connection:new j(c.id,this.transport),activityTimeout:c.activityTimeout}):(this.finish(c.action,{error:c.error}),this.transport.close())},this.onClosed=s=>{this.unbindListeners();var c=Gt.getCloseAction(s)||"backoff",f=Gt.getCloseError(s);this.finish(c,{error:f})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(s,c){this.callback(Te({transport:this.transport,action:s},c))}}class A{constructor(s,c){this.timeline=s,this.options=c||{}}send(s,c){this.timeline.isEmpty()||this.timeline.send(G.TimelineTransport.getAgent(this,s),c)}}class I extends Tt{constructor(s,c){super(function(f,b){ue.debug("No callbacks on "+s+" for "+f)}),this.name=s,this.pusher=c,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(s,c){return c(null,{auth:""})}trigger(s,c){if(s.indexOf("client-")!==0)throw new T("Event '"+s+"' does not start with 'client-'");if(!this.subscribed){var f=M.buildLogSuffix("triggeringClientEvents");ue.warn(`Client event triggered before channel 'subscription_succeeded' event . ${f}`)}return this.pusher.send_event(s,c,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(s){var c=s.event,f=s.data;if(c==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(s);else if(c==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(s);else if(c.indexOf("pusher_internal:")!==0){var b={};this.emit(c,f,b)}}handleSubscriptionSucceededEvent(s){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",s.data)}handleSubscriptionCountEvent(s){s.data.subscription_count&&(this.subscriptionCount=s.data.subscription_count),this.emit("pusher:subscription_count",s.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(s,c)=>{s?(this.subscriptionPending=!1,ue.error(s.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:s.message},s instanceof we?{status:s.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:c.auth,channel_data:c.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class se extends I{authorize(s,c){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:s},c)}}class Me{constructor(){this.reset()}get(s){return Object.prototype.hasOwnProperty.call(this.members,s)?{id:s,info:this.members[s]}:null}each(s){Q(this.members,(c,f)=>{s(this.get(f))})}setMyID(s){this.myID=s}onSubscription(s){this.members=s.presence.hash,this.count=s.presence.count,this.me=this.get(this.myID)}addMember(s){return this.get(s.user_id)===null&&this.count++,this.members[s.user_id]=s.user_info,this.get(s.user_id)}removeMember(s){var c=this.get(s.user_id);return c&&(delete this.members[s.user_id],this.count--),c}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var Se=function(u,s,c,f){function b(S){return S instanceof c?S:new c(function(R){R(S)})}return new(c||(c=Promise))(function(S,R){function O(re){try{ee(f.next(re))}catch(Pe){R(Pe)}}function B(re){try{ee(f.throw(re))}catch(Pe){R(Pe)}}function ee(re){re.done?S(re.value):b(re.value).then(O,B)}ee((f=f.apply(u,s||[])).next())})};class Je extends se{constructor(s,c){super(s,c),this.members=new Me}authorize(s,c){super.authorize(s,(f,b)=>Se(this,void 0,void 0,function*(){if(!f)if(b=b,b.channel_data!=null){var S=JSON.parse(b.channel_data);this.members.setMyID(S.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let R=M.buildLogSuffix("authorizationEndpoint");ue.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${R}, or the user should be signed in.`),c("Invalid auth response");return}c(f,b)}))}handleEvent(s){var c=s.event;if(c.indexOf("pusher_internal:")===0)this.handleInternalEvent(s);else{var f=s.data,b={};s.user_id&&(b.user_id=s.user_id),this.emit(c,f,b)}}handleInternalEvent(s){var c=s.event,f=s.data;switch(c){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(s);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(s);break;case"pusher_internal:member_added":var b=this.members.addMember(f);this.emit("pusher:member_added",b);break;case"pusher_internal:member_removed":var S=this.members.removeMember(f);S&&this.emit("pusher:member_removed",S);break}}handleSubscriptionSucceededEvent(s){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(s.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Ct=l(978),Ot=l(594);class wr extends se{constructor(s,c,f){super(s,c),this.key=null,this.nacl=f}authorize(s,c){super.authorize(s,(f,b)=>{if(f){c(f,b);return}let S=b.shared_secret;if(!S){c(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=(0,Ot.decode)(S),delete b.shared_secret,c(null,b)})}trigger(s,c){throw new Oe("Client events are not currently supported for encrypted channels")}handleEvent(s){var c=s.event,f=s.data;if(c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0){super.handleEvent(s);return}this.handleEncryptedEvent(c,f)}handleEncryptedEvent(s,c){if(!this.key){ue.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!c.ciphertext||!c.nonce){ue.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+c);return}let f=(0,Ot.decode)(c.ciphertext);if(f.length<this.nacl.secretbox.overheadLength){ue.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${f.length}`);return}let b=(0,Ot.decode)(c.nonce);if(b.length<this.nacl.secretbox.nonceLength){ue.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${b.length}`);return}let S=this.nacl.secretbox.open(f,b,this.key);if(S===null){ue.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(R,O)=>{if(R){ue.error(`Failed to make a request to the authEndpoint: ${O}. Unable to fetch new key, so dropping encrypted event`);return}if(S=this.nacl.secretbox.open(f,b,this.key),S===null){ue.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(s,this.getDataToEmit(S))});return}this.emit(s,this.getDataToEmit(S))}getDataToEmit(s){let c=(0,Ct.D4)(s);try{return JSON.parse(c)}catch(f){return c}}}class Ie extends Tt{constructor(s,c){super(),this.state="initialized",this.connection=null,this.key=s,this.options=c,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var f=G.getNetwork();f.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),f.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(s){this.key=s,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(s){return this.connection?this.connection.send(s):!1}send_event(s,c,f){return this.connection?this.connection.send_event(s,c,f):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var s=(c,f)=>{c?this.runner=this.strategy.connect(0,s):f.action==="error"?(this.emit("error",{type:"HandshakeError",error:f.error}),this.timeline.error({handshakeError:f.error})):(this.abortConnecting(),this.handshakeCallbacks[f.action](f))};this.runner=this.strategy.connect(0,s)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var s=this.abandonConnection();s.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(s){this.timeline.info({action:"retry",delay:s}),s>0&&this.emit("connecting_in",Math.round(s/1e3)),this.retryTimer=new Ge(s||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new Ge(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Ge(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Ge(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(s){return Te({},s,{message:c=>{this.resetActivityCheck(),this.emit("message",c)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:c=>{this.emit("error",c)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(s){return Te({},s,{connected:c=>{this.activityTimeout=Math.min(this.options.activityTimeout,c.activityTimeout,c.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(c.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let s=c=>f=>{f.error&&this.emit("error",{type:"WebSocketError",error:f.error}),c(f)};return{tls_only:s(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:s(()=>{this.disconnect()}),backoff:s(()=>{this.retryIn(1e3)}),retry:s(()=>{this.retryIn(0)})}}setConnection(s){this.connection=s;for(var c in this.connectionCallbacks)this.connection.bind(c,this.connectionCallbacks[c]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var s in this.connectionCallbacks)this.connection.unbind(s,this.connectionCallbacks[s]);var c=this.connection;return this.connection=null,c}}updateState(s,c){var f=this.state;if(this.state=s,f!==s){var b=s;b==="connected"&&(b+=" with new socket ID "+c.socket_id),ue.debug("State changed",f+" -> "+b),this.timeline.info({state:s,params:c}),this.emit("state_change",{previous:f,current:s}),this.emit(s,c)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class no{constructor(){this.channels={}}add(s,c){return this.channels[s]||(this.channels[s]=ro(s,c)),this.channels[s]}all(){return We(this.channels)}find(s){return this.channels[s]}remove(s){var c=this.channels[s];return delete this.channels[s],c}disconnect(){Q(this.channels,function(s){s.disconnect()})}}function ro(u,s){if(u.indexOf("private-encrypted-")===0){if(s.config.nacl)return Wt.createEncryptedChannel(u,s,s.config.nacl);let c="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",f=M.buildLogSuffix("encryptedChannelSupport");throw new Oe(`${c}. ${f}`)}else{if(u.indexOf("private-")===0)return Wt.createPrivateChannel(u,s);if(u.indexOf("presence-")===0)return Wt.createPresenceChannel(u,s);if(u.indexOf("#")===0)throw new C('Cannot create a channel with name "'+u+'".');return Wt.createChannel(u,s)}}var Dl={createChannels(){return new no},createConnectionManager(u,s){return new Ie(u,s)},createChannel(u,s){return new I(u,s)},createPrivateChannel(u,s){return new se(u,s)},createPresenceChannel(u,s){return new Je(u,s)},createEncryptedChannel(u,s,c){return new wr(u,s,c)},createTimelineSender(u,s){return new A(u,s)},createHandshake(u,s){return new _(u,s)},createAssistantToTheTransportManager(u,s,c){return new to(u,s,c)}};const Wt=Dl;class wi{constructor(s){this.options=s||{},this.livesLeft=this.options.lives||1/0}getAssistant(s){return Wt.createAssistantToTheTransportManager(this,s,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Sn{constructor(s,c){this.strategies=s,this.loop=!!c.loop,this.failFast=!!c.failFast,this.timeout=c.timeout,this.timeoutLimit=c.timeoutLimit}isSupported(){return Ue(this.strategies,xe.method("isSupported"))}connect(s,c){var f=this.strategies,b=0,S=this.timeout,R=null,O=(B,ee)=>{ee?c(null,ee):(b=b+1,this.loop&&(b=b%f.length),b<f.length?(S&&(S=S*2,this.timeoutLimit&&(S=Math.min(S,this.timeoutLimit))),R=this.tryStrategy(f[b],s,{timeout:S,failFast:this.failFast},O)):c(!0))};return R=this.tryStrategy(f[b],s,{timeout:S,failFast:this.failFast},O),{abort:function(){R.abort()},forceMinPriority:function(B){s=B,R&&R.forceMinPriority(B)}}}tryStrategy(s,c,f,b){var S=null,R=null;return f.timeout>0&&(S=new Ge(f.timeout,function(){R.abort(),b(!0)})),R=s.connect(c,function(O,B){O&&S&&S.isRunning()&&!f.failFast||(S&&S.ensureAborted(),b(O,B))}),{abort:function(){S&&S.ensureAborted(),R.abort()},forceMinPriority:function(O){R.forceMinPriority(O)}}}}class ls{constructor(s){this.strategies=s}isSupported(){return Ue(this.strategies,xe.method("isSupported"))}connect(s,c){return Ml(this.strategies,s,function(f,b){return function(S,R){if(b[f].error=S,S){jl(b)&&c(!0);return}je(b,function(O){O.forceMinPriority(R.transport.priority)}),c(null,R)}})}}function Ml(u,s,c){var f=Ft(u,function(b,S,R,O){return b.connect(s,c(S,O))});return{abort:function(){je(f,Ul)},forceMinPriority:function(b){je(f,function(S){S.forceMinPriority(b)})}}}function jl(u){return fr(u,function(s){return!!s.error})}function Ul(u){!u.error&&!u.aborted&&(u.abort(),u.aborted=!0)}class Zl{constructor(s,c,f){this.strategy=s,this.transports=c,this.ttl=f.ttl||18e5,this.usingTLS=f.useTLS,this.timeline=f.timeline}isSupported(){return this.strategy.isSupported()}connect(s,c){var f=this.usingTLS,b=ql(f),S=b&&b.cacheSkipCount?b.cacheSkipCount:0,R=[this.strategy];if(b&&b.timestamp+this.ttl>=xe.now()){var O=this.transports[b.transport];O&&(["ws","wss"].includes(b.transport)||S>3?(this.timeline.info({cached:!0,transport:b.transport,latency:b.latency}),R.push(new Sn([O],{timeout:b.latency*2+1e3,failFast:!0}))):S++)}var B=xe.now(),ee=R.pop().connect(s,function re(Pe,ao){Pe?(xi(f),R.length>0?(B=xe.now(),ee=R.pop().connect(s,re)):c(Pe)):(Hl(f,ao.transport.name,xe.now()-B,S),c(null,ao))});return{abort:function(){ee.abort()},forceMinPriority:function(re){s=re,ee&&ee.forceMinPriority(re)}}}}function us(u){return"pusherTransport"+(u?"TLS":"NonTLS")}function ql(u){var s=G.getLocalStorage();if(s)try{var c=s[us(u)];if(c)return JSON.parse(c)}catch(f){xi(u)}return null}function Hl(u,s,c,f){var b=G.getLocalStorage();if(b)try{b[us(u)]=Ae({timestamp:xe.now(),transport:s,latency:c,cacheSkipCount:f})}catch(S){}}function xi(u){var s=G.getLocalStorage();if(s)try{delete s[us(u)]}catch(c){}}class oo{constructor(s,{delay:c}){this.strategy=s,this.options={delay:c}}isSupported(){return this.strategy.isSupported()}connect(s,c){var f=this.strategy,b,S=new Ge(this.options.delay,function(){b=f.connect(s,c)});return{abort:function(){S.ensureAborted(),b&&b.abort()},forceMinPriority:function(R){s=R,b&&b.forceMinPriority(R)}}}}class xr{constructor(s,c,f){this.test=s,this.trueBranch=c,this.falseBranch=f}isSupported(){var s=this.test()?this.trueBranch:this.falseBranch;return s.isSupported()}connect(s,c){var f=this.test()?this.trueBranch:this.falseBranch;return f.connect(s,c)}}class Fl{constructor(s){this.strategy=s}isSupported(){return this.strategy.isSupported()}connect(s,c){var f=this.strategy.connect(s,function(b,S){S&&f.abort(),c(b,S)});return f}}function Sr(u){return function(){return u.isSupported()}}var Bl=function(u,s,c){var f={};function b(Ni,qu,Hu,Fu,Bu){var Di=c(u,Ni,qu,Hu,Fu,Bu);return f[Ni]=Di,Di}var S=Object.assign({},s,{hostNonTLS:u.wsHost+":"+u.wsPort,hostTLS:u.wsHost+":"+u.wssPort,httpPath:u.wsPath}),R=Object.assign({},S,{useTLS:!0}),O=Object.assign({},s,{hostNonTLS:u.httpHost+":"+u.httpPort,hostTLS:u.httpHost+":"+u.httpsPort,httpPath:u.httpPath}),B={loop:!0,timeout:15e3,timeoutLimit:6e4},ee=new wi({minPingDelay:1e4,maxPingDelay:u.activityTimeout}),re=new wi({lives:2,minPingDelay:1e4,maxPingDelay:u.activityTimeout}),Pe=b("ws","ws",3,S,ee),ao=b("wss","ws",3,R,ee),Du=b("sockjs","sockjs",1,O),Ri=b("xhr_streaming","xhr_streaming",1,O,re),Mu=b("xdr_streaming","xdr_streaming",1,O,re),Li=b("xhr_polling","xhr_polling",1,O),ju=b("xdr_polling","xdr_polling",1,O),zi=new Sn([Pe],B),Uu=new Sn([ao],B),Zu=new Sn([Du],B),Ii=new Sn([new xr(Sr(Ri),Ri,Mu)],B),$i=new Sn([new xr(Sr(Li),Li,ju)],B),Oi=new Sn([new xr(Sr(Ii),new ls([Ii,new oo($i,{delay:4e3})]),$i)],B),hs=new xr(Sr(Oi),Oi,Zu),fs;return s.useTLS?fs=new ls([zi,new oo(hs,{delay:2e3})]):fs=new ls([zi,new oo(Uu,{delay:2e3}),new oo(hs,{delay:5e3})]),new Zl(new Fl(new xr(Sr(Pe),fs,hs)),f,{ttl:18e5,timeline:s.timeline,useTLS:s.useTLS})};const Gl=Bl;function Wl(){var u=this;u.timeline.info(u.buildTimelineMessage({transport:u.name+(u.options.useTLS?"s":"")})),u.hooks.isInitialized()?u.changeState("initialized"):u.hooks.file?(u.changeState("initializing"),v.load(u.hooks.file,{useTLS:u.options.useTLS},function(s,c){u.hooks.isInitialized()?(u.changeState("initialized"),c(!0)):(s&&u.onError(s),u.onClose(),c(!1))})):u.onClose()}var Jl={getRequest:function(u){var s=new window.XDomainRequest;return s.ontimeout=function(){u.emit("error",new N),u.close()},s.onerror=function(c){u.emit("error",c),u.close()},s.onprogress=function(){s.responseText&&s.responseText.length>0&&u.onChunk(200,s.responseText)},s.onload=function(){s.responseText&&s.responseText.length>0&&u.onChunk(200,s.responseText),u.emit("finished",200),u.close()},s},abortRequest:function(u){u.ontimeout=u.onerror=u.onprogress=u.onload=null,u.abort()}};const Vl=Jl,Yl=256*1024;class Xl extends Tt{constructor(s,c,f){super(),this.hooks=s,this.method=c,this.url=f}start(s){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},G.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(s)}close(){this.unloader&&(G.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(s,c){for(;;){var f=this.advanceBuffer(c);if(f)this.emit("chunk",{status:s,data:f});else break}this.isBufferTooLong(c)&&this.emit("buffer_too_long")}advanceBuffer(s){var c=s.slice(this.position),f=c.indexOf(`
1518
- `);return f!==-1?(this.position+=f+1,c.slice(0,f)):null}isBufferTooLong(s){return this.position===s.length&&s.length>Yl}}var ds;(function(u){u[u.CONNECTING=0]="CONNECTING",u[u.OPEN=1]="OPEN",u[u.CLOSED=3]="CLOSED"})(ds||(ds={}));const Tn=ds;var Kl=1;class Ql{constructor(s,c){this.hooks=s,this.session=Ti(1e3)+"/"+ru(8),this.location=eu(c),this.readyState=Tn.CONNECTING,this.openStream()}send(s){return this.sendRaw(JSON.stringify([s]))}ping(){this.hooks.sendHeartbeat(this)}close(s,c){this.onClose(s,c,!0)}sendRaw(s){if(this.readyState===Tn.OPEN)try{return G.createSocketRequest("POST",Si(tu(this.location,this.session))).start(s),!0}catch(c){return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(s,c,f){this.closeStream(),this.readyState=Tn.CLOSED,this.onclose&&this.onclose({code:s,reason:c,wasClean:f})}onChunk(s){if(s.status===200){this.readyState===Tn.OPEN&&this.onActivity();var c,f=s.data.slice(0,1);switch(f){case"o":c=JSON.parse(s.data.slice(1)||"{}"),this.onOpen(c);break;case"a":c=JSON.parse(s.data.slice(1)||"[]");for(var b=0;b<c.length;b++)this.onEvent(c[b]);break;case"m":c=JSON.parse(s.data.slice(1)||"null"),this.onEvent(c);break;case"h":this.hooks.onHeartbeat(this);break;case"c":c=JSON.parse(s.data.slice(1)||"[]"),this.onClose(c[0],c[1],!0);break}}}onOpen(s){this.readyState===Tn.CONNECTING?(s&&s.hostname&&(this.location.base=nu(this.location.base,s.hostname)),this.readyState=Tn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(s){this.readyState===Tn.OPEN&&this.onmessage&&this.onmessage({data:s})}onActivity(){this.onactivity&&this.onactivity()}onError(s){this.onerror&&this.onerror(s)}openStream(){this.stream=G.createSocketRequest("POST",Si(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",s=>{this.onChunk(s)}),this.stream.bind("finished",s=>{this.hooks.onFinished(this,s)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(s){xe.defer(()=>{this.onError(s),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function eu(u){var s=/([^\?]*)\/*(\??.*)/.exec(u);return{base:s[1],queryString:s[2]}}function tu(u,s){return u.base+"/"+s+"/xhr_send"}function Si(u){var s=u.indexOf("?")===-1?"?":"&";return u+s+"t="+ +new Date+"&n="+Kl++}function nu(u,s){var c=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(u);return c[1]+s+c[3]}function Ti(u){return G.randomInt(u)}function ru(u){for(var s=[],c=0;c<u;c++)s.push(Ti(32).toString(32));return s.join("")}const ou=Ql;var su={getReceiveURL:function(u,s){return u.base+"/"+s+"/xhr_streaming"+u.queryString},onHeartbeat:function(u){u.sendRaw("[]")},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,s){u.onClose(1006,"Connection interrupted ("+s+")",!1)}};const iu=su;var au={getReceiveURL:function(u,s){return u.base+"/"+s+"/xhr"+u.queryString},onHeartbeat:function(){},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,s){s===200?u.reconnect():u.onClose(1006,"Connection interrupted ("+s+")",!1)}};const cu=au;var lu={getRequest:function(u){var s=G.getXHRAPI(),c=new s;return c.onreadystatechange=c.onprogress=function(){switch(c.readyState){case 3:c.responseText&&c.responseText.length>0&&u.onChunk(c.status,c.responseText);break;case 4:c.responseText&&c.responseText.length>0&&u.onChunk(c.status,c.responseText),u.emit("finished",c.status),u.close();break}},c},abortRequest:function(u){u.onreadystatechange=null,u.abort()}};const uu=lu;var du={createStreamingSocket(u){return this.createSocket(iu,u)},createPollingSocket(u){return this.createSocket(cu,u)},createSocket(u,s){return new ou(u,s)},createXHR(u,s){return this.createRequest(uu,u,s)},createRequest(u,s,c){return new Xl(u,s,c)}};const Ei=du;Ei.createXDR=function(u,s){return this.createRequest(Vl,u,s)};var pu={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:h,DependenciesReceivers:w,getDefaultStrategy:Gl,Transports:Et,transportConnectionInitializer:Wl,HTTPFactory:Ei,TimelineTransport:cn,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(u){window.Pusher=u;var s=()=>{this.onDocumentBody(u.ready)};window.JSON?s():v.load("json2",{},s)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:nn,jsonp:mr}},onDocumentBody(u){document.body?u():setTimeout(()=>{this.onDocumentBody(u)},0)},createJSONPRequest(u,s){return new Mn(u,s)},createScriptRequest(u){return new Jr(u)},getLocalStorage(){try{return window.localStorage}catch(u){return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var u=this.getXHRAPI();return new u},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return eo},createWebSocket(u){var s=this.getWebSocketAPI();return new s(u)},createSocketRequest(u,s){if(this.isXHRSupported())return this.HTTPFactory.createXHR(u,s);if(this.isXDRSupported(s.indexOf("https:")===0))return this.HTTPFactory.createXDR(u,s);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var u=this.getXHRAPI();return!!u&&new u().withCredentials!==void 0},isXDRSupported(u){var s=u?"https:":"http:",c=this.getProtocol();return!!window.XDomainRequest&&c===s},addUnloadListener(u){window.addEventListener!==void 0?window.addEventListener("unload",u,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",u)},removeUnloadListener(u){window.addEventListener!==void 0?window.removeEventListener("unload",u,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",u)},randomInt(u){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*u)}};const G=pu;var ps;(function(u){u[u.ERROR=3]="ERROR",u[u.INFO=6]="INFO",u[u.DEBUG=7]="DEBUG"})(ps||(ps={}));const so=ps;class hu{constructor(s,c,f){this.key=s,this.session=c,this.events=[],this.options=f||{},this.sent=0,this.uniqueID=0}log(s,c){s<=this.options.level&&(this.events.push(Te({},c,{timestamp:xe.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(s){this.log(so.ERROR,s)}info(s){this.log(so.INFO,s)}debug(s){this.log(so.DEBUG,s)}isEmpty(){return this.events.length===0}send(s,c){var f=Te({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],s(f,(b,S)=>{b||this.sent++,c&&c(b,S)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class fu{constructor(s,c,f,b){this.name=s,this.priority=c,this.transport=f,this.options=b||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(s,c){if(this.isSupported()){if(this.priority<s)return Ci(new J,c)}else return Ci(new te,c);var f=!1,b=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),S=null,R=function(){b.unbind("initialized",R),b.connect()},O=function(){S=Wt.createHandshake(b,function(Pe){f=!0,re(),c(null,Pe)})},B=function(Pe){re(),c(Pe)},ee=function(){re();var Pe;Pe=Ae(b),c(new ye(Pe))},re=function(){b.unbind("initialized",R),b.unbind("open",O),b.unbind("error",B),b.unbind("closed",ee)};return b.bind("initialized",R),b.bind("open",O),b.bind("error",B),b.bind("closed",ee),b.initialize(),{abort:()=>{f||(re(),S?S.close():b.close())},forceMinPriority:Pe=>{f||this.priority<Pe&&(S?S.close():b.close())}}}}function Ci(u,s){return xe.defer(function(){s(u)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:gu}=G;var mu=function(u,s,c,f,b,S){var R=gu[c];if(!R)throw new Be(c);var O=(!u.enabledTransports||oe(u.enabledTransports,s)!==-1)&&(!u.disabledTransports||oe(u.disabledTransports,s)===-1),B;return O?(b=Object.assign({ignoreNullOrigin:u.ignoreNullOrigin},b),B=new fu(s,f,S?S.getAssistant(R):R,b)):B=bu,B},bu={isSupported:function(){return!1},connect:function(u,s){var c=xe.defer(function(){s(new te)});return{abort:function(){c.ensureAborted()},forceMinPriority:function(){}}}};function ku(u){if(u==null)throw"You must pass an options object";if(u.cluster==null)throw"Options object must provide a cluster";"disableStats"in u&&ue.warn("The disableStats option is deprecated in favor of enableStats")}const _u=(u,s)=>{var c="socket_id="+encodeURIComponent(u.socketId);for(var f in s.params)c+="&"+encodeURIComponent(f)+"="+encodeURIComponent(s.params[f]);if(s.paramsProvider!=null){let b=s.paramsProvider();for(var f in b)c+="&"+encodeURIComponent(f)+"="+encodeURIComponent(b[f])}return c},vu=u=>{if(typeof G.getAuthorizers()[u.transport]=="undefined")throw`'${u.transport}' is not a recognized auth transport`;return(s,c)=>{const f=_u(s,u);G.getAuthorizers()[u.transport](G,f,u,E.UserAuthentication,c)}},yu=(u,s)=>{var c="socket_id="+encodeURIComponent(u.socketId);c+="&channel_name="+encodeURIComponent(u.channelName);for(var f in s.params)c+="&"+encodeURIComponent(f)+"="+encodeURIComponent(s.params[f]);if(s.paramsProvider!=null){let b=s.paramsProvider();for(var f in b)c+="&"+encodeURIComponent(f)+"="+encodeURIComponent(b[f])}return c},wu=u=>{if(typeof G.getAuthorizers()[u.transport]=="undefined")throw`'${u.transport}' is not a recognized auth transport`;return(s,c)=>{const f=yu(s,u);G.getAuthorizers()[u.transport](G,f,u,E.ChannelAuthorization,c)}},xu=(u,s,c)=>{const f={authTransport:s.transport,authEndpoint:s.endpoint,auth:{params:s.params,headers:s.headers}};return(b,S)=>{const R=u.channel(b.channelName);c(R,f).authorize(b.socketId,S)}};function Ai(u,s){let c={activityTimeout:u.activityTimeout||m.activityTimeout,cluster:u.cluster,httpPath:u.httpPath||m.httpPath,httpPort:u.httpPort||m.httpPort,httpsPort:u.httpsPort||m.httpsPort,pongTimeout:u.pongTimeout||m.pongTimeout,statsHost:u.statsHost||m.stats_host,unavailableTimeout:u.unavailableTimeout||m.unavailableTimeout,wsPath:u.wsPath||m.wsPath,wsPort:u.wsPort||m.wsPort,wssPort:u.wssPort||m.wssPort,enableStats:Au(u),httpHost:Su(u),useTLS:Cu(u),wsHost:Tu(u),userAuthenticator:Pu(u),channelAuthorizer:Lu(u,s)};return"disabledTransports"in u&&(c.disabledTransports=u.disabledTransports),"enabledTransports"in u&&(c.enabledTransports=u.enabledTransports),"ignoreNullOrigin"in u&&(c.ignoreNullOrigin=u.ignoreNullOrigin),"timelineParams"in u&&(c.timelineParams=u.timelineParams),"nacl"in u&&(c.nacl=u.nacl),c}function Su(u){return u.httpHost?u.httpHost:u.cluster?`sockjs-${u.cluster}.pusher.com`:m.httpHost}function Tu(u){return u.wsHost?u.wsHost:Eu(u.cluster)}function Eu(u){return`ws-${u}.pusher.com`}function Cu(u){return G.getProtocol()==="https:"?!0:u.forceTLS!==!1}function Au(u){return"enableStats"in u?u.enableStats:"disableStats"in u?!u.disableStats:!1}const Pi=u=>"customHandler"in u&&u.customHandler!=null;function Pu(u){const s=Object.assign(Object.assign({},m.userAuthentication),u.userAuthentication);return Pi(s)?s.customHandler:vu(s)}function Ru(u,s){let c;if("channelAuthorization"in u)c=Object.assign(Object.assign({},m.channelAuthorization),u.channelAuthorization);else if(c={transport:u.authTransport||m.authTransport,endpoint:u.authEndpoint||m.authEndpoint},"auth"in u&&("params"in u.auth&&(c.params=u.auth.params),"headers"in u.auth&&(c.headers=u.auth.headers)),"authorizer"in u)return{customHandler:xu(s,c,u.authorizer)};return c}function Lu(u,s){const c=Ru(u,s);return Pi(c)?c.customHandler:wu(c)}class zu extends Tt{constructor(s){super(function(c,f){ue.debug(`No callbacks on watchlist events for ${c}`)}),this.pusher=s,this.bindWatchlistInternalEvent()}handleEvent(s){s.data.events.forEach(c=>{this.emit(c.name,c)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",s=>{var c=s.event;c==="pusher_internal:watchlist_events"&&this.handleEvent(s)})}}function Iu(){let u,s;return{promise:new Promise((f,b)=>{u=f,s=b}),resolve:u,reject:s}}const $u=Iu;class Ou extends Tt{constructor(s){super(function(c,f){ue.debug("No callbacks on user for "+c)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(c,f)=>{if(c){ue.warn(`Error during signin: ${c}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:f.auth,user_data:f.user_data})},this.pusher=s,this.pusher.connection.bind("state_change",({previous:c,current:f})=>{c!=="connected"&&f==="connected"&&this._signin(),c==="connected"&&f!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new zu(s),this.pusher.connection.bind("message",c=>{var f=c.event;f==="pusher:signin_success"&&this._onSigninSuccess(c.data),this.serverToUserChannel&&this.serverToUserChannel.name===c.channel&&this.serverToUserChannel.handleEvent(c)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(s){try{this.user_data=JSON.parse(s.user_data)}catch(c){ue.error(`Failed parsing user data after signin: ${s.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){ue.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const s=c=>{c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.pusher.connection.state==="connected"&&c.subscribe()};this.serverToUserChannel=new I(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((c,f)=>{c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0||this.emit(c,f)}),s(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:s,resolve:c}=$u();s.done=!1;const f=()=>{s.done=!0};s.then(f).catch(f),this.signinDonePromise=s,this._signinDoneResolve=c}}class Ze{static ready(){Ze.isReady=!0;for(var s=0,c=Ze.instances.length;s<c;s++)Ze.instances[s].connect()}static getClientFeatures(){return Ne(Ce({ws:G.Transports.ws},function(s){return s.isSupported({})}))}constructor(s,c){Nu(s),ku(c),this.key=s,this.options=c,this.config=Ai(this.options,this),this.channels=Wt.createChannels(),this.global_emitter=new Tt,this.sessionID=G.randomInt(1e9),this.timeline=new hu(this.key,this.sessionID,{cluster:this.config.cluster,features:Ze.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:so.INFO,version:m.VERSION}),this.config.enableStats&&(this.timelineSender=Wt.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+G.TimelineTransport.name}));var f=b=>G.getDefaultStrategy(this.config,b,mu);this.connection=Wt.createConnectionManager(this.key,{getStrategy:f,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",b=>{var S=b.event,R=S.indexOf("pusher_internal:")===0;if(b.channel){var O=this.channel(b.channel);O&&O.handleEvent(b)}R||this.global_emitter.emit(b.event,b.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",b=>{ue.warn(b)}),Ze.instances.push(this),this.timeline.info({instances:Ze.instances.length}),this.user=new Ou(this),Ze.isReady&&this.connect()}switchCluster(s){const{appKey:c,cluster:f}=s;this.key=c,this.options=Object.assign(Object.assign({},this.options),{cluster:f}),this.config=Ai(this.options,this),this.connection.switchCluster(this.key)}channel(s){return this.channels.find(s)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var s=this.connection.isUsingTLS(),c=this.timelineSender;this.timelineSenderTimer=new an(6e4,function(){c.send(s)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(s,c,f){return this.global_emitter.bind(s,c,f),this}unbind(s,c,f){return this.global_emitter.unbind(s,c,f),this}bind_global(s){return this.global_emitter.bind_global(s),this}unbind_global(s){return this.global_emitter.unbind_global(s),this}unbind_all(s){return this.global_emitter.unbind_all(),this}subscribeAll(){var s;for(s in this.channels.channels)this.channels.channels.hasOwnProperty(s)&&this.subscribe(s)}subscribe(s){var c=this.channels.add(s,this);return c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.connection.state==="connected"&&c.subscribe(),c}unsubscribe(s){var c=this.channels.find(s);c&&c.subscriptionPending?c.cancelSubscription():(c=this.channels.remove(s),c&&c.subscribed&&c.unsubscribe())}send_event(s,c,f){return this.connection.send_event(s,c,f)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}Ze.instances=[],Ze.isReady=!1,Ze.logToConsole=!1,Ze.Runtime=G,Ze.ScriptReceivers=G.ScriptReceivers,Ze.DependenciesReceivers=G.DependenciesReceivers,Ze.auth_callbacks=G.auth_callbacks;const io=Ze;function Nu(u){if(u==null)throw"You must pass your app key when you instantiate Pusher."}G.setup(Ze)}},r={};function o(a){var d=r[a];if(d!==void 0)return d.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,o),l.exports}o.d=(a,d)=>{for(var l in d)o.o(d,l)&&!o.o(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:d[l]})},o.o=(a,d)=>Object.prototype.hasOwnProperty.call(a,d);var i=o(721);return i})())})(vs)),vs.exports}var jm=Mm();const Um=Dm(jm);let zt=null,Hn=null;function Zm(e){return z(this,null,function*(){return Hn||(Hn=z(null,null,function*(){const t=e.backendUrl.replace(/\/+$/,""),n=yield jo(`${t}/api/settings`,{headers:{Authorization:`Bearer ${e.token}`}});if(!n.ok)throw new Error(`Failed to fetch settings: HTTP ${n.status}`);const r=yield n.json();zt=new Um(r.pusher.key,{cluster:r.pusher.cluster||"local",forceTLS:!0,wsHost:r.pusher.wsHost||void 0,wsPort:r.pusher.wssPort,wssPort:r.pusher.wssPort,enabledTransports:r.pusher.wsHost?["ws"]:void 0,channelAuthorization:{customHandler:({socketId:o,channelName:i},a)=>{jo(`${t}/api/pusher/auth`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({socket_id:o,channel_name:i})}).then(d=>d.json()).then(d=>a(null,d)).catch(d=>a(d instanceof Error?d:new Error(String(d)),null))}}})}),Hn.catch(()=>{Hn=null}),Hn)})}function qm(e){if(!e||!zt)return null;let t=!1;const n=({current:r})=>{r==="connected"&&t?(t=!1,e()):r!=="connected"&&(t=!0)};return zt.connection.bind("state_change",n),()=>zt==null?void 0:zt.connection.unbind("state_change",n)}function Hm(e,t,n){return z(this,null,function*(){if(yield Zm(e),!zt)return()=>{};const r=zt.subscribe(`private-task-${t}`);n.onStatusUpdate&&r.bind(lo.TASK_STATUS_UPDATED,n.onStatusUpdate),n.onInteractionCreated&&r.bind(lo.TASK_INTERACTION_CREATED,n.onInteractionCreated),n.onInteractionAnswered&&r.bind(lo.TASK_INTERACTION_ANSWERED,n.onInteractionAnswered),n.onBrowserCommandCreated&&r.bind(lo.TASK_BROWSER_COMMAND_CREATED,n.onBrowserCommandCreated);const o=qm(n.onReconnect);return()=>{r.unbind_all(),zt==null||zt.unsubscribe(`private-task-${t}`),o==null||o()}})}const ei="ap-sdk-active-automation";function Fm(){try{const e=sessionStorage.getItem(ei);if(!e)return null;const t=JSON.parse(e);return t!=null&&t.taskId&&(t!=null&&t.backendUrl)&&(t!=null&&t.title)?t:null}catch(e){return null}}function Uc(e){try{sessionStorage.setItem(ei,JSON.stringify(e))}catch(t){}}function Zc(){try{sessionStorage.removeItem(ei)}catch(e){}}function Bm(e){return z(this,null,function*(){var i;try{(i=e.focus)==null||i.call(e)}catch(a){}e.scrollIntoView({block:"center",inline:"center",behavior:"instant"});let t=e.getBoundingClientRect();t.width===0&&t.height===0&&(yield Gm(),t=e.getBoundingClientRect());const n=t.left+t.width/2,r=t.top+t.height/2,o={bubbles:!0,cancelable:!0,clientX:n,clientY:r};typeof PointerEvent=="function"&&e.dispatchEvent(new PointerEvent("pointerdown",o)),e.dispatchEvent(new MouseEvent("mousedown",o)),typeof PointerEvent=="function"&&e.dispatchEvent(new PointerEvent("pointerup",o)),e.dispatchEvent(new MouseEvent("mouseup",o)),e.click()})}function Gm(){return new Promise(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):setTimeout(e,16)})}const ti="shared",qc="ap-sdk-panel-size:",ka=280,_a=200;function Wm(e){try{const t=sessionStorage.getItem(qc+e);if(!t)return null;const n=JSON.parse(t);return typeof(n==null?void 0:n.width)=="number"&&typeof(n==null?void 0:n.height)=="number"?n:null}catch(t){return null}}function Jm(e,t){try{sessionStorage.setItem(qc+e,JSON.stringify(t))}catch(n){}}function fo(e,t,n){return Math.min(Math.max(e,t),n)}function va(){return window.innerWidth-32}function ya(){return window.innerHeight-64}function ni(e,t){const n=Wm(t);n&&(e.style.width=`${fo(n.width,ka,va())}px`,e.style.height=`${fo(n.height,_a,ya())}px`);const r=document.createElement("div");r.className="ap-sdk-resize-handle",r.setAttribute("data-ap-sdk","1"),e.appendChild(r);let o=!1,i=0,a=0,d=0,l=0,p=0,h=0;const g=k=>{o&&(p=fo(d+(k.clientX-i),ka,va()),h=fo(l+(k.clientY-a),_a,ya()),e.style.width=`${p}px`,e.style.height=`${h}px`)},m=()=>{o&&(o=!1,document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",m),Jm(t,{width:p,height:h}))};r.addEventListener("pointerdown",k=>{k.preventDefault(),k.stopPropagation(),o=!0,i=k.clientX,a=k.clientY;const w=e.getBoundingClientRect();d=w.width,l=w.height,p=d,h=l,document.addEventListener("pointermove",g),document.addEventListener("pointerup",m)})}function ri(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Dn=ri();function Hc(e){Dn=e}var Cn={exec:()=>null};function Fn(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),o=t[r];return o||(o=e(r),t[r]=o),o}}function Y(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Ve.caret,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}var Vm=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch(t){return!1}})(),Ve={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Fn(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Fn(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Fn(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Fn(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Fn(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Fn(e=>new RegExp(`^ {0,${e}}>`))},Ym=/^(?:[ \t]*(?:\n|$))+/,Xm=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Km=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Br=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qm=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,oi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Fc=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Bc=Y(Fc).replace(/bull/g,oi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),eb=Y(Fc).replace(/bull/g,oi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),si=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,tb=/^[^\n]+/,ii=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,nb=Y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ii).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rb=Y(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,oi).getRegex(),ns="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ai=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ob=Y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ai).replace("tag",ns).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Gc=e=>Y(si).replace("hr",Br).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",e).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ns).getRegex(),sb=Gc(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ib=Gc(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),ab=Y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ib).getRegex(),ci={blockquote:ab,code:Xm,def:nb,fences:Km,heading:Qm,hr:Br,html:ob,lheading:Bc,list:rb,newline:Ym,paragraph:sb,table:Cn,text:tb},wa=Y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Br).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ns).getRegex(),cb=D(y({},ci),{lheading:eb,table:wa,paragraph:Y(si).replace("hr",Br).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wa).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ns).getRegex()}),lb=D(y({},ci),{html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ai).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Y(si).replace("hr",Br).replace("heading",` *#{1,6} *[^
1519
- ]`).replace("lheading",Bc).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),ub=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,db=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Wc=/^( {2,}|\\)\n(?!\s*$)/,pb=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tn=/[\p{P}\p{S}]/u,pr=/[\s\p{P}\p{S}]/u,Gr=/[^\s\p{P}\p{S}]/u,hb=Y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,pr).getRegex(),fb=/[\p{Pi}\p{Ps}"']/u,Jc=/(?!~)[\p{P}\p{S}]/u,gb=/(?!~)[\s\p{P}\p{S}]/u,mb=/(?:[^\s\p{P}\p{S}]|~)/u,bb=Y(/link|precode-code|html/,"g").replace("link",new RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)")).replace("precode-",Vm?"(?<!`)()":"(^^|[^`])").replace("code",new RegExp("(?<b>`+)[^`]+\\k<b>(?!`)")).replace("html",/<(?! )[^<>]*?>/).getRegex(),Vc=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,kb=Y(Vc,"u").replace(/punct/g,tn).getRegex(),_b=Y(Vc,"u").replace(/punct/g,Jc).getRegex(),vb=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,yb=Y(vb,"u").replace(/openQuote/g,fb).replace(/punct/g,tn).getRegex(),Yc="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wb=Y(Yc,"gu").replace(/notPunctSpace/g,Gr).replace(/punctSpace/g,pr).replace(/punct/g,tn).getRegex(),xb=Y(Yc,"gu").replace(/notPunctSpace/g,mb).replace(/punctSpace/g,gb).replace(/punct/g,Jc).getRegex(),Sb="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Tb=Y(Sb,"gu").replace(/notPunctSpace/g,Gr).replace(/punctSpace/g,pr).replace(/punct/g,tn).getRegex(),Eb=Y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Gr).replace(/punctSpace/g,pr).replace(/punct/g,tn).getRegex(),Cb="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Ab=Y(Cb,"gu").replace(/notPunctSpace/g,Gr).replace(/punctSpace/g,pr).replace(/punct/g,tn).getRegex(),Pb=Y(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,tn).getRegex(),Rb="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Lb=Y(Rb,"gu").replace(/notPunctSpace/g,Gr).replace(/punctSpace/g,pr).replace(/punct/g,tn).getRegex(),zb=Y(/\\(punct)/,"gu").replace(/punct/g,tn).getRegex(),Ib=Y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$b=Y(ai).replace("(?:-->|$)","-->").getRegex(),Ob=Y("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$b).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Zo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Nb=Y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Zo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xc=Y(/^!?\[(label)\]\[(ref)\]/).replace("label",Zo).replace("ref",ii).getRegex(),Kc=Y(/^!?\[(ref)\](?:\[\])?/).replace("ref",ii).getRegex(),Db=Y("reflink|nolink(?!\\()","g").replace("reflink",Xc).replace("nolink",Kc).getRegex(),xa=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,li={_backpedal:Cn,anyPunctuation:zb,autolink:Ib,blockSkip:bb,br:Wc,code:db,del:Cn,delLDelim:Cn,delRDelim:Cn,emStrongLDelim:kb,emStrongRDelimAst:wb,emStrongRDelimUnd:Eb,escape:ub,link:Nb,nolink:Kc,punctuation:hb,reflink:Xc,reflinkSearch:Db,tag:Ob,text:pb,url:Cn},Mb=D(y({},li),{emStrongLDelim:yb,emStrongRDelimAst:Tb,emStrongRDelimUnd:Ab,link:Y(/^!?\[(label)\]\((.*?)\)/).replace("label",Zo).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Zo).getRegex()}),Ns=D(y({},li),{emStrongRDelimAst:xb,emStrongLDelim:_b,delLDelim:Pb,delRDelim:Lb,url:Y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",xa).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Y(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",xa).getRegex()}),jb=D(y({},Ns),{br:Y(Wc).replace("{2,}","*").getRegex(),text:Y(Ns.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),go={normal:ci,gfm:cb,pedantic:lb},Er={normal:li,gfm:Ns,breaks:jb,pedantic:Mb},Ub={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Sa=e=>Ub[e];function Nt(e,t){if(t){if(Ve.escapeTest.test(e))return e.replace(Ve.escapeReplace,Sa)}else if(Ve.escapeTestNoEncode.test(e))return e.replace(Ve.escapeReplaceNoEncode,Sa);return e}function Ta(e){try{e=encodeURI(e).replace(Ve.percentDecode,"%")}catch(t){return null}return e}function Ea(e,t){var i;let n=e.replace(Ve.findPipe,(a,d,l)=>{let p=!1,h=d;for(;--h>=0&&l[h]==="\\";)p=!p;return p?"|":" |"}),r=n.split(Ve.splitPipe),o=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(Ve.slashPipe,"|");return r}function un(e,t,n){let r=e.length;if(r===0)return"";let o=0;for(;o<r&&e.charAt(r-o-1)===t;)o++;return e.slice(0,r-o)}function Ca(e){let t=e.split(`
1520
- `),n=t.length-1;for(;n>=0&&Ve.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
1521
- `)}function Zb(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function qb(e,t=0){let n=t,r="";for(let o of e)if(o===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=o,n++;return r}function Aa(e,t,n,r,o){let i=t.href,a=t.title||null,d=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:d,tokens:r.inlineTokens(d)};return r.state.inLink=!1,l}function Hb(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let o=r[1];return t.split(`
1522
- `).map(i=>{let a=i.match(n.other.beginningSpace);if(a===null)return i;let[d]=a;return d.length>=o.length?i.slice(o.length):i}).join(`
1523
- `)}var qo=class{constructor(e){ie(this,"options");ie(this,"rules");ie(this,"lexer");this.options=e||Dn}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=this.options.pedantic?t[0]:Ca(t[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Hb(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=un(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:un(t[0],`
1524
- `),depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:un(t[0],`
1525
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=un(t[0],`
1526
- `).split(`
1527
- `),r="",o="",i=[];for(;n.length>0;){let a=!1,d=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))d.push(n[l]),a=!0;else if(!a)d.push(n[l]);else break;n=n.slice(l);let p=d.join(`
1528
- `),h=p.replace(this.rules.other.blockquoteSetextReplace,`
1529
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
1530
- ${p}`:p,o=o?`${o}
1531
- ${h}`:h;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,i,!0),this.lexer.state.top=g,n.length===0)break;let m=i.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){let k=m,w=n.join(`
1532
- `),v=k.raw+`
1533
- `+w.replace(this.rules.other.blockquoteSetextReplace2,""),Z=this.blockquote(v);i[i.length-1]=Z,r=`${r}
1534
- ${w}`,o=o.substring(0,o.length-k.text.length)+Z.text;break}else if((m==null?void 0:m.type)==="list"){let k=m,w=k.raw+`
1535
- `+n.join(`
1536
- `),v=this.list(w);i[i.length-1]=v,r=r.substring(0,r.length-m.raw.length)+v.raw,o=o.substring(0,o.length-k.raw.length)+v.raw,n=w.substring(i.at(-1).raw.length).split(`
1537
- `);continue}}return{type:"blockquote",raw:r,tokens:i,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let i=this.rules.other.listItemRegex(n),a=!1;for(;e;){let l=!1,p="",h="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let g=qb(t[2].split(`
1538
- `,1)[0],t[1].length),m=e.split(`
1539
- `,1)[0],k=!g.trim(),w=0;if(this.options.pedantic?(w=2,h=g.trimStart()):k?w=t[1].length+1:(w=g.search(this.rules.other.nonSpaceChar),w=w>4?1:w,h=g.slice(w),w+=t[1].length),k&&this.rules.other.blankLine.test(m)&&(p+=m+`
1540
- `,e=e.substring(m.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(w),Z=this.rules.other.hrRegex(w),K=this.rules.other.fencesBeginRegex(w),M=this.rules.other.headingBeginRegex(w),E=this.rules.other.htmlBeginRegex(w),T=this.rules.other.blockquoteBeginRegex(w);for(;e;){let C=e.split(`
1541
- `,1)[0],N;if(m=C,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),N=m):N=m.replace(this.rules.other.tabCharGlobal," "),K.test(m)||M.test(m)||E.test(m)||T.test(m)||v.test(m)||Z.test(m))break;if(N.search(this.rules.other.nonSpaceChar)>=w||!m.trim())h+=`
1542
- `+N.slice(w);else{if(k||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||K.test(g)||M.test(g)||Z.test(g))break;h+=`
1543
- `+m}k=!m.trim(),p+=C+`
1544
- `,e=e.substring(C.length+1),g=N.slice(w)}}o.loose||(a?o.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(a=!0)),o.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),o.raw+=p}let d=o.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let l of o.items){this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]);let p=l.tokens[0];if(l.task&&((p==null?void 0:p.type)==="text"||(p==null?void 0:p.type)==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let g={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=g.checked,o.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=g.raw+l.tokens[0].raw,l.tokens[0].text=g.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(g)):l.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):l.tokens.unshift(g)}}else l.task&&(l.task=!1);if(!o.loose){let h=l.tokens.filter(m=>m.type==="space"),g=h.length>0&&h.some(m=>this.rules.other.anyLine.test(m.raw));o.loose=g}}if(o.loose)for(let l of o.items){l.loose=!0;for(let p of l.tokens)p.type==="text"&&(p.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let n=Ca(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:un(t[0],`
1545
- `),href:r,title:o}}}table(e){var a;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Ea(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
1546
- `):[],i={type:"table",raw:un(t[0],`
1547
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let d of r)this.rules.other.tableAlignRight.test(d)?i.align.push("right"):this.rules.other.tableAlignCenter.test(d)?i.align.push("center"):this.rules.other.tableAlignLeft.test(d)?i.align.push("left"):i.align.push(null);for(let d=0;d<n.length;d++)i.header.push({text:n[d],tokens:this.lexer.inline(n[d]),header:!0,align:i.align[d]});for(let d of o)i.rows.push(Ea(d,i.header.length).map((l,p)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[p]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:un(t[0],`
1548
- `),depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
1549
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=un(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=Zb(t[2],"()");if(i===-2)return;if(i>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],o="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],o=i[3])}else o=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Aa(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[r.toLowerCase()];if(!o){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Aa(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let o=[...r[0]].length-1,i,a,d=o,l=0,p=r[0][0],h=n===p,g=p==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,t=t.slice(-1*e.length+o);(r=g.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){d+=a;continue}else if(r[5]||r[6]){if(o%3&&!((o+a)%3)){l+=a;continue}if(h)break}if(d-=a,d>0)continue;a=Math.min(a,a+d+l);let m=[...r[0]][0].length,k=e.slice(0,o+r.index+m+a);if(Math.min(o,a)%2){let v=k.slice(1,-1);return{type:"em",raw:k,text:v,tokens:this.lexer.inlineTokens(v)}}let w=k.slice(2,-2);return{type:"strong",raw:k,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let o=[...r[0]].length-1,i,a,d=o,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*e.length+o);(r=l.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==o))continue;if(r[3]||r[4]){d+=a;continue}if(d-=a,d>0)continue;a=Math.min(a,a+d);let p=[...r[0]][0].length,h=e.slice(0,o+r.index+p+a),g=h.slice(o,-o);return{type:"del",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n,r;let t;if(t=this.rules.inline.url.exec(e)){let o,i;if(t[2]==="@")o=t[0],i="mailto:"+o;else{let a;do a=t[0],t[0]=(r=(n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])!=null?r:"";while(a!==t[0]);o=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Rt=class Ds{constructor(t){ie(this,"tokens");ie(this,"options");ie(this,"state");ie(this,"inlineQueue");ie(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Dn,this.options.tokenizer=this.options.tokenizer||new qo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Ve,block:go.normal,inline:Er.normal};this.options.pedantic?(n.block=go.pedantic,n.inline=Er.pedantic):this.options.gfm&&(n.block=go.gfm,this.options.breaks?n.inline=Er.breaks:n.inline=Er.gfm),this.tokenizer.rules=n}static get rules(){return{block:go,inline:Er}}static lex(t,n){return new Ds(n).lex(t)}static lexInline(t,n){return new Ds(n).inlineTokens(t)}lex(t){t=t.replace(Ve.carriageReturn,`
1550
- `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var i,a,d;this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Ve.tabCharGlobal," ").replace(Ve.spaceLine,""));let o=1/0;for(;t;){if(t.length<o)o=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let l;if((a=(i=this.options.extensions)==null?void 0:i.block)!=null&&a.some(h=>(l=h.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);let h=n.at(-1);l.raw.length===1&&h!==void 0?h.raw+=`
1551
- `:n.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
1552
- `)?"":`
1553
- `)+l.raw,h.text+=`
1554
- `+l.text,this.inlineQueue.at(-1).src=h.text):n.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
1555
- `)?"":`
1556
- `)+l.raw,h.text+=`
1557
- `+l.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},n.push(l));continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),n.push(l);continue}let p=t;if((d=this.options.extensions)!=null&&d.startBlock){let h=1/0,g=t.slice(1),m;this.options.extensions.startBlock.forEach(k=>{m=k.call({lexer:this},g),typeof m=="number"&&m>=0&&(h=Math.min(h,m))}),h<1/0&&h>=0&&(p=t.substring(0,h+1))}if(this.state.top&&(l=this.tokenizer.paragraph(p))){let h=n.at(-1);r&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
1558
- `)?"":`
1559
- `)+l.raw,h.text+=`
1560
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(l),r=p.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
1561
- `)?"":`
1562
- `)+l.raw,h.text+=`
1563
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(l);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var d,l,p,h,g,m;this.tokenizer.lexer=this;let r=t;if(this.tokens.links){let k=Object.keys(this.tokens.links);k.length>0&&(r=r.replace(this.tokenizer.rules.inline.reflinkSearch,w=>k.includes(w.slice(w.lastIndexOf("[")+1,-1))?"["+"a".repeat(w.length-2)+"]":w))}r=r.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),r=r.replace(this.tokenizer.rules.inline.blockSkip,(k,w,v)=>{let Z=v?v.length:0;return k.slice(0,Z)+"["+"a".repeat(k.length-Z-2)+"]"}),r=(p=(l=(d=this.options.hooks)==null?void 0:d.emStrongMask)==null?void 0:l.call({lexer:this},r))!=null?p:r;let o=!1,i="",a=1/0;for(;t;){if(t.length<a)a=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}o||(i=""),o=!1;let k;if((g=(h=this.options.extensions)==null?void 0:h.inline)!=null&&g.some(v=>(k=v.call({lexer:this},t,n))?(t=t.substring(k.raw.length),n.push(k),!0):!1))continue;if(k=this.tokenizer.escape(t)){t=t.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.tag(t)){t=t.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.link(t)){t=t.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(k.raw.length);let v=n.at(-1);k.type==="text"&&(v==null?void 0:v.type)==="text"?(v.raw+=k.raw,v.text+=k.text):n.push(k);continue}if(k=this.tokenizer.emStrong(t,r,i)){t=t.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.codespan(t)){t=t.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.br(t)){t=t.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.del(t,r,i)){t=t.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.autolink(t)){t=t.substring(k.raw.length),n.push(k);continue}if(!this.state.inLink&&(k=this.tokenizer.url(t))){t=t.substring(k.raw.length),n.push(k);continue}let w=t;if((m=this.options.extensions)!=null&&m.startInline){let v=1/0,Z=t.slice(1),K;this.options.extensions.startInline.forEach(M=>{K=M.call({lexer:this},Z),typeof K=="number"&&K>=0&&(v=Math.min(v,K))}),v<1/0&&v>=0&&(w=t.substring(0,v+1))}if(k=this.tokenizer.inlineText(w)){t=t.substring(k.raw.length),k.raw.slice(-1)!=="_"&&(i=k.raw.slice(-1)),o=!0;let v=n.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=k.raw,v.text+=k.text):n.push(k);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return n}infiniteLoopError(t){let n="Infinite loop on byte: "+t;if(this.options.silent)console.error(n);else throw new Error(n)}},Ho=class{constructor(e){ie(this,"options");ie(this,"parser");this.options=e||Dn}space(e){return""}code({text:e,lang:t,escaped:n}){var i;let r=(i=(t||"").match(Ve.notSpaceStart))==null?void 0:i[0],o=e.replace(Ve.endingNewline,"")+`
1564
- `;return r?'<pre><code class="language-'+Nt(r)+'">'+(n?o:Nt(o,!0))+`</code></pre>
1565
- `:"<pre><code>"+(n?o:Nt(o,!0))+`</code></pre>
1566
- `}blockquote({tokens:e}){return`<blockquote>
1567
- ${this.parser.parse(e)}</blockquote>
1568
- `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
1569
- `}hr(e){return`<hr>
1570
- `}list(e){let t=e.ordered,n=e.start,r="";for(let a=0;a<e.items.length;a++){let d=e.items[a];r+=this.listitem(d)}let o=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+o+i+`>
1571
- `+r+"</"+o+`>
1572
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
1573
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
1574
- `}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let r="";for(let o=0;o<e.rows.length;o++){let i=e.rows[o];n="";for(let a=0;a<i.length;a++)n+=this.tablecell(i[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
1575
- <thead>
1576
- `+t+`</thead>
1577
- `+r+`</table>
1578
- `}tablerow({text:e}){return`<tr>
1579
- ${e}</tr>
1580
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
1581
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Nt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),o=Ta(e);if(o===null)return r;e=o;let i='<a href="'+e+'"';return t&&(i+=' title="'+Nt(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=Ta(e);if(o===null)return Nt(n);e=o;let i=`<img src="${e}" alt="${Nt(n)}"`;return t&&(i+=` title="${Nt(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Nt(e.text)}},ui=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Lt=class Ms{constructor(t){ie(this,"options");ie(this,"renderer");ie(this,"textRenderer");this.options=t||Dn,this.options.renderer=this.options.renderer||new Ho,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ui}static parse(t,n){return new Ms(n).parse(t)}static parseInline(t,n){return new Ms(n).parseInline(t)}parse(t){var r,o;this.renderer.parser=this;let n="";for(let i=0;i<t.length;i++){let a=t[i];if((o=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&o[a.type]){let l=a,p=this.options.extensions.renderers[l.type].call({parser:this},l);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(l.type)){n+=p||"";continue}}let d=a;switch(d.type){case"space":{n+=this.renderer.space(d);break}case"hr":{n+=this.renderer.hr(d);break}case"heading":{n+=this.renderer.heading(d);break}case"code":{n+=this.renderer.code(d);break}case"table":{n+=this.renderer.table(d);break}case"blockquote":{n+=this.renderer.blockquote(d);break}case"list":{n+=this.renderer.list(d);break}case"checkbox":{n+=this.renderer.checkbox(d);break}case"html":{n+=this.renderer.html(d);break}case"def":{n+=this.renderer.def(d);break}case"paragraph":{n+=this.renderer.paragraph(d);break}case"text":{n+=this.renderer.text(d);break}default:{let l='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){var o,i;this.renderer.parser=this;let r="";for(let a=0;a<t.length;a++){let d=t[a];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[d.type]){let p=this.options.extensions.renderers[d.type].call({parser:this},d);if(p!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(d.type)){r+=p||"";continue}}let l=d;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let p='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return r}},vo,Ir=(vo=class{constructor(e){ie(this,"options");ie(this,"block");this.options=e||Dn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Rt.lex:Rt.lexInline}provideParser(e=this.block){return e?Lt.parse:Lt.parseInline}},ie(vo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),ie(vo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),vo),Fb=class{constructor(...e){ie(this,"defaults",ri());ie(this,"options",this.setOptions);ie(this,"parse",this.parseMarkdown(!0));ie(this,"parseInline",this.parseMarkdown(!1));ie(this,"Parser",Lt);ie(this,"Renderer",Ho);ie(this,"TextRenderer",ui);ie(this,"Lexer",Rt);ie(this,"Tokenizer",qo);ie(this,"Hooks",Ir);this.use(...e)}walkTokens(e,t){var r,o;let n=[];for(let i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{let a=i;for(let d of a.header)n=n.concat(this.walkTokens(d.tokens,t));for(let d of a.rows)for(let l of d)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{let a=i;n=n.concat(this.walkTokens(a.items,t));break}default:{let a=i;(o=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&o[a.type]?this.defaults.extensions.childTokens[a.type].forEach(d=>{let l=a[d].flat(1/0);n=n.concat(this.walkTokens(l,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r=y({},n);if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let i=t.renderers[o.name];i?t.renderers[o.name]=function(...a){let d=o.renderer.apply(this,a);return d===!1&&(d=i.apply(this,a)),d}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[o.level];i?i.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),r.extensions=t),n.renderer){let o=this.defaults.renderer||new Ho(this.defaults);for(let i in n.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,d=n.renderer[a],l=o[a];o[a]=(...p)=>{let h=d.apply(o,p);return h===!1&&(h=l.apply(o,p)),h||""}}r.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new qo(this.defaults);for(let i in n.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,d=n.tokenizer[a],l=o[a];o[a]=(...p)=>{let h=d.apply(o,p);return h===!1&&(h=l.apply(o,p)),h}}r.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new Ir;for(let i in n.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,d=n.hooks[a],l=o[a];Ir.passThroughHooks.has(i)?o[a]=p=>{if(this.defaults.async&&Ir.passThroughHooksRespectAsync.has(i))return z(this,null,function*(){let g=yield d.call(o,p);return l.call(o,g)});let h=d.call(o,p);return l.call(o,h)}:o[a]=(...p)=>{if(this.defaults.async)return z(this,null,function*(){let g=yield d.apply(o,p);return g===!1&&(g=yield l.apply(o,p)),g});let h=d.apply(o,p);return h===!1&&(h=l.apply(o,p)),h}}r.hooks=o}if(n.walkTokens){let o=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let d=[];return d.push(i.call(this,a)),o&&(d=d.concat(o.call(this,a))),d}}this.defaults=y(y({},this.defaults),r)}),this}setOptions(e){return this.defaults=y(y({},this.defaults),e),this}lexer(e,t){return Rt.lex(e,t!=null?t:this.defaults)}parser(e,t){return Lt.parse(e,t!=null?t:this.defaults)}parseMarkdown(e){return(t,n)=>{let r=y({},n),o=y(y({},this.defaults),r),i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return z(this,null,function*(){let a=o.hooks?yield o.hooks.preprocess(t):t,d=yield(o.hooks?yield o.hooks.provideLexer(e):e?Rt.lex:Rt.lexInline)(a,o),l=o.hooks?yield o.hooks.processAllTokens(d):d;o.walkTokens&&(yield Promise.all(this.walkTokens(l,o.walkTokens)));let p=yield(o.hooks?yield o.hooks.provideParser(e):e?Lt.parse:Lt.parseInline)(l,o);return o.hooks?yield o.hooks.postprocess(p):p}).catch(i);try{o.hooks&&(t=o.hooks.preprocess(t));let a=(o.hooks?o.hooks.provideLexer(e):e?Rt.lex:Rt.lexInline)(t,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let d=(o.hooks?o.hooks.provideParser(e):e?Lt.parse:Lt.parseInline)(a,o);return o.hooks&&(d=o.hooks.postprocess(d)),d}catch(a){return i(a)}}}onError(e,t){return n=>{if(n.message+=`
1582
- Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Nt(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},In=new Fb;function ce(e,t){return In.parse(e,t)}ce.options=ce.setOptions=function(e){return In.setOptions(e),ce.defaults=In.defaults,Hc(ce.defaults),ce};ce.getDefaults=ri;ce.defaults=Dn;function Bb(...e){return In.use(...e),ce.defaults=In.defaults,Hc(ce.defaults),ce}ce.use=Bb;ce.walkTokens=function(e,t){return In.walkTokens(e,t)};ce.parseInline=In.parseInline;ce.Parser=Lt;ce.parser=Lt.parse;ce.Renderer=Ho;ce.TextRenderer=ui;ce.Lexer=Rt;ce.lexer=Rt.lex;ce.Tokenizer=qo;ce.Hooks=Ir;ce.parse=ce;ce.options;ce.setOptions;ce.walkTokens;ce.parseInline;Lt.parse;Rt.lex;/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:Qc,setPrototypeOf:Pa,isFrozen:Gb,getPrototypeOf:Wb,getOwnPropertyDescriptor:Jb}=Object;let{freeze:nt,seal:kt,create:js}=Object,{apply:Us,construct:Zs}=typeof Reflect!="undefined"&&Reflect;nt||(nt=function(t){return t});kt||(kt=function(t){return t});Us||(Us=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return t.apply(n,o)});Zs||(Zs=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new t(...r)});const mo=rt(Array.prototype.forEach),Vb=rt(Array.prototype.lastIndexOf),Ra=rt(Array.prototype.pop),Cr=rt(Array.prototype.push),Yb=rt(Array.prototype.splice),xo=rt(String.prototype.toLowerCase),ys=rt(String.prototype.toString),ws=rt(String.prototype.match),Ar=rt(String.prototype.replace),Xb=rt(String.prototype.indexOf),Kb=rt(String.prototype.trim),At=rt(Object.prototype.hasOwnProperty),Xe=rt(RegExp.prototype.test),Pr=Qb(TypeError);function rt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Us(e,t,r)}}function Qb(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Zs(e,n)}}function V(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xo;Pa&&Pa(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(Gb(t)||(t[r]=i),o=i)}e[o]=!0}return e}function ek(e){for(let t=0;t<e.length;t++)At(e,t)||(e[t]=null);return e}function Dt(e){const t=js(null);for(const[n,r]of Qc(e))At(e,n)&&(Array.isArray(r)?t[n]=ek(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Dt(r):t[n]=r);return t}function Rr(e,t){for(;e!==null;){const r=Jb(e,t);if(r){if(r.get)return rt(r.get);if(typeof r.value=="function")return rt(r.value)}e=Wb(e)}function n(){return null}return n}const La=nt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),xs=nt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ss=nt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),tk=nt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ts=nt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),nk=nt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),za=nt(["#text"]),Ia=nt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Es=nt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$a=nt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),bo=nt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rk=kt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ok=kt(/<%[\w\W]*|[\w\W]*%>/gm),sk=kt(/\$\{[\w\W]*/gm),ik=kt(/^data-[\-\w.\u00B7-\uFFFF]+$/),ak=kt(/^aria-[\-\w]+$/),el=kt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ck=kt(/^(?:\w+script|data):/i),lk=kt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tl=kt(/^html$/i),uk=kt(/^[a-z][.\w]*(-[.\w]+)+$/i);var Oa=Object.freeze({__proto__:null,ARIA_ATTR:ak,ATTR_WHITESPACE:lk,CUSTOM_ELEMENT:uk,DATA_ATTR:ik,DOCTYPE_NAME:tl,ERB_EXPR:ok,IS_ALLOWED_URI:el,IS_SCRIPT_OR_DATA:ck,MUSTACHE_EXPR:rk,TMPLIT_EXPR:sk});const Lr={element:1,text:3,progressingInstruction:7,comment:8,document:9},dk=function(){return typeof window=="undefined"?null:window},pk=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch(a){return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Na=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function nl(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dk();const t=j=>nl(j);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==Lr.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:d,Element:l,NodeFilter:p,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:g,DOMParser:m,trustedTypes:k}=e,w=l.prototype,v=Rr(w,"cloneNode"),Z=Rr(w,"remove"),K=Rr(w,"nextSibling"),M=Rr(w,"childNodes"),E=Rr(w,"parentNode");if(typeof a=="function"){const j=n.createElement("template");j.content&&j.content.ownerDocument&&(n=j.content.ownerDocument)}let T,C="";const{implementation:N,createNodeIterator:J,createDocumentFragment:ye,getElementsByTagName:Oe}=n,{importNode:Be}=r;let te=Na();t.isSupported=typeof Qc=="function"&&typeof E=="function"&&N&&N.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:we,ERB_EXPR:ot,TMPLIT_EXPR:nn,DATA_ATTR:rn,ARIA_ATTR:dt,IS_SCRIPT_OR_DATA:It,ATTR_WHITESPACE:on,CUSTOM_ELEMENT:sn}=Oa;let{IS_ALLOWED_URI:$t}=Oa,pe=null;const vt=V({},[...La,...xs,...Ss,...Ts,...za]);let _e=null;const yn=V({},[...Ia,...Es,...$a,...bo]);let le=Object.seal(js(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ge=null,an=null;const yt=Object.seal(js(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let xe=!0,Te=!0,H=!1,oe=!0,Q=!1,Ne=!0,We=!1,je=!1,Ft=!1,wt=!1,De=!1,Ce=!1,ze=!0,Ue=!1;const fr="user-content-";let Ye=!0,st=!1,xt={},Ae=null;const gr=V({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const Wr=V({},["audio","video","img","source","image","track"]);let mr=null;const Jr=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Mn="http://www.w3.org/1998/Math/MathML",jn="http://www.w3.org/2000/svg",St="http://www.w3.org/1999/xhtml";let cn=St,wn=!1,xn=null;const ss=V({},[Mn,jn,St],ys);let Un=V({},["mi","mo","mn","ms","mtext"]),Zn=V({},["annotation-xml"]);const is=V({},["title","style","font","a","script"]);let Bt=null;const Tt=["application/xhtml+xml","text/html"],as="text/html";let de=null,ln=null;const Vr=n.createElement("form"),br=function(_){return _ instanceof RegExp||_ instanceof Function},qn=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ln&&ln===_)){if((!_||typeof _!="object")&&(_={}),_=Dt(_),Bt=Tt.indexOf(_.PARSER_MEDIA_TYPE)===-1?as:_.PARSER_MEDIA_TYPE,de=Bt==="application/xhtml+xml"?ys:xo,pe=At(_,"ALLOWED_TAGS")?V({},_.ALLOWED_TAGS,de):vt,_e=At(_,"ALLOWED_ATTR")?V({},_.ALLOWED_ATTR,de):yn,xn=At(_,"ALLOWED_NAMESPACES")?V({},_.ALLOWED_NAMESPACES,ys):ss,mr=At(_,"ADD_URI_SAFE_ATTR")?V(Dt(Jr),_.ADD_URI_SAFE_ATTR,de):Jr,ue=At(_,"ADD_DATA_URI_TAGS")?V(Dt(Wr),_.ADD_DATA_URI_TAGS,de):Wr,Ae=At(_,"FORBID_CONTENTS")?V({},_.FORBID_CONTENTS,de):gr,Ge=At(_,"FORBID_TAGS")?V({},_.FORBID_TAGS,de):Dt({}),an=At(_,"FORBID_ATTR")?V({},_.FORBID_ATTR,de):Dt({}),xt=At(_,"USE_PROFILES")?_.USE_PROFILES:!1,xe=_.ALLOW_ARIA_ATTR!==!1,Te=_.ALLOW_DATA_ATTR!==!1,H=_.ALLOW_UNKNOWN_PROTOCOLS||!1,oe=_.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=_.SAFE_FOR_TEMPLATES||!1,Ne=_.SAFE_FOR_XML!==!1,We=_.WHOLE_DOCUMENT||!1,wt=_.RETURN_DOM||!1,De=_.RETURN_DOM_FRAGMENT||!1,Ce=_.RETURN_TRUSTED_TYPE||!1,Ft=_.FORCE_BODY||!1,ze=_.SANITIZE_DOM!==!1,Ue=_.SANITIZE_NAMED_PROPS||!1,Ye=_.KEEP_CONTENT!==!1,st=_.IN_PLACE||!1,$t=_.ALLOWED_URI_REGEXP||el,cn=_.NAMESPACE||St,Un=_.MATHML_TEXT_INTEGRATION_POINTS||Un,Zn=_.HTML_INTEGRATION_POINTS||Zn,le=_.CUSTOM_ELEMENT_HANDLING||{},_.CUSTOM_ELEMENT_HANDLING&&br(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(le.tagNameCheck=_.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_.CUSTOM_ELEMENT_HANDLING&&br(_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(le.attributeNameCheck=_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_.CUSTOM_ELEMENT_HANDLING&&typeof _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=_.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Q&&(Te=!1),De&&(wt=!0),xt&&(pe=V({},za),_e=[],xt.html===!0&&(V(pe,La),V(_e,Ia)),xt.svg===!0&&(V(pe,xs),V(_e,Es),V(_e,bo)),xt.svgFilters===!0&&(V(pe,Ss),V(_e,Es),V(_e,bo)),xt.mathMl===!0&&(V(pe,Ts),V(_e,$a),V(_e,bo))),_.ADD_TAGS&&(typeof _.ADD_TAGS=="function"?yt.tagCheck=_.ADD_TAGS:(pe===vt&&(pe=Dt(pe)),V(pe,_.ADD_TAGS,de))),_.ADD_ATTR&&(typeof _.ADD_ATTR=="function"?yt.attributeCheck=_.ADD_ATTR:(_e===yn&&(_e=Dt(_e)),V(_e,_.ADD_ATTR,de))),_.ADD_URI_SAFE_ATTR&&V(mr,_.ADD_URI_SAFE_ATTR,de),_.FORBID_CONTENTS&&(Ae===gr&&(Ae=Dt(Ae)),V(Ae,_.FORBID_CONTENTS,de)),_.ADD_FORBID_CONTENTS&&(Ae===gr&&(Ae=Dt(Ae)),V(Ae,_.ADD_FORBID_CONTENTS,de)),Ye&&(pe["#text"]=!0),We&&V(pe,["html","head","body"]),pe.table&&(V(pe,["tbody"]),delete Ge.tbody),_.TRUSTED_TYPES_POLICY){if(typeof _.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=_.TRUSTED_TYPES_POLICY,C=T.createHTML("")}else T===void 0&&(T=pk(k,o)),T!==null&&typeof C=="string"&&(C=T.createHTML(""));nt&&nt(_),ln=_}},kr=V({},[...xs,...Ss,...tk]),Yr=V({},[...Ts,...nk]),cs=function(_){let A=E(_);(!A||!A.tagName)&&(A={namespaceURI:cn,tagName:"template"});const I=xo(_.tagName),se=xo(A.tagName);return xn[_.namespaceURI]?_.namespaceURI===jn?A.namespaceURI===St?I==="svg":A.namespaceURI===Mn?I==="svg"&&(se==="annotation-xml"||Un[se]):!!kr[I]:_.namespaceURI===Mn?A.namespaceURI===St?I==="math":A.namespaceURI===jn?I==="math"&&Zn[se]:!!Yr[I]:_.namespaceURI===St?A.namespaceURI===jn&&!Zn[se]||A.namespaceURI===Mn&&!Un[se]?!1:!Yr[I]&&(is[I]||!kr[I]):!!(Bt==="application/xhtml+xml"&&xn[_.namespaceURI]):!1},pt=function(_){Cr(t.removed,{element:_});try{E(_).removeChild(_)}catch(A){Z(_)}},ht=function(_,A){try{Cr(t.removed,{attribute:A.getAttributeNode(_),from:A})}catch(I){Cr(t.removed,{attribute:null,from:A})}if(A.removeAttribute(_),_==="is")if(wt||De)try{pt(A)}catch(I){}else try{A.setAttribute(_,"")}catch(I){}},Xr=function(_){let A=null,I=null;if(Ft)_="<remove></remove>"+_;else{const Se=ws(_,/^[\r\n\t ]+/);I=Se&&Se[0]}Bt==="application/xhtml+xml"&&cn===St&&(_='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+_+"</body></html>");const se=T?T.createHTML(_):_;if(cn===St)try{A=new m().parseFromString(se,Bt)}catch(Se){}if(!A||!A.documentElement){A=N.createDocument(cn,"template",null);try{A.documentElement.innerHTML=wn?C:se}catch(Se){}}const Me=A.body||A.documentElement;return _&&I&&Me.insertBefore(n.createTextNode(I),Me.childNodes[0]||null),cn===St?Oe.call(A,We?"html":"body")[0]:We?A.documentElement:Me},_r=function(_){return J.call(_.ownerDocument||_,_,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},vr=function(_){return _ instanceof g&&(typeof _.nodeName!="string"||typeof _.textContent!="string"||typeof _.removeChild!="function"||!(_.attributes instanceof h)||typeof _.removeAttribute!="function"||typeof _.setAttribute!="function"||typeof _.namespaceURI!="string"||typeof _.insertBefore!="function"||typeof _.hasChildNodes!="function")},Kr=function(_){return typeof d=="function"&&_ instanceof d};function Et(j,_,A){mo(j,I=>{I.call(t,_,A,ln)})}const Qr=function(_){let A=null;if(Et(te.beforeSanitizeElements,_,null),vr(_))return pt(_),!0;const I=de(_.nodeName);if(Et(te.uponSanitizeElement,_,{tagName:I,allowedTags:pe}),Ne&&_.hasChildNodes()&&!Kr(_.firstElementChild)&&Xe(/<[/\w!]/g,_.innerHTML)&&Xe(/<[/\w!]/g,_.textContent)||_.nodeType===Lr.progressingInstruction||Ne&&_.nodeType===Lr.comment&&Xe(/<[/\w]/g,_.data))return pt(_),!0;if(!(yt.tagCheck instanceof Function&&yt.tagCheck(I))&&(!pe[I]||Ge[I])){if(!Ge[I]&&to(I)&&(le.tagNameCheck instanceof RegExp&&Xe(le.tagNameCheck,I)||le.tagNameCheck instanceof Function&&le.tagNameCheck(I)))return!1;if(Ye&&!Ae[I]){const se=E(_)||_.parentNode,Me=M(_)||_.childNodes;if(Me&&se){const Se=Me.length;for(let Je=Se-1;Je>=0;--Je){const Ct=v(Me[Je],!0);Ct.__removalCount=(_.__removalCount||0)+1,se.insertBefore(Ct,K(_))}}}return pt(_),!0}return _ instanceof l&&!cs(_)||(I==="noscript"||I==="noembed"||I==="noframes")&&Xe(/<\/no(script|embed|frames)/i,_.innerHTML)?(pt(_),!0):(Q&&_.nodeType===Lr.text&&(A=_.textContent,mo([we,ot,nn],se=>{A=Ar(A,se," ")}),_.textContent!==A&&(Cr(t.removed,{element:_.cloneNode()}),_.textContent=A)),Et(te.afterSanitizeElements,_,null),!1)},eo=function(_,A,I){if(ze&&(A==="id"||A==="name")&&(I in n||I in Vr))return!1;if(!(Te&&!an[A]&&Xe(rn,A))){if(!(xe&&Xe(dt,A))){if(!(yt.attributeCheck instanceof Function&&yt.attributeCheck(A,_))){if(!_e[A]||an[A]){if(!(to(_)&&(le.tagNameCheck instanceof RegExp&&Xe(le.tagNameCheck,_)||le.tagNameCheck instanceof Function&&le.tagNameCheck(_))&&(le.attributeNameCheck instanceof RegExp&&Xe(le.attributeNameCheck,A)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(A,_))||A==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&Xe(le.tagNameCheck,I)||le.tagNameCheck instanceof Function&&le.tagNameCheck(I))))return!1}else if(!mr[A]){if(!Xe($t,Ar(I,on,""))){if(!((A==="src"||A==="xlink:href"||A==="href")&&_!=="script"&&Xb(I,"data:")===0&&ue[_])){if(!(H&&!Xe(It,Ar(I,on,"")))){if(I)return!1}}}}}}}return!0},to=function(_){return _!=="annotation-xml"&&ws(_,sn)},yr=function(_){Et(te.beforeSanitizeAttributes,_,null);const{attributes:A}=_;if(!A||vr(_))return;const I={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_e,forceKeepAttr:void 0};let se=A.length;for(;se--;){const Me=A[se],{name:Se,namespaceURI:Je,value:Ct}=Me,Ot=de(Se),wr=Ct;let Ie=Se==="value"?wr:Kb(wr);if(I.attrName=Ot,I.attrValue=Ie,I.keepAttr=!0,I.forceKeepAttr=void 0,Et(te.uponSanitizeAttribute,_,I),Ie=I.attrValue,Ue&&(Ot==="id"||Ot==="name")&&(ht(Se,_),Ie=fr+Ie),Ne&&Xe(/((--!?|])>)|<\/(style|title|textarea)/i,Ie)){ht(Se,_);continue}if(Ot==="attributename"&&ws(Ie,"href")){ht(Se,_);continue}if(I.forceKeepAttr)continue;if(!I.keepAttr){ht(Se,_);continue}if(!oe&&Xe(/\/>/i,Ie)){ht(Se,_);continue}Q&&mo([we,ot,nn],ro=>{Ie=Ar(Ie,ro," ")});const no=de(_.nodeName);if(!eo(no,Ot,Ie)){ht(Se,_);continue}if(T&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Je)switch(k.getAttributeType(no,Ot)){case"TrustedHTML":{Ie=T.createHTML(Ie);break}case"TrustedScriptURL":{Ie=T.createScriptURL(Ie);break}}if(Ie!==wr)try{Je?_.setAttributeNS(Je,Se,Ie):_.setAttribute(Se,Ie),vr(_)?pt(_):Ra(t.removed)}catch(ro){ht(Se,_)}}Et(te.afterSanitizeAttributes,_,null)},Gt=function j(_){let A=null;const I=_r(_);for(Et(te.beforeSanitizeShadowDOM,_,null);A=I.nextNode();)Et(te.uponSanitizeShadowNode,A,null),Qr(A),yr(A),A.content instanceof i&&j(A.content);Et(te.afterSanitizeShadowDOM,_,null)};return t.sanitize=function(j){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,I=null,se=null,Me=null;if(wn=!j,wn&&(j="<!-->"),typeof j!="string"&&!Kr(j))if(typeof j.toString=="function"){if(j=j.toString(),typeof j!="string")throw Pr("dirty is not a string, aborting")}else throw Pr("toString is not a function");if(!t.isSupported)return j;if(je||qn(_),t.removed=[],typeof j=="string"&&(st=!1),st){if(j.nodeName){const Ct=de(j.nodeName);if(!pe[Ct]||Ge[Ct])throw Pr("root node is forbidden and cannot be sanitized in-place")}}else if(j instanceof d)A=Xr("<!---->"),I=A.ownerDocument.importNode(j,!0),I.nodeType===Lr.element&&I.nodeName==="BODY"||I.nodeName==="HTML"?A=I:A.appendChild(I);else{if(!wt&&!Q&&!We&&j.indexOf("<")===-1)return T&&Ce?T.createHTML(j):j;if(A=Xr(j),!A)return wt?null:Ce?C:""}A&&Ft&&pt(A.firstChild);const Se=_r(st?j:A);for(;se=Se.nextNode();)Qr(se),yr(se),se.content instanceof i&&Gt(se.content);if(st)return j;if(wt){if(De)for(Me=ye.call(A.ownerDocument);A.firstChild;)Me.appendChild(A.firstChild);else Me=A;return(_e.shadowroot||_e.shadowrootmode)&&(Me=Be.call(r,Me,!0)),Me}let Je=We?A.outerHTML:A.innerHTML;return We&&pe["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&Xe(tl,A.ownerDocument.doctype.name)&&(Je="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
1583
- `+Je),Q&&mo([we,ot,nn],Ct=>{Je=Ar(Je,Ct," ")}),T&&Ce?T.createHTML(Je):Je},t.setConfig=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qn(j),je=!0},t.clearConfig=function(){ln=null,je=!1},t.isValidAttribute=function(j,_,A){ln||qn({});const I=de(j),se=de(_);return eo(I,se,A)},t.addHook=function(j,_){typeof _=="function"&&Cr(te[j],_)},t.removeHook=function(j,_){if(_!==void 0){const A=Vb(te[j],_);return A===-1?void 0:Yb(te[j],A,1)[0]}return Ra(te[j])},t.removeHooks=function(j){te[j]=[]},t.removeAllHooks=function(){te=Na()},t}var hk=nl();function rl(e){const t=ce.parse(e,{gfm:!0,breaks:!0,async:!1});return hk.sanitize(t)}const ol=1e3,fk=32,Da=15e3,gk=new Set(["completed","failed","cancelled"]),mk=4e3;let L=null,Ht=null,He=null,di=null,Fo=null,qs=!1,So=null,Or=null,F={kind:"connecting"},rr=[],lt=!0,cr=null,ge=null,lr=null,Yt=null,Nr=-1,tt=null,Kt=!1,Xt=null,Pn=new Set;function Hs(){Eo(),Zc(),Ht&&clearInterval(Ht),Ht=null,Xt==null||Xt(),Xt=null,He==null||He.destroy(),He=null,L&&en(L),L==null||L.remove(),L=null,di=null,F={kind:"connecting"},rr=[],lt=!0,cr=null,ge=null,lr=null,Yt=null,Fo=null,Nr=-1,tt=null,Kt=!1,Pn=new Set}function pi(e,t,n,r,o){L&&Hs(),di=o!=null?o:null,F={kind:"connecting"},rr=[],lt=!0,cr=null,Nr=-1,tt=null,Kt=!1,Pn=new Set,ge=e,lr=n,Yt=t,Fo=r,Uc({taskId:e,backendUrl:n,title:r}),L=document.createElement("div"),L.className="ap-sdk-panel",L.setAttribute("data-ap-sdk","1"),L.setAttribute("role","dialog"),L.setAttribute("aria-modal","true"),L.setAttribute("aria-label","Automation in progress");const i=r.length>55?`${r.slice(0,52)}…`:r;L.innerHTML=`
1584
- <div class="ap-sdk-panel__header">
1585
- <span class="ap-sdk-panel__title">
1586
- <span class="ap-sdk-panel__logo">AP</span>
1587
- Automating page
1588
- </span>
1589
- <div class="ap-sdk-panel__header-actions">
1590
- <button class="ap-sdk-panel__close" aria-label="Close" data-ap-close>×</button>
1591
- </div>
1592
- </div>
1593
- <div class="ap-sdk-runner__meta">
1594
- <div class="ap-sdk-runner__meta-row">
1595
- <span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--automate">Automate</span>
1596
- <span class="ap-sdk-runner__title" title="${Ak(r)}">${fi(i)}</span>
1597
- </div>
1598
- <div class="ap-sdk-runner__meta-row ap-sdk-runner__meta-row--controls">
1599
- <span class="ap-sdk-runner__counter" data-ap-runner-counter>0 actions</span>
1600
- <span class="ap-sdk-runner__timer" data-ap-runner-timer>00:00</span>
1601
- <span class="ap-sdk-status-badge ap-sdk-status-badge--in-progress" data-ap-runner-status>running</span>
1602
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-runner__cancel-btn" data-ap-runner-cancel type="button">Cancel task</button>
1603
- </div>
1604
- </div>
1605
- <div class="ap-sdk-runner__log-toolbar">
1606
- <button type="button" class="ap-sdk-runner__scroll-toggle" data-ap-runner-scroll-toggle>Auto ↓</button>
1607
- <button type="button" class="ap-sdk-runner__scroll-jump" data-ap-runner-scroll-jump title="Jump to latest output">Jump to latest</button>
1608
- </div>
1609
- <div class="ap-sdk-runner__log" data-ap-runner-log></div>
1610
- <div class="ap-sdk-runner__chat" data-ap-runner-chat>
1611
- <div class="ap-sdk-runner__question" data-ap-runner-question style="display:none"></div>
1612
- <form class="ap-sdk-runner__chat-form" data-ap-runner-chat-form>
1613
- <input
1614
- type="text"
1615
- class="ap-sdk-runner__chat-input"
1616
- data-ap-runner-chat-input
1617
- placeholder="Send a message to the agent…"
1618
- autocomplete="off"
1619
- />
1620
- <button type="submit" class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-runner-chat-send>Send</button>
1621
- </form>
1622
- <div class="ap-sdk-runner__chat-error" data-ap-runner-chat-error style="display:none"></div>
1623
- </div>
1624
- <div class="ap-sdk-runner__hint" data-ap-runner-hint>Closing keeps the task running — resume anytime from My Captures.</div>
1625
- <div class="ap-sdk-panel__status" data-ap-runner-summary style="display:none"></div>
1626
- `,L.addEventListener("wheel",a=>{a.stopPropagation()},{passive:!0}),L.addEventListener("touchmove",a=>{a.stopPropagation()},{passive:!0}),document.body.appendChild(L),He=Gs(),Qt(L),ni(L,ti),L.querySelector("[data-ap-close]").addEventListener("click",()=>{Hs(),o==null||o()}),L.querySelector("[data-ap-runner-chat-form]").addEventListener("submit",a=>{a.preventDefault(),_k(t,e)}),L.querySelector("[data-ap-runner-cancel]").addEventListener("click",a=>{a.stopPropagation();const d=a.currentTarget;if(!qs){qs=!0,d.textContent="Confirm",So=setTimeout(Eo,mk),Or=l=>{l.target!==d&&Eo()},document.addEventListener("click",Or,!0);return}Eo(),bk(t,e)}),L.querySelector("[data-ap-runner-scroll-toggle]").addEventListener("click",()=>{lt=!lt,lt&&Ma(),To()}),L.querySelector("[data-ap-runner-scroll-jump]").addEventListener("click",()=>{lt=!0,Ma(),To()}),L.querySelector("[data-ap-runner-log]").addEventListener("scroll",()=>{if(!lt||!L)return;const a=L.querySelector("[data-ap-runner-log]");a.scrollHeight-a.scrollTop-a.clientHeight>fk&&(lt=!1,To())}),hi(),sl(e,t)}function Ma(){const e=L==null?void 0:L.querySelector("[data-ap-runner-log]");e&&(e.scrollTop=e.scrollHeight)}function To(){if(!L)return;const e=L.querySelector("[data-ap-runner-scroll-toggle]");e&&(e.textContent=lt?"Auto ↓":"Manual",e.title=lt?"Disable auto-scroll":"Enable auto-scroll",e.classList.toggle("ap-sdk-runner__scroll-toggle--active",lt))}function sl(e,t){const n=d=>z(null,null,function*(){if(ge!==e||!L||F.kind!=="idle"&&F.kind!=="connecting"||Pn.has(d.commandId))return;Pn.add(d.commandId);const l={id:d.commandId,taskId:d.taskId,action:d.action,selector:d.selector,value:d.value,description:d.description,status:"pending",createdAt:new Date().toISOString()};An({kind:"executing",command:l,actionsRun:F.kind==="idle"?F.actionsRun:0}),yield ja(l,t,e)}),r=d=>{if(!(ge!==e||!L)&&gk.has(d)){if(F.kind==="executing")An({kind:"finishing",status:d,actionsRun:F.actionsRun});else if(F.kind==="connecting"||F.kind==="idle"){const l=F.kind==="idle"?F.actionsRun:0;An({kind:"finished",status:d,actionsRun:l})}}},o=d=>{ge!==e||!L||(d.outputChunk&&Ua([d.outputChunk]),r(d.status))},i=()=>z(null,null,function*(){var d;if(!(ge!==e||!L))try{const l=yield Uo(t,e);ge===e&&L&&(tt=(d=l[0])!=null?d:null,$n())}catch(l){}}),a=()=>z(null,null,function*(){var d;try{const[l,p,h,g]=yield Promise.all([Mc(t,e),zm(t,e),Uo(t,e),Rm(t,e)]);if(ge!==e||!L)return;Ua(p),tt=(d=h[0])!=null?d:null,$n(),r(l.status),g&&g.status==="pending"&&(F.kind==="idle"||F.kind==="connecting")&&!Pn.has(g.id)?(Pn.add(g.id),An({kind:"executing",command:g,actionsRun:F.kind==="idle"?F.actionsRun:0}),yield ja(g,t,e)):F.kind==="connecting"&&An({kind:"idle",actionsRun:0})}catch(l){}});a(),Hm(t,e,{onStatusUpdate:o,onInteractionCreated:i,onInteractionAnswered:i,onBrowserCommandCreated:n,onReconnect:()=>{a()}}).then(d=>{if(ge!==e||F.kind==="finished"){d();return}Xt=d})}function An(e){F=e,F.kind==="idle"&&cr===null&&(cr=Date.now(),Bo(),Ht=setInterval(Bo,ol)),F.kind==="finished"&&(Ht&&(clearInterval(Ht),Ht=null),Xt==null||Xt(),Xt=null,He==null||He.hide(),Zc()),hi()}function Eo(){qs=!1,So&&(clearTimeout(So),So=null),Or&&(document.removeEventListener("click",Or,!0),Or=null);const e=L==null?void 0:L.querySelector("[data-ap-runner-cancel]");e&&(e.textContent="Cancel task")}function bk(e,t){return z(this,null,function*(){if(ge!==t||!L)return;const n=L.querySelector("[data-ap-runner-cancel]");n&&(n.disabled=!0);try{yield $m(e,t)}catch(r){n&&(n.disabled=!1)}})}function il(){if(!ge||!Yt||!lr||!Fo)return;const e=ge,t=Yt;Uc({taskId:e,backendUrl:lr,title:Fo}),Ht&&clearInterval(Ht),Bo(),Ht=setInterval(Bo,ol);const n=F.kind==="finished"?F.actionsRun:0;Pn=new Set,F={kind:"idle",actionsRun:n},hi(),sl(e,t)}function hi(){if(!L)return;const e=L.querySelector("[data-ap-runner-status]"),t=L.querySelector("[data-ap-runner-counter]"),n=L.querySelector("[data-ap-runner-log]"),r=L.querySelector("[data-ap-runner-hint]");if(!e||!t||!n||!r)return;const o="actionsRun"in F?F.actionsRun:0;t.textContent=`${o} action${o===1?"":"s"}`,To(),F.kind==="finished"?(e.textContent=F.status.replace(/_/g," "),e.className=`ap-sdk-status-badge ap-sdk-status-badge--${F.status.replace(/_/g,"-")}`,r.style.display="none",Ek(F.status)):(e.textContent="running",e.className="ap-sdk-status-badge ap-sdk-status-badge--in-progress",r.style.display="block");const i=n.querySelector("[data-ap-runner-placeholder]");if(rr.length===0&&(F.kind==="connecting"||F.kind==="idle")){if(!i){const h=document.createElement("div");h.className="ap-sdk-runner__placeholder",h.setAttribute("data-ap-runner-placeholder","1"),h.textContent="Waiting for the agent's first action…",n.appendChild(h)}}else i==null||i.remove();$n();const a=L.querySelector("[data-ap-runner-chat-input]"),d=L.querySelector("[data-ap-runner-chat-send]");if(a&&d){const h=F.kind==="finished"&&F.status==="failed";a.disabled=h,d.disabled=h||Kt,h&&(a.placeholder="This task failed — start a new automation to continue.")}const l=L.querySelector("[data-ap-runner-cancel]");l&&(l.style.display=F.kind==="finished"?"none":"");const p=L.querySelector("[data-ap-runner-summary]");p&&F.kind!=="finished"&&(p.style.display="none",p.innerHTML="")}function $n(){var o;if(!L)return;const e=L.querySelector("[data-ap-runner-question]"),t=L.querySelector("[data-ap-runner-chat-input]");if(!e||!t)return;if(!tt){e.style.display="none",e.innerHTML="",t.placeholder="Send a message to the agent…";return}const n=tt.questionMetadata,r=(o=n==null?void 0:n.options)!=null?o:[];if(t.placeholder="Type your answer…",e.style.display="block",e.innerHTML=`
1627
- <div class="ap-sdk-runner__question-label">${fi((n==null?void 0:n.header)||"The agent has a question")}</div>
1628
- <div class="ap-sdk-runner__question-text ap-sdk-markdown">${rl((n==null?void 0:n.question)||tt.question)}</div>
1629
- ${r.length>0?'<div class="ap-sdk-runner__question-options" data-ap-runner-question-options></div>':""}
1630
- `,r.length>0){const i=e.querySelector("[data-ap-runner-question-options]");for(const a of r){const d=document.createElement("button");d.type="button",d.className="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-runner__question-option",d.textContent=a.label,d.addEventListener("click",()=>void kk(a.label)),i.appendChild(d)}}}function kk(e){return z(this,null,function*(){var r;if(!L||!tt||!ge||Kt)return;const t=ge,n=Yt;if(n){Kt=!0;try{const o={selectedOption:e};yield jc(n,t,tt.id,o),tt=null,$n();const i=yield Uo(n,t);ge===t&&L&&(tt=(r=i[0])!=null?r:null,$n())}catch(o){const i=L.querySelector("[data-ap-runner-chat-error]");i&&(i.textContent="Failed to send your answer — try again.",i.style.display="block")}finally{Kt=!1}}})}function Bo(){if(!L||cr===null)return;const e=L.querySelector("[data-ap-runner-timer]");if(!e)return;const t=Math.max(0,Math.floor((Date.now()-cr)/1e3)),n=String(Math.floor(t/60)).padStart(2,"0"),r=String(t%60).padStart(2,"0");e.textContent=`${n}:${r}`}function ja(e,t,n){return z(this,null,function*(){let r="done",o;try{if(e.action==="getContext"){const a=e.selector?document.querySelector(e.selector):document.body;if(!a)throw new Error(`element not found (${e.selector})`);He==null||He.update(a),o=yk(a)}else{if(!e.selector)throw new Error(`${e.action} command is missing a selector`);const a=document.querySelector(e.selector);if(!a)throw new Error(`element not found (${e.selector})`);if(He==null||He.update(a),e.action==="click")yield Bm(a),o="Clicked";else{if(e.value===void 0)throw new Error("inputText command is missing a value");wk(a,e.value),o="Entered text"}}}catch(a){r="error",o=a instanceof Error?a.message:"Unknown error executing command"}if(ge===n&&L&&xk(r,e,o),yield vk(t,n,e.id,r,o),ge!==n||!L)return;He==null||He.hide();const i=(F.kind==="executing"||F.kind==="finishing"?F.actionsRun:0)+1;F.kind==="finishing"?An({kind:"finished",status:F.status,actionsRun:i}):F.kind==="executing"&&An({kind:"idle",actionsRun:i})})}function _k(e,t){return z(this,null,function*(){var a;if(!L||Kt||F.kind==="finished"&&F.status==="failed")return;const n=L.querySelector("[data-ap-runner-chat-input]"),r=L.querySelector("[data-ap-runner-chat-error]"),o=L.querySelector("[data-ap-runner-chat-send]");if(!n||!r||!o)return;const i=n.value.trim();if(i){Kt=!0,o.disabled=!0,r.style.display="none";try{if(tt){yield jc(e,t,tt.id,i),tt=null,$n();try{const d=yield Uo(e,t);ge===t&&L&&(tt=(a=d[0])!=null?a:null,$n())}catch(d){}}else yield Im(e,t,i),F.kind==="finished"&&il();n.value=""}catch(d){r.textContent=d instanceof Error?d.message:"Failed to send — try again.",r.style.display="block"}finally{Kt=!1,o.disabled=!1}}})}function vk(e,t,n,r,o){return z(this,null,function*(){try{yield Lm(e,t,n,r,o)}catch(i){}})}function yk(e){const t=e.cloneNode(!0);t.querySelectorAll("script, style, noscript").forEach(o=>o.remove()),Ka(t);let n=t.outerHTML,r=!1;return n.length>Da&&(n=n.slice(0,Da),r=!0),`URL: ${location.href}
1631
- Title: ${document.title}
1623
+ `)}g.write("payload.value = newResult;"),g.write("return payload;");const v=g.compile();return(y,x)=>v(f,y,x)};let s;const o=as,a=!Kd.jitless,c=a&&DB.value,u=e.catchall;let h;A._zod.parse=(f,g)=>{h!=null||(h=n.value);const m=f.value;return o(m)?a&&c&&(g==null?void 0:g.async)===!1&&g.jitless!==!0?(s||(s=r(e.shape)),f=s(f,g),u?rp([],m,f,g,h,A):f):t(f,g):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:A}),f)}});function Ql(A,e,t,n){for(const s of A)if(s.issues.length===0)return e.value=s.value,e;const r=A.filter(s=>!Wn(s));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:A.map(s=>s.issues.map(o=>$t(o,n,zt())))}),e)}const sp=_("$ZodUnion",(A,e)=>{UA.init(A,e),aA(A._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),aA(A._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),aA(A._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),aA(A._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){const r=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>fc(s.source)).join("|")})$`)}});const t=e.options.length===1,n=e.options[0]._zod.run;A._zod.parse=(r,s)=>{if(t)return n(r,s);let o=!1;const a=[];for(const i of e.options){const c=i._zod.run({value:r.value,issues:[]},s);if(c instanceof Promise)a.push(c),o=!0;else{if(c.issues.length===0)return c;a.push(c)}}return o?Promise.all(a).then(i=>Ql(i,r,A,s)):Ql(a,r,A,s)}}),ym=_("$ZodDiscriminatedUnion",(A,e)=>{e.inclusive=!1,sp.init(A,e);const t=A._zod.parse;aA(A._zod,"propValues",()=>{const r={};for(const s of e.options){const o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const[a,i]of Object.entries(o)){r[a]||(r[a]=new Set);for(const c of i)r[a].add(c)}}return r});const n=ii(()=>{var o;const r=e.options,s=new Map;for(const a of r){const i=(o=a._zod.propValues)==null?void 0:o[e.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(const c of i){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,a)}}return s});A._zod.parse=(r,s)=>{const o=r.value;if(!as(o))return r.issues.push({code:"invalid_type",expected:"object",input:o,inst:A}),r;const a=n.value.get(o==null?void 0:o[e.discriminator]);return a?a._zod.run(r,s):e.unionFallback?t(r,s):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:o,path:[e.discriminator],inst:A}),r)}}),Um=_("$ZodIntersection",(A,e)=>{UA.init(A,e),A._zod.parse=(t,n)=>{const r=t.value,s=e.left._zod.run({value:r,issues:[]},n),o=e.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([i,c])=>yl(t,i,c)):yl(t,s,o)}});function ya(A,e){if(A===e)return{valid:!0,data:A};if(A instanceof Date&&e instanceof Date&&+A==+e)return{valid:!0,data:A};if(ar(A)&&ar(e)){const t=Object.keys(e),n=Object.keys(A).filter(s=>t.indexOf(s)!==-1),r=k(k({},A),e);for(const s of n){const o=ya(A[s],e[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};r[s]=o.data}return{valid:!0,data:r}}if(Array.isArray(A)&&Array.isArray(e)){if(A.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let n=0;n<A.length;n++){const r=A[n],s=e[n],o=ya(r,s);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};t.push(o.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function yl(A,e,t){const n=new Map;let r;for(const a of e.issues)if(a.code==="unrecognized_keys"){r!=null||(r=a);for(const i of a.keys)n.has(i)||n.set(i,{}),n.get(i).l=!0}else A.issues.push(a);for(const a of t.issues)if(a.code==="unrecognized_keys")for(const i of a.keys)n.has(i)||n.set(i,{}),n.get(i).r=!0;else A.issues.push(a);const s=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&r&&A.issues.push($(k({},r),{keys:s})),Wn(A))return A;const o=ya(e.value,t.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return A.value=o.data,A}const Em=_("$ZodRecord",(A,e)=>{UA.init(A,e),A._zod.parse=(t,n)=>{const r=t.value;if(!ar(r))return t.issues.push({expected:"record",code:"invalid_type",input:r,inst:A}),t;const s=[],o=e.keyType._zod.values;if(o){t.value={};const a=new Set;for(const c of o)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const u=e.valueType._zod.run({value:r[c],issues:[]},n);u instanceof Promise?s.push(u.then(h=>{h.issues.length&&t.issues.push(...Jn(c,h.issues)),t.value[c]=h.value})):(u.issues.length&&t.issues.push(...Jn(c,u.issues)),t.value[c]=u.value)}let i;for(const c in r)a.has(c)||(i=i!=null?i:[],i.push(c));i&&i.length>0&&t.issues.push({code:"unrecognized_keys",input:r,inst:A,keys:i})}else{t.value={};for(const a of Reflect.ownKeys(r)){if(a==="__proto__")continue;let i=e.keyType._zod.run({value:a,issues:[]},n);if(i instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&jd.test(a)&&i.issues.length&&i.issues.some(h=>h.code==="invalid_type"&&h.expected==="number")){const h=e.keyType._zod.run({value:Number(a),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(i=h)}if(i.issues.length){e.mode==="loose"?t.value[a]=r[a]:t.issues.push({code:"invalid_key",origin:"record",issues:i.issues.map(h=>$t(h,n,zt())),input:a,path:[a],inst:A});continue}const u=e.valueType._zod.run({value:r[a],issues:[]},n);u instanceof Promise?s.push(u.then(h=>{h.issues.length&&t.issues.push(...Jn(a,h.issues)),t.value[i.value]=h.value})):(u.issues.length&&t.issues.push(...Jn(a,u.issues)),t.value[i.value]=u.value)}}return s.length?Promise.all(s).then(()=>t):t}}),Fm=_("$ZodEnum",(A,e)=>{UA.init(A,e);const t=Nd(e.entries),n=new Set(t);A._zod.values=n,A._zod.pattern=new RegExp(`^(${t.filter(r=>RB.has(typeof r)).map(r=>typeof r=="string"?cr(r):r.toString()).join("|")})$`),A._zod.parse=(r,s)=>{const o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t,input:o,inst:A}),r}}),km=_("$ZodLiteral",(A,e)=>{if(UA.init(A,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const t=new Set(e.values);A._zod.values=t,A._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?cr(n):n?cr(n.toString()):String(n)).join("|")})$`),A._zod.parse=(n,r)=>{const s=n.value;return t.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:A}),n}}),vm=_("$ZodTransform",(A,e)=>{UA.init(A,e),A._zod.parse=(t,n)=>{if(n.direction==="backward")throw new Pd(A.constructor.name);const r=e.transform(t.value,t);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(o=>(t.value=o,t));if(r instanceof Promise)throw new nr;return t.value=r,t}});function Ul(A,e){return A.issues.length&&e===void 0?{issues:[],value:void 0}:A}const op=_("$ZodOptional",(A,e)=>{UA.init(A,e),A._zod.optin="optional",A._zod.optout="optional",aA(A._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),aA(A._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${fc(t.source)})?$`):void 0}),A._zod.parse=(t,n)=>{if(e.innerType._zod.optin==="optional"){const r=e.innerType._zod.run(t,n);return r instanceof Promise?r.then(s=>Ul(s,t.value)):Ul(r,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,n)}}),_m=_("$ZodExactOptional",(A,e)=>{op.init(A,e),aA(A._zod,"values",()=>e.innerType._zod.values),aA(A._zod,"pattern",()=>e.innerType._zod.pattern),A._zod.parse=(t,n)=>e.innerType._zod.run(t,n)}),xm=_("$ZodNullable",(A,e)=>{UA.init(A,e),aA(A._zod,"optin",()=>e.innerType._zod.optin),aA(A._zod,"optout",()=>e.innerType._zod.optout),aA(A._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${fc(t.source)}|null)$`):void 0}),aA(A._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),A._zod.parse=(t,n)=>t.value===null?t:e.innerType._zod.run(t,n)}),Sm=_("$ZodDefault",(A,e)=>{UA.init(A,e),A._zod.optin="optional",aA(A._zod,"values",()=>e.innerType._zod.values),A._zod.parse=(t,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);if(t.value===void 0)return t.value=e.defaultValue,t;const r=e.innerType._zod.run(t,n);return r instanceof Promise?r.then(s=>El(s,e)):El(r,e)}});function El(A,e){return A.value===void 0&&(A.value=e.defaultValue),A}const Im=_("$ZodPrefault",(A,e)=>{UA.init(A,e),A._zod.optin="optional",aA(A._zod,"values",()=>e.innerType._zod.values),A._zod.parse=(t,n)=>(n.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,n))}),Tm=_("$ZodNonOptional",(A,e)=>{UA.init(A,e),aA(A._zod,"values",()=>{const t=e.innerType._zod.values;return t?new Set([...t].filter(n=>n!==void 0)):void 0}),A._zod.parse=(t,n)=>{const r=e.innerType._zod.run(t,n);return r instanceof Promise?r.then(s=>Fl(s,A)):Fl(r,A)}});function Fl(A,e){return!A.issues.length&&A.value===void 0&&A.issues.push({code:"invalid_type",expected:"nonoptional",input:A.value,inst:e}),A}const Hm=_("$ZodCatch",(A,e)=>{UA.init(A,e),aA(A._zod,"optin",()=>e.innerType._zod.optin),aA(A._zod,"optout",()=>e.innerType._zod.optout),aA(A._zod,"values",()=>e.innerType._zod.values),A._zod.parse=(t,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);const r=e.innerType._zod.run(t,n);return r instanceof Promise?r.then(s=>(t.value=s.value,s.issues.length&&(t.value=e.catchValue($(k({},t),{error:{issues:s.issues.map(o=>$t(o,n,zt()))},input:t.value})),t.issues=[]),t)):(t.value=r.value,r.issues.length&&(t.value=e.catchValue($(k({},t),{error:{issues:r.issues.map(s=>$t(s,n,zt()))},input:t.value})),t.issues=[]),t)}}),Lm=_("$ZodPipe",(A,e)=>{UA.init(A,e),aA(A._zod,"values",()=>e.in._zod.values),aA(A._zod,"optin",()=>e.in._zod.optin),aA(A._zod,"optout",()=>e.out._zod.optout),aA(A._zod,"propValues",()=>e.in._zod.propValues),A._zod.parse=(t,n)=>{if(n.direction==="backward"){const s=e.out._zod.run(t,n);return s instanceof Promise?s.then(o=>$s(o,e.in,n)):$s(s,e.in,n)}const r=e.in._zod.run(t,n);return r instanceof Promise?r.then(s=>$s(s,e.out,n)):$s(r,e.out,n)}});function $s(A,e,t){return A.issues.length?(A.aborted=!0,A):e._zod.run({value:A.value,issues:A.issues},t)}const Dm=_("$ZodReadonly",(A,e)=>{UA.init(A,e),aA(A._zod,"propValues",()=>e.innerType._zod.propValues),aA(A._zod,"values",()=>e.innerType._zod.values),aA(A._zod,"optin",()=>{var t,n;return(n=(t=e.innerType)==null?void 0:t._zod)==null?void 0:n.optin}),aA(A._zod,"optout",()=>{var t,n;return(n=(t=e.innerType)==null?void 0:t._zod)==null?void 0:n.optout}),A._zod.parse=(t,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);const r=e.innerType._zod.run(t,n);return r instanceof Promise?r.then(kl):kl(r)}});function kl(A){return A.value=Object.freeze(A.value),A}const Rm=_("$ZodCustom",(A,e)=>{Be.init(A,e),UA.init(A,e),A._zod.parse=(t,n)=>t,A._zod.check=t=>{const n=t.value,r=e.fn(n);if(r instanceof Promise)return r.then(s=>vl(s,t,n,A));vl(r,t,n,A)}});function vl(A,e,t,n){var r;if(!A){const s={code:"custom",input:t,inst:n,path:[...(r=n._zod.def.path)!=null?r:[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),e.issues.push(cs(s))}}var _l;class Om{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){var n;const t=e._zod.parent;if(t){const r=k({},(n=this.get(t))!=null?n:{});delete r.id;const s=k(k({},r),this._map.get(e));return Object.keys(s).length?s:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Mm(){return new Om}var Sd;(Sd=(_l=globalThis).__zod_globalRegistry)!=null||(_l.__zod_globalRegistry=Mm());const Nr=globalThis.__zod_globalRegistry;function Pm(A,e){return new A(k({type:"string"},V(e)))}function Km(A,e){return new A(k({type:"string",format:"email",check:"string_format",abort:!1},V(e)))}function xl(A,e){return new A(k({type:"string",format:"guid",check:"string_format",abort:!1},V(e)))}function Nm(A,e){return new A(k({type:"string",format:"uuid",check:"string_format",abort:!1},V(e)))}function zm(A,e){return new A(k({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4"},V(e)))}function $m(A,e){return new A(k({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6"},V(e)))}function Gm(A,e){return new A(k({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7"},V(e)))}function Vm(A,e){return new A(k({type:"string",format:"url",check:"string_format",abort:!1},V(e)))}function Zm(A,e){return new A(k({type:"string",format:"emoji",check:"string_format",abort:!1},V(e)))}function Xm(A,e){return new A(k({type:"string",format:"nanoid",check:"string_format",abort:!1},V(e)))}function Wm(A,e){return new A(k({type:"string",format:"cuid",check:"string_format",abort:!1},V(e)))}function Jm(A,e){return new A(k({type:"string",format:"cuid2",check:"string_format",abort:!1},V(e)))}function jm(A,e){return new A(k({type:"string",format:"ulid",check:"string_format",abort:!1},V(e)))}function Ym(A,e){return new A(k({type:"string",format:"xid",check:"string_format",abort:!1},V(e)))}function qm(A,e){return new A(k({type:"string",format:"ksuid",check:"string_format",abort:!1},V(e)))}function AC(A,e){return new A(k({type:"string",format:"ipv4",check:"string_format",abort:!1},V(e)))}function eC(A,e){return new A(k({type:"string",format:"ipv6",check:"string_format",abort:!1},V(e)))}function tC(A,e){return new A(k({type:"string",format:"cidrv4",check:"string_format",abort:!1},V(e)))}function nC(A,e){return new A(k({type:"string",format:"cidrv6",check:"string_format",abort:!1},V(e)))}function rC(A,e){return new A(k({type:"string",format:"base64",check:"string_format",abort:!1},V(e)))}function sC(A,e){return new A(k({type:"string",format:"base64url",check:"string_format",abort:!1},V(e)))}function oC(A,e){return new A(k({type:"string",format:"e164",check:"string_format",abort:!1},V(e)))}function iC(A,e){return new A(k({type:"string",format:"jwt",check:"string_format",abort:!1},V(e)))}function aC(A,e){return new A(k({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null},V(e)))}function cC(A,e){return new A(k({type:"string",format:"date",check:"string_format"},V(e)))}function lC(A,e){return new A(k({type:"string",format:"time",check:"string_format",precision:null},V(e)))}function uC(A,e){return new A(k({type:"string",format:"duration",check:"string_format"},V(e)))}function dC(A,e){return new A(k({type:"number",checks:[]},V(e)))}function pC(A,e){return new A(k({type:"number",check:"number_format",abort:!1,format:"safeint"},V(e)))}function hC(A,e){return new A(k({type:"boolean"},V(e)))}function fC(A){return new A({type:"any"})}function gC(A){return new A({type:"unknown"})}function BC(A,e){return new A(k({type:"never"},V(e)))}function Sl(A,e){return new qd($(k({check:"less_than"},V(e)),{value:A,inclusive:!1}))}function Pi(A,e){return new qd($(k({check:"less_than"},V(e)),{value:A,inclusive:!0}))}function Il(A,e){return new Ap($(k({check:"greater_than"},V(e)),{value:A,inclusive:!1}))}function Ki(A,e){return new Ap($(k({check:"greater_than"},V(e)),{value:A,inclusive:!0}))}function Tl(A,e){return new xw($(k({check:"multiple_of"},V(e)),{value:A}))}function ip(A,e){return new Iw($(k({check:"max_length"},V(e)),{maximum:A}))}function Po(A,e){return new Tw($(k({check:"min_length"},V(e)),{minimum:A}))}function ap(A,e){return new Hw($(k({check:"length_equals"},V(e)),{length:A}))}function wC(A,e){return new Lw($(k({check:"string_format",format:"regex"},V(e)),{pattern:A}))}function mC(A){return new Dw(k({check:"string_format",format:"lowercase"},V(A)))}function CC(A){return new Rw(k({check:"string_format",format:"uppercase"},V(A)))}function bC(A,e){return new Ow($(k({check:"string_format",format:"includes"},V(e)),{includes:A}))}function QC(A,e){return new Mw($(k({check:"string_format",format:"starts_with"},V(e)),{prefix:A}))}function yC(A,e){return new Pw($(k({check:"string_format",format:"ends_with"},V(e)),{suffix:A}))}function dr(A){return new Kw({check:"overwrite",tx:A})}function UC(A){return dr(e=>e.normalize(A))}function EC(){return dr(A=>A.trim())}function FC(){return dr(A=>A.toLowerCase())}function kC(){return dr(A=>A.toUpperCase())}function vC(){return dr(A=>LB(A))}function _C(A,e,t){return new A(k({type:"array",element:e},V(t)))}function xC(A,e,t){return new A(k({type:"custom",check:"custom",fn:e},V(t)))}function SC(A){const e=IC(t=>(t.addIssue=n=>{var r,s,o,a;if(typeof n=="string")t.issues.push(cs(n,t.value,e._zod.def));else{const i=n;i.fatal&&(i.continue=!1),(r=i.code)!=null||(i.code="custom"),(s=i.input)!=null||(i.input=t.value),(o=i.inst)!=null||(i.inst=e),(a=i.continue)!=null||(i.continue=!e._zod.def.abort),t.issues.push(cs(i))}},A(t.value,t)));return e}function IC(A,e){const t=new Be(k({check:"custom"},V(e)));return t._zod.check=A,t}function cp(A){var t,n,r,s,o,a,i,c,u;let e=(t=A==null?void 0:A.target)!=null?t:"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:(n=A.processors)!=null?n:{},metadataRegistry:(r=A==null?void 0:A.metadata)!=null?r:Nr,target:e,unrepresentable:(s=A==null?void 0:A.unrepresentable)!=null?s:"throw",override:(o=A==null?void 0:A.override)!=null?o:(()=>{}),io:(a=A==null?void 0:A.io)!=null?a:"output",counter:0,seen:new Map,cycles:(i=A==null?void 0:A.cycles)!=null?i:"ref",reused:(c=A==null?void 0:A.reused)!=null?c:"inline",external:(u=A==null?void 0:A.external)!=null?u:void 0}}function PA(A,e,t={path:[],schemaPath:[]}){var u,h,f;var n;const r=A._zod.def,s=e.seen.get(A);if(s)return s.count++,t.schemaPath.includes(A)&&(s.cycle=t.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(A,o);const a=(h=(u=A._zod).toJSONSchema)==null?void 0:h.call(u);if(a)o.schema=a;else{const g=$(k({},t),{schemaPath:[...t.schemaPath,A],path:t.path});if(A._zod.processJSONSchema)A._zod.processJSONSchema(e,o.schema,g);else{const Q=o.schema,U=e.processors[r.type];if(!U)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);U(A,e,Q,g)}const m=A._zod.parent;m&&(o.ref||(o.ref=m),PA(m,e,g),e.seen.get(m).isParent=!0)}const i=e.metadataRegistry.get(A);return i&&Object.assign(o.schema,i),e.io==="input"&&ae(A)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&o.schema._prefault&&((f=(n=o.schema).default)!=null||(n.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(A).schema}function lp(A,e){var o,a,i,c;const t=A.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const u of A.seen.entries()){const h=(o=A.metadataRegistry.get(u[0]))==null?void 0:o.id;if(h){const f=n.get(h);if(f&&f!==u[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(h,u[0])}}const r=u=>{var Q,U,E,v,F;const h=A.target==="draft-2020-12"?"$defs":"definitions";if(A.external){const y=(Q=A.external.registry.get(u[0]))==null?void 0:Q.id,x=(U=A.external.uri)!=null?U:(I=>I);if(y)return{ref:x(y)};const R=(v=(E=u[1].defId)!=null?E:u[1].schema.id)!=null?v:`schema${A.counter++}`;return u[1].defId=R,{defId:R,ref:`${x("__shared")}#/${h}/${R}`}}if(u[1]===t)return{ref:"#"};const g=`#/${h}/`,m=(F=u[1].schema.id)!=null?F:`__schema${A.counter++}`;return{defId:m,ref:g+m}},s=u=>{if(u[1].schema.$ref)return;const h=u[1],{ref:f,defId:g}=r(u);h.def=k({},h.schema),g&&(h.defId=g);const m=h.schema;for(const Q in m)delete m[Q];m.$ref=f};if(A.cycles==="throw")for(const u of A.seen.entries()){const h=u[1];if(h.cycle)throw new Error(`Cycle detected: #/${(a=h.cycle)==null?void 0:a.join("/")}/<root>
1632
1624
 
1633
- ${n}${r?`
1634
- … (truncated)`:""}`}function wk(e,t){var i;const r=e instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,o=(i=Object.getOwnPropertyDescriptor(r,"value"))==null?void 0:i.set;if(!o)throw new Error("target element does not accept text input");o.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function xk(e,t,n){var h,g;const r=e==="done"?"✓":"✗",o=t.selector?` \`${t.selector}\``:"",i=t.description||`${t.action}${o}`,a=e==="done"&&t.action==="getContext"?`read context (${(h=n==null?void 0:n.length)!=null?h:0} chars)`:n,d=a?` — ${a}`:"";if(rr.push({status:e,text:`${r} ${i}${d}`}),!L)return;const l=L.querySelector("[data-ap-runner-log]");if(!l)return;(g=l.querySelector("[data-ap-runner-placeholder]"))==null||g.remove();const p=document.createElement("div");p.className=`ap-sdk-runner__log-entry ap-sdk-runner__log-entry--${e}`,p.textContent=rr[rr.length-1].text,l.appendChild(p),lt&&(l.scrollTop=l.scrollHeight)}function Sk(e){var t,n;return(n=(t=e.display)==null?void 0:t.variant)!=null?n:e.sdkEventType}function Tk(e){const t=Sk(e);return(e.stream==="stdout"||e.stream==="stderr"||e.stream==="sdk_event"&&(t==="text"||t==="thinking"))&&e.data.trim()||null}function Ua(e){var r;const t=e.filter(o=>o.sequence>Nr).sort((o,i)=>o.sequence-i.sequence);if(t.length===0||(Nr=Math.max(Nr,...t.map(o=>o.sequence)),!L))return;const n=L.querySelector("[data-ap-runner-log]");if(n)for(const o of t){const i=Tk(o);if(!i)continue;(r=n.querySelector("[data-ap-runner-placeholder]"))==null||r.remove();const a=document.createElement("div");a.className=`ap-sdk-runner__log-entry ap-sdk-runner__log-entry--output ap-sdk-runner__log-entry--${o.stream}`,o.stream==="sdk_event"?(a.classList.add("ap-sdk-markdown"),a.innerHTML=rl(i)):a.textContent=i,n.appendChild(a),lt&&(n.scrollTop=n.scrollHeight)}}function Ek(e){if(!L||!ge||!lr)return;const t=L.querySelector("[data-ap-runner-summary]");if(!t)return;const n=`${lr.replace(/\/+$/,"")}/tasks/${ge}`,r=e==="completed"?"Automation complete!":"Automation ended",o=e==="completed",i=o?"ap-sdk-panel__btn--secondary":"ap-sdk-panel__btn--primary";t.style.display="block",t.innerHTML=`
1635
- <div class="ap-sdk-success-card">
1636
- <p class="ap-sdk-success-headline">${fi(r)}</p>
1637
- ${o?`
1638
- <div class="ap-sdk-runner__approval" data-ap-runner-approval>
1639
- <div class="ap-sdk-runner__approval-actions">
1640
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary ap-sdk-panel__btn--block" data-ap-runner-approve><span class="ap-sdk-btn-icon" aria-hidden="true">✓</span>Approve</button>
1641
- <button class="ap-sdk-runner__text-btn ap-sdk-runner__text-btn--danger" data-ap-runner-reject>Reject</button>
1642
- </div>
1643
- <div class="ap-sdk-runner__reject-form" data-ap-runner-reject-form style="display:none">
1644
- <textarea class="ap-sdk-panel__textarea" rows="2" placeholder="What was wrong? (optional)" data-ap-runner-reject-feedback></textarea>
1645
- <div class="ap-sdk-runner__reject-hint">Leave blank to reject permanently, or add details so the agent can retry with your feedback.</div>
1646
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--danger ap-sdk-panel__btn--block" data-ap-runner-reject-submit>Reject Permanently</button>
1647
- </div>
1648
- <div class="ap-sdk-runner__approval-error" data-ap-runner-approval-error style="display:none"></div>
1649
- </div>
1650
- <div class="ap-sdk-runner__divider"></div>`:""}
1651
- <div class="ap-sdk-success-actions ap-sdk-success-actions--stacked">
1652
- <button class="ap-sdk-panel__btn ${i} ap-sdk-panel__btn--block" data-ap-runner-view>View task<span class="ap-sdk-btn-icon ap-sdk-btn-icon--trailing" aria-hidden="true">↗</span></button>
1653
- <button class="ap-sdk-runner__text-btn" data-ap-runner-close>Close</button>
1654
- </div>
1655
- </div>
1656
- `,t.querySelector("[data-ap-runner-view]").addEventListener("click",()=>window.open(n,"_blank","noopener,noreferrer")),t.querySelector("[data-ap-runner-close]").addEventListener("click",()=>{const a=di;Hs(),a==null||a()}),o&&Ck(t)}function Ck(e){const t=e.querySelector("[data-ap-runner-approve]"),n=e.querySelector("[data-ap-runner-reject]"),r=e.querySelector("[data-ap-runner-reject-form]"),o=e.querySelector("[data-ap-runner-reject-feedback]"),i=e.querySelector("[data-ap-runner-reject-submit]"),a=e.querySelector("[data-ap-runner-approval-error]"),d=e.querySelector(".ap-sdk-runner__approval-actions"),l=h=>{a.textContent=h,a.style.display="block"};t.addEventListener("click",()=>z(null,null,function*(){if(!ge||!Yt)return;const h=ge,g=Yt;t.disabled=!0,n.disabled=!0,a.style.display="none";try{yield Om(g,h),d.innerHTML='<span class="ap-sdk-status-badge ap-sdk-status-badge--approved">✓ Approved</span>',r.style.display="none"}catch(m){t.disabled=!1,n.disabled=!1,l(m instanceof Error?m.message:"Failed to approve — try again.")}})),n.addEventListener("click",()=>{r.style.display=r.style.display==="none"?"block":"none",r.style.display==="block"&&o.focus()});const p=()=>{i.textContent=o.value.trim()?"Reject & Continue":"Reject Permanently"};o.addEventListener("input",p),i.addEventListener("click",()=>z(null,null,function*(){if(!ge||!Yt)return;const h=ge,g=Yt,m=o.value.trim();i.disabled=!0,t.disabled=!0,a.style.display="none",i.textContent="Rejecting…";try{yield Nm(g,h,m),m?il():(d.innerHTML='<span class="ap-sdk-status-badge ap-sdk-status-badge--rejected">✕ Rejected</span>',r.style.display="none")}catch(k){i.disabled=!1,t.disabled=!1,p(),l(k instanceof Error?k.message:"Failed to reject — try again.")}}))}function Ak(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function fi(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Pk(e,t,n){const r=!!(t.backendUrl&&t.token),o=document.createElement("div");o.className="ap-sdk-advanced",o.innerHTML=`
1625
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of A.seen.entries()){const h=u[1];if(e===u[0]){s(u);continue}if(A.external){const g=(i=A.external.registry.get(u[0]))==null?void 0:i.id;if(e!==u[0]&&g){s(u);continue}}if((c=A.metadataRegistry.get(u[0]))==null?void 0:c.id){s(u);continue}if(h.cycle){s(u);continue}if(h.count>1&&A.reused==="ref"){s(u);continue}}}function up(A,e){var o,a,i,c,u;const t=A.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=h=>{var E,v,F;const f=A.seen.get(h);if(f.ref===null)return;const g=(E=f.def)!=null?E:f.schema,m=k({},g),Q=f.ref;if(f.ref=null,Q){n(Q);const y=A.seen.get(Q),x=y.schema;if(x.$ref&&(A.target==="draft-07"||A.target==="draft-04"||A.target==="openapi-3.0")?(g.allOf=(v=g.allOf)!=null?v:[],g.allOf.push(x)):Object.assign(g,x),Object.assign(g,m),h._zod.parent===Q)for(const I in g)I==="$ref"||I==="allOf"||I in m||delete g[I];if(x.$ref)for(const I in g)I==="$ref"||I==="allOf"||I in y.def&&JSON.stringify(g[I])===JSON.stringify(y.def[I])&&delete g[I]}const U=h._zod.parent;if(U&&U!==Q){n(U);const y=A.seen.get(U);if(y!=null&&y.schema.$ref&&(g.$ref=y.schema.$ref,y.def))for(const x in g)x==="$ref"||x==="allOf"||x in y.def&&JSON.stringify(g[x])===JSON.stringify(y.def[x])&&delete g[x]}A.override({zodSchema:h,jsonSchema:g,path:(F=f.path)!=null?F:[]})};for(const h of[...A.seen.entries()].reverse())n(h[0]);const r={};if(A.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":A.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":A.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":A.target,(o=A.external)!=null&&o.uri){const h=(a=A.external.registry.get(e))==null?void 0:a.id;if(!h)throw new Error("Schema is missing an `id` property");r.$id=A.external.uri(h)}Object.assign(r,(i=t.def)!=null?i:t.schema);const s=(u=(c=A.external)==null?void 0:c.defs)!=null?u:{};for(const h of A.seen.entries()){const f=h[1];f.def&&f.defId&&(s[f.defId]=f.def)}A.external||Object.keys(s).length>0&&(A.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{const h=JSON.parse(JSON.stringify(r));return Object.defineProperty(h,"~standard",{value:$(k({},e["~standard"]),{jsonSchema:{input:Ko(e,"input",A.processors),output:Ko(e,"output",A.processors)}}),enumerable:!1,writable:!1}),h}catch(h){throw new Error("Error converting schema to JSON.")}}function ae(A,e){const t=e!=null?e:{seen:new Set};if(t.seen.has(A))return!1;t.seen.add(A);const n=A._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return ae(n.element,t);if(n.type==="set")return ae(n.valueType,t);if(n.type==="lazy")return ae(n.getter(),t);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return ae(n.innerType,t);if(n.type==="intersection")return ae(n.left,t)||ae(n.right,t);if(n.type==="record"||n.type==="map")return ae(n.keyType,t)||ae(n.valueType,t);if(n.type==="pipe")return ae(n.in,t)||ae(n.out,t);if(n.type==="object"){for(const r in n.shape)if(ae(n.shape[r],t))return!0;return!1}if(n.type==="union"){for(const r of n.options)if(ae(r,t))return!0;return!1}if(n.type==="tuple"){for(const r of n.items)if(ae(r,t))return!0;return!!(n.rest&&ae(n.rest,t))}return!1}const TC=(A,e={})=>t=>{const n=cp($(k({},t),{processors:e}));return PA(A,n),lp(n,A),up(n,A)},Ko=(A,e,t={})=>n=>{const{libraryOptions:r,target:s}=n!=null?n:{},o=cp($(k({},r!=null?r:{}),{target:s,io:e,processors:t}));return PA(A,o),lp(o,A),up(o,A)},HC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},LC=(A,e,t,n)=>{var u;const r=t;r.type="string";const{minimum:s,maximum:o,format:a,patterns:i,contentEncoding:c}=A._zod.bag;if(typeof s=="number"&&(r.minLength=s),typeof o=="number"&&(r.maxLength=o),a&&(r.format=(u=HC[a])!=null?u:a,r.format===""&&delete r.format,a==="time"&&delete r.format),c&&(r.contentEncoding=c),i&&i.size>0){const h=[...i];h.length===1?r.pattern=h[0].source:h.length>1&&(r.allOf=[...h.map(f=>$(k({},e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{}),{pattern:f.source}))])}},DC=(A,e,t,n)=>{const r=t,{minimum:s,maximum:o,format:a,multipleOf:i,exclusiveMaximum:c,exclusiveMinimum:u}=A._zod.bag;typeof a=="string"&&a.includes("int")?r.type="integer":r.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u),typeof s=="number"&&(r.minimum=s,typeof u=="number"&&e.target!=="draft-04"&&(u>=s?delete r.minimum:delete r.exclusiveMinimum)),typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c),typeof o=="number"&&(r.maximum=o,typeof c=="number"&&e.target!=="draft-04"&&(c<=o?delete r.maximum:delete r.exclusiveMaximum)),typeof i=="number"&&(r.multipleOf=i)},RC=(A,e,t,n)=>{t.type="boolean"},OC=(A,e,t,n)=>{t.not={}},MC=(A,e,t,n)=>{},PC=(A,e,t,n)=>{},KC=(A,e,t,n)=>{const r=A._zod.def,s=Nd(r.entries);s.every(o=>typeof o=="number")&&(t.type="number"),s.every(o=>typeof o=="string")&&(t.type="string"),t.enum=s},NC=(A,e,t,n)=>{const r=A._zod.def,s=[];for(const o of r.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){const o=s[0];t.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[o]:t.const=o}else s.every(o=>typeof o=="number")&&(t.type="number"),s.every(o=>typeof o=="string")&&(t.type="string"),s.every(o=>typeof o=="boolean")&&(t.type="boolean"),s.every(o=>o===null)&&(t.type="null"),t.enum=s},zC=(A,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},$C=(A,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},GC=(A,e,t,n)=>{const r=t,s=A._zod.def,{minimum:o,maximum:a}=A._zod.bag;typeof o=="number"&&(r.minItems=o),typeof a=="number"&&(r.maxItems=a),r.type="array",r.items=PA(s.element,e,$(k({},n),{path:[...n.path,"items"]}))},VC=(A,e,t,n)=>{var c;const r=t,s=A._zod.def;r.type="object",r.properties={};const o=s.shape;for(const u in o)r.properties[u]=PA(o[u],e,$(k({},n),{path:[...n.path,"properties",u]}));const a=new Set(Object.keys(o)),i=new Set([...a].filter(u=>{const h=s.shape[u]._zod;return e.io==="input"?h.optin===void 0:h.optout===void 0}));i.size>0&&(r.required=Array.from(i)),((c=s.catchall)==null?void 0:c._zod.def.type)==="never"?r.additionalProperties=!1:s.catchall?s.catchall&&(r.additionalProperties=PA(s.catchall,e,$(k({},n),{path:[...n.path,"additionalProperties"]}))):e.io==="output"&&(r.additionalProperties=!1)},ZC=(A,e,t,n)=>{const r=A._zod.def,s=r.inclusive===!1,o=r.options.map((a,i)=>PA(a,e,$(k({},n),{path:[...n.path,s?"oneOf":"anyOf",i]})));s?t.oneOf=o:t.anyOf=o},XC=(A,e,t,n)=>{const r=A._zod.def,s=PA(r.left,e,$(k({},n),{path:[...n.path,"allOf",0]})),o=PA(r.right,e,$(k({},n),{path:[...n.path,"allOf",1]})),a=c=>"allOf"in c&&Object.keys(c).length===1,i=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];t.allOf=i},WC=(A,e,t,n)=>{const r=t,s=A._zod.def;r.type="object";const o=s.keyType,a=o._zod.bag,i=a==null?void 0:a.patterns;if(s.mode==="loose"&&i&&i.size>0){const u=PA(s.valueType,e,$(k({},n),{path:[...n.path,"patternProperties","*"]}));r.patternProperties={};for(const h of i)r.patternProperties[h.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(r.propertyNames=PA(s.keyType,e,$(k({},n),{path:[...n.path,"propertyNames"]}))),r.additionalProperties=PA(s.valueType,e,$(k({},n),{path:[...n.path,"additionalProperties"]}));const c=o._zod.values;if(c){const u=[...c].filter(h=>typeof h=="string"||typeof h=="number");u.length>0&&(r.required=u)}},JC=(A,e,t,n)=>{const r=A._zod.def,s=PA(r.innerType,e,n),o=e.seen.get(A);e.target==="openapi-3.0"?(o.ref=r.innerType,t.nullable=!0):t.anyOf=[s,{type:"null"}]},jC=(A,e,t,n)=>{const r=A._zod.def;PA(r.innerType,e,n);const s=e.seen.get(A);s.ref=r.innerType},YC=(A,e,t,n)=>{const r=A._zod.def;PA(r.innerType,e,n);const s=e.seen.get(A);s.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue))},qC=(A,e,t,n)=>{const r=A._zod.def;PA(r.innerType,e,n);const s=e.seen.get(A);s.ref=r.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},Ab=(A,e,t,n)=>{const r=A._zod.def;PA(r.innerType,e,n);const s=e.seen.get(A);s.ref=r.innerType;let o;try{o=r.catchValue(void 0)}catch(a){throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=o},eb=(A,e,t,n)=>{const r=A._zod.def,s=e.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;PA(s,e,n);const o=e.seen.get(A);o.ref=s},tb=(A,e,t,n)=>{const r=A._zod.def;PA(r.innerType,e,n);const s=e.seen.get(A);s.ref=r.innerType,t.readOnly=!0},dp=(A,e,t,n)=>{const r=A._zod.def;PA(r.innerType,e,n);const s=e.seen.get(A);s.ref=r.innerType},nb=_("ZodISODateTime",(A,e)=>{em.init(A,e),vA.init(A,e)});function rb(A){return aC(nb,A)}const sb=_("ZodISODate",(A,e)=>{tm.init(A,e),vA.init(A,e)});function ob(A){return cC(sb,A)}const ib=_("ZodISOTime",(A,e)=>{nm.init(A,e),vA.init(A,e)});function ab(A){return lC(ib,A)}const cb=_("ZodISODuration",(A,e)=>{rm.init(A,e),vA.init(A,e)});function lb(A){return uC(cb,A)}const ub=(A,e)=>{Vd.init(A,e),A.name="ZodError",Object.defineProperties(A,{format:{value:t=>XB(A,t)},flatten:{value:t=>ZB(A,t)},addIssue:{value:t=>{A.issues.push(t),A.message=JSON.stringify(A.issues,Qa,2)}},addIssues:{value:t=>{A.issues.push(...t),A.message=JSON.stringify(A.issues,Qa,2)}},isEmpty:{get(){return A.issues.length===0}}})},De=_("ZodError",ub,{Parent:Error}),db=Bc(De),pb=wc(De),hb=ai(De),fb=ci(De),gb=jB(De),Bb=YB(De),wb=qB(De),mb=Aw(De),Cb=ew(De),bb=tw(De),Qb=nw(De),yb=rw(De),FA=_("ZodType",(A,e)=>(UA.init(A,e),Object.assign(A["~standard"],{jsonSchema:{input:Ko(A,"input"),output:Ko(A,"output")}}),A.toJSONSchema=TC(A,{}),A.def=e,A.type=e.type,Object.defineProperty(A,"_def",{value:e}),A.check=(...t)=>{var n;return A.clone(Vt(e,{checks:[...(n=e.checks)!=null?n:[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},A.with=A.check,A.clone=(t,n)=>Zt(A,t,n),A.brand=()=>A,A.register=((t,n)=>(t.add(A,n),A)),A.parse=(t,n)=>db(A,t,n,{callee:A.parse}),A.safeParse=(t,n)=>hb(A,t,n),A.parseAsync=(t,n)=>T(null,null,function*(){return pb(A,t,n,{callee:A.parseAsync})}),A.safeParseAsync=(t,n)=>T(null,null,function*(){return fb(A,t,n)}),A.spa=A.safeParseAsync,A.encode=(t,n)=>gb(A,t,n),A.decode=(t,n)=>Bb(A,t,n),A.encodeAsync=(t,n)=>T(null,null,function*(){return wb(A,t,n)}),A.decodeAsync=(t,n)=>T(null,null,function*(){return mb(A,t,n)}),A.safeEncode=(t,n)=>Cb(A,t,n),A.safeDecode=(t,n)=>bb(A,t,n),A.safeEncodeAsync=(t,n)=>T(null,null,function*(){return Qb(A,t,n)}),A.safeDecodeAsync=(t,n)=>T(null,null,function*(){return yb(A,t,n)}),A.refine=(t,n)=>A.check(wQ(t,n)),A.superRefine=t=>A.check(mQ(t)),A.overwrite=t=>A.check(dr(t)),A.optional=()=>Rl(A),A.exactOptional=()=>sQ(A),A.nullable=()=>Ol(A),A.nullish=()=>Rl(Ol(A)),A.nonoptional=t=>uQ(A,t),A.array=()=>Ce(A),A.or=t=>Jb([A,t]),A.and=t=>qb(A,t),A.transform=t=>Ml(A,nQ(t)),A.default=t=>aQ(A,t),A.prefault=t=>lQ(A,t),A.catch=t=>pQ(A,t),A.pipe=t=>Ml(A,t),A.readonly=()=>gQ(A),A.describe=t=>{const n=A.clone();return Nr.add(n,{description:t}),n},Object.defineProperty(A,"description",{get(){var t;return(t=Nr.get(A))==null?void 0:t.description},configurable:!0}),A.meta=(...t)=>{if(t.length===0)return Nr.get(A);const n=A.clone();return Nr.add(n,t[0]),n},A.isOptional=()=>A.safeParse(void 0).success,A.isNullable=()=>A.safeParse(null).success,A.apply=t=>t(A),A)),pp=_("_ZodString",(A,e)=>{var n,r,s;mc.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(o,a,i)=>LC(A,o,a);const t=A._zod.bag;A.format=(n=t.format)!=null?n:null,A.minLength=(r=t.minimum)!=null?r:null,A.maxLength=(s=t.maximum)!=null?s:null,A.regex=(...o)=>A.check(wC(...o)),A.includes=(...o)=>A.check(bC(...o)),A.startsWith=(...o)=>A.check(QC(...o)),A.endsWith=(...o)=>A.check(yC(...o)),A.min=(...o)=>A.check(Po(...o)),A.max=(...o)=>A.check(ip(...o)),A.length=(...o)=>A.check(ap(...o)),A.nonempty=(...o)=>A.check(Po(1,...o)),A.lowercase=o=>A.check(mC(o)),A.uppercase=o=>A.check(CC(o)),A.trim=()=>A.check(EC()),A.normalize=(...o)=>A.check(UC(...o)),A.toLowerCase=()=>A.check(FC()),A.toUpperCase=()=>A.check(kC()),A.slugify=()=>A.check(vC())}),Ub=_("ZodString",(A,e)=>{mc.init(A,e),pp.init(A,e),A.email=t=>A.check(Km(Eb,t)),A.url=t=>A.check(Vm(Fb,t)),A.jwt=t=>A.check(iC(Kb,t)),A.emoji=t=>A.check(Zm(kb,t)),A.guid=t=>A.check(xl(Hl,t)),A.uuid=t=>A.check(Nm(Gs,t)),A.uuidv4=t=>A.check(zm(Gs,t)),A.uuidv6=t=>A.check($m(Gs,t)),A.uuidv7=t=>A.check(Gm(Gs,t)),A.nanoid=t=>A.check(Xm(vb,t)),A.guid=t=>A.check(xl(Hl,t)),A.cuid=t=>A.check(Wm(_b,t)),A.cuid2=t=>A.check(Jm(xb,t)),A.ulid=t=>A.check(jm(Sb,t)),A.base64=t=>A.check(rC(Ob,t)),A.base64url=t=>A.check(sC(Mb,t)),A.xid=t=>A.check(Ym(Ib,t)),A.ksuid=t=>A.check(qm(Tb,t)),A.ipv4=t=>A.check(AC(Hb,t)),A.ipv6=t=>A.check(eC(Lb,t)),A.cidrv4=t=>A.check(tC(Db,t)),A.cidrv6=t=>A.check(nC(Rb,t)),A.e164=t=>A.check(oC(Pb,t)),A.datetime=t=>A.check(rb(t)),A.date=t=>A.check(ob(t)),A.time=t=>A.check(ab(t)),A.duration=t=>A.check(lb(t))});function L(A){return Pm(Ub,A)}const vA=_("ZodStringFormat",(A,e)=>{EA.init(A,e),pp.init(A,e)}),Eb=_("ZodEmail",(A,e)=>{Vw.init(A,e),vA.init(A,e)}),Hl=_("ZodGUID",(A,e)=>{$w.init(A,e),vA.init(A,e)}),Gs=_("ZodUUID",(A,e)=>{Gw.init(A,e),vA.init(A,e)}),Fb=_("ZodURL",(A,e)=>{Zw.init(A,e),vA.init(A,e)}),kb=_("ZodEmoji",(A,e)=>{Xw.init(A,e),vA.init(A,e)}),vb=_("ZodNanoID",(A,e)=>{Ww.init(A,e),vA.init(A,e)}),_b=_("ZodCUID",(A,e)=>{Jw.init(A,e),vA.init(A,e)}),xb=_("ZodCUID2",(A,e)=>{jw.init(A,e),vA.init(A,e)}),Sb=_("ZodULID",(A,e)=>{Yw.init(A,e),vA.init(A,e)}),Ib=_("ZodXID",(A,e)=>{qw.init(A,e),vA.init(A,e)}),Tb=_("ZodKSUID",(A,e)=>{Am.init(A,e),vA.init(A,e)}),Hb=_("ZodIPv4",(A,e)=>{sm.init(A,e),vA.init(A,e)}),Lb=_("ZodIPv6",(A,e)=>{om.init(A,e),vA.init(A,e)}),Db=_("ZodCIDRv4",(A,e)=>{im.init(A,e),vA.init(A,e)}),Rb=_("ZodCIDRv6",(A,e)=>{am.init(A,e),vA.init(A,e)}),Ob=_("ZodBase64",(A,e)=>{cm.init(A,e),vA.init(A,e)}),Mb=_("ZodBase64URL",(A,e)=>{um.init(A,e),vA.init(A,e)}),Pb=_("ZodE164",(A,e)=>{dm.init(A,e),vA.init(A,e)}),Kb=_("ZodJWT",(A,e)=>{hm.init(A,e),vA.init(A,e)}),hp=_("ZodNumber",(A,e)=>{var n,r,s,o,a,i,c,u,h;tp.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(f,g,m)=>DC(A,f,g),A.gt=(f,g)=>A.check(Il(f,g)),A.gte=(f,g)=>A.check(Ki(f,g)),A.min=(f,g)=>A.check(Ki(f,g)),A.lt=(f,g)=>A.check(Sl(f,g)),A.lte=(f,g)=>A.check(Pi(f,g)),A.max=(f,g)=>A.check(Pi(f,g)),A.int=f=>A.check(Ll(f)),A.safe=f=>A.check(Ll(f)),A.positive=f=>A.check(Il(0,f)),A.nonnegative=f=>A.check(Ki(0,f)),A.negative=f=>A.check(Sl(0,f)),A.nonpositive=f=>A.check(Pi(0,f)),A.multipleOf=(f,g)=>A.check(Tl(f,g)),A.step=(f,g)=>A.check(Tl(f,g)),A.finite=()=>A;const t=A._zod.bag;A.minValue=(s=Math.max((n=t.minimum)!=null?n:Number.NEGATIVE_INFINITY,(r=t.exclusiveMinimum)!=null?r:Number.NEGATIVE_INFINITY))!=null?s:null,A.maxValue=(i=Math.min((o=t.maximum)!=null?o:Number.POSITIVE_INFINITY,(a=t.exclusiveMaximum)!=null?a:Number.POSITIVE_INFINITY))!=null?i:null,A.isInt=((c=t.format)!=null?c:"").includes("int")||Number.isSafeInteger((u=t.multipleOf)!=null?u:.5),A.isFinite=!0,A.format=(h=t.format)!=null?h:null});function lt(A){return dC(hp,A)}const Nb=_("ZodNumberFormat",(A,e)=>{fm.init(A,e),hp.init(A,e)});function Ll(A){return pC(Nb,A)}const zb=_("ZodBoolean",(A,e)=>{gm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>RC(A,t,n)});function QA(A){return hC(zb,A)}const $b=_("ZodAny",(A,e)=>{Bm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>MC()});function fp(){return fC($b)}const Gb=_("ZodUnknown",(A,e)=>{wm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>PC()});function Dl(){return gC(Gb)}const Vb=_("ZodNever",(A,e)=>{mm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>OC(A,t,n)});function Zb(A){return BC(Vb,A)}const Xb=_("ZodArray",(A,e)=>{Cm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>GC(A,t,n,r),A.element=e.element,A.min=(t,n)=>A.check(Po(t,n)),A.nonempty=t=>A.check(Po(1,t)),A.max=(t,n)=>A.check(ip(t,n)),A.length=(t,n)=>A.check(ap(t,n)),A.unwrap=()=>A.element});function Ce(A,e){return _C(Xb,A,e)}const Wb=_("ZodObject",(A,e)=>{Qm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>VC(A,t,n,r),aA(A,"shape",()=>e.shape),A.keyof=()=>_e(Object.keys(A._zod.def.shape)),A.catchall=t=>A.clone($(k({},A._zod.def),{catchall:t})),A.passthrough=()=>A.clone($(k({},A._zod.def),{catchall:Dl()})),A.loose=()=>A.clone($(k({},A._zod.def),{catchall:Dl()})),A.strict=()=>A.clone($(k({},A._zod.def),{catchall:Zb()})),A.strip=()=>A.clone($(k({},A._zod.def),{catchall:void 0})),A.extend=t=>NB(A,t),A.safeExtend=t=>zB(A,t),A.merge=t=>$B(A,t),A.pick=t=>PB(A,t),A.omit=t=>KB(A,t),A.partial=(...t)=>GB(wp,A,t[0]),A.required=(...t)=>VB(mp,A,t[0])});function CA(A,e){const t=k({type:"object",shape:A!=null?A:{}},V(e));return new Wb(t)}const gp=_("ZodUnion",(A,e)=>{sp.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>ZC(A,t,n,r),A.options=e.options});function Jb(A,e){return new gp(k({type:"union",options:A},V(e)))}const jb=_("ZodDiscriminatedUnion",(A,e)=>{gp.init(A,e),ym.init(A,e)});function Bp(A,e,t){return new jb(k({type:"union",options:e,discriminator:A},V(t)))}const Yb=_("ZodIntersection",(A,e)=>{Um.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>XC(A,t,n,r)});function qb(A,e){return new Yb({type:"intersection",left:A,right:e})}const AQ=_("ZodRecord",(A,e)=>{Em.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>WC(A,t,n,r),A.keyType=e.keyType,A.valueType=e.valueType});function it(A,e,t){return new AQ(k({type:"record",keyType:A,valueType:e},V(t)))}const Ua=_("ZodEnum",(A,e)=>{Fm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(n,r,s)=>KC(A,n,r),A.enum=e.entries,A.options=Object.values(e.entries);const t=new Set(Object.keys(e.entries));A.extract=(n,r)=>{const s={};for(const o of n)if(t.has(o))s[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Ua($(k($(k({},e),{checks:[]}),V(r)),{entries:s}))},A.exclude=(n,r)=>{const s=k({},e.entries);for(const o of n)if(t.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new Ua($(k($(k({},e),{checks:[]}),V(r)),{entries:s}))}});function _e(A,e){const t=Array.isArray(A)?Object.fromEntries(A.map(n=>[n,n])):A;return new Ua(k({type:"enum",entries:t},V(e)))}const eQ=_("ZodLiteral",(A,e)=>{km.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>NC(A,t,n),A.values=new Set(e.values),Object.defineProperty(A,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function ke(A,e){return new eQ(k({type:"literal",values:Array.isArray(A)?A:[A]},V(e)))}const tQ=_("ZodTransform",(A,e)=>{vm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>$C(A,t),A._zod.parse=(t,n)=>{if(n.direction==="backward")throw new Pd(A.constructor.name);t.addIssue=s=>{var o,a,i;if(typeof s=="string")t.issues.push(cs(s,t.value,e));else{const c=s;c.fatal&&(c.continue=!1),(o=c.code)!=null||(c.code="custom"),(a=c.input)!=null||(c.input=t.value),(i=c.inst)!=null||(c.inst=A),t.issues.push(cs(c))}};const r=e.transform(t.value,t);return r instanceof Promise?r.then(s=>(t.value=s,t)):(t.value=r,t)}});function nQ(A){return new tQ({type:"transform",transform:A})}const wp=_("ZodOptional",(A,e)=>{op.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>dp(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function Rl(A){return new wp({type:"optional",innerType:A})}const rQ=_("ZodExactOptional",(A,e)=>{_m.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>dp(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function sQ(A){return new rQ({type:"optional",innerType:A})}const oQ=_("ZodNullable",(A,e)=>{xm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>JC(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function Ol(A){return new oQ({type:"nullable",innerType:A})}const iQ=_("ZodDefault",(A,e)=>{Sm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>YC(A,t,n,r),A.unwrap=()=>A._zod.def.innerType,A.removeDefault=A.unwrap});function aQ(A,e){return new iQ({type:"default",innerType:A,get defaultValue(){return typeof e=="function"?e():$d(e)}})}const cQ=_("ZodPrefault",(A,e)=>{Im.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>qC(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function lQ(A,e){return new cQ({type:"prefault",innerType:A,get defaultValue(){return typeof e=="function"?e():$d(e)}})}const mp=_("ZodNonOptional",(A,e)=>{Tm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>jC(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function uQ(A,e){return new mp(k({type:"nonoptional",innerType:A},V(e)))}const dQ=_("ZodCatch",(A,e)=>{Hm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Ab(A,t,n,r),A.unwrap=()=>A._zod.def.innerType,A.removeCatch=A.unwrap});function pQ(A,e){return new dQ({type:"catch",innerType:A,catchValue:typeof e=="function"?e:()=>e})}const hQ=_("ZodPipe",(A,e)=>{Lm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>eb(A,t,n,r),A.in=e.in,A.out=e.out});function Ml(A,e){return new hQ({type:"pipe",in:A,out:e})}const fQ=_("ZodReadonly",(A,e)=>{Dm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>tb(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function gQ(A){return new fQ({type:"readonly",innerType:A})}const BQ=_("ZodCustom",(A,e)=>{Rm.init(A,e),FA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>zC(A,t)});function wQ(A,e={}){return xC(BQ,A,e)}function mQ(A){return SC(A)}const CQ=CA({name:L().min(1).max(100).optional(),command:L().min(1).max(500),args:Ce(L()).optional(),failOnError:QA().default(!0).optional(),timeout:lt().int().min(1e3).max(3e5).default(3e4).optional(),workingDirectory:L().optional(),env:it(L(),L()).optional(),runOnBackground:QA().optional(),agentTags:Ce(L()).optional()});CA({name:L(),command:L(),success:QA(),exitCode:lt().optional(),stdout:L().optional(),stderr:L().optional(),error:L().optional(),duration:lt(),failOnError:QA()});const rn=CA({path:L(),extraCommands:Ce(CQ).optional(),id:L().uuid().optional(),rotationKey:L().optional(),usageStatus:_e(["free","in_use"]).optional(),agentTags:Ce(L()).optional()}),bQ=Bp("operation",[rn.extend({operation:ke("create"),content:L().optional(),contentPath:L().optional(),encoding:_e(["utf-8","base64"]).optional()}),rn.extend({operation:ke("merge"),data:it(L(),fp()),mergeStrategy:_e(["deep","shallow"]).optional(),arrayMergeStrategy:_e(["concat","replace"]).optional()}),rn.extend({operation:ke("modify"),content:L().optional(),contentPath:L().optional(),createIfMissing:QA().optional()}),rn.extend({operation:ke("delete"),ignoreIfMissing:QA().optional()}),rn.extend({operation:ke("createDirectory"),contentPath:L().optional(),mode:lt().optional(),ignoreIfExists:QA().optional()}),rn.extend({operation:ke("download"),url:L().url(),headers:it(L(),L()).optional(),timeout:lt().min(1e3).max(3e5).optional()}),rn.extend({operation:ke("gitClone"),gitUrl:L(),gitSecretKey:L().optional(),sourceBranch:L().optional(),targetBranch:L().optional(),originalBranch:L().optional(),defaultBranch:L().optional()})]);var kA=(A=>(A.DRAFT="draft",A.PENDING="pending",A.ASSIGNED="assigned",A.IN_PROGRESS="in_progress",A.WAITING_FOR_INPUT="waiting_for_input",A.WAITING_FOR_PLAN_APPROVAL="waiting_for_plan_approval",A.PLAN_APPROVED="plan_approved",A.PLAN_REJECTED="plan_rejected",A.COMPLETED="completed",A.FAILED="failed",A.CANCELLED="cancelled",A.RESULT_REJECTED="result_rejected",A))(kA||{});const QQ=CA({type:_e(["json","file","regex"]).describe("Extraction method"),source:L().describe("Source to extract from (file path or stdout/stderr)"),schema:CA({}).passthrough().optional().describe("JSON schema for validation"),pattern:L().optional().describe("Regex pattern for extraction")}),yQ=CA({type:_e(["issue_update","bulk_issue_update","notification","webhook"]).describe("Hook type"),config:fp().describe("Hook-specific configuration")});CA({command:L().optional().describe("Legacy — unused in SDK mode"),args:Ce(L()).optional().describe("Legacy — unused in SDK mode"),env:it(L(),L()).optional().describe("Environment variables"),workingDirectory:L().optional().describe("Working directory for command execution"),fileOperations:Ce(bQ).optional().describe("File operations to perform during setup"),gitUrl:L().optional().describe("Git repository URL (populated from project)"),gitPrivateKey:L().optional().describe("Git SSH private key (populated from project)"),gitCommitMessage:L().optional().describe("Commit message for git operations"),resultExtraction:QQ.optional().describe("Schema for extracting result data"),postExecutionHooks:Ce(yQ).optional().describe("Hooks to run after task completion"),executionMode:_e(["claudeAgentSdk","openaiAgentSdk","opencodeSdk","cursorSdk","codexSdk"]).optional().default("claudeAgentSdk").describe("Execution mode (default: claudeAgentSdk)"),executionPlan:Bp("executionMode",[CA({executionMode:ke("claudeAgentSdk"),promptText:L(),sdkOptions:CA({model:L(),permissionMode:_e(["plan","acceptEdits","bypassPermissions","ask"]),settingSources:Ce(L()),allowDangerouslySkipPermissions:QA(),persistSession:QA(),streamSdkEvents:QA().optional(),allowedTools:Ce(L()).optional(),settings:CA({enabledPlugins:it(L(),QA())}),env:it(L(),L()).optional()}),resume:CA({sessionId:L().optional(),continue:QA()}).optional()}),CA({executionMode:ke("opencodeSdk"),promptText:L(),sdkOptions:CA({provider:L(),model:L(),allowedTools:Ce(L()).optional(),env:it(L(),L()).optional()}),resume:CA({sessionId:L().optional(),continue:QA()}).optional()}),CA({executionMode:ke("openaiAgentSdk"),promptText:L(),sdkOptions:CA({model:L(),env:it(L(),L()).optional()}),resume:CA({sessionId:L().optional(),continue:QA()}).optional()}),CA({executionMode:ke("codexSdk"),promptText:L(),sdkOptions:CA({model:L().optional(),sandboxMode:_e(["read-only","workspace-write","danger-full-access"]).optional(),approvalPolicy:_e(["never","on-request","on-failure","untrusted"]).optional(),env:it(L(),L()).optional()}),resume:CA({sessionId:L().optional(),continue:QA()}).optional()}),CA({executionMode:ke("cursorSdk"),promptText:L(),sdkOptions:CA({model:L(),env:it(L(),L()).optional()}),resume:CA({sessionId:L().optional(),continue:QA()}).optional()})]).optional().describe("Backend-built prompt + resolved SDK options for this phase"),planEnabled:QA().optional().default(!1).describe("Enable planning phase (computed at runtime for agent)"),planContent:L().optional().describe("Final approved plan content"),planApproved:QA().optional().describe("Plan approval status"),planApprovedAt:L().optional().describe("ISO timestamp of approval"),planRejected:QA().optional().describe("Plan rejection flag"),planRejectionFeedback:L().optional().describe("User rejection feedback"),rejectedPlanContent:L().optional().describe("Previously rejected plan content"),planCompletedAt:L().optional().describe("ISO timestamp when plan was generated"),planRejectedAt:L().optional().describe("ISO timestamp when plan was rejected"),resultRejectionFeedback:L().optional().describe("User feedback when rejecting the result (most recent)"),resultRejectedAt:L().optional().describe("ISO timestamp when result was rejected (most recent)"),resultRejectionHistory:Ce(CA({feedback:L(),rejectedAt:L()})).optional().describe("All rejection messages in chronological order"),notificationChannelPlanMessageId:lt().optional(),notificationChannelPlanMessageSentAt:L().optional(),notificationChannelCompletedMessageId:lt().optional(),notificationChannelFailedMessageId:lt().optional(),streamSdkEvents:QA().optional().describe("Stream SDK messages (thinking, tool calls, etc.) as sdk_event chunks"),originalTaskSummary:L().optional().describe("Summary from the original task run (passed to retry for historical context)"),planWasApproved:QA().optional().describe("True when planApproved was cleared for rePlan=true retry — indicates the plan had been approved before"),planComments:Ce(CA({id:L(),selectedText:L(),startOffset:lt(),endOffset:lt(),commentText:L(),createdAt:L()})).optional().describe("Inline review comments attached to the plan"),hasAiConfigSecrets:QA().optional().describe("True when AI Config has secret-backed env vars; agent must fetch resolved values via /tasks/:id/resolve-secrets"),hasCredentials:QA().optional().describe("True when the task has credentials attached; agent must fetch resolved values via /tasks/:id/resolve-credentials"),mcpServersMode:_e(["all","ignoreExistingMcpServers"]).optional().describe("MCP server strategy for this run; 'ignoreExistingMcpServers' overrides the existing .mcp.json with only the template's configured servers plus the agent-platform server"),enableBrowserTools:QA().optional().describe("When true, the MCP server registers browser_interact and browser_get_context (browser_automate tasks only)")});kA.DRAFT+"",kA.CANCELLED,kA.PENDING+"",kA.CANCELLED,kA.ASSIGNED+"",kA.CANCELLED,kA.IN_PROGRESS+"",kA.CANCELLED,kA.FAILED,kA.WAITING_FOR_INPUT+"",kA.CANCELLED,kA.WAITING_FOR_PLAN_APPROVAL+"",kA.CANCELLED,kA.PLAN_APPROVED+"",kA.CANCELLED,kA.PLAN_REJECTED+"",kA.CANCELLED,kA.COMPLETED+"",kA.RESULT_REJECTED+"",kA.CANCELLED,kA.FAILED+"",kA.CANCELLED+"";const Cp="browser_capture",UQ="browser_automate";function Pl(A){let e=(A||"").trim().toLowerCase();const t=e.indexOf("@");return t>=0&&(e=e.slice(t+1)),e=e.split("/")[0].split(":")[0],e.startsWith("www.")&&(e=e.slice(4)),e}function EQ(A,e){const t=Pl(A),n=(e||"").trim().toLowerCase();if(!t||!n)return!1;if(n.startsWith("*.")){const r=n.slice(2);return t===r||t.endsWith("."+r)}return t===Pl(n)}function Kl(A,e){var s;let t;try{const o=new URL(A);if(o.protocol!=="http:"&&o.protocol!=="https:")return null;t=o.hostname}catch(o){return null}let n=null,r=-1;for(const o of e)for(const a of(s=o.domains)!=null?s:[])EQ(t,a)&&a.length>r&&(r=a.length,n=o.id);return n}class bp extends Error{}function Cc(A){return T(this,null,function*(){if(!A.ok){const e=yield A.json().catch(()=>({message:`HTTP ${A.status}`})),t=e.message||e.error||`HTTP ${A.status}`;throw A.status===401?new bp(t):new Error(t)}return A.json()})}const FQ=3e4;let Qp=FQ;function kQ(A){Number.isFinite(A)&&A>0&&(Qp=A)}function ls(n){return T(this,arguments,function*(A,e={},t=Qp){const r=new AbortController,s=setTimeout(()=>r.abort(),t);try{return yield fetch(A,$(k({},e),{credentials:"omit",signal:r.signal}))}catch(o){throw o instanceof DOMException&&o.name==="AbortError"?new Error(`Request timed out after ${Math.round(t/1e3)}s. Please check your connection and try again.`):o}finally{clearTimeout(s)}})}function YA(A,e,t,n){return T(this,null,function*(){const s=`${A.backendUrl.replace(/\/+$/,"")}/api${t}`,o=yield ls(s,{method:e,headers:{"Content-Type":"application/json",Authorization:`Bearer ${A.token}`},body:n!==void 0?JSON.stringify(n):void 0});return Cc(o)})}function vQ(A,e,t){return T(this,null,function*(){const n=A.backendUrl.replace(/\/+$/,""),r=new FormData;r.append("file",e,t);const s=yield ls(`${n}/api/files/upload`,{method:"POST",headers:{Authorization:`Bearer ${A.token}`},body:r});return Cc(s)})}function _Q(A,e){return T(this,null,function*(){return YA(A,"GET",`/projects/by-key/${encodeURIComponent(e)}`)})}const xQ=["project","note","ctx"];function SQ(A){var t,n;const e=xQ.filter(r=>A[r]===void 0||A[r]===null);if(e.length>0)throw new Error(`createTask: missing required field(s): ${e.join(", ")}`);if(!((t=A.project)!=null&&t.id)&&!((n=A.project)!=null&&n.key))throw new Error("createTask: project must have an id or key")}function Ea(A,e){return T(this,null,function*(){var h,f,g,m,Q,U;SQ(e);const{project:t,note:n,ctx:r,advancedOpts:s,titleOverride:o,titleInstruction:a,allowSubmit:i,extraFileIds:c,type:u=Cp}=e;return YA(A,"POST","/tasks",$(k(k(k(k(k(k(k(k(k(k(k(k($(k({type:u,title:o||n.slice(0,120)||r.pageTitle||"Browser capture",titleInstruction:a!=null?a:n},t.id?{projectId:t.id}:{projectKey:t.key}),{autoAssign:!0}),s!=null&&s.claudeTemplateId?{claudeTemplateId:s.claudeTemplateId}:{}),(s==null?void 0:s.quickMode)!==void 0?{quickMode:s.quickMode}:{}),(s==null?void 0:s.modelOverride)!=null?{modelOverride:s.modelOverride}:{}),(s==null?void 0:s.claudeProfileId)!=null?{claudeProfileId:s.claudeProfileId}:{}),(s==null?void 0:s.effort)!=null?{effort:s.effort}:{}),(s==null?void 0:s.executionMode)!=null?{executionMode:s.executionMode}:{}),(h=s==null?void 0:s.selectedPluginIds)!=null&&h.length?{selectedPluginIds:s.selectedPluginIds}:{}),(f=s==null?void 0:s.selectedSkillIds)!=null&&f.length?{selectedSkillIds:s.selectedSkillIds}:{}),(g=s==null?void 0:s.selectedPluginSkillIds)!=null&&g.length?{selectedPluginSkillIds:s.selectedPluginSkillIds}:{}),(m=s==null?void 0:s.selectedMcpServerIds)!=null&&m.length?{selectedMcpServerIds:s.selectedMcpServerIds}:{}),(Q=s==null?void 0:s.selectedSlashCommandIds)!=null&&Q.length?{selectedSlashCommandIds:s.selectedSlashCommandIds}:{}),(U=s==null?void 0:s.selectedRemoteContextProviderIds)!=null&&U.length?{selectedRemoteContextProviderIds:s.selectedRemoteContextProviderIds}:{}),{metadata:k(k({type:u,note:n,source:"web-sdk",pageUrl:r.pageUrl,pageTitle:r.pageTitle,elementText:r.elementText,cssSelector:r.cssSelector,elementOuterHtml:r.elementOuterHtml,ancestry:r.ancestry,elementRole:r.elementRole,elementAriaLabel:r.elementAriaLabel,enclosingSection:r.enclosingSection,description:r.description,canonicalUrl:r.canonicalUrl,lang:r.lang,ogTitle:r.ogTitle,ogDescription:r.ogDescription,ogType:r.ogType,ogSiteName:r.ogSiteName,viewportWidth:r.viewportWidth,viewportHeight:r.viewportHeight,scrollX:r.scrollX,scrollY:r.scrollY,selectionText:r.selectionText,capturedAt:r.capturedAt,interactionSteps:r.interactionSteps},i!==void 0?{allowSubmit:i}:{}),c!=null&&c.length?{extraFileIds:c}:{})}))})}function Nl(A,e){return T(this,null,function*(){return Ea(A,$(k({},e),{type:UQ}))})}function zl(A,e,t,n,r){return T(this,null,function*(){var s;return YA(A,"POST","/planning-sessions",k(k($(k({},e.id?{projectId:e.id}:{projectKey:e.key}),{instruction:t,quickMode:(s=n==null?void 0:n.quickMode)!=null?s:!1}),n!=null&&n.claudeTemplateId?{claudeTemplateId:n.claudeTemplateId}:{}),r!=null&&r.length?{fileIds:r}:{}))})}function IQ(A,e){return T(this,null,function*(){const t=e?`?projectId=${encodeURIComponent(e)}`:"";return YA(A,"GET",`/claude-templates${t}`)})}function yp(A,e){return T(this,null,function*(){return YA(A,"GET",`/tasks/${e}`)})}function TQ(A,e){return T(this,null,function*(){return YA(A,"GET",`/planning-sessions/${e}`)})}function $l(A){return T(this,null,function*(){return YA(A,"GET","/projects")})}function HQ(A){return T(this,null,function*(){return(yield YA(A,"GET","/tenants/current")).membership})}function Gl(A,e){if(!A||A.includes("tenant:*")||A.includes(e))return!0;const t=e.split(":")[0];return A.includes(`${t}:*`)}function Fa(A,e,t){return T(this,null,function*(){const r=`${A.backendUrl.replace(/\/+$/,"")}/api/auth/tokens/exchange-code`,s=yield ls(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,origin:t})});return Cc(s)})}function LQ(A,e){return T(this,null,function*(){return YA(A,"GET",`/tasks/${e}/browser-commands/pending`)})}function DQ(A,e,t,n,r){return T(this,null,function*(){return YA(A,"POST",`/tasks/${e}/browser-commands/${t}/result`,{status:n,message:r})})}function RQ(A,e){return T(this,null,function*(){return YA(A,"GET",`/tasks/${e}/chunks`)})}function OQ(A,e,t){return T(this,null,function*(){return YA(A,"POST",`/tasks/${e}/instructions`,{content:t})})}function MQ(A,e){return T(this,null,function*(){return YA(A,"POST",`/tasks/${e}/cancel`)})}function PQ(A,e){return T(this,null,function*(){return YA(A,"POST",`/tasks/${e}/approve-result`)})}function KQ(A,e,t){return T(this,null,function*(){return YA(A,"POST",`/tasks/${e}/reject-result`,{feedback:t})})}function No(A,e){return T(this,null,function*(){return YA(A,"GET",`/tasks/${e}/interactions?filter=unanswered`)})}function Up(A,e,t,n){return T(this,null,function*(){return YA(A,"POST",`/tasks/${e}/interactions/${t}/answer`,{answer:n})})}function NQ(A,e,t){const n=!!(e.backendUrl&&e.token),r=document.createElement("div");r.className="ap-sdk-advanced",r.innerHTML=`
1657
1626
  <details class="ap-sdk-advanced__details">
1658
1627
  <summary class="ap-sdk-advanced__summary">Advanced options</summary>
1659
1628
  <div class="ap-sdk-advanced__body">
@@ -1672,12 +1641,134 @@ ${n}${r?`
1672
1641
  </div>
1673
1642
  </div>
1674
1643
  </details>
1675
- `,e.appendChild(o);const i=o.querySelector("[data-ap-adv-template-field]"),a=o.querySelector("[data-ap-template]"),d=o.querySelector("[data-ap-quickmode]");let l=[];if(r){const p={backendUrl:t.backendUrl,token:t.token};Cm(p,n!=null?n:void 0).then(h=>{var m,k;if(l=h,h.length===0){i.style.display="none";return}const g=(m=h.find(w=>w.isDefault&&w.scope==="project"))!=null?m:h.find(w=>w.isDefault&&w.scope==="global");a.innerHTML='<option value="">None (use default)</option>'+h.map(w=>`<option value="${Rk(w.id)}">${Lk(w.name)}${w.isDefault?" (Default)":""}</option>`).join(""),a.value=(k=g==null?void 0:g.id)!=null?k:""}).catch(()=>{i.style.display="none"})}else{a.innerHTML='<option value="">None</option>',a.disabled=!0;const p=document.createElement("span");p.className="ap-sdk-advanced__hint",p.textContent="Connect credentials to enable template selection",i.appendChild(p)}return{getOptions(){var g,m,k,w,v,Z,K,M;const p=a.value||null,h=p?(m=(g=l.find(E=>E.id===p))==null?void 0:g.templateData)!=null?m:{}:{};return y(y(y(y(y(y(y(y(y(y({claudeTemplateId:p,quickMode:d.checked},h.modelOverride!=null?{modelOverride:h.modelOverride}:{}),h.claudeProfileId!=null?{claudeProfileId:h.claudeProfileId}:{}),h.effort!=null?{effort:h.effort}:{}),h.executionMode!=null?{executionMode:h.executionMode}:{}),(k=h.selectedPluginIds)!=null&&k.length?{selectedPluginIds:h.selectedPluginIds}:{}),(w=h.selectedSkillIds)!=null&&w.length?{selectedSkillIds:h.selectedSkillIds}:{}),(v=h.selectedPluginSkillIds)!=null&&v.length?{selectedPluginSkillIds:h.selectedPluginSkillIds}:{}),(Z=h.selectedMcpServerIds)!=null&&Z.length?{selectedMcpServerIds:h.selectedMcpServerIds}:{}),(K=h.selectedSlashCommandIds)!=null&&K.length?{selectedSlashCommandIds:h.selectedSlashCommandIds}:{}),(M=h.selectedRemoteContextProviderIds)!=null&&M.length?{selectedRemoteContextProviderIds:h.selectedRemoteContextProviderIds}:{})}}}function Rk(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Lk(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const gi="ap-sdk-captures",zk=50;function hr(){try{const e=localStorage.getItem(gi);return e?JSON.parse(e):[]}catch(e){return[]}}function Ik(e){const t=hr(),n=[e,...t].slice(0,zk);try{localStorage.setItem(gi,JSON.stringify(n))}catch(r){}}function $k(){try{localStorage.removeItem(gi)}catch(e){}}function al(e){var a,d,l,p,h;if(e.id){const g=document.querySelector(`label[for="${CSS.escape(e.id)}"]`),m=(a=g==null?void 0:g.textContent)==null?void 0:a.trim();if(m)return m}const t=e.closest("label"),n=(d=t==null?void 0:t.textContent)==null?void 0:d.trim();if(n)return n;const r=(l=e.getAttribute("aria-label"))==null?void 0:l.trim();if(r)return r;const o=(p=e.placeholder)==null?void 0:p.trim();if(o)return o;const i=(h=e.getAttribute("name"))==null?void 0:h.trim();return i||e.tagName.toLowerCase()}function Ok(e,t){return`Click "${e}" ${t.toLowerCase()}`}function cl(e,t,n){return n?`Typed [redacted] into ${e}`:`Typed "${t}" into ${e}`}function Za(e,t){return`Scrolled to (${e}, ${t})`}function Nk(e,t){return t?`Pressed "${e}" in ${t}`:`Pressed "${e}"`}function ll(e){return e.map((t,n)=>`${n+1}. ${t.description}`).join(`
1676
- `)}const Dk=400,Mk=new Set(["Enter","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]),jk=new Set(["Control","Meta","Alt","Shift"]);function Uk(e){if(jk.has(e.key))return null;const t=[];return e.ctrlKey&&t.push("Ctrl"),e.metaKey&&t.push("Cmd"),e.altKey&&t.push("Alt"),t.length>0?(t.push(e.key.length===1?e.key.toUpperCase():e.key),t.join("+")):Mk.has(e.key)?e.key:null}function Zk(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement?al(e):$o(e)||e.tagName.toLowerCase()}let ur=[],Ke=null,Go=null,it=null,Ut=null,Zt=null;function ul(){Go&&(Go.textContent=`● Recording — ${ur.length} step${ur.length===1?"":"s"}`)}function Fs(){Zt&&(clearTimeout(Zt),Zt=null),Ut&&(ur.push(Ut),Ut=null,ul())}function Cs(e){Fs(),ur.push(e),ul()}function qk(e){var t,n,r;return e instanceof HTMLSelectElement&&(r=(n=(t=e.selectedOptions[0])==null?void 0:t.textContent)==null?void 0:n.trim())!=null?r:e.value}function Hk(e,t){it&&it(),ur=[],Ut=null,Ke=document.createElement("div"),Ke.className="ap-sdk-recorder-bar",Ke.setAttribute("data-ap-sdk","1"),Ke.innerHTML=`
1677
- <span class="ap-sdk-recorder-bar__counter" data-ap-recorder-counter>● Recording — 0 steps</span>
1678
- <button class="ap-sdk-recorder-bar__btn ap-sdk-recorder-bar__btn--stop" data-ap-recorder-stop type="button">Stop</button>
1679
- <button class="ap-sdk-recorder-bar__btn ap-sdk-recorder-bar__btn--discard" data-ap-recorder-discard type="button">Discard</button>
1680
- `,document.body.appendChild(Ke),Qt(Ke),Go=Ke.querySelector("[data-ap-recorder-counter]");const n=()=>{Fs();const l=ur;it==null||it(),e(l)},r=()=>{it==null||it()};Ke.querySelector("[data-ap-recorder-stop]").addEventListener("click",n),Ke.querySelector("[data-ap-recorder-discard]").addEventListener("click",r);const o=l=>{if($r(l.target))return;const p=l.target;Cs({action:"click",cssSelector:yo(p),elementText:$o(p),description:Ok($o(p),p.tagName),capturedAt:new Date().toISOString()})},i=l=>{if($r(l.target))return;const p=l.target;if(!(p instanceof HTMLInputElement)&&!(p instanceof HTMLTextAreaElement)&&!(p instanceof HTMLSelectElement))return;const h=al(p),g=Ed(p),m=g?"[redacted]":qk(p);Cs(D(y({action:"inputText",cssSelector:yo(p),elementText:h,value:m},g?{redacted:!0}:{}),{description:cl(h,m,g),capturedAt:new Date().toISOString()}))},a=()=>{const l=Math.round(window.scrollX),p=Math.round(window.scrollY);Ut?(Ut.scrollX=l,Ut.scrollY=p,Ut.description=Za(l,p)):Ut={action:"scroll",scrollX:l,scrollY:p,description:Za(l,p),capturedAt:new Date().toISOString()},Zt&&clearTimeout(Zt),Zt=setTimeout(()=>{Zt=null,Fs()},Dk)},d=l=>{if(l.key==="Escape"){r();return}if($r(l.target))return;const p=Uk(l);if(!p)return;const h=l.target instanceof Element?l.target:document.body,g=Zk(h);Cs({action:"keypress",cssSelector:yo(h),elementText:g,key:p,description:Nk(p,g),capturedAt:new Date().toISOString()})};document.addEventListener("click",o,{capture:!0}),document.addEventListener("change",i,{capture:!0}),window.addEventListener("scroll",a,{capture:!0,passive:!0}),document.addEventListener("keydown",d,{capture:!0}),it=()=>{document.removeEventListener("click",o,{capture:!0}),document.removeEventListener("change",i,{capture:!0}),window.removeEventListener("scroll",a,{capture:!0}),document.removeEventListener("keydown",d,{capture:!0}),Zt&&(clearTimeout(Zt),Zt=null),Ut=null,Ke&&en(Ke),Ke==null||Ke.remove(),Ke=null,Go=null,it=null}}function Fk(){it==null||it()}function Co(){return it!==null}const Bk="data-ap-sdk",Gk="ap-sdk-fab",qa="ap-sdk-fab--dragging",mi="ap-sdk-fab--open",dl="ap-sdk-fab-pos",Wo="ap-sdk-fab--left-edge",Wk='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M15 13v2"/><path d="M9 13v2"/></svg>',Jk='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 3 7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/><path d="m13 13 6 6"/></svg>',Vk='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="8"/></svg>',Yk='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>';let $=null,Mt=null,hn=null,fn=null,ft=null,Bn=null,Gn=null,Wn=null,Ao=null,Dr=null,or=null,Po=null,Ro=null,Lo=null,pl=0,hl=0,fl=0,gl=0,Xn=!1,Pt=!1,Mr=null,Rn=null;function Xk(){Mr=e=>{if(!$){zo();return}if(!Xn){if(Math.hypot(e.clientX-fl,e.clientY-gl)<5)return;Xn=!0,Pt=!0,$.classList.add(qa)}Kk(e.clientX-pl,e.clientY-hl)},Rn=()=>{if(!$){zo();return}Xn?(Xn=!1,$.classList.remove(qa),$.style.transition="",Qk($.getBoundingClientRect())):$.style.transition="",zo()},window.addEventListener("pointermove",Mr),window.addEventListener("pointerup",Rn),window.addEventListener("pointercancel",Rn)}function zo(){Mr&&(window.removeEventListener("pointermove",Mr),Mr=null),Rn&&(window.removeEventListener("pointerup",Rn),window.removeEventListener("pointercancel",Rn),Rn=null)}function Kk(e,t){if(!$)return;const n=$.offsetWidth||52,r=$.offsetHeight||52;$.style.top=`${Math.max(0,Math.min(t,window.innerHeight-r))}px`,$.style.left=`${Math.max(0,Math.min(e,window.innerWidth-n))}px`,$.style.bottom="auto",$.style.right="auto"}function Qk(e){if(!$)return;const n=Math.max(16,Math.min(window.innerHeight-e.bottom,window.innerHeight-52-16)),r=e.left+e.width/2<window.innerWidth/2?"left":"right";$.style.top="auto",$.style.bottom=`${n}px`,r==="left"?($.style.right="auto",$.style.left="16px",$.classList.add(Wo)):($.style.left="auto",$.style.right="16px",$.classList.remove(Wo));try{localStorage.setItem(dl,JSON.stringify({edge:r,bottom:n}))}catch(o){}}function e_(){if($)try{const e=localStorage.getItem(dl);if(!e)return;const t=JSON.parse(e);if(typeof t.bottom!="number"||t.edge!=="left"&&t.edge!=="right")return;const r=Math.max(16,Math.min(t.bottom,window.innerHeight-52-16));$.style.top="auto",$.style.bottom=`${r}px`,t.edge==="left"?($.style.right="auto",$.style.left="16px",$.classList.add(Wo)):($.style.left="auto",$.style.right="16px",$.classList.remove(Wo))}catch(e){}}function Kn(){$==null||$.classList.remove(mi),or&&(window.removeEventListener("pointerdown",or,{capture:!0}),or=null)}function t_(){$&&($.classList.add(mi),or=e=>{!$||$.contains(e.target)||Kn()},requestAnimationFrame(()=>{or&&window.addEventListener("pointerdown",or,{capture:!0})}))}function ko(e){return new DOMParser().parseFromString(e,"text/html").body.firstElementChild}function ml(e,t,n){var d;if(Po=e,Ro=t,Lo=n,$)return;$=document.createElement("div"),$.className=Gk,$.setAttribute(Bk,"1"),Bn=document.createElement("div"),Bn.className="ap-sdk-fab__row";const r=document.createElement("span");r.className="ap-sdk-fab__label",r.textContent="View captures",ft=document.createElement("button"),ft.className="ap-sdk-fab__list ap-sdk-fab__sub",ft.setAttribute("aria-label","My captures"),ft.setAttribute("title","View my captures"),ft.appendChild(ko(Yk));const o=document.createElement("span");o.className="ap-sdk-fab__badge",o.setAttribute("data-ap-badge",""),o.style.display="none",ft.appendChild(o),Bn.appendChild(r),Bn.appendChild(ft),Gn=document.createElement("div"),Gn.className="ap-sdk-fab__row";const i=document.createElement("span");i.className="ap-sdk-fab__label",i.textContent="Capture element",hn=document.createElement("button"),hn.className="ap-sdk-fab__capture ap-sdk-fab__sub",hn.setAttribute("aria-label","Capture element"),hn.setAttribute("title","Capture element to Agent Platform"),hn.appendChild(ko(Jk)),Gn.appendChild(i),Gn.appendChild(hn),Wn=document.createElement("div"),Wn.className="ap-sdk-fab__row";const a=document.createElement("span");a.className="ap-sdk-fab__label",a.textContent="Record interaction",fn=document.createElement("button"),fn.className="ap-sdk-fab__record ap-sdk-fab__sub",fn.setAttribute("aria-label","Record interaction"),fn.setAttribute("title","Record a sequence of interactions"),fn.appendChild(ko(Vk)),Wn.appendChild(a),Wn.appendChild(fn),Mt=document.createElement("button"),Mt.className="ap-sdk-fab__main",Mt.setAttribute("aria-label","Agent Platform"),Mt.setAttribute("title","Agent Platform"),Mt.appendChild(ko(Wk)),$.appendChild(Bn),$.appendChild(Gn),$.appendChild(Wn),$.appendChild(Mt),Mt.addEventListener("click",l=>{if(Pt){Pt=!1;return}l.preventDefault(),l.stopPropagation(),$!=null&&$.classList.contains(mi)?Kn():t_()}),hn.addEventListener("click",l=>{if(Pt){Pt=!1;return}l.preventDefault(),l.stopPropagation(),Kn(),!tr()&&!Co()&&Po&&Po()}),fn.addEventListener("click",l=>{if(Pt){Pt=!1;return}l.preventDefault(),l.stopPropagation(),Kn(),!tr()&&!Co()&&Ro&&Ro()}),ft.addEventListener("click",l=>{if(Pt){Pt=!1;return}l.preventDefault(),l.stopPropagation(),Kn(),Lo&&Lo()}),Dr=l=>{if(!$||!($===l.target||$.contains(l.target)))return;const p=$.getBoundingClientRect();pl=l.clientX-p.left,hl=l.clientY-p.top,fl=l.clientX,gl=l.clientY,Xn=!1,Pt=!1,$.style.transition="none",l.stopPropagation(),Xk()},window.addEventListener("pointerdown",Dr,{capture:!0}),((d=document.body)!=null?d:document.documentElement).appendChild($),Qt($),e_(),Ao=setInterval(()=>{Mt&&Mt.classList.toggle("ap-sdk-fab__main--active",tr()||Co())},200)}function On(e){const t=ft==null?void 0:ft.querySelector("[data-ap-badge]");t&&(e>0?(t.textContent=String(e),t.style.display=""):t.style.display="none")}function bl(){Xn=!1,Pt=!1,zo(),Kn(),Ao&&(clearInterval(Ao),Ao=null),Dr&&(window.removeEventListener("pointerdown",Dr,{capture:!0}),Dr=null),$&&en($),$==null||$.remove(),$=null,Mt=null,hn=null,fn=null,ft=null,Bn=null,Gn=null,Wn=null,Po=null,Ro=null,Lo=null}function kl(e,t){return z(this,null,function*(){try{if(e.type==="planning"){const r=yield Am(t,e.id);return{capture:e,status:r.status,approved:r.status==="approved"}}const n=yield Mc(t,e.id);return{capture:e,status:n.status,approved:n.approved===!0}}catch(n){return{capture:e,status:"unavailable",approved:!1}}})}function _l(e){return e.filter(t=>!t.approved).length}function vl(e){return z(this,null,function*(){const t=hr();if(!e||t.length===0){On(t.length);return}const n=yield Promise.all(t.map(r=>kl(r,e)));On(_l(n))})}let dn=null;function n_(){const e=new Uint32Array(4);return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16)).join("")}function Bs(e){if(dn){const d=dn;d.cleanup(),d.popup.closed||d.popup.close(),dn=null}const t=e.replace(/\/+$/,""),n=new URL(t).origin,r=n_(),o=window.location.origin,i=`${t}/oauth/authorize?origin=${encodeURIComponent(o)}&state=${encodeURIComponent(r)}`,a=window.open(i,"ap-sdk-oauth","width=480,height=640");return a?new Promise((d,l)=>{let p=!1;function h(){window.removeEventListener("message",g),clearInterval(m),(dn==null?void 0:dn.popup)===a&&(dn=null)}function g(k){if(k.origin!==n)return;const w=k.data;!w||w.type!=="ap-sdk-oauth"||w.state!==r||!w.code||(p=!0,h(),d({code:w.code}))}window.addEventListener("message",g);const m=window.setInterval(()=>{a.closed&&(h(),p||l(new Error("Connection cancelled.")))},500);dn={popup:a,cleanup:h}}):Promise.reject(new Error("Popup blocked — please allow popups for this site and try again."))}const r_="https://agent-platform.tung.engineering",bi="ap-sdk-config";function o_(){try{const e=sessionStorage.getItem(bi);if(!e)return null;const t=JSON.parse(e);return!(t!=null&&t.backendUrl)||!(t!=null&&t.token)||!(t!=null&&t.projectCode)||!(t!=null&&t.expiresAt)?null:new Date(t.expiresAt).getTime()<=Date.now()?(yl(),null):t}catch(e){return null}}function rs(e){sessionStorage.setItem(bi,JSON.stringify(e)),i_({backendUrl:e.backendUrl,projectCode:e.projectCode})}function yl(){sessionStorage.removeItem(bi)}const wl="ap-sdk-last-connection";function s_(){try{const e=localStorage.getItem(wl);if(!e)return null;const t=JSON.parse(e);return!(t!=null&&t.backendUrl)||!(t!=null&&t.projectCode)?null:t}catch(e){return null}}function i_(e){try{localStorage.setItem(wl,JSON.stringify(e))}catch(t){}}let X=null;function Jt(){X&&en(X),X==null||X.remove(),X=null}function ki(e){X&&Jt(),X=document.createElement("div"),X.className="ap-sdk-panel",X.setAttribute("data-ap-sdk","1"),X.setAttribute("role","dialog"),X.setAttribute("aria-modal","true"),X.setAttribute("aria-label","Connect to Agent Platform");const t=s_();t?n(t):r(r_),document.body.appendChild(X),Qt(X);function n(i){if(!X)return;X.innerHTML=`
1644
+ `,A.appendChild(r);const s=r.querySelector("[data-ap-adv-template-field]"),o=r.querySelector("[data-ap-template]"),a=r.querySelector("[data-ap-quickmode]");let i=[];if(n){const c={backendUrl:e.backendUrl,token:e.token};IQ(c,t!=null?t:void 0).then(u=>{var f,g;if(i=u,u.length===0){s.style.display="none";return}const h=(f=u.find(m=>m.isDefault&&m.scope==="project"))!=null?f:u.find(m=>m.isDefault&&m.scope==="global");o.innerHTML='<option value="">None (use default)</option>'+u.map(m=>`<option value="${zQ(m.id)}">${$Q(m.name)}${m.isDefault?" (Default)":""}</option>`).join(""),o.value=(g=h==null?void 0:h.id)!=null?g:""}).catch(()=>{s.style.display="none"})}else{o.innerHTML='<option value="">None</option>',o.disabled=!0;const c=document.createElement("span");c.className="ap-sdk-advanced__hint",c.textContent="Connect credentials to enable template selection",s.appendChild(c)}return{getOptions(){var h,f,g,m,Q,U,E,v;const c=o.value||null,u=c?(f=(h=i.find(F=>F.id===c))==null?void 0:h.templateData)!=null?f:{}:{};return k(k(k(k(k(k(k(k(k(k({claudeTemplateId:c,quickMode:a.checked},u.modelOverride!=null?{modelOverride:u.modelOverride}:{}),u.claudeProfileId!=null?{claudeProfileId:u.claudeProfileId}:{}),u.effort!=null?{effort:u.effort}:{}),u.executionMode!=null?{executionMode:u.executionMode}:{}),(g=u.selectedPluginIds)!=null&&g.length?{selectedPluginIds:u.selectedPluginIds}:{}),(m=u.selectedSkillIds)!=null&&m.length?{selectedSkillIds:u.selectedSkillIds}:{}),(Q=u.selectedPluginSkillIds)!=null&&Q.length?{selectedPluginSkillIds:u.selectedPluginSkillIds}:{}),(U=u.selectedMcpServerIds)!=null&&U.length?{selectedMcpServerIds:u.selectedMcpServerIds}:{}),(E=u.selectedSlashCommandIds)!=null&&E.length?{selectedSlashCommandIds:u.selectedSlashCommandIds}:{}),(v=u.selectedRemoteContextProviderIds)!=null&&v.length?{selectedRemoteContextProviderIds:u.selectedRemoteContextProviderIds}:{})}}}function zQ(A){return A.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function $Q(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const bc="shared",Ep="ap-sdk-panel-size:",Vl=280,Zl=200;function GQ(A){try{const e=sessionStorage.getItem(Ep+A);if(!e)return null;const t=JSON.parse(e);return typeof(t==null?void 0:t.width)=="number"&&typeof(t==null?void 0:t.height)=="number"?t:null}catch(e){return null}}function VQ(A,e){try{sessionStorage.setItem(Ep+A,JSON.stringify(e))}catch(t){}}function Vs(A,e,t){return Math.min(Math.max(A,e),t)}function Xl(){return window.innerWidth-32}function Wl(){return window.innerHeight-64}function Qc(A,e){const t=GQ(e);t&&(A.style.width=`${Vs(t.width,Vl,Xl())}px`,A.style.height=`${Vs(t.height,Zl,Wl())}px`);const n=document.createElement("div");n.className="ap-sdk-resize-handle",n.setAttribute("data-ap-sdk","1"),A.appendChild(n);let r=!1,s=0,o=0,a=0,i=0,c=0,u=0;const h=m=>{r&&(c=Vs(a+(m.clientX-s),Vl,Xl()),u=Vs(i+(m.clientY-o),Zl,Wl()),A.style.width=`${c}px`,A.style.height=`${u}px`)},f=()=>{r&&(r=!1,document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",f),VQ(e,{width:c,height:u}))},g=m=>{const Q=m.target;if(!(Q===n||n.contains(Q)))return;m.preventDefault(),m.stopPropagation(),r=!0,s=m.clientX,o=m.clientY;const U=A.getBoundingClientRect();a=U.width,i=U.height,c=a,u=i,document.addEventListener("pointermove",h),document.addEventListener("pointerup",f)};return window.addEventListener("pointerdown",g,{capture:!0}),()=>{window.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",f)}}const ms="shared",Fp="ap-sdk-panel-pos:";function ZQ(A){try{const e=sessionStorage.getItem(Fp+A);if(!e)return null;const t=JSON.parse(e);return typeof(t==null?void 0:t.left)=="number"&&typeof(t==null?void 0:t.top)=="number"?t:null}catch(e){return null}}function XQ(A,e){try{sessionStorage.setItem(Fp+A,JSON.stringify(e))}catch(t){}}function Jl(A,e,t){return Math.min(Math.max(A,e),t)}function Cs(A,e){const t=(m,Q)=>{const U=Math.max(0,window.innerWidth-A.offsetWidth),E=Math.max(0,window.innerHeight-A.offsetHeight);A.style.left=`${Jl(m,0,U)}px`,A.style.top=`${Jl(Q,0,E)}px`,A.style.right="auto",A.style.transform="none"},n=ZQ(e);n&&t(n.left,n.top);let r=!1,s=0,o=0,a=0,i=0,c=0,u=0;const h=m=>{r&&(c=a+(m.clientX-s),u=i+(m.clientY-o),t(c,u))},f=()=>{r&&(r=!1,document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",f),XQ(e,{left:c,top:u}))},g=m=>{const Q=m.target;if(!(Q===A||A.contains(Q))||!Q.closest(".ap-sdk-panel__header")||Q.closest("button, a, input, select, textarea"))return;m.preventDefault(),r=!0,s=m.clientX,o=m.clientY;const U=A.getBoundingClientRect();a=U.left,i=U.top,c=a,u=i,document.addEventListener("pointermove",h),document.addEventListener("pointerup",f)};return window.addEventListener("pointerdown",g,{capture:!0}),()=>{window.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",f)}}const zo="ap-sdk-panel-draft";function kp(){var A,e;try{const t=localStorage.getItem(zo);if(!t)return null;const n=JSON.parse(t);return!Array.isArray(n.completedPicks)||!n.currentCtx||typeof n.currentCtx!="object"?null:{captureType:(A=n.captureType)!=null?A:"task",note:(e=n.note)!=null?e:"",completedPicks:n.completedPicks,allowSubmit:!!n.allowSubmit,currentCtx:n.currentCtx}}catch(t){return null}}function WQ(A){try{if(!A.note&&A.completedPicks.length===0&&!A.allowSubmit){localStorage.removeItem(zo);return}localStorage.setItem(zo,JSON.stringify(A))}catch(e){}}function yc(){try{localStorage.removeItem(zo)}catch(A){}}/*!
1645
+ * html2canvas-pro 2.4.3 <https://yorickshan.github.io/html2canvas-pro/>
1646
+ * Copyright (c) 2024-present yorickshan and html2canvas-pro contributors
1647
+ * Released under MIT License
1648
+ */var JQ=class ka{constructor(e={}){const t=e.window||(typeof window!="undefined"?window:void 0);if(!t)throw new Error("Window object is required but not available");this.window=t,this.cspNonce=e.cspNonce,this.cache=e.cache}static fromElement(e,t={}){const n=e.ownerDocument;if(!n)throw new Error("Element is not attached to a document");const r=n.defaultView;if(!r)throw new Error("Document is not attached to a window");return new ka(k({window:r},t))}clone(e={}){var t,n;return new ka({window:e.window||this.window,cspNonce:(t=e.cspNonce)!=null?t:this.cspNonce,cache:(n=e.cache)!=null?n:this.cache})}},jQ=class{constructor(A={}){this.config=k({maxImageTimeout:3e5,allowDataUrls:!0},A)}validateUrl(A,e="general"){if(!A||typeof A!="string")return{valid:!1,error:"URL must be a non-empty string"};if(A.startsWith("data:"))return this.config.allowDataUrls?{valid:!0,sanitized:A}:{valid:!1,error:"Data URLs are not allowed"};if(A.startsWith("blob:"))return{valid:!0,sanitized:A};try{const t=new URL(A);if(!["http:","https:"].includes(t.protocol))return{valid:!1,error:`Protocol ${t.protocol} is not allowed. Only http and https are permitted.`};if(e==="proxy"&&this.config.allowedProxyDomains&&this.config.allowedProxyDomains.length>0){const n=t.hostname.toLowerCase();if(!this.config.allowedProxyDomains.some(r=>{const s=r.toLowerCase();return n===s||n.endsWith("."+s)}))return{valid:!1,error:`Proxy domain ${t.hostname} is not in the allowed list`}}if(e==="proxy"){if(!this.config.allowLocalhostProxy){const n=t.hostname.toLowerCase();if(n==="localhost"||n==="127.0.0.1"||n==="::1")return{valid:!1,error:"Localhost is not allowed for proxy URLs"};if(this.isPrivateIP(n))return{valid:!1,error:"Private IP addresses are not allowed for proxy URLs"};if(n.startsWith("169.254.")||n.startsWith("fe80:"))return{valid:!1,error:"Link-local addresses are not allowed for proxy URLs"}}return{valid:!0,sanitized:A,requiresRuntimeCheck:!0}}return{valid:!0,sanitized:A}}catch(t){return{valid:!1,error:`Invalid URL format: ${t instanceof Error?t.message:"Unknown error"}`}}}isPrivateIP(A){return[/^0\./,/^10\./,/^100\.(6[4-9]|[7-9][0-9]|1[0-1][0-9]|12[0-7])\./,/^127\./,/^169\.254\./,/^172\.(1[6-9]|2[0-9]|3[0-1])\./,/^192\.0\.0\./,/^192\.0\.2\./,/^192\.168\./,/^198\.(1[8-9])\./,/^198\.51\.100\./,/^203\.0\.113\./,/^2(2[4-9]|3[0-9])\./,/^24[0-9]\./,/^255\.255\.255\.255$/].some(e=>e.test(A))?!0:A.includes(":")?this.isPrivateIPv6(A):!1}isPrivateIPv6(A){const e=A.toLowerCase().trim().replace(/^\[|\]$/g,"").split("%")[0];if(/^(0:){7}1$/.test(e)||e==="::1"||/^(0:){7}0$/.test(e)||e==="::")return!0;const t=this.expandIPv6(e);if(!t)return this.isPrivateIPv6Prefix(e);const n=parseInt(t.substring(0,2),16);if(n>=252&&n<=253)return!0;if(n===254){const r=parseInt(t.substring(2,4),16);if(r>=128&&r<=191)return!0}return n===255}expandIPv6(A){try{if(A.includes("::")){const e=A.split("::");if(e.length>2)return null;const t=e[0]?e[0].split(":"):[],n=e[1]?e[1].split(":"):[],r=8-t.length-n.length;if(r<0)return null;const s=Array(r).fill("0000");return[...t,...s,...n].map(o=>o.padStart(4,"0")).join(":")}else{const e=A.split(":");return e.length!==8?null:e.map(t=>t.padStart(4,"0")).join(":")}}catch(e){return null}}isPrivateIPv6Prefix(A){return!!(/^fc[0-9a-f]{0,2}:?/i.test(A)||/^fd[0-9a-f]{0,2}:?/i.test(A)||/^fe[89ab][0-9a-f]:?/i.test(A)||/^ff[0-9a-f]{0,2}:?/i.test(A))}validateCspNonce(A){return!A||typeof A!="string"?{valid:!1,error:"CSP nonce must be a non-empty string"}:A.length<16?{valid:!1,error:"CSP nonce is too short (minimum 16 characters recommended)"}:/^[A-Za-z0-9+/=_-]+$/.test(A)?{valid:!0,sanitized:A}:{valid:!1,error:"CSP nonce contains invalid characters"}}validateImageTimeout(A){return typeof A!="number"||isNaN(A)?{valid:!1,error:"Image timeout must be a number"}:A<0?{valid:!1,error:"Image timeout cannot be negative"}:this.config.maxImageTimeout&&A>this.config.maxImageTimeout?{valid:!1,error:`Image timeout ${A}ms exceeds maximum allowed ${this.config.maxImageTimeout}ms`}:{valid:!0,sanitized:A}}validateDimensions(A,e){if(typeof A!="number"||typeof e!="number")return{valid:!1,error:"Dimensions must be numbers"};if(isNaN(A)||isNaN(e))return{valid:!1,error:"Dimensions cannot be NaN"};if(A<=0||e<=0)return{valid:!1,error:"Dimensions must be positive"};const t=32767;return A>t||e>t?{valid:!1,error:`Dimensions exceed maximum allowed (${t}px)`}:{valid:!0,sanitized:{width:A,height:e}}}validateScale(A){return typeof A!="number"||isNaN(A)?{valid:!1,error:"Scale must be a number"}:A<=0?{valid:!1,error:"Scale must be positive"}:A>10?{valid:!1,error:"Scale factor too large (maximum 10x)"}:{valid:!0,sanitized:A}}validateElement(A){if(!A)return{valid:!1,error:"Element is required"};if(typeof A!="object")return{valid:!1,error:"Element must be an object"};const e=A;return typeof HTMLElement!="undefined"&&A instanceof HTMLElement?A.ownerDocument?{valid:!0}:{valid:!1,error:"Element must be attached to a document"}:e.ownerDocument?e.ownerDocument.defaultView?{valid:!0}:{valid:!1,error:"Document must be attached to a window (ownerDocument.defaultView required)"}:{valid:!1,error:"Element must be attached to a document (ownerDocument required)"}}validateOptions(A){var n,r;const e=[],t=A.proxy;if(t!=null&&typeof t=="string"&&t.length>0){const s=this.validateUrl(t,"proxy");s.valid||e.push(`Proxy: ${s.error}`)}if(A.imageTimeout!==void 0){const s=this.validateImageTimeout(A.imageTimeout);s.valid||e.push(`Image timeout: ${s.error}`)}if(A.width!==void 0||A.height!==void 0){const s=(n=A.width)!=null?n:800,o=(r=A.height)!=null?r:600,a=this.validateDimensions(s,o);a.valid||e.push(`Dimensions: ${a.error}`)}if(A.scale!==void 0){const s=this.validateScale(A.scale);s.valid||e.push(`Scale: ${s.error}`)}if(A.cspNonce!==void 0){const s=this.validateCspNonce(A.cspNonce);s.valid||e.push(`CSP nonce: ${s.error}`)}if(this.config.customValidator){const s=this.config.customValidator(A,"options");s.valid||e.push(`Custom validation: ${s.error}`)}return e.length>0?{valid:!1,error:e.join("; ")}:{valid:!0}}};function YQ(A={}){return new jQ(k({allowDataUrls:!0,maxImageTimeout:3e5},A))}var qQ=class{constructor(A,e=!0){this.context=A,this.activeMetrics=new Map,this.completedMetrics=[],this.enabled=e,this.getTime=typeof performance!="undefined"&&typeof performance.now=="function"?()=>performance.now():()=>Date.now()}start(A,e){var t;this.enabled&&(this.activeMetrics.has(A)&&((t=this.context)==null||t.logger.warn(`Performance metric '${A}' already started. Overwriting.`)),this.activeMetrics.set(A,{name:A,startTime:this.getTime(),metadata:e}))}end(A){var t,n;if(!this.enabled)return;const e=this.activeMetrics.get(A);if(!e){(t=this.context)==null||t.logger.warn(`Performance metric '${A}' not found. Was start() called?`);return}return e.endTime=this.getTime(),e.duration=e.endTime-e.startTime,this.completedMetrics.push(e),this.activeMetrics.delete(A),(n=this.context)==null||n.logger.debug(`⏱️ ${A}: ${e.duration.toFixed(2)}ms`,e.metadata),e}measure(A,e,t){this.start(A,t);try{const n=e();return this.end(A),n}catch(n){throw this.end(A),n}}measureAsync(A,e,t){return T(this,null,function*(){this.start(A,t);try{const n=yield e();return this.end(A),n}catch(n){throw this.end(A),n}})}getMetrics(){return[...this.completedMetrics]}getMetric(A){return this.completedMetrics.find(e=>e.name===A)}getSummary(){const A=this.completedMetrics.reduce((t,n)=>t+(n.duration||0),0),e=this.completedMetrics.map(t=>({name:t.name,duration:t.duration||0,percentage:A>0?((t.duration||0)/A*100).toFixed(1)+"%":"0%"}));return{totalDuration:A,metrics:this.getMetrics(),breakdown:e}}logSummary(){if(!this.enabled||this.completedMetrics.length===0||!this.context)return;const A=this.getSummary();this.context.logger.info(`
1649
+ 📊 Performance Summary (Total: ${A.totalDuration.toFixed(2)}ms):`),A.breakdown.sort((e,t)=>t.duration-e.duration).forEach(e=>{this.context.logger.info(` ${e.name.padEnd(20)} ${e.duration.toFixed(2).padStart(8)}ms ${e.percentage.padStart(6)}`)})}clear(){this.activeMetrics.clear(),this.completedMetrics.splice(0)}isEnabled(){return this.enabled}getActiveMetrics(){return Array.from(this.activeMetrics.keys())}},Xe,He=(Xe=class{constructor(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r}add(e,t,n,r){return new Xe(this.left+e,this.top+t,this.width+n,this.height+r)}static fromClientRect(e,t){return new Xe(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)}static fromDOMRectList(e,t){const n=Array.from(t);let r=n.find(s=>s.width!==0);return r||(r=n.find(s=>s.height!==0)),!r&&n.length>0&&(r=n[0]),r?new Xe(r.left+e.windowBounds.left,r.top+e.windowBounds.top,r.width,r.height):Xe.EMPTY}},Xe.EMPTY=new Xe(0,0,0,0),Xe);const us=(A,e)=>He.fromClientRect(A,e.getBoundingClientRect()),Ay=A=>{const e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");return new He(0,0,Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight)))};var ui=function(A){for(var e=[],t=0,n=A.length;t<n;){var r=A.charCodeAt(t++);if(r>=55296&&r<=56319&&t<n){var s=A.charCodeAt(t++);(s&64512)===56320?e.push(((r&1023)<<10)+(s&1023)+65536):(e.push(r),t--)}else e.push(r)}return e},DA=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],r=-1,s="";++r<t;){var o=A[r];o<=65535?n.push(o):(o-=65536,n.push((o>>10)+55296,o%1024+56320)),(r+1===t||n.length>16384)&&(s+=String.fromCharCode.apply(String,n),n.length=0)}return s},jl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ey=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var Zs=0;Zs<jl.length;Zs++)ey[jl.charCodeAt(Zs)]=Zs;var Yl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zr=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var Xs=0;Xs<Yl.length;Xs++)zr[Yl.charCodeAt(Xs)]=Xs;var ty=function(A){var e=A.length*.75,t=A.length,n,r=0,s,o,a,i;A[A.length-1]==="="&&(e--,A[A.length-2]==="="&&e--);var c=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&typeof Uint8Array.prototype.slice!="undefined"?new ArrayBuffer(e):new Array(e),u=Array.isArray(c)?c:new Uint8Array(c);for(n=0;n<t;n+=4)s=zr[A.charCodeAt(n)],o=zr[A.charCodeAt(n+1)],a=zr[A.charCodeAt(n+2)],i=zr[A.charCodeAt(n+3)],u[r++]=s<<2|o>>4,u[r++]=(o&15)<<4|a>>2,u[r++]=(a&3)<<6|i&63;return c},ny=function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t},ry=function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t},fn=5,Uc=11,Ni=2,sy=Uc-fn,vp=65536>>fn,zi=(1<<fn)-1,oy=vp+(1024>>fn)+32,iy=65536>>Uc,ay=(1<<sy)-1,ql=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},cy=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},ly=function(A,e){var t=ty(A),n=Array.isArray(t)?ry(t):new Uint32Array(t),r=Array.isArray(t)?ny(t):new Uint16Array(t),s=24,o=ql(r,s/2,n[4]/2),a=n[5]===2?ql(r,(s+n[4])/2):cy(n,Math.ceil((s+n[4])/4));return new uy(n[0],n[1],n[2],n[3],o,a)},uy=(function(){function A(e,t,n,r,s,o){this.initialValue=e,this.errorValue=t,this.highStart=n,this.highValueIndex=r,this.index=s,this.data=o}return A.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>fn],t=(t<<Ni)+(e&zi),this.data[t];if(e<=65535)return t=this.index[vp+(e-55296>>fn)],t=(t<<Ni)+(e&zi),this.data[t];if(e<this.highStart)return t=oy-iy+(e>>Uc),t=this.index[t],t+=e>>fn&ay,t=this.index[t],t=(t<<Ni)+(e&zi),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A})(),Au="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dy=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var Ws=0;Ws<Au.length;Ws++)dy[Au.charCodeAt(Ws)]=Ws;var py="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",eu=50,hy=1,_p=2,xp=3,fy=4,gy=5,tu=7,Sp=8,nu=9,Pt=10,va=11,ru=12,_a=13,By=14,$r=15,xa=16,Js=17,xr=18,wy=19,su=20,Sa=21,Sr=22,$i=23,Dn=24,me=25,Gr=26,Vr=27,Rn=28,my=29,on=30,Cy=31,js=32,Ys=33,Ia=34,Ta=35,Ha=36,ds=37,La=38,yo=39,Uo=40,Gi=41,Ip=42,by=43,Qy=[9001,65288],Tp="!",nA="×",qs="÷",Da=ly(py),Ct=[on,Ha],Ra=[hy,_p,xp,gy],Hp=[Pt,Sp],ou=[Vr,Gr],yy=Ra.concat(Hp),iu=[La,yo,Uo,Ia,Ta],Uy=[$r,_a],Ey=function(A,e){e===void 0&&(e="strict");var t=[],n=[],r=[];return A.forEach(function(s,o){var a=Da.get(s);if(a>eu?(r.push(!0),a-=eu):r.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return n.push(o),t.push(xa);if(a===fy||a===va){if(o===0)return n.push(o),t.push(on);var i=t[o-1];return yy.indexOf(i)===-1?(n.push(n[o-1]),t.push(i)):(n.push(o),t.push(on))}if(n.push(o),a===Cy)return t.push(e==="strict"?Sa:ds);if(a===Ip||a===my)return t.push(on);if(a===by)return s>=131072&&s<=196605||s>=196608&&s<=262141?t.push(ds):t.push(on);t.push(a)}),[n,t,r]},Vi=function(A,e,t,n){var r=n[t];if(Array.isArray(A)?A.indexOf(r)!==-1:A===r)for(var s=t;s<=n.length;){s++;var o=n[s];if(o===e)return!0;if(o!==Pt)break}if(r===Pt)for(var s=t;s>0;){s--;var a=n[s];if(Array.isArray(A)?A.indexOf(a)!==-1:A===a)for(var i=t;i<=n.length;){i++;var o=n[i];if(o===e)return!0;if(o!==Pt)break}if(a!==Pt)break}return!1},au=function(A,e){for(var t=A;t>=0;){var n=e[t];if(n===Pt)t--;else return n}return 0},Fy=function(A,e,t,n,r){if(t[n]===0)return nA;var s=n-1;if(Array.isArray(r)&&r[s]===!0)return nA;var o=s-1,a=s+1,i=e[s],c=o>=0?e[o]:0,u=e[a];if(i===_p&&u===xp)return nA;if(Ra.indexOf(i)!==-1)return Tp;if(Ra.indexOf(u)!==-1||Hp.indexOf(u)!==-1)return nA;if(au(s,e)===Sp)return qs;if(Da.get(A[s])===va||(i===js||i===Ys)&&Da.get(A[a])===va||i===tu||u===tu||i===nu||[Pt,_a,$r].indexOf(i)===-1&&u===nu||[Js,xr,wy,Dn,Rn].indexOf(u)!==-1||au(s,e)===Sr||Vi($i,Sr,s,e)||Vi([Js,xr],Sa,s,e)||Vi(ru,ru,s,e))return nA;if(i===Pt)return qs;if(i===$i||u===$i)return nA;if(u===xa||i===xa)return qs;if([_a,$r,Sa].indexOf(u)!==-1||i===By||c===Ha&&Uy.indexOf(i)!==-1||i===Rn&&u===Ha||u===su||Ct.indexOf(u)!==-1&&i===me||Ct.indexOf(i)!==-1&&u===me||i===Vr&&[ds,js,Ys].indexOf(u)!==-1||[ds,js,Ys].indexOf(i)!==-1&&u===Gr||Ct.indexOf(i)!==-1&&ou.indexOf(u)!==-1||ou.indexOf(i)!==-1&&Ct.indexOf(u)!==-1||[Vr,Gr].indexOf(i)!==-1&&(u===me||[Sr,$r].indexOf(u)!==-1&&e[a+1]===me)||[Sr,$r].indexOf(i)!==-1&&u===me||i===me&&[me,Rn,Dn].indexOf(u)!==-1)return nA;if([me,Rn,Dn,Js,xr].indexOf(u)!==-1)for(var h=s;h>=0;){var f=e[h];if(f===me)return nA;if([Rn,Dn].indexOf(f)!==-1)h--;else break}if([Vr,Gr].indexOf(u)!==-1)for(var h=[Js,xr].indexOf(i)!==-1?o:s;h>=0;){var f=e[h];if(f===me)return nA;if([Rn,Dn].indexOf(f)!==-1)h--;else break}if(La===i&&[La,yo,Ia,Ta].indexOf(u)!==-1||[yo,Ia].indexOf(i)!==-1&&[yo,Uo].indexOf(u)!==-1||[Uo,Ta].indexOf(i)!==-1&&u===Uo||iu.indexOf(i)!==-1&&[su,Gr].indexOf(u)!==-1||iu.indexOf(u)!==-1&&i===Vr||Ct.indexOf(i)!==-1&&Ct.indexOf(u)!==-1||i===Dn&&Ct.indexOf(u)!==-1||Ct.concat(me).indexOf(i)!==-1&&u===Sr&&Qy.indexOf(A[a])===-1||Ct.concat(me).indexOf(u)!==-1&&i===xr)return nA;if(i===Gi&&u===Gi){for(var g=t[s],m=1;g>0&&(g--,e[g]===Gi);)m++;if(m%2!==0)return nA}return i===js&&u===Ys?nA:qs},ky=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=Ey(A,e.lineBreak),n=t[0],r=t[1],s=t[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(r=r.map(function(a){return[me,on,Ip].indexOf(a)!==-1?ds:a}));var o=e.wordBreak==="keep-all"?s.map(function(a,i){return a&&A[i]>=19968&&A[i]<=40959}):void 0;return[n,r,o]},vy=(function(){function A(e,t,n,r){this.codePoints=e,this.required=t===Tp,this.start=n,this.end=r}return A.prototype.slice=function(){return DA.apply(void 0,this.codePoints.slice(this.start,this.end))},A})(),_y=function(A,e){var t=ui(A),n=ky(t,e),r=n[0],s=n[1],o=n[2],a=t.length,i=0,c=0;return{next:function(){if(c>=a)return{done:!0,value:null};for(var u=nA;c<a&&(u=Fy(t,s,r,++c,o))===nA;);if(u!==nA||c===a){var h=new vy(t,u,i,c);return i=c,{value:h,done:!1}}return{done:!0,value:null}}}};const cu=65533,te=A=>A>=48&&A<=57,xy=A=>A>=55296&&A<=57343,On=A=>te(A)||A>=65&&A<=70||A>=97&&A<=102,Sy=A=>A>=97&&A<=122,Iy=A=>A>=65&&A<=90,Ty=A=>Sy(A)||Iy(A),Hy=A=>A>=128,Ao=A=>A===10||A===9||A===32,$o=A=>Ty(A)||Hy(A)||A===95,lu=A=>$o(A)||te(A)||A===45,Ly=A=>A>=0&&A<=8||A===11||A>=14&&A<=31||A===127,Rt=(A,e)=>A!==92?!1:e!==10,eo=(A,e,t)=>A===45?$o(e)||Rt(e,t):$o(A)?!0:!!(A===92&&Rt(A,e)),Zi=(A,e,t)=>A===43||A===45?te(e)?!0:e===46&&te(t):te(A===46?e:A),Dy=A=>{let e=0,t=1;(A[e]===43||A[e]===45)&&(A[e]===45&&(t=-1),e++);const n=[];for(;te(A[e]);)n.push(A[e++]);const r=n.length?parseInt(DA(...n),10):0;A[e]===46&&e++;const s=[];for(;te(A[e]);)s.push(A[e++]);const o=s.length,a=o?parseInt(DA(...s),10):0;(A[e]===69||A[e]===101)&&e++;let i=1;(A[e]===43||A[e]===45)&&(A[e]===45&&(i=-1),e++);const c=[];for(;te(A[e]);)c.push(A[e++]);const u=c.length?parseInt(DA(...c),10):0;return t*(r+a*Math.pow(10,-o))*Math.pow(10,i*u)},Ry={type:2},Oy={type:3},My={type:4},Py={type:13},Ky={type:8},Ny={type:21},zy={type:9},$y={type:10},Gy={type:11},Vy={type:12},Zy={type:14},to={type:23},Xy={type:1},Wy={type:25},Jy={type:24},jy={type:26},Yy={type:27},qy={type:28},A0={type:29},e0={type:31},Oa={type:32};var ve,Ma=(ve=class{static get(){return ve._pool.pop()||new ve}static release(e){ve._pool.length<ve.MAX_POOL_SIZE&&(e._reset(),ve._pool.push(e))}constructor(){this._value=[]}_reset(){this._value=[]}write(e){this._value=this._value.concat(ui(e))}read(){const e=[];let t=this.consumeToken();for(;t!==Oa;)e.push(t),t=this.consumeToken();return e}consumeToken(){const e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:{const t=this.peekCodePoint(0),n=this.peekCodePoint(1),r=this.peekCodePoint(2);if(lu(t)||Rt(n,r)){const s=eo(t,n,r)?2:1;return{type:5,value:this.consumeName(),flags:s}}break}case 36:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),Py;break;case 39:return this.consumeStringToken(39);case 40:return Ry;case 41:return Oy;case 42:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),Zy;break;case 43:if(Zi(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return My;case 45:{const t=e,n=this.peekCodePoint(0),r=this.peekCodePoint(1);if(Zi(t,n,r))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(eo(t,n,r))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(n===45&&r===62)return this.consumeCodePoint(),this.consumeCodePoint(),Jy;break}case 46:if(Zi(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 47:if(this.peekCodePoint(0)===42)for(this.consumeCodePoint();;){let t=this.consumeCodePoint();if(t===42&&(t=this.consumeCodePoint(),t===47))return this.consumeToken();if(t===-1)return this.consumeToken()}break;case 58:return jy;case 59:return Yy;case 60:if(this.peekCodePoint(0)===33&&this.peekCodePoint(1)===45&&this.peekCodePoint(2)===45)return this.consumeCodePoint(),this.consumeCodePoint(),Wy;break;case 64:if(eo(this.peekCodePoint(0),this.peekCodePoint(1),this.peekCodePoint(2)))return{type:7,value:this.consumeName()};break;case 91:return qy;case 92:if(Rt(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return A0;case 61:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),Ky;break;case 123:return Gy;case 125:return Vy;case 117:case 85:{const t=this.peekCodePoint(0),n=this.peekCodePoint(1);return t===43&&(On(n)||n===63)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken()}case 124:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),zy;if(this.peekCodePoint(0)===124)return this.consumeCodePoint(),Ny;break;case 126:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),$y;break;case-1:return Oa}return Ao(e)?(this.consumeWhiteSpace(),e0):te(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):$o(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:DA(e)}}consumeCodePoint(){const e=this._value.shift();return typeof e=="undefined"?-1:e}reconsumeCodePoint(e){this._value.unshift(e)}peekCodePoint(e){return e>=this._value.length?-1:this._value[e]}consumeUnicodeRangeToken(){const e=[];let t=this.consumeCodePoint();for(;On(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();let n=!1;for(;t===63&&e.length<6;)e.push(t),t=this.consumeCodePoint(),n=!0;if(n)return{type:30,start:parseInt(DA(...e.map(s=>s===63?48:s)),16),end:parseInt(DA(...e.map(s=>s===63?70:s)),16)};const r=parseInt(DA(...e),16);if(this.peekCodePoint(0)===45&&On(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();const s=[];for(;On(t)&&s.length<6;)s.push(t),t=this.consumeCodePoint();return{type:30,start:r,end:parseInt(DA(...s),16)}}else return{type:30,start:r,end:r}}consumeIdentLikeToken(){const e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===40?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===40?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}}consumeUrlToken(){const e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===-1)return{type:22,value:""};const t=this.peekCodePoint(0);if(t===39||t===34){const n=this.consumeStringToken(this.consumeCodePoint());return n.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===-1||this.peekCodePoint(0)===41)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),to)}for(;;){const n=this.consumeCodePoint();if(n===-1||n===41)return{type:22,value:DA(...e)};if(Ao(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===-1||this.peekCodePoint(0)===41?(this.consumeCodePoint(),{type:22,value:DA(...e)}):(this.consumeBadUrlRemnants(),to);if(n===34||n===39||n===40||Ly(n))return this.consumeBadUrlRemnants(),to;if(n===92)if(Rt(n,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),to;else e.push(n)}}consumeWhiteSpace(){for(;Ao(this.peekCodePoint(0));)this.consumeCodePoint()}consumeBadUrlRemnants(){for(;;){const e=this.consumeCodePoint();if(e===41||e===-1)return;Rt(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}}consumeStringSlice(e){let n="";for(;e>0;){const r=Math.min(5e4,e);n+=DA(...this._value.splice(0,r)),e-=r}return this._value.shift(),n}consumeStringToken(e){let t="",n=0;do{const r=this._value[n];if(r===-1||r===void 0||r===e)return t+=this.consumeStringSlice(n),{type:0,value:t};if(r===10)return this._value.splice(0,n),Xy;if(r===92){const s=this._value[n+1];s!==-1&&s!==void 0&&(s===10?(t+=this.consumeStringSlice(n),n=-1,this._value.shift()):Rt(r,s)&&(t+=this.consumeStringSlice(n),t+=DA(this.consumeEscapedCodePoint()),n=-1))}n++}while(!0)}consumeNumber(){const e=[];let t=4,n=this.peekCodePoint(0);for((n===43||n===45)&&e.push(this.consumeCodePoint());te(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);let r=this.peekCodePoint(1);if(n===46&&te(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;te(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),r=this.peekCodePoint(1);const s=this.peekCodePoint(2);if((n===69||n===101)&&((r===43||r===45)&&te(s)||te(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;te(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Dy(e),t]}consumeNumericToken(){const[e,t]=this.consumeNumber(),n=this.peekCodePoint(0);return eo(n,this.peekCodePoint(1),this.peekCodePoint(2))?{type:15,number:e,flags:t,unit:this.consumeName()}:n===37?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}}consumeEscapedCodePoint(){const e=this.consumeCodePoint();if(On(e)){let t=DA(e);for(;On(this.peekCodePoint(0))&&t.length<6;)t+=DA(this.consumeCodePoint());Ao(this.peekCodePoint(0))&&this.consumeCodePoint();const n=parseInt(t,16);return n===0||xy(n)||n>1114111?cu:n}return e===-1?cu:e}consumeName(){let e="";for(;;){const t=this.consumeCodePoint();if(lu(t))e+=DA(t);else if(Rt(t,this.peekCodePoint(0)))e+=DA(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}}},ve._pool=[],ve.MAX_POOL_SIZE=40,ve),Lp=class Eo{constructor(e){this._tokens=e}static create(e){const t=new Ma;return t.write(e),new Eo(t.read())}static parseValue(e){return Eo.create(e).parseComponentValue()}static parseValues(e){return Eo.create(e).parseComponentValues()}parseComponentValue(){let e=this.consumeToken();for(;e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);const t=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")}parseComponentValues(){const e=[];for(;;){const t=this.consumeComponentValue();if(t.type===32)return e;e.push(t)}}consumeComponentValue(){const e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e}consumeSimpleBlock(e){const t={type:e,values:[]};let n=this.consumeToken();for(;;){if(n.type===32||n0(n,e))return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue()),n=this.consumeToken()}}consumeFunction(e){const t={name:e.value,values:[],type:18};for(;;){const n=this.consumeToken();if(n.type===32||n.type===3)return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue())}}consumeToken(){const e=this._tokens.shift();return typeof e=="undefined"?Oa:e}reconsumeToken(e){this._tokens.unshift(e)}};const ht=A=>A.type===15,GA=A=>A.type===17,j=A=>A.type===20,t0=A=>A.type===0,ps=(A,e)=>j(A)&&A.value===e,bs=A=>A.type!==31,VA=A=>A.type!==31&&A.type!==4,Ye=A=>{const e=[];let t=[];return A.forEach(n=>{if(n.type===4){t.length&&(e.push(t),t=[]);return}n.type!==31&&t.push(n)}),t.length&&e.push(t),e},n0=(A,e)=>e===11&&A.type===12||e===28&&A.type===29?!0:e===2&&A.type===3,r0=/(\d+(?:\.\d+)?|[+\-*/()])/g,Dp=A=>{const e=A.match(r0);if(!e)return NaN;const t=[],n=[],r={"+":1,"-":1,"*":2,"/":2};for(const o of e)if(/^\d+(?:\.\d+)?$/.test(o))t.push(parseFloat(o));else if(o==="(")n.push(o);else if(o===")"){for(;n.length&&n[n.length-1]!=="(";)t.push(n.pop());if(!n.length)return NaN;n.pop()}else{for(;n.length&&r[n[n.length-1]]>=r[o];)t.push(n.pop());n.push(o)}for(;n.length;){const o=n.pop();if(o==="(")return NaN;t.push(o)}const s=[];for(const o of t)if(typeof o=="number")s.push(o);else{const a=s.pop(),i=s.pop();if(i===void 0||a===void 0)return NaN;switch(o){case"+":s.push(i+a);break;case"-":s.push(i-a);break;case"*":s.push(i*a);break;case"/":s.push(a===0?NaN:i/a);break;default:return NaN}}return s.length===1?s[0]:NaN},IA=(A,e,t)=>Math.min(Math.max(A,e),t),ge=(A,e)=>[A[0]*e[0]+A[1]*e[1]+A[2]*e[2],A[3]*e[0]+A[4]*e[1]+A[5]*e[2],A[6]*e[0]+A[7]*e[1]+A[8]*e[2]],Xt=A=>ge([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],A),Pa=A=>ge([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],A),kn=A=>A.map(e=>{const t=e<0?-1:1,n=Math.abs(e);return n>.0031308?t*(1.055*we(n,1/2.4)-.055):12.92*e}),Ka=A=>A.map(e=>{const t=e<0?-1:1,n=Math.abs(e);return n<=.04045?e/12.92:t*we((n+.055)/1.055,2.4)}),s0=A=>{const[e,t,n]=kn(Xt([A[0],A[1],A[2]]));return[e,t,n,A[3]]},o0=A=>{const[e,t,n]=Xt([A[0],A[1],A[2]]);return[IA(Math.round(e*255),0,255),IA(Math.round(t*255),0,255),IA(Math.round(n*255),0,255),A[3]]},Gt=A=>A.type===17||A.type===15,iA=A=>A.type===16||Gt(A)||Rp(A),Rp=A=>A.type===17&&A._calcPercentage!==void 0,i0=A=>A.type===18&&A.name==="calc",a0=A=>{const e=uu(A,0);if(!e)return null;const t=uu(A,100);if(!t)return null;const n=e.number,r=t.number-n;return r===0?e:{type:17,number:n,flags:4,_calcPercentage:r,_calcPixelOffset:n}},Op=A=>i0(A)?a0(A):iA(A)?A:null,uu=(A,e=0)=>{const t=n=>{let r="";for(const s of n)if(s.type!==31){if(s.type===18)if(s.name==="calc"){const o=t(s.values);if(o===null)return null;r+=`(${o})`}else return null;else if(s.type===17)r+=s.number.toString();else if(s.type===15)s.unit==="px"?r+=s.number.toString():s.unit==="rem"||s.unit==="em"?r+=(s.number*16).toString():r+=s.number.toString();else if(s.type===16)r+=(s.number/100*e).toString();else if(s.type===6){const o=s.value;o==="+"||o==="-"||o==="*"||o==="/"?r+=` ${o} `:o==="("?r+="(":o===")"&&(r+=")")}}return r};try{const n=t(A.values);if(n===null||n.trim()==="")return null;const r=Dp(n);if(typeof r=="number"&&!isNaN(r))return{type:17,number:r,flags:4}}catch(n){return null}return null},Mp=A=>A.length>1?[A[0],A[1]]:[A[0]],RA={type:17,number:0,flags:4},Ut={type:16,number:50,flags:4},Je={type:16,number:100,flags:4},Zr=(A,e,t)=>{const[n,r]=A;return[J(n,e),J(typeof r!="undefined"?r:n,t)]},J=(A,e)=>{if(Rp(A))return A._calcPercentage/100*e+A._calcPixelOffset;if(A.type===16)return A.number/100*e;if(ht(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Pp="deg",Kp="grad",Np="rad",zp="turn",pr={name:"angle",parse:(A,e)=>{if(e.type===15)switch(e.unit){case Pp:return Math.PI*e.number/180;case Kp:return Math.PI/200*e.number;case Np:return e.number;case zp:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},$p=A=>A.type===15&&(A.unit===Pp||A.unit===Kp||A.unit===Np||A.unit===zp),Gp=A=>{switch(A.filter(j).map(e=>e.value).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[RA,RA];case"to top":case"bottom":return Se(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[RA,Je];case"to right":case"left":return Se(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Je,Je];case"to bottom":case"top":return Se(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Je,RA];case"to left":case"right":return Se(270)}return 0},Se=A=>Math.PI*A/180,Et=A=>(255&A)===0,yA=A=>{const e=255&A,t=255&A>>8,n=255&A>>16,r=255&A>>24;return e<255?`rgba(${r},${n},${t},${e/255})`:`rgb(${r},${n},${t})`},je=(A,e,t,n)=>(A<<24|e<<16|t<<8|Math.round(n*255)<<0)>>>0,Ot=(A,e)=>{if(A.type===17)return A.number;if(A.type===16){const t=e===3?1:255;return e===3?A.number/100*t:Math.round(A.number/100*t)}return 0},vn=A=>(A[0].type===20?A[0].value:"unknown")==="from",c0=A=>je(IA(Math.round(A[0]*255),0,255),IA(Math.round(A[1]*255),0,255),IA(Math.round(A[2]*255),0,255),IA(A[3],0,1)),Ec=([A,e,t,n])=>{const r=kn([A,e,t]);return je(IA(Math.round(r[0]*255),0,255),IA(Math.round(r[1]*255),0,255),IA(Math.round(r[2]*255),0,255),n)},Qs=A=>{const e=Xt([A[0],A[1],A[2]]);return Ec([e[0],e[1],e[2],A[3]])},l0=(A,e)=>{if(vn(e.filter(VA)))throw new Error("Relative color not supported for lab()");const[t,n,r,s]=di(e),o=kn(Xt(fi([t,n,r])));return je(IA(Math.round(o[0]*255),0,255),IA(Math.round(o[1]*255),0,255),IA(Math.round(o[2]*255),0,255),s)},u0=(A,e)=>{if(vn(e.filter(VA)))throw new Error("Relative color not supported for oklab()");const[t,n,r,s]=di(e),o=kn(Xt(hi([t,n,r])));return je(IA(Math.round(o[0]*255),0,255),IA(Math.round(o[1]*255),0,255),IA(Math.round(o[2]*255),0,255),s)},d0=(A,e)=>{if(vn(e.filter(VA)))throw new Error("Relative color not supported for oklch()");const[t,n,r,s]=Xp(e),o=kn(Xt(hi(pi([t,n,r]))));return je(IA(Math.round(o[0]*255),0,255),IA(Math.round(o[1]*255),0,255),IA(Math.round(o[2]*255),0,255),s)},p0=(A,e)=>{if(vn(e.filter(VA)))throw new Error("Relative color not supported for lch()");const[t,n,r,s]=Zp(e),o=kn(Xt(fi(pi([t,n,r]))));return je(IA(Math.round(o[0]*255),0,255),IA(Math.round(o[1]*255),0,255),IA(Math.round(o[2]*255),0,255),s)},Vp=(A,e)=>{const[t,n,r,s]=e.filter(VA);return[(t.type===17?Se(t.number):pr.parse(A,t))/(Math.PI*2),iA(n)?n.number/100:0,iA(r)?r.number/100:0,typeof s!="undefined"&&iA(s)?J(s,1):1]},du=(A,e)=>{if(vn(e))throw new Error("Relative color not supported for hsl()");const[t,n,r,s]=Vp(A,e),o=Jp([t,n,r]);return je(o[0]*255,o[1]*255,o[2]*255,n===0?1:s)},Zp=A=>{const e=A.filter(VA);return[iA(e[0])?e[0].number:0,iA(e[1])?e[1].number:0,GA(e[2])||ht(e[2])?e[2].number:0,typeof e[4]!="undefined"&&iA(e[4])?J(e[4],1):1]},di=A=>{const e=A.filter(VA);return[e[0].type===16?e[0].number/100:GA(e[0])?e[0].number:0,e[1].type===16?e[1].number/100:GA(e[1])?e[1].number:0,GA(e[2])||ht(e[2])?e[2].number:0,typeof e[4]!="undefined"&&iA(e[4])?J(e[4],1):1]},Xp=A=>{const e=A.filter(VA);return[e[0].type===16?e[0].number/100:GA(e[0])?e[0].number:0,e[1].type===16?e[1].number/100:GA(e[1])?e[1].number:0,GA(e[2])||ht(e[2])?e[2].number:0,typeof e[4]!="undefined"&&iA(e[4])?J(e[4],1):1]},Wp=A=>ge([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],A),Fc=A=>ge([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],A),Xi=(A,e,t)=>(t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<1/2?e:t<2/3?(e-A)*6*(2/3-t)+A:A),Jp=([A,e,t])=>{if(e===0)return[t*255,t*255,t*255];const n=t<=.5?t*(e+1):t+e-t*e,r=t*2-n;return[Xi(r,n,A+1/3),Xi(r,n,A),Xi(r,n,A-1/3)]},pi=([A,e,t])=>(e<0&&(e=0),isNaN(t)&&(t=0),[A,e*Math.cos(t*Math.PI/180),e*Math.sin(t*Math.PI/180)]),hi=A=>ge([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],ge([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],A).map(e=>we(e,3))),fi=A=>{const e=(A[0]+16)/116,t=A[1]/500+e,n=e-A[2]/200,r=24389/27,s=24/116,o=[(t>s?we(t,3):(116*t-16)/r)*.3457/.3585,A[0]>8?we(e,3):A[0]/r,(n>s?we(n,3):(116*n-16)/r)*.2958/.3585];return Fc([o[0],o[1],o[2]])},h0=(A,e)=>{const t=e.filter(VA);if(t.length===3){const[n,r,s]=t.map(Ot),o=Ka([n/255,r/255,s/255]),[a,i,c]=Pa([o[0],o[1],o[2]]);return[a,i,c,1]}if(t.length===4){const[n,r,s,o]=t.map(Ot),a=Ka([n/255,r/255,s/255]),[i,c,u]=Pa([a[0],a[1],a[2]]);return[i,c,u,o]}return[0,0,0,1]},f0=(A,e)=>{const[t,n,r,s]=Vp(A,e),o=Ka(Jp([t,n,r])),[a,i,c]=Pa([o[0],o[1],o[2]]);return[a,i,c,s]},g0=(A,e)=>{const[t,n,r,s]=di(e),[o,a,i]=fi([t,n,r]);return[o,a,i,s]},B0=(A,e)=>{const[t,n,r,s]=Zp(e),[o,a,i]=fi(pi([t,n,r]));return[o,a,i,s]},w0=(A,e)=>{const[t,n,r,s]=Xp(e),[o,a,i]=hi(pi([t,n,r]));return[o,a,i,s]},m0=(A,e)=>{const[t,n,r,s]=di(e),[o,a,i]=hi([t,n,r]);return[o,a,i,s]},C0=A=>Fc([A[0],A[1],A[2]]),pu=A=>A,b0=A=>{const[e,t,n]=Wp([A[0],A[2],A[3]]);return[e,t,n,A[3]]},hu=A=>Qs([A[0],A[1],A[2],A[3]]),Q0=A=>{const e=C0([A[0],A[1],A[2]]);return Qs([e[0],e[1],e[2],A[3]])},y0=A=>ge([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],A),U0=A=>ge([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],A),E0=A=>A.map(e=>{const t=e<0?-1:1;return e*t<=.04045?e/12.92:t*we((e+.055)/1.055,2.4)||0}),F0=A=>kn(A),k0=A=>{const e=E0([A[0],A[1],A[2]]);return y0([e[0],e[1],e[2]])},v0=A=>{const[e,t,n]=F0(U0([A[0],A[1],A[2]]));return[e,t,n,A[3]]},_0=A=>{const e=k0([A[0],A[1],A[2]]);return Qs([e[0],e[1],e[2],A[3]])},x0=A=>ge([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],A),S0=A=>ge([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],A),I0=A=>{const e=A.map(t=>(t<0?-1:1)*we(Math.abs(t),2.19921875));return[e[0],e[1],e[2]]},T0=A=>{const e=A.map(t=>(t<0?-1:1)*we(Math.abs(t),.4547069271758437));return[e[0],e[1],e[2]]},H0=A=>{const[e,t,n]=T0(x0([A[0],A[1],A[2]]));return[e,t,n,A[3]]},L0=A=>{const e=Xt(S0(I0([A[0],A[1],A[2]])));return Ec([e[0],e[1],e[2],A[3]])},D0=A=>ge([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],A),R0=A=>ge([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],A),O0=A=>A.map(e=>e<16/512?e/16:we(e,1.8)),M0=A=>A.map(e=>e>1/512?we(e,1/1.8):e*16),P0=A=>{const e=O0([A[0],A[1],A[2]]);return Fc(D0([e[0],e[1],e[2]]))},K0=A=>{const[e,t,n]=M0(R0(Wp([A[0],A[1],A[2]])));return[e,t,n,A[3]]},N0=A=>{const e=P0([A[0],A[1],A[2]]);return Qs([e[0],e[1],e[2],A[3]])},Go=1.09929682680944,jp=.018053968510807,z0=A=>A.map(function(e){return e<jp*4.5?e/4.5:Math.pow((e+Go-1)/Go,1/.45)}),$0=A=>A.map(function(e){return e>=jp?Go*Math.pow(e,.45)-(Go-1):4.5*e}),G0=A=>ge([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],A),V0=A=>ge([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],A),Z0=A=>{const e=z0([A[0],A[1],A[2]]);return G0([e[0],e[1],e[2]])},X0=A=>{const[e,t,n]=$0(V0([A[0],A[1],A[2]]));return[e,t,n,A[3]]},W0=A=>{const e=Z0([A[0],A[1],A[2]]);return Qs([e[0],e[1],e[2],A[3]])},Nt={name:"color",parse:(A,e)=>{if(e.type===18){const t=q0[e.name];if(typeof t=="undefined")throw new Error(`Attempting to parse an unsupported color function "${e.name}"`);return t(A,e.values)}if(e.type===5){const[t,n,r,s]=Yp(e);return je(t,n,r,s)}if(e.type===20){const t=ut[e.value.toUpperCase()];if(typeof t!="undefined")return t}return ut.TRANSPARENT}},Yp=A=>{if(A.value.length===3){const e=A.value.substring(0,1),t=A.value.substring(1,2),n=A.value.substring(2,3);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(n+n,16),1]}if(A.value.length===4){const e=A.value.substring(0,1),t=A.value.substring(1,2),n=A.value.substring(2,3),r=A.value.substring(3,4);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(n+n,16),parseInt(r+r,16)/255]}if(A.value.length===6){const e=A.value.substring(0,2),t=A.value.substring(2,4),n=A.value.substring(4,6);return[parseInt(e,16),parseInt(t,16),parseInt(n,16),1]}if(A.value.length===8){const e=A.value.substring(0,2),t=A.value.substring(2,4),n=A.value.substring(4,6),r=A.value.substring(6,8);return[parseInt(e,16),parseInt(t,16),parseInt(n,16),parseInt(r,16)/255]}return[0,0,0,1]},fu=(A,e)=>{const t=e.filter(VA);if(vn(t))throw new Error("Relative color not supported for rgb()");if(t.length===3){const[n,r,s]=t.map(Ot);return je(n,r,s,1)}if(t.length===4){const[n,r,s,o]=t.map(Ot);return je(n,r,s,o)}return t.length===5&&t[3].type===6&&t[3].value==="/"?je(Ot(t[0],0),Ot(t[1],1),Ot(t[2],2),Ot(t[4],3)):0},J0=(A,e)=>{const t=e.filter(VA),n=t[0].type===20?t[0].value:"unknown";if(vn(t)){const r=(U,E)=>{if(GA(E))return E.number;const v=y=>y==="r"||y==="x"?0:y==="g"||y==="y"?1:2;if(j(E))return U[v(E.value)];const F=y=>{const x=y.filter(VA);let R="(";for(const I of x)R+=I.type===18&&I.name==="calc"?F(I.values):GA(I)?I.number:I.type===6||j(I)?I.value:"";return R+=")",R};if(E.type===18){const y=E.values.filter(VA);if(E.name==="calc")return Dp(F(y).replace(/r|x/,U[0].toString()).replace(/g|y/,U[1].toString()).replace(/b|z/,U[2].toString()))}return null},s=t[1].type===18?t[1].name:j(t[1])||t[1].type===5?"rgb":"unknown",o=j(t[2])?t[2].value:"unknown";let a=t[1].type===18?t[1].values:j(t[1])?[t[1]]:[];if(j(t[1])){if(typeof ut[t[1].value.toUpperCase()]=="undefined")throw new Error("Attempting to use unknown color in relative color 'from'");{const U=rr(A,t[1].value),E=255&U,v=255&U>>8,F=255&U>>16;a=[{type:17,number:255&U>>24,flags:1},{type:17,number:F,flags:1},{type:17,number:v,flags:1},{type:17,number:E>1?E/255:E,flags:1}]}}else if(t[1].type===5){const[U,E,v,F]=Yp(t[1]);a=[{type:17,number:U,flags:1},{type:17,number:E,flags:1},{type:17,number:v,flags:1},{type:17,number:F>1?F/255:F,flags:1}]}if(a.length===0)throw new Error("Attempting to use unknown color in relative color 'from'");if(o==="unknown")throw new Error("Attempting to use unknown colorspace in relative color 'to'");const i=j0[s],c=Y0[o],u=gu[o];if(typeof i=="undefined")throw new Error(`Attempting to parse an unsupported color space "${s}" for color() function`);if(typeof c=="undefined")throw new Error(`Attempting to parse an unsupported color space "${o}" for color() function`);const h=c(i(A,a)),f=r(h,t[3]),g=r(h,t[4]),m=r(h,t[5]),Q=t.length>6&&t[6].type===6&&t[6].value==="/"&&GA(t[7])?t[7].number:1;if(f===null||g===null||m===null)throw new Error("Invalid relative color in color() function");return u([f,g,m,Q])}else{const r=n,s=gu[r];if(typeof s=="undefined")throw new Error(`Attempting to parse an unsupported color space "${r}" for color() function`);return s([GA(t[1])?t[1].number:0,GA(t[2])?t[2].number:0,GA(t[3])?t[3].number:0,t.length>4&&t[4].type===6&&t[4].value==="/"&&GA(t[5])?t[5].number:1])}},gu={srgb:c0,"srgb-linear":Ec,"display-p3":_0,"a98-rgb":L0,"prophoto-rgb":N0,xyz:hu,"xyz-d50":Q0,"xyz-d65":hu,rec2020:W0},j0={rgb:h0,hsl:f0,lab:g0,lch:B0,oklab:m0,oklch:w0},Y0={srgb:s0,"srgb-linear":o0,"display-p3":v0,"a98-rgb":H0,"prophoto-rgb":K0,xyz:pu,"xyz-d50":b0,"xyz-d65":pu,rec2020:X0},q0={hsl:du,hsla:du,rgb:fu,rgba:fu,lch:p0,oklch:d0,oklab:u0,lab:l0,color:J0},rr=(A,e)=>Nt.parse(A,Lp.create(e).parseComponentValue()),ut={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},un=A=>A.nodeType===Node.ELEMENT_NODE,qp=A=>A.nodeType===Node.TEXT_NODE,dn=A=>typeof A.className=="object",hs=A=>un(A)&&typeof A.style!="undefined"&&!dn(A),AU=A=>A.tagName==="INPUT",eU=A=>A.tagName==="HTML",Ah=A=>A.tagName==="svg",kc=A=>A.tagName==="BODY",eh=A=>A.tagName==="CANVAS",Bu=A=>A.tagName==="VIDEO",Na=A=>A.tagName==="IMG",th=A=>A.tagName==="IFRAME",nh=A=>A.tagName==="STYLE",tU=A=>A.tagName==="SCRIPT",Vo=A=>A.tagName==="TEXTAREA",Zo=A=>A.tagName==="SELECT",Xr=A=>A.tagName==="SLOT",nU=A=>A.tagName==="LI",rU=A=>A.tagName==="OL",wu=A=>!dn(A)&&A.tagName.indexOf("-")>0,sU=new Set(["IMG","VIDEO","AUDIO","CANVAS","IFRAME","INPUT","TEXTAREA","SELECT","BR","HR","META","LINK","BASE","COL","SOURCE","TRACK","WBR","AREA","PARAM","EMBED","OBJECT"]),oU=A=>!dn(A)&&!sU.has(A.tagName),za={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 52;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},jA=(A,e)=>(A&e)!==0;var iU=class{constructor(){this.counters={}}getCounterValue(A){const e=this.counters[A];return e&&e.length?e[e.length-1]:1}getCounterValues(A){const e=this.counters[A];return e||[]}pop(A){A.forEach(e=>this.counters[e].pop())}parse(A){const e=A.counterIncrement,t=A.counterReset;let n=!0;e!==null&&e.forEach(s=>{const o=this.counters[s.counter];o&&s.increment!==0&&(n=!1,o.length||o.push(1),o[Math.max(0,o.length-1)]+=s.increment)});const r=[];return n&&t.forEach(s=>{let o=this.counters[s.counter];r.push(s.counter),o||(o=this.counters[s.counter]=[]),o.push(s.reset)}),r}};const mu={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Cu={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},aU={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},cU={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Mn=(A,e,t,n,r,s)=>A<e||A>t?fs(A,r,s.length>0):n.integers.reduce((o,a,i)=>{for(;A>=a;)A-=a,o+=n.values[i];return o},"")+s,rh=(A,e,t,n)=>{let r="";do t||A--,r=n(A)+r,A/=e;while(A*e>=e);return r},HA=(A,e,t,n,r)=>{const s=t-e+1;return(A<0?"-":"")+(rh(Math.abs(A),s,n,o=>DA(Math.floor(o%s)+e))+r)},sn=(A,e,t=". ")=>{const n=e.length;return rh(Math.abs(A),n,!1,r=>e[Math.floor(r%n)])+t},lU=1,uU=2,dU=4,pU=8,bt=(A,e,t,n,r,s)=>{if(A<-9999||A>9999)return fs(A,4,r.length>0);let o=Math.abs(A),a=r;if(o===0)return e[0]+a;for(let i=0;o>0&&i<=4;i++){const c=o%10;c===0&&jA(s,lU)&&a!==""?a=e[c]+a:c>1||c===1&&i===0||c===1&&i===1&&jA(s,uU)||c===1&&i===1&&jA(s,dU)&&A>100||c===1&&i>1&&jA(s,pU)?a=e[c]+(i>0?t[i-1]:"")+a:c===1&&i>0&&(a=t[i-1]+a),o=Math.floor(o/10)}return(A<0?n:"")+a},bu="十百千萬",Qu="拾佰仟萬",yu="マイナス",Wi="마이너스",fs=(A,e,t)=>{const n=t?". ":"",r=t?"、":"",s=t?", ":"",o=t?" ":"";switch(e){case 0:return"•"+o;case 1:return"◦"+o;case 2:return"◾"+o;case 5:const a=HA(A,48,57,!0,n);return a.length<4?`0${a}`:a;case 4:return sn(A,"〇一二三四五六七八九",r);case 6:return Mn(A,1,3999,mu,3,n).toLowerCase();case 7:return Mn(A,1,3999,mu,3,n);case 8:return HA(A,945,969,!1,n);case 9:return HA(A,97,122,!1,n);case 10:return HA(A,65,90,!1,n);case 11:return HA(A,1632,1641,!0,n);case 12:case 49:return Mn(A,1,9999,Cu,3,n);case 35:return Mn(A,1,9999,Cu,3,n).toLowerCase();case 13:return HA(A,2534,2543,!0,n);case 14:case 30:return HA(A,6112,6121,!0,n);case 15:return sn(A,"子丑寅卯辰巳午未申酉戌亥",r);case 16:return sn(A,"甲乙丙丁戊己庚辛壬癸",r);case 17:case 48:return bt(A,"零一二三四五六七八九",bu,"負",r,14);case 47:return bt(A,"零壹貳參肆伍陸柒捌玖",Qu,"負",r,15);case 42:return bt(A,"零一二三四五六七八九",bu,"负",r,14);case 41:return bt(A,"零壹贰叁肆伍陆柒捌玖",Qu,"负",r,15);case 26:return bt(A,"〇一二三四五六七八九","十百千万",yu,r,0);case 25:return bt(A,"零壱弐参四伍六七八九","拾百千万",yu,r,7);case 31:return bt(A,"영일이삼사오육칠팔구","십백천만",Wi,s,7);case 33:return bt(A,"零一二三四五六七八九","十百千萬",Wi,s,0);case 32:return bt(A,"零壹貳參四五六七八九","拾百千",Wi,s,7);case 18:return HA(A,2406,2415,!0,n);case 20:return Mn(A,1,19999,cU,3,n);case 21:return HA(A,2790,2799,!0,n);case 22:return HA(A,2662,2671,!0,n);case 52:return Mn(A,1,10999,aU,3,n);case 23:return sn(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return sn(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return HA(A,3302,3311,!0,n);case 28:return sn(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",r);case 29:return sn(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",r);case 34:return HA(A,3792,3801,!0,n);case 37:return HA(A,6160,6169,!0,n);case 38:return HA(A,4160,4169,!0,n);case 39:return HA(A,2918,2927,!0,n);case 40:return HA(A,1776,1785,!0,n);case 43:return HA(A,3046,3055,!0,n);case 44:return HA(A,3174,3183,!0,n);case 45:return HA(A,3664,3673,!0,n);case 46:return HA(A,3872,3881,!0,n);default:return HA(A,48,57,!0,n)}},hU={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:(A,e)=>e.map(t=>{if(j(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2;case"text":return 3}return 0})},fU={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},gi=(A,e)=>{const t=Nt.parse(A,e[0]),n=e[1];return n&&iA(n)?{color:t,stop:n}:{color:t,stop:null}},Ji=(A,e)=>{const t=A[0],n=A[A.length-1];t.stop===null&&(t.stop=RA),n.stop===null&&(n.stop=Je);const r=[];let s=0;for(let a=0;a<A.length;a++){const i=A[a].stop;if(i!==null){const c=J(i,e);c>s?r.push(c):r.push(s),s=c}else r.push(null)}let o=null;for(let a=0;a<r.length;a++){const i=r[a];if(i===null)o===null&&(o=a);else if(o!==null){const c=a-o,u=(i-r[o-1])/(c+1);for(let h=1;h<=c;h++)r[o+h-1]=u*h;o=null}}return A.map(({color:a},i)=>({color:a,stop:Math.max(Math.min(1,r[i]/e),0)}))},gU=(A,e,t)=>{const n=e/2,r=t/2,s=J(A[0],e)-n,o=r-J(A[1],t);return(Math.atan2(o,s)+Math.PI*2)%(Math.PI*2)},Uu=(A,e,t)=>{const n=typeof A=="number"?A:gU(A,e,t),r=Math.abs(e*Math.sin(n))+Math.abs(t*Math.cos(n)),s=e/2,o=t/2,a=r/2,i=Math.sin(n-Math.PI/2)*a,c=Math.cos(n-Math.PI/2)*a;return[r,s-c,s+c,o-i,o+i]},ze=(A,e)=>Math.sqrt(A*A+e*e),Eu=(A,e,t,n,r)=>[[0,0],[0,e],[A,0],[A,e]].reduce((s,o)=>{const[a,i]=o,c=ze(t-a,n-i);return(r?c<s.optimumDistance:c>s.optimumDistance)?{optimumCorner:o,optimumDistance:c}:s},{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner,BU=(A,e,t,n,r)=>{let s=0,o=0;switch(A.size){case 0:A.shape===0?s=o=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-r)):A.shape===1&&(s=Math.min(Math.abs(e),Math.abs(e-n)),o=Math.min(Math.abs(t),Math.abs(t-r)));break;case 2:if(A.shape===0)s=o=Math.min(ze(e,t),ze(e,t-r),ze(e-n,t),ze(e-n,t-r));else if(A.shape===1){const a=Math.min(Math.abs(t),Math.abs(t-r))/Math.min(Math.abs(e),Math.abs(e-n)),[i,c]=Eu(n,r,e,t,!0);s=ze(i-e,(c-t)/a),o=a*s}break;case 1:A.shape===0?s=o=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-r)):A.shape===1&&(s=Math.max(Math.abs(e),Math.abs(e-n)),o=Math.max(Math.abs(t),Math.abs(t-r)));break;case 3:if(A.shape===0)s=o=Math.max(ze(e,t),ze(e,t-r),ze(e-n,t),ze(e-n,t-r));else if(A.shape===1){const a=Math.max(Math.abs(t),Math.abs(t-r))/Math.max(Math.abs(e),Math.abs(e-n)),[i,c]=Eu(n,r,e,t,!1);s=ze(i-e,(c-t)/a),o=a*s}break}return Array.isArray(A.size)&&(s=J(A.size[0],n),o=A.size.length===2?J(A.size[1],r):s),[s,o]},sh=(A,e)=>{let t=Se(180);const n=[];return Ye(e).forEach((r,s)=>{if(s===0){const a=r[0];if(a.type===20&&a.value==="to"){t=Gp(r);return}else if($p(a)){t=pr.parse(A,a);return}}const o=gi(A,r);n.push(o)}),{angle:t,stops:n,type:1}},no=(A,e)=>{let t=Se(180);const n=[];return Ye(e).forEach((r,s)=>{if(s===0){const a=r[0];if(a.type===20&&["top","left","right","bottom"].indexOf(a.value)!==-1){t=Gp(r);return}else if($p(a)){t=(pr.parse(A,a)+Se(270))%Se(360);return}}const o=gi(A,r);n.push(o)}),{angle:t,stops:n,type:1}},wU=(A,e)=>{const t=Se(180),n=[];let r=1;const s=0,o=3,a=[];return Ye(e).forEach((i,c)=>{const u=i[0];if(c===0){if(j(u)&&u.value==="linear"){r=1;return}else if(j(u)&&u.value==="radial"){r=2;return}}if(u.type===18){if(u.name==="from"){const h=Nt.parse(A,u.values[0]);n.push({stop:RA,color:h})}else if(u.name==="to"){const h=Nt.parse(A,u.values[0]);n.push({stop:Je,color:h})}else if(u.name==="color-stop"){const h=u.values.filter(VA);if(h.length===2){const f=Nt.parse(A,h[1]),g=h[0];GA(g)&&n.push({stop:{type:16,number:g.number*100,flags:g.flags},color:f})}}}}),r===1?{angle:(t+Se(180))%Se(360),stops:n,type:r}:{size:o,shape:s,stops:n,position:a,type:r}},oh="closest-side",ih="farthest-side",ah="closest-corner",ch="farthest-corner",lh="circle",uh="ellipse",dh="cover",ph="contain",mU=(A,e)=>{let t=0,n=3;const r=[],s=[];return Ye(e).forEach((o,a)=>{let i=!0;if(a===0){let c=!1;i=o.reduce((u,h)=>{if(c)if(j(h))switch(h.value){case"center":return s.push(Ut),u;case"top":case"left":return s.push(RA),u;case"right":case"bottom":return s.push(Je),u}else(iA(h)||Gt(h))&&s.push(h);else if(j(h))switch(h.value){case lh:return t=0,!1;case uh:return t=1,!1;case"at":return c=!0,!1;case oh:return n=0,!1;case dh:case ih:return n=1,!1;case ph:case ah:return n=2,!1;case ch:return n=3,!1}else if(Gt(h)||iA(h))return Array.isArray(n)||(n=[]),n.push(h),!1;return u},i)}if(i){const c=gi(A,o);r.push(c)}}),{size:n,shape:t,stops:r,position:s,type:2}},ro=(A,e)=>{let t=0,n=3;const r=[],s=[];return Ye(e).forEach((o,a)=>{let i=!0;if(a===0?i=o.reduce((c,u)=>{if(j(u))switch(u.value){case"center":return s.push(Ut),!1;case"top":case"left":return s.push(RA),!1;case"right":case"bottom":return s.push(Je),!1}else if(iA(u)||Gt(u))return s.push(u),!1;return c},i):a===1&&(i=o.reduce((c,u)=>{if(j(u))switch(u.value){case lh:return t=0,!1;case uh:return t=1,!1;case ph:case oh:return n=0,!1;case ih:return n=1,!1;case ah:return n=2,!1;case dh:case ch:return n=3,!1}else if(Gt(u)||iA(u))return Array.isArray(n)||(n=[]),n.push(u),!1;return c},i)),i){const c=gi(A,o);r.push(c)}}),{size:n,shape:t,stops:r,position:s,type:2}},Ir=(A,e)=>$(k({},sh(A,e)),{type:3}),CU=A=>A.type===1,bU=A=>A.type===2,QU=A=>A.type===3,Bi={name:"image",parse:(A,e)=>{if(e.type===22){const t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(e.type===18){const t=fh[e.name];if(typeof t=="undefined")throw new Error(`Attempting to parse an unsupported image function "${e.name}"`);return t(A,e.values)}throw new Error(`Unsupported image type ${e.type}`)}};function hh(A){return!(A.type===20&&A.value==="none")&&(A.type!==18||!!fh[A.name])}const fh={"linear-gradient":sh,"-moz-linear-gradient":no,"-ms-linear-gradient":no,"-o-linear-gradient":no,"-webkit-linear-gradient":no,"radial-gradient":mU,"-moz-radial-gradient":ro,"-ms-radial-gradient":ro,"-o-radial-gradient":ro,"-webkit-radial-gradient":ro,"-webkit-gradient":wU,"repeating-linear-gradient":Ir,"-webkit-repeating-linear-gradient":Ir,"-moz-repeating-linear-gradient":Ir,"-ms-repeating-linear-gradient":Ir,"-o-repeating-linear-gradient":Ir},yU={name:"background-image",initialValue:"none",type:1,prefix:!1,skipCache:!0,parse:(A,e)=>{if(e.length===0)return[];const t=e[0];return t.type===20&&t.value==="none"?[]:e.filter(n=>VA(n)&&hh(n)).map(n=>Bi.parse(A,n))}},UU={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:(A,e)=>e.map(t=>{if(j(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})},EU={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:(A,e)=>Ye(e).map(t=>t.map(Op).filter(n=>n!==null)).map(Mp)},FU={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:(A,e)=>Ye(e).map(t=>t.filter(j).map(n=>n.value).join(" ")).map(kU)},kU=A=>{switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}},vU={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:(A,e)=>Ye(e).map(t=>t.map(n=>_U(n)?n:Op(n)).filter(n=>n!==null))},_U=A=>j(A)||iA(A),wi=A=>({name:`border-${A}-color`,initialValue:"transparent",prefix:!1,type:3,format:"color"}),xU=wi("top"),SU=wi("right"),IU=wi("bottom"),TU=wi("left"),mi=A=>({name:`border-${A}-radius`,initialValue:"0 0",prefix:!1,type:1,parse:(e,t)=>Mp(t.filter(iA))}),HU=mi("top-left"),LU=mi("top-right"),DU=mi("bottom-right"),RU=mi("bottom-left"),Ci=A=>({name:`border-${A}-style`,initialValue:"solid",prefix:!1,type:2,parse:(e,t)=>{switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}),OU=Ci("top"),MU=Ci("right"),PU=Ci("bottom"),KU=Ci("left"),bi=A=>({name:`border-${A}-width`,initialValue:"0",type:0,prefix:!1,parse:(e,t)=>ht(t)?t.number:0}),NU=bi("top"),zU=bi("right"),$U=bi("bottom"),GU=bi("left"),$a={type:0},Ga=A=>{const[e]=A;return e?j(e)?e.value==="farthest-side"?"farthest-side":"closest-side":iA(e)?e:"closest-side":"closest-side"},gh=A=>{let e=null,t=null;for(const n of A)if(j(n))switch(n.value){case"left":e=RA;break;case"right":e=Je;break;case"top":t=RA;break;case"bottom":t=Je;break;case"center":e===null?e=Ut:t===null&&(t=Ut);break}else iA(n)&&(e===null?e=n:t===null&&(t=n));return{cx:e!=null?e:Ut,cy:t!=null?t:Ut}},VU=A=>{var r,s,o,a;const e=[];for(const i of A)if(i.type!==31){if(j(i)&&i.value==="round")break;iA(i)&&e.push(i)}const t=(r=e[0])!=null?r:RA,n=(s=e[1])!=null?s:t;return{type:1,top:t,right:n,bottom:(o=e[2])!=null?o:t,left:(a=e[3])!=null?a:n}},ZU=A=>{const e=A.filter(bs),t=e.findIndex(s=>ps(s,"at")),n=t===-1?e:e.slice(0,t),r=t===-1?[]:e.slice(t+1);return k({type:2,radius:Ga(n)},gh(r))},XU=A=>{const e=A.filter(bs),t=e.findIndex(s=>ps(s,"at")),n=t===-1?e:e.slice(0,t),r=t===-1?[]:e.slice(t+1);return k({type:3,rx:Ga(n.slice(0,1)),ry:Ga(n.slice(1,2))},gh(r))},WU=A=>{const e=Ye(A),t=[];for(const n of e){if(n.length===1&&j(n[0]))continue;const r=n.filter(iA);r.length>=2&&t.push([r[0],r[1]])}return{type:4,points:t}},JU=A=>{const e=A.find(t=>t.type===0);return e?{type:5,d:e.value}:$a},jU={name:"clip-path",initialValue:"none",prefix:!1,type:0,parse:(A,e)=>{if(j(e)&&e.value==="none")return $a;if(e.type===18)switch(e.name){case"inset":return VU(e.values);case"circle":return ZU(e.values);case"ellipse":return XU(e.values);case"polygon":return WU(e.values);case"path":return JU(e.values)}return $a}},YU={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},qU={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"rtl":return 1;default:return 0}}},AE={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:(A,e)=>e.filter(j).reduce((t,n)=>t|eE(n.value),0)},eE=A=>{switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Fu={name:"float",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},tE={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:(A,e)=>e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0},nE={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"strict":return"strict";default:return"normal"}}},rE={name:"line-height",initialValue:"normal",prefix:!1,type:4},Va=(A,e)=>j(A)&&A.value==="normal"?1.2*e:A.type===17?e*A.number:iA(A)?J(A,e):e,sE={name:"list-style-image",initialValue:"none",type:0,prefix:!1,skipCache:!0,parse:(A,e)=>e.type===20&&e.value==="none"?null:Bi.parse(A,e)},oE={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"inside":return 0;default:return 1}}},Qi=A=>({name:`margin-${A}`,initialValue:"0",prefix:!1,type:4}),iE=Qi("top"),aE=Qi("right"),cE=Qi("bottom"),lE=Qi("left"),ku={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:(A,e)=>e.filter(j).map(t=>{switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})},uE={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"break-word":return"break-word";default:return"normal"}}},yi=A=>({name:`padding-${A}`,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}),dE=yi("top"),pE=yi("right"),hE=yi("bottom"),fE=yi("left"),gE={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},BE={name:"position",initialValue:"static",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},wE={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.length===1&&ps(e[0],"none")?[]:Ye(e).map(t=>{const n={color:ut.TRANSPARENT,offsetX:RA,offsetY:RA,blur:RA};let r=0;for(let s=0;s<t.length;s++){const o=t[s];Gt(o)?(r===0?n.offsetX=o:r===1?n.offsetY=o:n.blur=o,r++):n.color=Nt.parse(A,o)}return n})},mE={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},CE={name:"transform",initialValue:"none",prefix:!0,type:0,parse:(A,e)=>{if(e.type===20&&e.value==="none")return null;if(e.type===18){const t=UE[e.name];if(typeof t=="undefined")throw new Error(`Attempting to parse an unsupported transform function "${e.name}"`);return t(A,e.values)}return null}},bE=(A,e)=>{const t=e.filter(n=>n.type===17).map(n=>n.number);return t.length===6?t:null},QE=(A,e)=>{const t=e.filter(c=>c.type===17).map(c=>c.number),[n,r,{},{},s,o,{},{},{},{},{},{},a,i]=t;return t.length===16?[n,r,s,o,a,i]:null},yE=(A,e)=>{if(e.length!==1)return null;const t=e[0];let n=0;if(t.type===17&&t.number===0)n=0;else if(t.type===15)n=pr.parse(A,t);else return null;const r=Math.cos(n),s=Math.sin(n);return[r,s,-s,r,0,0]},UE={matrix:bE,matrix3d:QE,rotate:yE},vu={type:16,number:50,flags:4},EE=[vu,vu],FE={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:(A,e)=>{const t=e.filter(iA);return t.length!==2?EE:[t[0],t[1]]}},kE={name:"rotate",initialValue:"none",prefix:!1,type:0,parse:(A,e)=>e.type===20&&e.value==="none"?null:e.type===17&&e.number===0?0:e.type===15?pr.parse(A,e)*180/Math.PI:null},vE={name:"visibility",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}},_E={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"break-all":return"break-all";case"keep-all":return"keep-all";default:return"normal"}}},xE={name:"white-space",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"pre":return"pre";case"nowrap":return"nowrap";case"pre-wrap":return"pre-wrap";case"pre-line":return"pre-line";default:return"normal"}}},Xo=A=>A!==0,ji=A=>A===3||A===4,SE={name:"writing-mode",initialValue:"horizontal-tb",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"vertical-rl":return 1;case"vertical-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4;default:return 0}}},IE={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:(A,e)=>{if(e.type===20)return{auto:!0,order:0};if(GA(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},Bh={name:"time",parse:(A,e)=>{if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},TE={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:(A,e)=>GA(e)?e.number:1},_u={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},xu={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:(A,e)=>e.filter(j).map(t=>{switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(t=>t!==0)},HE={name:"text-decoration-style",initialValue:"solid",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"double":return 1;case"dotted":return 2;case"dashed":return 3;case"wavy":return 4;default:return 0}}},LE={name:"text-decoration-thickness",initialValue:"auto",prefix:!1,type:0,parse:(A,e)=>{if(j(e))switch(e.value){case"auto":return"auto";case"from-font":return"from-font"}return ht(e)?e.number:"auto"}},DE={name:"text-underline-offset",initialValue:"auto",prefix:!1,type:0,parse:(A,e)=>j(e)&&e.value==="auto"?"auto":ht(e)?e.number:"auto"},RE={name:"font-family",initialValue:"",prefix:!1,type:1,parse:(A,e)=>{const t=[],n=[],r=[];let s=!1;return e.forEach(o=>{switch(o.type){case 20:t.push(o.value);break;case 0:s=!0,t.push(o.value);break;case 17:t.push(o.number.toString());break;case 4:n.push(t.join(" ")),r.push(s),s=!1,t.length=0;break}}),t.length&&(n.push(t.join(" ")),r.push(s)),n.map((o,a)=>r[a]||o.indexOf(" ")!==-1?`'${o.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\a ").replace(/\r/g,"\\d ").replace(/\f/g,"\\c ")}'`:o)}},OE={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},ME={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:(A,e)=>{if(GA(e))return e.number;if(j(e))switch(e.value){case"bold":return 700;default:return 400}return 400}},PE={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.filter(j).map(t=>t.value)},KE={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},NE={name:"content",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>{if(e.length===0)return[];const t=e[0];return t.type===20&&t.value==="none"?[]:e}},wh=(A,e)=>{const t=[],n=A.filter(bs);for(let r=0;r<n.length;r++){const s=n[r],o=n[r+1];if(s.type===20){const a=o&&GA(o)?o.number:e;t.push([s.value,a])}}return t},zE={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:(A,e)=>{if(e.length===0)return null;const t=e[0];return t.type===20&&t.value==="none"?null:wh(e,1).map(([n,r])=>({counter:n,increment:r}))}},$E={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:(A,e)=>e.length===0?[]:wh(e,0).filter(([t])=>t!=="none").map(([t,n])=>({counter:t,reset:n}))},GE={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:(A,e)=>e.filter(ht).map(t=>Bh.parse(A,t))},VE={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:(A,e)=>{if(e.length===0)return null;const t=e[0];if(t.type===20&&t.value==="none")return null;const n=[],r=e.filter(t0);if(r.length%2!==0)return null;for(let s=0;s<r.length;s+=2){const o=r[s].value,a=r[s+1].value;n.push({open:o,close:a})}return n}},Su=(A,e,t)=>{if(!A)return"";const n=A[Math.min(e,A.length-1)];return n?t?n.open:n.close:""},ZE={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.length===1&&ps(e[0],"none")?[]:Ye(e).map(t=>{const n={color:255,offsetX:RA,offsetY:RA,blur:RA,spread:RA,inset:!1};let r=0;for(let s=0;s<t.length;s++){const o=t[s];ps(o,"inset")?n.inset=!0:Gt(o)?(r===0?n.offsetX=o:r===1?n.offsetY=o:r===2?n.blur=o:n.spread=o,r++):n.color=Nt.parse(A,o)}return n})},XE={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:(A,e)=>{const t=[0,1,2],n=[];return e.filter(j).forEach(r=>{switch(r.value){case"stroke":n.push(1);break;case"fill":n.push(0);break;case"markers":n.push(2);break}}),t.forEach(r=>{n.indexOf(r)===-1&&n.push(r)}),n}},WE={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},JE={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:(A,e)=>ht(e)?e.number:0},jE={name:"-webkit-line-clamp",initialValue:"none",prefix:!0,type:0,parse:(A,e)=>e.type===20&&e.value==="none"?0:e.type===17?Math.max(0,Math.floor(e.number)):0},YE={name:"object-fit",initialValue:"fill",prefix:!1,type:1,parse:(A,e)=>e.filter(j).reduce((t,n)=>t|qE(n.value),0)},qE=A=>{switch(A){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},AF={name:"text-overflow",initialValue:"clip",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"ellipsis":return 1;default:return 0}}},eF={name:"image-rendering",initialValue:"auto",prefix:!1,type:2,parse:(A,e)=>{switch(e.toLowerCase()){case"crisp-edges":case"-webkit-crisp-edges":case"-moz-crisp-edges":return 1;case"pixelated":case"-webkit-optimize-contrast":return 2;case"smooth":case"high-quality":return 3;default:return 0}}},$A={NORMAL:"normal",MULTIPLY:"multiply",SCREEN:"screen",OVERLAY:"overlay",DARKEN:"darken",LIGHTEN:"lighten",COLOR_DODGE:"color-dodge",COLOR_BURN:"color-burn",HARD_LIGHT:"hard-light",SOFT_LIGHT:"soft-light",DIFFERENCE:"difference",EXCLUSION:"exclusion",HUE:"hue",SATURATION:"saturation",COLOR:"color",LUMINOSITY:"luminosity"},tF=new Set(Object.values($A)),nF={name:"mix-blend-mode",initialValue:"normal",type:2,prefix:!1,parse:(A,e)=>tF.has(e)?e:$A.NORMAL},rF={name:"filter",initialValue:"none",prefix:!1,type:1,parse:(A,e)=>{if(e.length===1&&e[0].type===20&&e[0].value==="none")return null;const t=[];for(const n of e)if(n.type===18){const r=n,s=sF(r.values);switch(r.name){case"blur":t.push(`blur(${s}px)`);break;case"brightness":case"contrast":case"invert":case"opacity":case"saturate":case"sepia":t.push(`${r.name}(${s})`);break;case"grayscale":t.push(`grayscale(${s})`);break;case"hue-rotate":t.push(`hue-rotate(${s}deg)`);break;case"drop-shadow":t.push(`drop-shadow(${s})`);break}}return t.length>0?t.join(" "):null}},sF=A=>{const e=[];for(const t of A)t.type!==31&&(t.type===15?e.push(`${t.number}${t.unit}`):t.type===17?e.push(`${t.number}`):t.type===16?e.push(`${t.number}%`):t.type===20?e.push(t.value):t.type===5&&e.push(`#${t.value}`));return e.join(" ")},oF={name:"font-variant-ligatures",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"none":return 1;case"common-ligatures":return 2;case"no-common-ligatures":return 3;case"discretionary-ligatures":return 4;case"no-discretionary-ligatures":return 5;case"historical-ligatures":return 6;case"no-historical-ligatures":return 7;case"contextual":return 8;case"no-contextual":return 9;default:return 0}}},iF={name:"zoom",initialValue:"1",type:0,prefix:!1,parse:(A,e)=>e.type===16?Math.max(0,e.number/100):e.type===17?Math.max(0,e.number):1},aF={name:"object-position",initialValue:"50% 50%",prefix:!1,type:1,parse:(A,e)=>{const t=[];let n=0;for(;n<e.length&&t.length<2;){const r=e[n];if(j(r))switch(r.value){case"left":case"top":t.push(RA);break;case"center":t.push(Ut);break;case"right":case"bottom":t.push(Je);break}else iA(r)&&t.push(r);n++}for(;t.length<2;)t.push(Ut);return[t[0],t[1]]}},cF=new Set(Object.values({NORMAL:"normal",MULTIPLY:"multiply",SCREEN:"screen",OVERLAY:"overlay",DARKEN:"darken",LIGHTEN:"lighten",COLOR_DODGE:"color-dodge",COLOR_BURN:"color-burn",HARD_LIGHT:"hard-light",SOFT_LIGHT:"soft-light",DIFFERENCE:"difference",EXCLUSION:"exclusion",HUE:"hue",SATURATION:"saturation",COLOR:"color",LUMINOSITY:"luminosity"})),lF={name:"background-blend-mode",initialValue:"normal",prefix:!1,type:1,parse:(A,e)=>{const t=[],n=e.filter(VA);for(const r of n)j(r)&&cF.has(r.value)&&t.push(r.value);return t.length>0?t:["normal"]}},uF={name:"border-image-source",initialValue:"none",prefix:!1,type:1,skipCache:!0,parse:(A,e)=>{if(e.length===0)return null;const t=e.filter(n=>VA(n)&&hh(n));return t.length===0?null:Bi.parse(A,t[0])}},dF=A=>{const e=[...A];return e.length===1?e.push(e[0],e[0],e[0]):e.length===2?e.push(e[0],e[1]):e.length===3&&e.push(e[1]),e.slice(0,4)},pF={name:"border-image-slice",initialValue:"100%",prefix:!1,type:1,parse:(A,e)=>{const t=e.filter(bs),n=[];let r=!1,s="percent";for(const u of t){if(j(u)&&u.value==="fill"){r=!0;continue}u.type===17?(n.push(u.number),s="number"):u.type===16&&(n.push(u.number),s="percent")}const[o,a,i,c]=dF(n.length>0?n:[100]);return{top:o,right:a,bottom:i,left:c,fill:r,unit:s}}},hF=A=>{switch(A){case"repeat":return 1;case"round":return 2;case"space":return 3;default:return 0}},fF={name:"border-image-repeat",initialValue:"stretch",prefix:!1,type:1,parse:(A,e)=>{var s,o;const t=e.filter(bs),n=[];for(const a of t)j(a)&&n.push(hF(a.value));const r=(s=n[0])!=null?s:0;return{horizontal:r,vertical:(o=n[1])!=null?o:r}}},gF={name:"box-decoration-break",initialValue:"slice",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"clone":return 1;default:return 0}}},BF=1e4;var wF=class{constructor(A){this.styles=A}get topColor(){return this.styles.borderTopColor}get rightColor(){return this.styles.borderRightColor}get bottomColor(){return this.styles.borderBottomColor}get leftColor(){return this.styles.borderLeftColor}get topStyle(){return this.styles.borderTopStyle}get rightStyle(){return this.styles.borderRightStyle}get bottomStyle(){return this.styles.borderBottomStyle}get leftStyle(){return this.styles.borderLeftStyle}get topWidth(){return this.styles.borderTopWidth}get rightWidth(){return this.styles.borderRightWidth}get bottomWidth(){return this.styles.borderBottomWidth}get leftWidth(){return this.styles.borderLeftWidth}get topLeftRadius(){return this.styles.borderTopLeftRadius}get topRightRadius(){return this.styles.borderTopRightRadius}get bottomRightRadius(){return this.styles.borderBottomRightRadius}get bottomLeftRadius(){return this.styles.borderBottomLeftRadius}get imageSource(){return this.styles.borderImageSource}get imageSlice(){return this.styles.borderImageSlice}get imageRepeat(){return this.styles.borderImageRepeat}get boxShadow(){return this.styles.boxShadow}},mF=class{constructor(A){this.styles=A}get color(){return this.styles.backgroundColor}get image(){return this.styles.backgroundImage}get clip(){return this.styles.backgroundClip}get origin(){return this.styles.backgroundOrigin}get position(){return this.styles.backgroundPosition}get repeat(){return this.styles.backgroundRepeat}get size(){return this.styles.backgroundSize}get blendMode(){return this.styles.backgroundBlendMode}},CF=class{constructor(A){this.styles=A}get family(){return this.styles.fontFamily}get size(){return this.styles.fontSize}get style(){return this.styles.fontStyle}get variant(){return this.styles.fontVariant}get weight(){return this.styles.fontWeight}get ligatures(){return this.styles.fontVariantLigatures}get color(){return this.styles.color}get letterSpacing(){return this.styles.letterSpacing}get lineHeight(){return this.styles.lineHeight}get textAlign(){return this.styles.textAlign}get textTransform(){return this.styles.textTransform}get textOverflow(){return this.styles.textOverflow}get textShadow(){return this.styles.textShadow}get textDecorationColor(){return this.styles.textDecorationColor}get textDecorationLine(){return this.styles.textDecorationLine}get textDecorationStyle(){return this.styles.textDecorationStyle}get textDecorationThickness(){return this.styles.textDecorationThickness}get textUnderlineOffset(){return this.styles.textUnderlineOffset}get wordBreak(){return this.styles.wordBreak}get lineBreak(){return this.styles.lineBreak}get overflowWrap(){return this.styles.overflowWrap}get writingMode(){return this.styles.writingMode}get direction(){return this.styles.direction}get webkitTextStrokeColor(){return this.styles.webkitTextStrokeColor}get webkitTextStrokeWidth(){return this.styles.webkitTextStrokeWidth}get webkitLineClamp(){return this.styles.webkitLineClamp}get paintOrder(){return this.styles.paintOrder}},bF=class{constructor(A){this.styles=A}get display(){return this.styles.display}get position(){return this.styles.position}get float(){return this.styles.float}get zIndex(){return this.styles.zIndex}get marginTop(){return this.styles.marginTop}get marginRight(){return this.styles.marginRight}get marginBottom(){return this.styles.marginBottom}get marginLeft(){return this.styles.marginLeft}get paddingTop(){return this.styles.paddingTop}get paddingRight(){return this.styles.paddingRight}get paddingBottom(){return this.styles.paddingBottom}get paddingLeft(){return this.styles.paddingLeft}get overflowX(){return this.styles.overflowX}get overflowY(){return this.styles.overflowY}get opacity(){return this.styles.opacity}get visibility(){return this.styles.visibility}get transform(){return this.styles.transform}get transformOrigin(){return this.styles.transformOrigin}get rotate(){return this.styles.rotate}get zoom(){return this.styles.zoom}get clipPath(){return this.styles.clipPath}get mixBlendMode(){return this.styles.mixBlendMode}get filter(){return this.styles.filter}get imageRendering(){return this.styles.imageRendering}get objectFit(){return this.styles.objectFit}get objectPosition(){return this.styles.objectPosition}get boxDecorationBreak(){return this.styles.boxDecorationBreak}get listStyleImage(){return this.styles.listStyleImage}get listStylePosition(){return this.styles.listStylePosition}get listStyleType(){return this.styles.listStyleType}get animationDuration(){return this.styles.animationDuration}isVisible(){return this.styles.isVisible()}isTransparent(){return this.styles.isTransparent()}isTransformed(){return this.styles.isTransformed()}isPositioned(){return this.styles.isPositioned()}isPositionedWithZIndex(){return this.styles.isPositionedWithZIndex()}isFloating(){return this.styles.isFloating()}isInlineLevel(){return this.styles.isInlineLevel()}},Cn,QF=(Cn=class{get border(){var e;return(e=this._border)!=null?e:this._border=new wF(this)}get background(){var e;return(e=this._background)!=null?e:this._background=new mF(this)}get font(){var e;return(e=this._font)!=null?e:this._font=new CF(this)}get layout(){var e;return(e=this._layout)!=null?e:this._layout=new bF(this)}constructor(e,t){var s,o;const n=Cn.standardProps;if(t.display==="none"){this.display=0;for(const[i,c]of n)i!=="display"&&(this[i]=pe(e,c,void 0));this.float=pe(e,Fu,void 0),this.textDecorationColor=pe(e,_u,void 0),this.textDecorationLine=pe(e,xu,void 0);const a=pe(e,ku,void 0);this.overflowX=a[0],this.overflowY=a[a.length>1?1:0];return}for(const[a,i,c]of n)this[a]=pe(e,i,t[c]);this.float=pe(e,Fu,t.cssFloat),this.textDecorationColor=pe(e,_u,(s=t.textDecorationColor)!=null?s:t.color),this.textDecorationLine=pe(e,xu,(o=t.textDecorationLine)!=null?o:t.textDecoration);const r=pe(e,ku,t.overflow);this.overflowX=r[0],this.overflowY=r[r.length>1?1:0]}isVisible(){return this.display>0&&this.opacity>0&&this.visibility===0}isTransparent(){return Et(this.backgroundColor)}isTransformed(){return this.transform!==null||this.rotate!==null}isPositioned(){return this.position!==0}isPositionedWithZIndex(){return this.isPositioned()&&!this.zIndex.auto}isFloating(){return this.float!==0}isInlineLevel(){return jA(this.display,4)||jA(this.display,33554432)||jA(this.display,268435456)||jA(this.display,536870912)||jA(this.display,67108864)||jA(this.display,134217728)}},Cn.standardProps=[["animationDuration",GE,"animationDuration"],["backgroundClip",hU,"backgroundClip"],["backgroundColor",fU,"backgroundColor"],["backgroundImage",yU,"backgroundImage"],["backgroundOrigin",UU,"backgroundOrigin"],["backgroundPosition",EU,"backgroundPosition"],["backgroundRepeat",FU,"backgroundRepeat"],["backgroundSize",vU,"backgroundSize"],["borderTopColor",xU,"borderTopColor"],["borderRightColor",SU,"borderRightColor"],["borderBottomColor",IU,"borderBottomColor"],["borderLeftColor",TU,"borderLeftColor"],["borderTopLeftRadius",HU,"borderTopLeftRadius"],["borderTopRightRadius",LU,"borderTopRightRadius"],["borderBottomRightRadius",DU,"borderBottomRightRadius"],["borderBottomLeftRadius",RU,"borderBottomLeftRadius"],["borderTopStyle",OU,"borderTopStyle"],["borderRightStyle",MU,"borderRightStyle"],["borderBottomStyle",PU,"borderBottomStyle"],["borderLeftStyle",KU,"borderLeftStyle"],["borderTopWidth",NU,"borderTopWidth"],["borderRightWidth",zU,"borderRightWidth"],["borderBottomWidth",$U,"borderBottomWidth"],["borderLeftWidth",GU,"borderLeftWidth"],["boxShadow",ZE,"boxShadow"],["clipPath",jU,"clipPath"],["color",YU,"color"],["direction",qU,"direction"],["display",AE,"display"],["fontFamily",RE,"fontFamily"],["fontSize",OE,"fontSize"],["fontStyle",KE,"fontStyle"],["fontVariant",PE,"fontVariant"],["fontWeight",ME,"fontWeight"],["letterSpacing",tE,"letterSpacing"],["lineBreak",nE,"lineBreak"],["lineHeight",rE,"lineHeight"],["listStyleImage",sE,"listStyleImage"],["listStylePosition",oE,"listStylePosition"],["listStyleType",za,"listStyleType"],["marginTop",iE,"marginTop"],["marginRight",aE,"marginRight"],["marginBottom",cE,"marginBottom"],["marginLeft",lE,"marginLeft"],["opacity",TE,"opacity"],["overflowWrap",uE,"overflowWrap"],["paddingTop",dE,"paddingTop"],["paddingRight",pE,"paddingRight"],["paddingBottom",hE,"paddingBottom"],["paddingLeft",fE,"paddingLeft"],["paintOrder",XE,"paintOrder"],["position",BE,"position"],["textAlign",gE,"textAlign"],["textDecorationStyle",HE,"textDecorationStyle"],["textDecorationThickness",LE,"textDecorationThickness"],["textUnderlineOffset",DE,"textUnderlineOffset"],["textShadow",wE,"textShadow"],["textTransform",mE,"textTransform"],["textOverflow",AF,"textOverflow"],["transform",CE,"transform"],["transformOrigin",FE,"transformOrigin"],["rotate",kE,"rotate"],["visibility",vE,"visibility"],["webkitTextStrokeColor",WE,"webkitTextStrokeColor"],["webkitTextStrokeWidth",JE,"webkitTextStrokeWidth"],["webkitLineClamp",jE,"webkitLineClamp"],["wordBreak",_E,"wordBreak"],["whiteSpace",xE,"whiteSpace"],["writingMode",SE,"writingMode"],["zIndex",IE,"zIndex"],["objectFit",YE,"objectFit"],["imageRendering",eF,"imageRendering"],["mixBlendMode",nF,"mixBlendMode"],["filter",rF,"filter"],["fontVariantLigatures",oF,"fontVariantLigatures"],["zoom",iF,"zoom"],["objectPosition",aF,"objectPosition"],["backgroundBlendMode",lF,"backgroundBlendMode"],["borderImageSource",uF,"borderImageSource"],["borderImageSlice",pF,"borderImageSlice"],["borderImageRepeat",fF,"borderImageRepeat"],["boxDecorationBreak",gF,"boxDecorationBreak"]],Cn),yF=class{constructor(A,e){this.content=pe(A,NE,e.content),this.quotes=pe(A,VE,e.quotes)}},Iu=class{constructor(A,e){this.counterIncrement=pe(A,zE,e.counterIncrement),this.counterReset=pe(A,$E,e.counterReset)}};const Tu=new Map,pe=(A,e,t)=>{let n=t!==null&&typeof t!="undefined"?t.toString():e.initialValue;n.trim()===""&&(n=e.initialValue);let r=Tu.get(e);if(r){const i=r.get(n);if(i!==void 0)return r.delete(n),r.set(n,i),i}const s=Ma.get();s.write(n);const o=new Lp(s.read());Ma.release(s);const a=(()=>{switch(e.type){case 2:{const i=o.parseComponentValue();return e.parse(A,j(i)?i.value:e.initialValue)}case 0:return e.parse(A,o.parseComponentValue());case 1:return e.parse(A,o.parseComponentValues());case 4:return o.parseComponentValue();case 3:switch(e.format){case"angle":return pr.parse(A,o.parseComponentValue());case"color":return Nt.parse(A,o.parseComponentValue());case"image":return Bi.parse(A,o.parseComponentValue());case"length":{const i=o.parseComponentValue();return Gt(i)?i:RA}case"length-percentage":{const i=o.parseComponentValue();return iA(i)?i:RA}case"time":return Bh.parse(A,o.parseComponentValue())}}})();if(r||(r=new Map,Tu.set(e,r)),!(e.skipCache||e.type===3&&e.format==="image")){if(r.size>=200){const i=r.keys().next().value;r.delete(i)}r.set(n,a)}return a},UF="data-html2canvas-debug",EF=A=>{if(typeof A.getAttribute!="function")return 0;switch(A.getAttribute(UF)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Za=(A,e)=>{const t=EF(A);return t===1||e===t},FF="data-html2canvas-ignore";var kF=class{constructor(A,e,t){this.cloneNodeFn=A,this.options=e,this.context=t}appendChildNode(A,e,t){this.safeAppendClonedChild(A,e,t)}cloneChildNodes(A,e,t){A.shadowRoot&&e.shadowRoot?(this.cloneShadowDOMChildren(A.shadowRoot,e.shadowRoot,t),this.cloneLightDOMChildren(A,e,t)):A.shadowRoot&&!e.shadowRoot?this.cloneShadowDOMAsLightDOM(A.shadowRoot,e,t):this.cloneLightDOMChildren(A,e,t)}shouldCloneChild(A){return!un(A)||!tU(A)&&!A.hasAttribute("data-html2canvas-ignore")&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(A))}shouldCloneStyleElement(A){return!this.options.copyStyles||!un(A)||!nh(A)}safeAppendClonedChild(A,e,t){this.shouldCloneChild(e)&&this.shouldCloneStyleElement(e)&&A.appendChild(this.cloneNodeFn(e,t))}cloneAssignedNodes(A,e,t){A.forEach(n=>{this.safeAppendClonedChild(e,n,t)})}cloneSlotFallbackContent(A,e,t){for(let n=A.firstChild;n;n=n.nextSibling)this.safeAppendClonedChild(e,n,t)}cloneSlotElement(A,e,t){if(!Xr(A))return;const n=A;if(typeof n.assignedNodes!="function"){this.context.logger.warn("HTMLSlotElement.assignedNodes is not available",A),this.cloneSlotFallbackContent(A,e,t);return}const r=n.assignedNodes();if(!r||!Array.isArray(r)){this.context.logger.warn("assignedNodes() did not return a valid array",A),this.cloneSlotFallbackContent(A,e,t);return}r.length>0?this.cloneAssignedNodes(r,e,t):this.cloneSlotFallbackContent(A,e,t)}cloneShadowDOMChildren(A,e,t){for(let n=A.firstChild;n;n=n.nextSibling)un(n)&&Xr(n)?this.cloneSlotElement(n,e,t):this.safeAppendClonedChild(e,n,t)}cloneLightDOMChildren(A,e,t){for(let n=A.firstChild;n;n=n.nextSibling)this.appendChildNode(e,n,t)}cloneSlotElementAsLightDOM(A,e,t){if(!Xr(A))return;const n=A;if(typeof n.assignedNodes!="function"){for(let s=A.firstChild;s;s=s.nextSibling)this.appendChildNode(e,s,t);return}const r=n.assignedNodes();if(r&&Array.isArray(r)&&r.length>0)r.forEach(s=>this.appendChildNode(e,s,t));else for(let s=A.firstChild;s;s=s.nextSibling)this.appendChildNode(e,s,t)}cloneShadowDOMAsLightDOM(A,e,t){for(let n=A.firstChild;n;n=n.nextSibling)un(n)&&Xr(n)?this.cloneSlotElementAsLightDOM(n,e,t):this.appendChildNode(e,n,t)}};const vF=A=>{let e=A;for(;e;){if(e.parentNode&&e.parentNode.host)return e.parentNode;const t=e.getRootNode();if(t&&t!==e.ownerDocument&&t.host)return t;e=e.parentNode}return null};var Yi=class{constructor(A,e,t){var n;if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new iU,this.quoteDepth=0,this.slotCloner=new kF((r,s)=>this.cloneNode(r,s),{ignoreElements:t.ignoreElements,copyStyles:(n=t.copyStyles)!=null?n:!0},A),!e.ownerDocument)throw new Error("Cloned element does not have an owner document");if(!this.options.iframeContainer){const r=vF(e);r&&(this.options.iframeContainer=r)}this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}toIFrame(A,e){var h,f;const t=_F(A,e,this.options.iframeContainer);if(!t.contentWindow)throw new Error("Unable to find iframe window");const n=A.defaultView.pageXOffset,r=A.defaultView.pageYOffset,s=t.contentWindow,o=s.document,a=IF(t).then(()=>T(this,null,function*(){this.scrolledElements.forEach(DF),s&&s.scrollTo(e.left,e.top);const g=this.options.onclone,m=this.clonedReferenceElement;if(typeof m=="undefined")throw new Error(`Error finding the ${this.referenceElement.nodeName} in the cloned document`);return o.fonts&&o.fonts.ready&&(yield o.fonts.ready),/(AppleWebKit)/g.test(navigator.userAgent)&&(yield SF(o)),typeof g=="function"&&(yield Promise.resolve().then(()=>g(o,m))),s.scrollTo(e.left,e.top),/AppleWebKit/g.test(navigator.userAgent)&&(s.scrollY!==e.top||s.scrollX!==e.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-e.left,s.scrollY-e.top,0,0)),t})),i=A.baseURI;o.open();const c=HF(document.doctype)+"<html></html>";try{const g=(h=this.referenceElement.ownerDocument)==null?void 0:h.defaultView,m=g&&g.trustedTypes;let Q=(f=m==null?void 0:m.getPolicy)==null?void 0:f.call(m,"html2canvas-pro");!Q&&m&&(Q=m.createPolicy("html2canvas-pro",{createHTML:E=>E}));const U=Q?Q.createHTML(c):c;o.write(U)}catch(g){o.write(c)}LF(this.referenceElement.ownerDocument,n,r),o.close();const u=o.adoptNode(this.documentElement);return KF(u,i),o.replaceChild(u,o.documentElement),a}createElementClone(A){if(Za(A,2))debugger;if(eh(A))return this.createCanvasClone(A);if(Bu(A))return this.createVideoClone(A);if(nh(A))return this.createStyleClone(A);const e=A.cloneNode(!1);return Na(e)&&(Na(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager")),wu(e)&&!dn(e)?this.createCustomElementClone(A,e):e}createCustomElementClone(A,e){const t=document.createElement("div");t.className=e.className,qi(e.style,t);const n=e.attributes;for(let r=0;r<n.length;r++){const s=n[r];s.name!=="class"&&s.name!=="style"&&t.setAttribute(s.name,s.value)}if(A.shadowRoot)try{t.attachShadow({mode:"open"})}catch(r){this.context.logger.error("Failed to attach shadow root to custom element clone:",r)}return t}createStyleClone(A){try{const t=A.sheet;if(t&&t.cssRules){const n=[].slice.call(t.cssRules,0).reduce((s,o)=>o&&typeof o.cssText=="string"?s+o.cssText:s,""),r=A.cloneNode(!1);return r.textContent=n,this.options.cspNonce&&(r.nonce=this.options.cspNonce),r}}catch(t){if(this.context.logger.error("Unable to access cssRules property",t),t.name!=="SecurityError")throw t}const e=A.cloneNode(!1);return this.options.cspNonce&&(e.nonce=this.options.cspNonce),e}createCanvasClone(A){var t,n;if(this.options.inlineImages&&A.ownerDocument){const r=A.ownerDocument.createElement("img");try{return r.src=A.toDataURL(),r}catch(s){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}const e=A.cloneNode(!1);try{e.width=A.width,e.height=A.height;const r=A.getContext("2d"),s=e.getContext("2d",{willReadFrequently:!0});if(s)if(!this.options.allowTaint&&r)s.putImageData(r.getImageData(0,0,A.width,A.height),0,0);else{const o=(t=A.getContext("webgl2"))!=null?t:A.getContext("webgl");o&&((n=o.getContextAttributes())==null?void 0:n.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A),s.drawImage(A,0,0)}return e}catch(r){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return e}createVideoClone(A){const e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;const t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch(r){this.context.logger.info("Unable to clone video as it is tainted",A)}const n=A.ownerDocument.createElement("canvas");return n.width=A.offsetWidth,n.height=A.offsetHeight,n}appendChildNode(A,e,t){this.slotCloner.appendChildNode(A,e,t)}cloneChildNodes(A,e,t){this.slotCloner.cloneChildNodes(A,e,t)}cloneNode(A,e){if(qp(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);const t=A.ownerDocument.defaultView;if(t&&un(A)&&(hs(A)||dn(A))){const n=this.createElementClone(A);n.style.transitionProperty="none";const r=t.getComputedStyle(A),s=oU(A);this.referenceElement===A&&hs(n)&&(this.clonedReferenceElement=n),kc(n)&&MF(n,this.options.cspNonce);const o=this.counters.parse(new Iu(this.context,r));if(s){const a=t.getComputedStyle(A,":before"),i=this.resolvePseudoContent(A,n,a,0);i&&n.insertBefore(i,n.firstChild);const c=t.getComputedStyle(A,":after"),u=this.resolvePseudoContent(A,n,c,1);u&&n.appendChild(u)}return wu(A)&&(e=!0),Bu(A)||this.cloneChildNodes(A,n,e),this.counters.pop(o),(r&&(this.options.copyStyles||dn(A))&&!th(A)||e)&&qi(r,n),(A.scrollTop!==0||A.scrollLeft!==0)&&this.scrolledElements.push([n,A.scrollLeft,A.scrollTop]),(Vo(A)||Zo(A))&&(Vo(n)||Zo(n))&&(n.value=A.value),n}return A.cloneNode(!1)}resolvePseudoContent(A,e,t,n){if(!t)return;const r=t.content,s=e.ownerDocument;if(!s||!r||r==="none"||r==="-moz-alt-content"||t.display==="none")return;this.counters.parse(new Iu(this.context,t));const o=new yF(this.context,t),a=s.createElement("html2canvaspseudoelement");qi(t,a),o.content.forEach(c=>{if(c.type===0)a.appendChild(s.createTextNode(c.value));else if(c.type===22){const u=s.createElement("img");u.src=c.value,u.style.opacity="1",a.appendChild(u)}else if(c.type===18){if(c.name==="attr"){const u=c.values.filter(j);u.length&&a.appendChild(s.createTextNode(A.getAttribute(u[0].value)||""))}else if(c.name==="counter"){const[u,h]=c.values.filter(VA);if(u&&j(u)){const f=this.counters.getCounterValue(u.value),g=h&&j(h)?za.parse(this.context,h.value):3;a.appendChild(s.createTextNode(fs(f,g,!1)))}}else if(c.name==="counters"){const[u,h,f]=c.values.filter(VA);if(u&&j(u)){const g=this.counters.getCounterValues(u.value),m=f&&j(f)?za.parse(this.context,f.value):3,Q=h&&h.type===0?h.value:"",U=g.map(E=>fs(E,m,!1)).join(Q);a.appendChild(s.createTextNode(U))}}}else if(c.type===20)switch(c.value){case"open-quote":a.appendChild(s.createTextNode(Su(o.quotes,this.quoteDepth++,!0)));break;case"close-quote":a.appendChild(s.createTextNode(Su(o.quotes,--this.quoteDepth,!1)));break;default:a.appendChild(s.createTextNode(c.value))}}),a.className=`${Xa} ${Wa}`;const i=n===0?` ${Xa}`:` ${Wa}`;return dn(e)?e.className.baseValue+=i:e.className+=i,a}static destroy(A){return A.parentNode?(A.parentNode.removeChild(A),!0):!1}};const _F=(A,e,t)=>{const n=A.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=e.width.toString(),n.height=e.height.toString(),n.scrolling="no",n.setAttribute(FF,"true"),(t||A.body).appendChild(n),n},xF=A=>new Promise(e=>{if(A.complete){e();return}if(!A.src){e();return}A.onload=e,A.onerror=e}),SF=A=>Promise.all([].slice.call(A.images,0).map(xF)),IF=A=>new Promise((e,t)=>{const n=A.contentWindow;if(!n)return t("No window assigned for iframe");const r=n.document;n.onload=A.onload=()=>{n.onload=A.onload=null;const s=600;let o=0;const a=setInterval(()=>{o++,(r.body.childNodes.length>0&&r.readyState==="complete"||o>=s)&&(clearInterval(a),e(A))},50)}}),TF=["all","d","content"],qi=(A,e)=>{const t=[];for(let n=A.length-1;n>=0;n--){const r=A.item(n);if(TF.indexOf(r)===-1&&!r.startsWith("--")){const s=A.getPropertyValue(r);if(s){const o=A.getPropertyPriority(r);t.push(o?`${r}:${s} !${o}`:`${r}:${s}`)}}}return t.length>0&&(e.style.cssText=t.join(";")+";"),e},HF=A=>{let e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=" "+A.internalSubset.replace(/"/g,"&quot;").replace(/>/g,"&gt;")),A.publicId?(e+=' PUBLIC "'+A.publicId.replace(/"/g,"&quot;")+'"',A.systemId&&(e+=' "'+A.systemId.replace(/"/g,"&quot;")+'"')):A.systemId&&(e+=' SYSTEM "'+A.systemId.replace(/"/g,"&quot;")+'"'),e+=">"),e},LF=(A,e,t)=>{A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},DF=([A,e,t])=>{A.scrollLeft=e,A.scrollTop=t},RF=":before",OF=":after",Xa="___html2canvas___pseudoelement_before",Wa="___html2canvas___pseudoelement_after",Hu=`{
1650
+ content: "" !important;
1651
+ display: none !important;
1652
+ }`,MF=(A,e)=>{PF(A,`.${Xa}${RF}${Hu}
1653
+ .${Wa}${OF}${Hu}`,e)},PF=(A,e,t)=>{const n=A.ownerDocument;if(n){const r=n.createElement("style");r.textContent=e,t&&(r.nonce=t),A.appendChild(r)}},KF=(A,e)=>{var r;const t=A.ownerDocument.createElement("base");t.href=e;const n=A.getElementsByTagName("head").item(0);n==null||n.insertBefore(t,(r=n==null?void 0:n.firstChild)!=null?r:null)};var Lu=class{static normalizeElement(A,e){const t={};return hs(A)&&(e.animationDuration.some(n=>n>0)&&(t.animationDuration=A.style.animationDuration,A.style.animationDuration="0s"),e.transform!==null&&(t.transform=A.style.transform,A.style.transform="translate(0, 0)"),e.rotate!==null&&(t.rotate=A.style.rotate,A.style.rotate="0deg",t.transform===void 0&&(t.transform=A.style.transform,A.style.transform="translate(0, 0)"))),t}static restoreElement(A,e){hs(A)&&(e.animationDuration!==void 0&&(A.style.animationDuration=e.animationDuration),e.transform!==void 0&&(A.style.transform=e.transform),e.rotate!==void 0&&(A.style.rotate=e.rotate))}},ft=class{constructor(A,e,t={}){if(this.context=A,this.textNodes=[],this.elements=[],this.createsStackingContext=!1,this.createsRealStackingContext=!1,this.isListOwner=!1,this.debugRender=!1,Za(e,3))debugger;if(this.styles=new QF(A,A.config.window.getComputedStyle(e,null)),t.normalizeDom!==!1&&hs(e)&&(this.originalStyles=Lu.normalizeElement(e,this.styles),this.originalElement=e),this.bounds=us(this.context,e),e.tagName==="FIELDSET"){const n=e.querySelector(":scope > legend");if(n){const r=us(this.context,n);this.legendBounds=r;const s=r.top+r.height/2-this.styles.borderTopWidth/2;this.bounds=new He(this.bounds.left,s,this.bounds.width,this.bounds.height-(s-this.bounds.top))}}Za(e,4)&&(this.debugRender=!0)}restore(){this.originalStyles&&this.originalElement&&(Lu.restoreElement(this.originalElement,this.originalStyles),this.originalStyles=void 0,this.originalElement=void 0)}restoreTree(){this.restore();for(const A of this.elements)A.restoreTree()}},NF="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Du="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wr=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var so=0;so<Du.length;so++)Wr[Du.charCodeAt(so)]=so;var zF=function(A){var e=A.length*.75,t=A.length,n,r=0,s,o,a,i;A[A.length-1]==="="&&(e--,A[A.length-2]==="="&&e--);var c=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&typeof Uint8Array.prototype.slice!="undefined"?new ArrayBuffer(e):new Array(e),u=Array.isArray(c)?c:new Uint8Array(c);for(n=0;n<t;n+=4)s=Wr[A.charCodeAt(n)],o=Wr[A.charCodeAt(n+1)],a=Wr[A.charCodeAt(n+2)],i=Wr[A.charCodeAt(n+3)],u[r++]=s<<2|o>>4,u[r++]=(o&15)<<4|a>>2,u[r++]=(a&3)<<6|i&63;return c},$F=function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t},GF=function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t},gn=5,vc=11,Aa=2,VF=vc-gn,mh=65536>>gn,ea=(1<<gn)-1,ZF=mh+(1024>>gn)+32,XF=65536>>vc,WF=(1<<VF)-1,Ru=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},JF=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},jF=function(A,e){var t=zF(A),n=Array.isArray(t)?GF(t):new Uint32Array(t),r=Array.isArray(t)?$F(t):new Uint16Array(t),s=24,o=Ru(r,s/2,n[4]/2),a=n[5]===2?Ru(r,(s+n[4])/2):JF(n,Math.ceil((s+n[4])/4));return new YF(n[0],n[1],n[2],n[3],o,a)},YF=(function(){function A(e,t,n,r,s,o){this.initialValue=e,this.errorValue=t,this.highStart=n,this.highValueIndex=r,this.index=s,this.data=o}return A.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>gn],t=(t<<Aa)+(e&ea),this.data[t];if(e<=65535)return t=this.index[mh+(e-55296>>gn)],t=(t<<Aa)+(e&ea),this.data[t];if(e<this.highStart)return t=ZF-XF+(e>>vc),t=this.index[t],t+=e>>gn&WF,t=this.index[t],t=(t<<Aa)+(e&ea),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A})(),Ou="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qF=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var oo=0;oo<Ou.length;oo++)qF[Ou.charCodeAt(oo)]=oo;var Ak=1,ta=2,na=3,Mu=4,Pu=5,ek=7,Ku=8,ra=9,sa=10,Nu=11,zu=12,$u=13,Gu=14,oa=15,tk=function(A){for(var e=[],t=0,n=A.length;t<n;){var r=A.charCodeAt(t++);if(r>=55296&&r<=56319&&t<n){var s=A.charCodeAt(t++);(s&64512)===56320?e.push(((r&1023)<<10)+(s&1023)+65536):(e.push(r),t--)}else e.push(r)}return e},nk=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],r=-1,s="";++r<t;){var o=A[r];o<=65535?n.push(o):(o-=65536,n.push((o>>10)+55296,o%1024+56320)),(r+1===t||n.length>16384)&&(s+=String.fromCharCode.apply(String,n),n.length=0)}return s},rk=jF(NF),Ee="×",ia="÷",sk=function(A){return rk.get(A)},ok=function(A,e,t){var n=t-2,r=e[n],s=e[t-1],o=e[t];if(s===ta&&o===na)return Ee;if(s===ta||s===na||s===Mu||o===ta||o===na||o===Mu)return ia;if(s===Ku&&[Ku,ra,Nu,zu].indexOf(o)!==-1||(s===Nu||s===ra)&&(o===ra||o===sa)||(s===zu||s===sa)&&o===sa||o===$u||o===Pu||o===ek||s===Ak)return Ee;if(s===$u&&o===Gu){for(;r===Pu;)r=e[--n];if(r===Gu)return Ee}if(s===oa&&o===oa){for(var a=0;r===oa;)a++,r=e[--n];if(a%2===0)return Ee}return ia},ik=function(A){var e=tk(A),t=e.length,n=0,r=0,s=e.map(sk);return{next:function(){if(n>=t)return{done:!0,value:null};for(var o=Ee;n<t&&(o=ok(e,s,++n))===Ee;);if(o!==Ee||n===t){var a=nk.apply(null,e.slice(r,n));return r=n,{value:a,done:!1}}return{done:!0,value:null}}}},ak=function(A){for(var e=ik(A),t=[],n;!(n=e.next()).done;)n.value&&t.push(n.value.slice());return t};const ck=A=>{if(A.createRange){const t=A.createRange();if(t.getBoundingClientRect){const n=A.createElement("boundtest");n.style.height="123px",n.style.display="block",A.body.appendChild(n),t.selectNode(n);const r=t.getBoundingClientRect(),s=Math.round(r.height);if(A.body.removeChild(n),s===123)return!0}}return!1},lk=A=>{const e=A.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",A.body.appendChild(e);const t=A.createRange();e.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";const n=e.firstChild,r=ui(n.data).map(i=>DA(i));let s=0,o={};const a=r.every((i,c)=>{t.setStart(n,s),t.setEnd(n,s+i.length);const u=t.getBoundingClientRect();s+=i.length;const h=u.x>o.x||u.y>o.y;return o=u,c===0?!0:h});return A.body.removeChild(e),a},uk=()=>typeof new Image().crossOrigin!="undefined",dk=()=>typeof new XMLHttpRequest().responseType=="string",pk=A=>{const e=new Image,t=A.createElement("canvas"),n=t.getContext("2d");if(!n)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(e,0,0),t.toDataURL()}catch(r){return!1}return!0},Vu=A=>A[0]===0&&A[1]===255&&A[2]===0&&A[3]===255,hk=A=>{const e=A.createElement("canvas"),t=100;e.width=t,e.height=t;const n=e.getContext("2d");if(!n)return Promise.reject(new Error("Failed to get 2D rendering context"));n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,t,t);const r=new Image,s=e.toDataURL();r.src=s;const o=Ja(t,t,0,0,r);return n.fillStyle="red",n.fillRect(0,0,t,t),ja(o).then(a=>{n.drawImage(a,0,0);const i=n.getImageData(0,0,t,t).data;n.fillStyle="red",n.fillRect(0,0,t,t);const c=A.createElement("div");return c.style.backgroundImage=`url(${s})`,c.style.height=`${t}px`,Vu(i)?ja(Ja(t,t,0,0,c)):Promise.reject(new Error("ForeignObject rendering not supported"))}).then(a=>(n.drawImage(a,0,0),Vu(n.getImageData(0,0,t,t).data))).catch(()=>!1)},Ja=(A,e,t,n,r)=>{const s="http://www.w3.org/2000/svg",o=document.createElementNS(s,"svg"),a=document.createElementNS(s,"foreignObject");return o.setAttributeNS(null,"width",A.toString()),o.setAttributeNS(null,"height",e.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",t.toString()),a.setAttributeNS(null,"y",n.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),o.appendChild(a),a.appendChild(r),o},ja=A=>new Promise((e,t)=>{const n=new Image;n.onload=()=>e(n),n.onerror=t,n.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(A))}`}),JA={get SUPPORT_RANGE_BOUNDS(){const A=ck(document);return Object.defineProperty(JA,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){const A=JA.SUPPORT_RANGE_BOUNDS&&lk(document);return Object.defineProperty(JA,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){const A=pk(document);return Object.defineProperty(JA,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){const A=typeof Array.from=="function"&&typeof window.fetch=="function"?hk(document):Promise.resolve(!1);return Object.defineProperty(JA,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){const A=uk();return Object.defineProperty(JA,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){const A=dk();return Object.defineProperty(JA,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){const A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(JA,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){const A=!!(typeof Intl!="undefined"&&Intl.Segmenter);return Object.defineProperty(JA,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}};var Bn=class{constructor(A,e){this.text=A,this.bounds=e}};const fk=(A,e,t,n)=>{const r=wk(e,t),s=[];let o=0;return r.forEach(a=>{if(t.textDecorationLine.length||a.trim().length>0)if(JA.SUPPORT_RANGE_BOUNDS){const i=Zu(n,o,a.length).getClientRects();if(i.length>1){const c=wn(a);let u=0;c.forEach(h=>{s.push(new Bn(h,He.fromDOMRectList(A,Zu(n,u+o,h.length).getClientRects()))),u+=h.length})}else s.push(new Bn(a,He.fromDOMRectList(A,i)))}else{const i=n.splitText(a.length);s.push(new Bn(a,gk(A,n))),n=i}else JA.SUPPORT_RANGE_BOUNDS||(n=n.splitText(a.length));o+=a.length}),s},gk=(A,e)=>{const t=e.ownerDocument;if(t){const n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));const r=e.parentNode;if(r){r.replaceChild(n,e);const s=us(A,n);return n.firstChild&&r.replaceChild(n.firstChild,n),s}}return He.EMPTY},Zu=(A,e,t)=>{const n=A.ownerDocument;if(!n)throw new Error("Node has no owner document");const r=n.createRange();return r.setStart(A,e),r.setEnd(A,e+t),r},wn=A=>{if(JA.SUPPORT_NATIVE_TEXT_SEGMENTATION){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map(t=>t.segment)}return ak(A)},Bk=(A,e)=>{if(JA.SUPPORT_NATIVE_TEXT_SEGMENTATION){const t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map(n=>n.segment)}return Ck(A,e)},wk=(A,e)=>Xo(e.writingMode)||e.letterSpacing!==0?wn(A):Bk(A,e),mk=[32,160,4961,65792,65793,4153,4241],Ck=(A,e)=>{const t=_y(A,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),n=[];let r;for(;!(r=t.next()).done;)if(r.value){const s=ui(r.value.slice());let o="";s.forEach(a=>{mk.indexOf(a)===-1?o+=DA(a):(o.length&&n.push(o),n.push(DA(a)),o="")}),o.length&&n.push(o)}return n};var bk=class{constructor(A,e,t){this.text=Qk(e.data,t.textTransform),this.text.length!==e.data.length&&(e.data=this.text),this.textBounds=fk(A,this.text,t,e)}};const Qk=(A,e)=>{switch(e){case 1:return A.toLowerCase();case 3:return A.replace(yk,Uk);case 2:return A.toUpperCase();default:return A}},yk=/(^|\s|:|-|\(|\))([a-z])/g,Uk=(A,e,t)=>A.length>0?e+t.toUpperCase():A;var Ch=class extends ft{constructor(A,e){super(A,e),this.src=e.currentSrc||e.src,this.intrinsicWidth=e.naturalWidth,this.intrinsicHeight=e.naturalHeight,this.context.cache.addImage(this.src)}},bh=class extends ft{constructor(A,e){super(A,e),this.canvas=e,this.intrinsicWidth=e.width,this.intrinsicHeight=e.height}};const Ek=["position","inset","top","right","bottom","left","inset-inline","inset-inline-start","inset-inline-end","inset-block","inset-block-start","inset-block-end","margin","margin-top","margin-right","margin-bottom","margin-left","margin-inline","margin-inline-start","margin-inline-end","margin-block","margin-block-start","margin-block-end"],Fk=(A,e)=>{const t=e.getAttribute("style");Ek.forEach(r=>e.style.removeProperty(r));const n=A.serializeToString(e);return t===null?e.removeAttribute("style"):e.setAttribute("style",t),n};var Qh=class extends ft{constructor(A,e){super(A,e);const t=new XMLSerializer,n=us(A,e);e.setAttribute("width",`${n.width}px`),e.setAttribute("height",`${n.height}px`),this.svg=`data:image/svg+xml,${encodeURIComponent(Fk(t,e))}`,this.intrinsicWidth=e.width.baseVal.value,this.intrinsicHeight=e.height.baseVal.value,this.context.cache.addImage(this.svg)}},yh=class extends ft{constructor(A,e){super(A,e),this.value=e.value}},Ya=class extends ft{constructor(A,e){super(A,e),this.start=e.start,this.reversed=typeof e.reversed=="boolean"&&e.reversed===!0}};const kk=[{type:15,flags:0,unit:"px",number:3}],vk=[{type:16,flags:0,number:50}],_k=A=>A.width>A.height?new He(A.left+(A.width-A.height)/2,A.top,A.height,A.height):A.width<A.height?new He(A.left,A.top+(A.height-A.width)/2,A.width,A.width):A,xk=A=>{const e=A.type==="password"?new Array(A.value.length+1).join("•"):A.value;return e.length===0?A.placeholder||"":e},Sk=A=>A.value.length===0&&!!A.placeholder,Ik="checkbox",Tk="radio",Xu=707406591,Hk=1970632191;var jn=class extends ft{constructor(A,e){switch(super(A,e),this.type=e.type.toLowerCase(),this.checked=e.checked,this.value=xk(e),this.isPlaceholder=Sk(e),(this.type==="checkbox"||this.type==="radio")&&(this.styles.backgroundColor=3739148031,this.styles.borderTopColor=this.styles.borderRightColor=this.styles.borderBottomColor=this.styles.borderLeftColor=2779096575,this.styles.borderTopWidth=this.styles.borderRightWidth=this.styles.borderBottomWidth=this.styles.borderLeftWidth=1,this.styles.borderTopStyle=this.styles.borderRightStyle=this.styles.borderBottomStyle=this.styles.borderLeftStyle=1,this.styles.backgroundClip=[0],this.styles.backgroundOrigin=[0],this.bounds=_k(this.bounds)),this.type){case Ik:this.styles.borderTopRightRadius=this.styles.borderTopLeftRadius=this.styles.borderBottomRightRadius=this.styles.borderBottomLeftRadius=kk;break;case Tk:this.styles.borderTopRightRadius=this.styles.borderTopLeftRadius=this.styles.borderBottomRightRadius=this.styles.borderBottomLeftRadius=vk;break}}},Uh=class extends ft{constructor(A,e){super(A,e);const t=e.options[e.selectedIndex||0];this.value=t&&t.text||""}},Eh=class extends ft{constructor(A,e){super(A,e),this.value=e.value}},Fh=class extends ft{constructor(A,e,t){super(A,e),this.src=e.src,this.width=parseInt(e.width,10)||0,this.height=parseInt(e.height,10)||0,this.backgroundColor=this.styles.backgroundColor,this.parseTreeFn=t;try{if(e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.documentElement&&this.parseTreeFn){this.tree=this.parseTreeFn(A,e.contentWindow.document.documentElement);const n=e.contentWindow.document.documentElement?rr(A,getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):ut.TRANSPARENT,r=e.contentWindow.document.body?rr(A,getComputedStyle(e.contentWindow.document.body).backgroundColor):ut.TRANSPARENT;this.backgroundColor=Et(n)?Et(r)?this.styles.backgroundColor:r:n}}catch(n){}}};const Lk=["OL","UL","MENU"],qa=(A,e,t,n)=>{for(let r=e.firstChild,s;r;r=s)s=r.nextSibling,kh(A,r,t,n)},kh=(A,e,t,n)=>{if(qp(e)&&e.data.length>0)t.textNodes.push(new bk(A,e,t.styles));else if(un(e))if(Xr(e)&&e.assignedNodes)e.assignedNodes().forEach(r=>kh(A,r,t,n));else{const r=vh(A,e);r.styles.isVisible()&&(Dk(e,r,n)?r.createsRealStackingContext=!0:Rk(r.styles)&&(r.createsStackingContext=!0),Lk.indexOf(e.tagName)!==-1&&(r.isListOwner=!0),t.elements.push(r),e.shadowRoot?qa(A,e.shadowRoot,r,n):!Vo(e)&&!Ah(e)&&!Zo(e)&&qa(A,e,r,n))}},vh=(A,e)=>Na(e)?new Ch(A,e):eh(e)?new bh(A,e):Ah(e)?new Qh(A,e):nU(e)?new yh(A,e):rU(e)?new Ya(A,e):AU(e)?new jn(A,e):Zo(e)?new Uh(A,e):Vo(e)?new Eh(A,e):th(e)?new Fh(A,e,_h):new ft(A,e),_h=(A,e)=>{const t=vh(A,e);return t.createsRealStackingContext=!0,qa(A,e,t,t),t},Dk=(A,e,t)=>e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||kc(A)&&t.styles.isTransparent(),Rk=A=>A.isPositioned()||A.isFloating()?!0:jA(A.display,268435456)||jA(A.display,33554432)||jA(A.display,536870912)||jA(A.display,134217728),Wu=(A,e)=>A.length===e.length?A.some((t,n)=>t===e[n]):!1,Ok=(A,e,t,n,r)=>A.map((s,o)=>{switch(o){case 0:return s.add(e,t);case 1:return s.add(e+n,t);case 2:return s.add(e+n,t+r);case 3:return s.add(e,t+r)}return s});var O=class xh{constructor(e,t){this.type=0,this.x=e,this.y=t}add(e,t){return new xh(this.x+e,this.y+t)}};const Pn=(A,e,t)=>new O(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t);var io=class Jr{constructor(e,t,n,r){this.type=1,this.start=e,this.startControl=t,this.endControl=n,this.end=r}subdivide(e,t){const n=Pn(this.start,this.startControl,e),r=Pn(this.startControl,this.endControl,e),s=Pn(this.endControl,this.end,e),o=Pn(n,r,e),a=Pn(r,s,e),i=Pn(o,a,e);return t?new Jr(this.start,n,o,i):new Jr(i,a,s,this.end)}add(e,t){return new Jr(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))}reverse(){return new Jr(this.end,this.endControl,this.startControl,this.start)}};const Ie=A=>A.type===1;var Mk=class{constructor(A){const e=A.styles,t=A.bounds;let[n,r]=Zr(e.borderTopLeftRadius,t.width,t.height),[s,o]=Zr(e.borderTopRightRadius,t.width,t.height),[a,i]=Zr(e.borderBottomRightRadius,t.width,t.height),[c,u]=Zr(e.borderBottomLeftRadius,t.width,t.height);const h=[];h.push((n+s)/t.width),h.push((c+a)/t.width),h.push((r+u)/t.height),h.push((o+i)/t.height);const f=Math.max(...h);f>1&&(n/=f,r/=f,s/=f,o/=f,a/=f,i/=f,c/=f,u/=f);const g=t.width-s,m=t.height-i,Q=t.width-a,U=t.height-u,E=e.borderTopWidth,v=e.borderRightWidth,F=e.borderBottomWidth,y=e.borderLeftWidth,x=J(e.paddingTop,A.bounds.width),R=J(e.paddingRight,A.bounds.width),I=J(e.paddingBottom,A.bounds.width),K=J(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||r>0?bA(t.left+y/3,t.top+E/3,n-y/3,r-E/3,0):new O(t.left+y/3,t.top+E/3),this.topRightBorderDoubleOuterBox=n>0||r>0?bA(t.left+g,t.top+E/3,s-v/3,o-E/3,1):new O(t.left+t.width-v/3,t.top+E/3),this.bottomRightBorderDoubleOuterBox=a>0||i>0?bA(t.left+Q,t.top+m,a-v/3,i-F/3,2):new O(t.left+t.width-v/3,t.top+t.height-F/3),this.bottomLeftBorderDoubleOuterBox=c>0||u>0?bA(t.left+y/3,t.top+U,c-y/3,u-F/3,3):new O(t.left+y/3,t.top+t.height-F/3),this.topLeftBorderDoubleInnerBox=n>0||r>0?bA(t.left+y*2/3,t.top+E*2/3,n-y*2/3,r-E*2/3,0):new O(t.left+y*2/3,t.top+E*2/3),this.topRightBorderDoubleInnerBox=n>0||r>0?bA(t.left+g,t.top+E*2/3,s-v*2/3,o-E*2/3,1):new O(t.left+t.width-v*2/3,t.top+E*2/3),this.bottomRightBorderDoubleInnerBox=a>0||i>0?bA(t.left+Q,t.top+m,a-v*2/3,i-F*2/3,2):new O(t.left+t.width-v*2/3,t.top+t.height-F*2/3),this.bottomLeftBorderDoubleInnerBox=c>0||u>0?bA(t.left+y*2/3,t.top+U,c-y*2/3,u-F*2/3,3):new O(t.left+y*2/3,t.top+t.height-F*2/3),this.topLeftBorderStroke=n>0||r>0?bA(t.left+y/2,t.top+E/2,n-y/2,r-E/2,0):new O(t.left+y/2,t.top+E/2),this.topRightBorderStroke=n>0||r>0?bA(t.left+g,t.top+E/2,s-v/2,o-E/2,1):new O(t.left+t.width-v/2,t.top+E/2),this.bottomRightBorderStroke=a>0||i>0?bA(t.left+Q,t.top+m,a-v/2,i-F/2,2):new O(t.left+t.width-v/2,t.top+t.height-F/2),this.bottomLeftBorderStroke=c>0||u>0?bA(t.left+y/2,t.top+U,c-y/2,u-F/2,3):new O(t.left+y/2,t.top+t.height-F/2),this.topLeftBorderBox=n>0||r>0?bA(t.left,t.top,n,r,0):new O(t.left,t.top),this.topRightBorderBox=s>0||o>0?bA(t.left+g,t.top,s,o,1):new O(t.left+t.width,t.top),this.bottomRightBorderBox=a>0||i>0?bA(t.left+Q,t.top+m,a,i,2):new O(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=c>0||u>0?bA(t.left,t.top+U,c,u,3):new O(t.left,t.top+t.height),this.topLeftPaddingBox=n>0||r>0?bA(t.left+y,t.top+E,Math.max(0,n-y),Math.max(0,r-E),0):new O(t.left+y,t.top+E),this.topRightPaddingBox=s>0||o>0?bA(t.left+Math.min(g,t.width-v),t.top+E,g>t.width+v?0:Math.max(0,s-v),Math.max(0,o-E),1):new O(t.left+t.width-v,t.top+E),this.bottomRightPaddingBox=a>0||i>0?bA(t.left+Math.min(Q,t.width-y),t.top+Math.min(m,t.height-F),Math.max(0,a-v),Math.max(0,i-F),2):new O(t.left+t.width-v,t.top+t.height-F),this.bottomLeftPaddingBox=c>0||u>0?bA(t.left+y,t.top+Math.min(U,t.height-F),Math.max(0,c-y),Math.max(0,u-F),3):new O(t.left+y,t.top+t.height-F),this.topLeftContentBox=n>0||r>0?bA(t.left+y+K,t.top+E+x,Math.max(0,n-(y+K)),Math.max(0,r-(E+x)),0):new O(t.left+y+K,t.top+E+x),this.topRightContentBox=s>0||o>0?bA(t.left+Math.min(g,t.width+y+K),t.top+E+x,g>t.width+y+K?0:s-y+K,o-(E+x),1):new O(t.left+t.width-(v+R),t.top+E+x),this.bottomRightContentBox=a>0||i>0?bA(t.left+Math.min(Q,t.width-(y+K)),t.top+Math.min(m,t.height+E+x),Math.max(0,a-(v+R)),i-(F+I),2):new O(t.left+t.width-(v+R),t.top+t.height-(F+I)),this.bottomLeftContentBox=c>0||u>0?bA(t.left+y+K,t.top+U,Math.max(0,c-(y+K)),u-(F+I),3):new O(t.left+y+K,t.top+t.height-(F+I))}};const bA=(A,e,t,n,r)=>{const s=4*((Math.sqrt(2)-1)/3),o=t*s,a=n*s,i=A+t,c=e+n;switch(r){case 0:return new io(new O(A,c),new O(A,c-a),new O(i-o,e),new O(i,e));case 1:return new io(new O(A,e),new O(A+o,e),new O(i,c-a),new O(i,c));case 2:return new io(new O(i,e),new O(i,e+a),new O(A+o,c),new O(A,c));default:return new io(new O(i,c),new O(i-o,c),new O(A,e+a),new O(A,e))}},Wo=A=>[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox],Pk=A=>[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox],Jo=A=>[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox];var aa=class{constructor(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6}},ao=class{constructor(A,e){this.path=A,this.target=e,this.type=1}},Kk=class{constructor(A){this.opacity=A,this.type=2,this.target=6}},Tr=class{constructor(A){this.applyClip=A,this.type=3,this.target=6}};const Nk={[$A.NORMAL]:"source-over",[$A.MULTIPLY]:"multiply",[$A.SCREEN]:"screen",[$A.OVERLAY]:"overlay",[$A.DARKEN]:"darken",[$A.LIGHTEN]:"lighten",[$A.COLOR_DODGE]:"color-dodge",[$A.COLOR_BURN]:"color-burn",[$A.HARD_LIGHT]:"hard-light",[$A.SOFT_LIGHT]:"soft-light",[$A.DIFFERENCE]:"difference",[$A.EXCLUSION]:"exclusion",[$A.HUE]:"hue",[$A.SATURATION]:"saturation",[$A.COLOR]:"color",[$A.LUMINOSITY]:"luminosity"};var zk=class{constructor(A){this.mixBlendMode=A,this.type=4,this.target=6,this.compositeOperation=Nk[A]}},$k=class Gn{constructor(e){this.type=5,this.target=6;const t=Gn.parseDropShadow(e);this.shadow=t.shadow,this.safeFilterString=t.safeFilterString}static parseDropShadow(e){if(!e)return{safeFilterString:""};const t=Gn.findDropShadows(e);if(t.length===0)return{safeFilterString:e};const n=Gn.parseDropShadowBody(t[0].body);let r="",s=0;for(const o of t)r+=e.slice(s,o.start),s=o.end;return r+=e.slice(s),{shadow:n,safeFilterString:r.replace(/\s+/g," ").trim()}}static findDropShadows(e){const t=[],n=/drop-shadow\(/gi;let r;for(;(r=n.exec(e))!==null;){const s=r.index+12-1,o=r.index;let a=1,i=s+1;for(;i<e.length&&a>0;){const u=e[i];u==="("?a++:u===")"&&a--,i++}if(a!==0)break;const c=e.slice(s+1,i-1);t.push({body:c,start:o,end:i})}return t}static parseDropShadowBody(e){var s;const t=Gn.tokenizeFilterArgs(e.trim()),n=[];let r;for(const o of t)Gn.isCSSLength(o)?n.push(parseFloat(o)):o&&(r=o);if(!(n.length<2||n.length>3))return{offsetX:n[0],offsetY:n[1],blur:(s=n[2])!=null?s:0,color:r!=null?r:"rgba(0,0,0,1)"}}static tokenizeFilterArgs(e){const t=[];let n="",r=0;for(let s=0;s<e.length;s++){const o=e[s];o==="("?(r++,n+=o):o===")"?(r--,n+=o):/\s/.test(o)?r>0?n+=o:n&&(t.push(n),n=""):n+=o}return n&&t.push(n),t}static isCSSLength(e){return/^-?[\d.]+(px|em|rem|pt|cm|mm|in|pc|ex|ch|vw|vh|vmin|vmax|%)?$/i.test(e)}};const Ju=A=>A.type===0,Ac=A=>A.type===1,Gk=A=>A.type===2,ju=A=>A.type===3,Vk=A=>A.type===4,Zk=A=>A.type===5;var Sh=class{constructor(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}},Ih=class{constructor(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new Mk(this.container),this.container.styles.opacity<1&&this.effects.push(new Kk(this.container.styles.opacity)),this.container.styles.rotate!==null){const t=this.container.styles.transformOrigin,n=this.container.bounds.left+J(t[0],this.container.bounds.width),r=this.container.bounds.top+J(t[1],this.container.bounds.height),s=this.container.styles.rotate*Math.PI/180,o=Math.cos(s),a=Math.sin(s),i=[o,a,-a,o,0,0];this.effects.push(new aa(n,r,i))}if(this.container.styles.transform!==null){const t=this.container.styles.transformOrigin,n=this.container.bounds.left+J(t[0],this.container.bounds.width),r=this.container.bounds.top+J(t[1],this.container.bounds.height),s=this.container.styles.transform;this.effects.push(new aa(n,r,s))}if(Yu(this.container.styles)){const t=Wo(this.curves),n=Jo(this.curves);Wu(t,n)?this.effects.push(new ao(t,6)):(this.effects.push(new ao(t,2)),this.effects.push(new ao(n,4)))}if(this.container.styles.clipPath.type!==0){const t=Xk(this.container.styles.clipPath,this.container.bounds);t&&this.effects.push(t)}if(this.container.styles.mixBlendMode!==$A.NORMAL&&this.effects.push(new zk(this.container.styles.mixBlendMode)),this.container.styles.filter!==null&&this.effects.push(new $k(this.container.styles.filter)),this.container.styles.zoom!==1){const t=this.container.styles.transformOrigin,n=this.container.bounds.left+J(t[0],this.container.bounds.width),r=this.container.bounds.top+J(t[1],this.container.bounds.height),s=this.container.styles.zoom,o=[s,0,0,s,0,0];this.effects.push(new aa(n,r,o))}}getEffects(A){let e=[2,3].indexOf(this.container.styles.position)===-1,t=this.parent;const n=this.effects.slice(0);for(;t;){const r=t.effects.filter(s=>!Ac(s));if(e||t.container.styles.position!==0||!t.parent){if(e=[2,3].indexOf(t.container.styles.position)===-1,Yu(t.container.styles)){const s=Wo(t.curves),o=Jo(t.curves);Wu(s,o)||n.unshift(new ao(o,6))}n.unshift(...r)}else n.unshift(...r);t=t.parent}return n.filter(r=>jA(r.target,A))}};const Yu=A=>A.overflowX!==0||A.overflowY!==0,qu=(A,e,t,n,r)=>A==="closest-side"?Math.min(e-t,n-e):A==="farthest-side"?Math.max(e-t,n-e):J(A,r),Xk=(A,e)=>{const{left:t,top:n,width:r,height:s}=e;switch(A.type){case 1:{const o=J(A.left,r),a=J(A.top,s),i=t+o,c=n+a,u=Math.max(0,r-o-J(A.right,r)),h=Math.max(0,s-a-J(A.bottom,s));return new Tr(f=>{f.beginPath(),f.rect(i,c,u,h),f.clip()})}case 2:{const o=t+J(A.cx,r),a=n+J(A.cy,s);let i;return A.radius==="closest-side"?i=Math.min(o-t,a-n,t+r-o,n+s-a):A.radius==="farthest-side"?i=Math.max(o-t,a-n,t+r-o,n+s-a):i=J(A.radius,Math.sqrt(r*r+s*s)/Math.SQRT2),new Tr(c=>{c.beginPath(),c.arc(o,a,Math.max(0,i),0,Math.PI*2),c.clip()})}case 3:{const o=t+J(A.cx,r),a=n+J(A.cy,s),i=qu(A.rx,o,t,t+r,r),c=qu(A.ry,a,n,n+s,s);return new Tr(u=>{u.beginPath(),u.ellipse(o,a,Math.max(0,i),Math.max(0,c),0,0,Math.PI*2),u.clip()})}case 4:{const o=A.points.map(([a,i])=>[t+J(a,r),n+J(i,s)]);return new Tr(a=>{if(a.beginPath(),o.length>0){a.moveTo(o[0][0],o[0][1]);for(let i=1;i<o.length;i++)a.lineTo(o[i][0],o[i][1]);a.closePath()}a.clip()})}case 5:{const{d:o}=A;let a=null;return new Tr(i=>{try{a||(a=new Path2D(o));const c=i.getTransform();i.translate(t,n),i.clip(a),i.setTransform(c)}catch(c){}})}case 0:return null;default:return null}},ec=(A,e,t,n)=>{A.container.elements.forEach(r=>{const s=r.createsRealStackingContext,o=r.createsStackingContext,a=new Ih(r,A);jA(r.styles.display,2048)&&n.push(a);const i=r.isListOwner?[]:n;if(s||o){const c=s||r.styles.isPositioned()?t:e,u=new Sh(a);if(r.styles.isPositioned()||r.styles.opacity<1||r.styles.isTransformed()){const h=r.styles.zIndex.order;if(h<0){let f=0;c.negativeZIndex.some((g,m)=>h>g.element.container.styles.zIndex.order?(f=m,!1):f>0),c.negativeZIndex.splice(f,0,u)}else if(h>0){let f=0;c.positiveZIndex.some((g,m)=>h>=g.element.container.styles.zIndex.order?(f=m+1,!1):f>0),c.positiveZIndex.splice(f,0,u)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else r.styles.isFloating()?c.nonPositionedFloats.push(u):c.nonPositionedInlineLevel.push(u);ec(a,u,s?u:t,i)}else r.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),ec(a,e,t,i);r.isListOwner&&Th(r,i)})},Th=(A,e)=>{let t=A instanceof Ya?A.start:1;const n=A instanceof Ya?A.reversed:!1;for(let r=0;r<e.length;r++){const s=e[r];s.container instanceof yh&&typeof s.container.value=="number"&&s.container.value!==0&&(t=s.container.value),s.listValue=fs(t,s.container.styles.listStyleType,!0),t+=n?-1:1}},Wk=A=>{const e=new Ih(A,null),t=new Sh(e),n=[];return ec(e,t,t,n),Th(e.container,n),t},_c=A=>{const e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},gs=A=>{const e=A.styles,t=A.bounds,n=J(e.paddingLeft,t.width),r=J(e.paddingRight,t.width),s=J(e.paddingTop,t.width),o=J(e.paddingBottom,t.width);return t.add(n+e.borderLeftWidth,s+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+r),-(e.borderTopWidth+e.borderBottomWidth+s+o))},Jk=(A,e)=>A===0?e.bounds:A===2?gs(e):_c(e),jk=(A,e)=>A===0?e.bounds:A===2?gs(e):_c(e),co=(A,e,t)=>{const n=Jk(an(A.styles.backgroundOrigin,e),A),r=jk(an(A.styles.backgroundClip,e),A),s=Yk(an(A.styles.backgroundSize,e),t,n);let[o,a]=s;const i=Zr(an(A.styles.backgroundPosition,e),n.width-o,n.height-a),c=qk(an(A.styles.backgroundRepeat,e),i,s,n,r),u=Math.round(n.left+i[0]),h=Math.round(n.top+i[1]);return o=Math.max(1,o),a=Math.max(1,a),[c,u,h,o,a]},Kn=A=>j(A)&&A.value==="auto",lo=A=>typeof A=="number",Yk=(A,[e,t,n],r)=>{const[s,o]=A;if(!s)return[0,0];if(iA(s)&&o&&iA(o))return[J(s,r.width),J(o,r.height)];const a=lo(n);if(j(s)&&(s.value==="contain"||s.value==="cover"))return lo(n)?r.width/r.height<n!=(s.value==="cover")?[r.width,r.width/n]:[r.height*n,r.height]:[r.width,r.height];const i=lo(e),c=lo(t),u=i||c;if(Kn(s)&&(!o||Kn(o)))return i&&c?[e,t]:!a&&!u?[r.width,r.height]:u&&a?[i?e:t*n,c?t:e/n]:[i?e:r.width,c?t:r.height];if(a){let g=0,m=0;return iA(s)?g=J(s,r.width):iA(o)&&(m=J(o,r.height)),Kn(s)?g=m*n:(!o||Kn(o))&&(m=g/n),[g,m]}let h=null,f=null;if(iA(s)?h=J(s,r.width):o&&iA(o)&&(f=J(o,r.height)),h!==null&&(!o||Kn(o))&&(f=i&&c?h/e*t:r.height),f!==null&&Kn(s)&&(h=i&&c?f/t*e:r.width),h!==null&&f!==null)return[h,f];throw new Error("Unable to calculate background-size for element")},an=(A,e)=>{const t=A[e];return typeof t=="undefined"?A[0]:t},qk=(A,[e,t],[n,r],s,o)=>{switch(A){case 2:return[new O(Math.round(s.left),Math.round(s.top+t)),new O(Math.round(s.left+s.width),Math.round(s.top+t)),new O(Math.round(s.left+s.width),Math.round(r+s.top+t)),new O(Math.round(s.left),Math.round(r+s.top+t))];case 3:return[new O(Math.round(s.left+e),Math.round(s.top)),new O(Math.round(s.left+e+n),Math.round(s.top)),new O(Math.round(s.left+e+n),Math.round(s.height+s.top)),new O(Math.round(s.left+e),Math.round(s.height+s.top))];case 1:return[new O(Math.round(s.left+e),Math.round(s.top+t)),new O(Math.round(s.left+e+n),Math.round(s.top+t)),new O(Math.round(s.left+e+n),Math.round(s.top+t+r)),new O(Math.round(s.left+e),Math.round(s.top+t+r))];default:return[new O(Math.round(o.left),Math.round(o.top)),new O(Math.round(o.left+o.width),Math.round(o.top)),new O(Math.round(o.left+o.width),Math.round(o.height+o.top)),new O(Math.round(o.left),Math.round(o.height+o.top))]}};var Av=class{constructor(A){this.ctx=A}render(A,e){this.ctx.fillStyle=yA(e.textDecorationColor||e.color);let t=1;typeof e.textDecorationThickness=="number"?t=e.textDecorationThickness:e.textDecorationThickness==="from-font"&&(t=Math.max(1,Math.floor(e.fontSize.number*.05)));let n=0;typeof e.textUnderlineOffset=="number"&&(n=e.textUnderlineOffset);const r=e.textDecorationStyle;e.textDecorationLine.forEach(s=>{let o=0;switch(s){case 1:o=A.top+A.height-t+n;break;case 2:o=A.top;break;case 3:o=A.top+(A.height/2-t/2);break;default:return}this.draw(A.left,o,A.width,t,r)})}draw(A,e,t,n,r){switch(r){case 0:this.ctx.fillRect(A,e,t,n);break;case 1:{const s=Math.max(1,n);this.ctx.fillRect(A,e,t,n),this.ctx.fillRect(A,e+n+s,t,n);break}case 2:this.drawPattern(A,e,t,n,[n,n*2]);break;case 3:this.drawPattern(A,e,t,n,[n*3,n*2]);break;case 4:this.drawWavy(A,e,t,n);break;default:this.ctx.fillRect(A,e,t,n)}}drawPattern(A,e,t,n,r){this.ctx.save(),this.ctx.beginPath(),this.ctx.setLineDash(r),this.ctx.lineWidth=n,this.ctx.strokeStyle=this.ctx.fillStyle,this.ctx.moveTo(A,e+n/2),this.ctx.lineTo(A+t,e+n/2),this.ctx.stroke(),this.ctx.restore()}drawWavy(A,e,t,n){this.ctx.save(),this.ctx.beginPath(),this.ctx.lineWidth=n,this.ctx.strokeStyle=this.ctx.fillStyle;const r=n*2,s=n*4;let o=A;for(this.ctx.moveTo(o,e+n/2);o<A+t;){const a=Math.min(o+s/2,A+t);if(this.ctx.quadraticCurveTo(o+s/4,e+n/2-r,a,e+n/2),o=a,o<A+t){const i=Math.min(o+s/2,A+t);this.ctx.quadraticCurveTo(o+s/4,e+n/2+r,i,e+n/2),o=i}}this.ctx.stroke(),this.ctx.restore()}};const ev="Mg",Nn=A=>A!==void 0&&!Number.isNaN(A),Hh=(A,e)=>{const t=A.measureText(ev),n=t;return{baseline:Nn(n.fontBoundingBoxAscent)?n.fontBoundingBoxAscent:Nn(t.actualBoundingBoxAscent)?t.actualBoundingBoxAscent:e,height:Nn(n.fontBoundingBoxAscent)&&Nn(n.fontBoundingBoxDescent)?n.fontBoundingBoxAscent+n.fontBoundingBoxDescent:Nn(t.actualBoundingBoxAscent)&&Nn(t.actualBoundingBoxDescent)?t.actualBoundingBoxAscent+t.actualBoundingBoxDescent:e}},Lh=(A,e)=>Hh(A,e).baseline,tv=["-apple-system","system-ui"],nv=1,rv=/[\u2E80-\u2FFF\u3000-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF01-\uFFEF]/,Hr=A=>rv.test(A),sv=()=>{if(typeof navigator=="undefined")return null;const A=navigator.userAgent,e=/iPhone|iPad|iPod/.test(A),t=/Macintosh/.test(A)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>1;if(!e&&!t)return null;for(const n of[/(?:iPhone|CPU(?:\siPhone)?)\sOS\s(\d+)[\._](\d+)/,/Version\/(\d+)\.(\d+)/]){const r=A.match(n);if(r&&r[1])return parseInt(r[1],10)}return null},ov=A=>{const e=sv();return e!==null&&e>=15&&e<17?A.map(t=>tv.indexOf(t)!==-1?'-apple-system, "Helvetica Neue", Arial, sans-serif':t):A},iv=()=>{var A;return(A=typeof window!="undefined"?window:void 0)!=null&&A.chrome?"miter":"round"};var av=class{constructor(A){this.glyphWidthCache=null,this.ctx=A.ctx,this.options=A.options,this.decorationRenderer=new Av(A.ctx)}cachedMeasureText(A,e){let t=this.glyphWidthCache;t||(t=new Map,this.glyphWidthCache=t);const n=A+e;let r=t.get(n);return r===void 0&&(r=this.ctx.measureText(A).width,t.set(n,r)),r}iterateLettersWithLetterSpacing(A,e,t,n,r){if(Xo(n)){this.iterateVerticalGlyphs(A,e,t,n,r);return}const s=wn(A.text),o=A.bounds.top+t,a=this.ctx.font;let i=A.bounds.left;for(const c of s){if(Hr(c)){const u=this.ctx.textBaseline;this.ctx.textBaseline="ideographic",r(c,i,o),this.ctx.textBaseline=u}else r(c,i,o);i+=this.cachedMeasureText(c,a)+e}}iterateVerticalGlyphs(A,e,t,n,r){const s=wn(A.text),o=this.ctx.font,a=n===4?-Math.PI/2:Math.PI/2;let i=A.bounds.top;for(let c=0;c<s.length;){const u=s[c];if(!(ji(n)||!Hr(u)&&u.trim().length>0)){const g=this.ctx.textBaseline;Hr(u)&&(this.ctx.textBaseline="ideographic"),r(u,A.bounds.left,i+t),this.ctx.textBaseline=g,i+=this.cachedMeasureText(u,o)+e,c++;continue}const h=c;for(;c<s.length;){const g=s[c];if(!ji(n)&&!Hr(g)&&g.trim().length===0)break;if(ji(n)||!Hr(g)&&g.trim().length>0)c++;else break}this.ctx.save(),this.ctx.translate(A.bounds.left+t,i),this.ctx.rotate(a);let f=0;for(let g=h;g<c;g++)r(s[g],0,f),f+=this.cachedMeasureText(s[g],o)+e;this.ctx.restore(),i+=f}}renderTextWithLetterSpacing(A,e,t,n=0){this.renderFillText(A,e,t,n)}canRenderWholeText(A,e){return A===0&&!Xo(e)}renderFillText(A,e,t,n){this.canRenderWholeText(e,n)?this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+t):this.iterateLettersWithLetterSpacing(A,e,t,n,(r,s,o)=>{this.ctx.fillText(r,s,o)})}renderStrokeText(A,e,t,n){this.canRenderWholeText(e,n)?this.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+t):this.iterateLettersWithLetterSpacing(A,e,t,n,(r,s,o)=>{this.ctx.strokeText(r,s,o)})}renderTextStrokeWithStyle(A,e,t){!e.webkitTextStrokeWidth||!A.text.trim().length||(this.ctx.strokeStyle=yA(e.webkitTextStrokeColor),this.ctx.lineWidth=e.webkitTextStrokeWidth,this.ctx.lineJoin=iv(),this.renderStrokeText(A,e.letterSpacing,t,e.writingMode),this.ctx.strokeStyle="",this.ctx.lineWidth=0,this.ctx.lineJoin="miter")}renderTextFillWithShadows(A,e,t){this.ctx.fillStyle=yA(e.color),this.renderTextWithLetterSpacing(A,e.letterSpacing,t,e.writingMode);const n=e.textShadow;n.length&&A.text.trim().length&&(n.slice(0).reverse().forEach(r=>{this.ctx.shadowColor=yA(r.color),this.ctx.shadowOffsetX=r.offsetX.number*this.options.scale,this.ctx.shadowOffsetY=r.offsetY.number*this.options.scale,this.ctx.shadowBlur=r.blur.number,this.renderTextWithLetterSpacing(A,e.letterSpacing,t,e.writingMode)}),this.ctx.shadowColor="",this.ctx.shadowOffsetX=0,this.ctx.shadowOffsetY=0,this.ctx.shadowBlur=0)}renderTextBoundWithPaintOrder(A,e,t,n){t.forEach(r=>{switch(r){case 0:this.ctx.fillStyle=yA(e.color),this.renderTextWithLetterSpacing(A,e.letterSpacing,n,e.writingMode);break;case 1:this.renderTextStrokeWithStyle(A,e,n);break}})}renderTextDecoration(A,e){this.decorationRenderer.render(A,e)}truncateTextWithEllipsis(A,e,t){const r=this.ctx.measureText("…").width,s=wn(A);if(t===0){const o=c=>this.ctx.measureText(s.slice(0,c).join("")).width+r<=e;let a=0,i=s.length;for(;a<i;){const c=a+i+1>>1;o(c)?a=c:i=c-1}return s.slice(0,a).join("")+"…"}else{const o=this.ctx.font;let a=r;const i=[];for(const c of s){const u=this.cachedMeasureText(c,o);if(a+u>e)break;i.push(c),a+=u+t}return i.join("")+"…"}}createFontStyle(A){const e=A.fontVariant.filter(r=>r==="normal"||r==="small-caps").join(""),t=ov(A.fontFamily).join(", "),n=ht(A.fontSize)?`${A.fontSize.number}${A.fontSize.unit}`:`${A.fontSize.number}px`;return[[A.fontStyle,e,A.fontWeight,n,t].join(" "),t,n]}renderLineClampedText(A,e,t,n,r){const s=e.fontSize.number*1.5,o=[];let a=[],i=A.textBounds[0].bounds.top;A.textBounds.forEach(h=>{Math.abs(h.bounds.top-i)>=s*.5?(a.length>0&&o.push(a),a=[h],i=h.bounds.top):a.push(h)}),a.length>0&&o.push(a);const c=e.webkitLineClamp;if(o.length<=c)return!1;for(let h=0;h<c-1;h++)o[h].forEach(f=>this.renderTextBoundWithPaintOrder(f,e,t,n));const u=o[c-1];if(u!=null&&u.length&&r){const h=u.map(Q=>Q.text).join(""),f=u[0],g=r.width-(f.bounds.left-r.left),m=new Bn(this.truncateTextWithEllipsis(h,g,e.letterSpacing),f.bounds);for(const Q of t)Q===0?(this.ctx.fillStyle=yA(e.color),this.renderTextWithLetterSpacing(m,e.letterSpacing,n,e.writingMode)):Q===1&&this.renderTextStrokeWithStyle(m,e,n)}return!0}renderEllipsisText(A,e,t,n,r){const s=e.fontSize.number*1.5,o=A.textBounds[0].bounds.top;if(!A.textBounds.every(c=>Math.abs(c.bounds.top-o)<s*.5))return!1;let a=A.textBounds.map(c=>c.text).join("").replace(/\s+/g," ").trim();if(this.ctx.measureText(a).width<=r.width+nv)return!1;const i=new Bn(this.truncateTextWithEllipsis(a,r.width,e.letterSpacing),A.textBounds[0].bounds);for(const c of t)c===0?this.renderTextFillWithShadows(i,e,n):c===1&&this.renderTextStrokeWithStyle(i,e,n);return!0}renderTextNode(A,e,t){return T(this,null,function*(){this.glyphWidthCache=null;const[n]=this.createFontStyle(e);this.ctx.font=n,this.ctx.direction=e.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic";const r=e.paintOrder,s=Lh(this.ctx,e.fontSize.number);e.webkitLineClamp>0&&(e.display&2)!==0&&e.overflowY===1&&A.textBounds.length>0&&this.renderLineClampedText(A,e,r,s,t)||e.textOverflow===1&&t&&e.overflowX===1&&A.textBounds.length>0&&this.renderEllipsisText(A,e,r,s,t)||A.textBounds.forEach(o=>{r.forEach(a=>{a===0?(this.renderTextFillWithShadows(o,e,s),e.textDecorationLine.length&&this.renderTextDecoration(o.bounds,e)):a===1&&this.renderTextStrokeWithStyle(o,e,s)})})})}};const Dh=(A,e)=>{e.forEach((t,n)=>{const r=Ie(t)?t.start:t;n===0?A.moveTo(r.x,r.y):A.lineTo(r.x,r.y),Ie(t)&&A.bezierCurveTo(t.startControl.x,t.startControl.y,t.endControl.x,t.endControl.y,t.end.x,t.end.y)})},Rh=(A,e)=>{A.beginPath(),Dh(A,e),A.closePath()};var cv=class{constructor(A){this.maxSize=A,this._map=new Map}get(A){if(!this._map.has(A))return;const e=this._map.get(A);return this._map.delete(A),this._map.set(A,e),e}set(A,e){if(this._map.has(A))this._map.delete(A);else if(this._map.size>=this.maxSize){const t=this._map.keys().next().value;t!==void 0&&this._map.delete(t)}this._map.set(A,e)}get size(){return this._map.size}clear(){this._map.clear()}},Ad=class{constructor(A){this.patternCache=new cv(50),this.ctx=A.ctx,this.context=A.context,this.canvas=A.canvas}renderBackgroundImage(A){return T(this,null,function*(){var r,s,o,a;let e=A.styles.backgroundImage.length-1;const t=A.styles.backgroundBlendMode;let n=0;for(const i of A.styles.backgroundImage.slice(0).reverse()){if(n>0){const c=(s=(r=t[n])!=null?r:t[0])!=null?s:"normal";c!=="normal"&&(this.ctx.save(),this.ctx.globalCompositeOperation=c)}i.type===0?yield this.renderBackgroundURLImage(A,i,e):CU(i)?this.renderLinearGradient(A,i,e):QU(i)?this.renderRepeatingLinearGradient(A,i,e):bU(i)&&this.renderRadialGradient(A,i,e),n>0&&((a=(o=t[n])!=null?o:t[0])!=null?a:"normal")!=="normal"&&this.ctx.restore(),e--,n++}})}renderBackgroundURLImage(A,e,t){return T(this,null,function*(){var s,o;let n;const r=e.url;try{n=yield this.context.cache.match(r)}catch(a){this.context.logger.error(`Error loading background-image ${r}`),(o=(s=this.context).onError)==null||o.call(s,a instanceof Error?a:new Error(String(a)))}if(n){const a=isNaN(n.width)||n.width===0?1:n.width,i=isNaN(n.height)||n.height===0?1:n.height,[c,u,h,f,g]=co(A,t,[a,i,a/i]),m=an(A.styles.backgroundRepeat,t),Q=m===1?"no-repeat":m===2?"repeat-x":m===3?"repeat-y":"repeat",U=`${r}|${Math.round(f)}x${Math.round(g)}|${A.styles.imageRendering}|${Q}`;let E=this.patternCache.get(U);if(!E){const v=this.resizeImage(n,f,g,A.styles.imageRendering);E=this.ctx.createPattern(v,Q),this.patternCache.set(U,E)}this.renderRepeat(c,E,u,h)}})}renderRepeatingLinearGradient(A,e,t){var X;const[n,r,s,o,a]=co(A,t,[null,null,null]),[i,c,u,h,f]=Uu(e.angle,o,a),g=Ji(e.stops,i||1),m=g[g.length-1],Q=g[0],U=m.stop-Q.stop;if(U<=0){this.renderLinearGradient(A,e,t);return}const E=u-c,v=f-h,F=U/(Math.sqrt(E*E+v*v)||1),y=c,x=h,R=c+E*F,I=h+v*F,K=(X=this.canvas.ownerDocument)!=null?X:document,N=`rlg|${e.angle}|${Math.round(U)}|${JSON.stringify(e.stops)}`;let Z=this.patternCache.get(N);if(!Z){const oA=K.createElement("canvas"),hA=Math.max(1,Math.ceil(U));oA.width=hA,oA.height=hA;const OA=oA.getContext("2d");if(!OA)return;const de=OA.createLinearGradient(y-r,x-s,R-r,I-s);g.forEach(re=>{de.addColorStop((re.stop-Q.stop)/U,yA(re.color))}),OA.fillStyle=de,OA.fillRect(0,0,hA,hA),hA>0&&(Z=this.ctx.createPattern(oA,"repeat"),this.patternCache.set(N,Z))}Z&&this.renderRepeat(n,Z,r,s)}renderLinearGradient(A,e,t){var Q;const[n,r,s,o,a]=co(A,t,[null,null,null]),[i,c,u,h,f]=Uu(e.angle,o,a),g=`lg|${e.angle}|${Math.round(o)}x${Math.round(a)}|${JSON.stringify(e.stops)}`;let m=this.patternCache.get(g);if(!m){const U=((Q=this.canvas.ownerDocument)!=null?Q:document).createElement("canvas");U.width=o,U.height=a;const E=U.getContext("2d");if(!E)return;const v=E.createLinearGradient(c,h,u,f);Ji(e.stops,i||1).forEach(F=>v.addColorStop(F.stop,yA(F.color))),E.fillStyle=v,E.fillRect(0,0,o,a),o>0&&a>0&&(m=this.ctx.createPattern(U,"repeat"),this.patternCache.set(g,m))}m&&this.renderRepeat(n,m,r,s)}renderRadialGradient(A,e,t){var g;const[n,r,s,o,a]=co(A,t,[null,null,null]),i=e.position.length===0?[Ut]:e.position,c=J(i[0],o),u=J(i[i.length-1],a);let[h,f]=BU(e,c,u,o,a);if((h===0||f===0)&&(h=Math.max(h,.01),f=Math.max(f,.01)),h>0&&f>0){const m=`rg|${Math.round(c)}x${Math.round(u)}|${Math.round(h)}x${Math.round(f)}|${JSON.stringify(e.stops)}`,Q=Ji(e.stops,h*2),U=Q[Q.length-1];let E=this.patternCache.get(m);if(!E){const v=((g=this.canvas.ownerDocument)!=null?g:document).createElement("canvas");v.width=Math.ceil(h*2),v.height=Math.ceil(f*2);const F=v.getContext("2d");if(F){const y=F.createRadialGradient(h,h,0,h,h,h);Q.forEach(x=>y.addColorStop(x.stop,yA(x.color))),F.fillStyle=y,h!==f&&F.scale(1,f/h),F.fillRect(0,0,h*2,h*2),E=this.ctx.createPattern(v,"no-repeat"),this.patternCache.set(m,E)}}E&&(this.path(n),this.ctx.save(),this.ctx.clip(),U&&(this.ctx.fillStyle=yA(U.color),this.ctx.fill()),this.ctx.translate(r+c-h,s+u-f),this.ctx.fillStyle=E,this.ctx.fillRect(0,0,h*2,f*2),this.ctx.restore())}}renderRepeat(A,e,t,n){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,n),this.ctx.fill(),this.ctx.translate(-t,-n)}resizeImage(A,e,t,n){var o;const r=((o=this.canvas.ownerDocument)!=null?o:document).createElement("canvas");r.width=Math.max(1,e),r.height=Math.max(1,t);const s=r.getContext("2d");return s?(n===2||n===1?(this.context.logger.debug("Disabling image smoothing for background image due to CSS image-rendering"),s.imageSmoothingEnabled=!1):n===3?(this.context.logger.debug("Enabling image smoothing for background image due to CSS image-rendering: smooth"),s.imageSmoothingEnabled=!0):s.imageSmoothingEnabled=this.ctx.imageSmoothingEnabled,this.ctx.imageSmoothingQuality&&(s.imageSmoothingQuality=this.ctx.imageSmoothingQuality),s.drawImage(A,0,0,A.width,A.height,0,0,e,t),r):A}path(A){Rh(this.ctx,A)}};const ed=(A,e)=>{switch(e){case 0:return Te(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return Te(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return Te(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return Te(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},lv=(A,e)=>{switch(e){case 0:return Te(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return Te(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return Te(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return Te(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},uv=(A,e)=>{switch(e){case 0:return Te(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return Te(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return Te(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return Te(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},dv=(A,e)=>{switch(e){case 0:return uo(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return uo(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return uo(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return uo(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},uo=(A,e)=>{const t=[];return Ie(A)?t.push(A.subdivide(.5,!1)):t.push(A),Ie(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},Te=(A,e,t,n)=>{const r=[];return Ie(A)?r.push(A.subdivide(.5,!1)):r.push(A),Ie(t)?r.push(t.subdivide(.5,!0)):r.push(t),Ie(n)?r.push(n.subdivide(.5,!0).reverse()):r.push(n),Ie(e)?r.push(e.subdivide(.5,!1).reverse()):r.push(e),r};var pv=class{constructor(A,e){this.ctx=A.ctx,this.pathCallbacks=e}renderSolidBorder(A,e,t){return T(this,null,function*(){this.pathCallbacks.path(ed(t,e)),this.ctx.fillStyle=yA(A),this.ctx.fill()})}renderDoubleBorder(A,e,t,n){return T(this,null,function*(){if(e<3){yield this.renderSolidBorder(A,t,n);return}const r=lv(n,t);this.pathCallbacks.path(r),this.ctx.fillStyle=yA(A),this.ctx.fill();const s=uv(n,t);this.pathCallbacks.path(s),this.ctx.fill()})}renderDashedDottedBorder(A,e,t,n,r){return T(this,null,function*(){this.ctx.save();const s=dv(n,t),o=ed(n,t);r===2&&(this.pathCallbacks.path(o),this.ctx.clip());let a,i,c,u;Ie(o[0])?(a=o[0].start.x,i=o[0].start.y):(a=o[0].x,i=o[0].y),Ie(o[1])?(c=o[1].end.x,u=o[1].end.y):(c=o[1].x,u=o[1].y);let h;t===0||t===2?h=Math.abs(a-c):h=Math.abs(i-u),this.ctx.beginPath(),r===3?this.pathCallbacks.formatPath(s):this.pathCallbacks.formatPath(o.slice(0,2));let f=e<3?e*3:e*2,g=e<3?e*2:e;r===3&&(f=e,g=e);let m=!0;if(h<=f*2)m=!1;else if(h<=f*2+g){const Q=h/(2*f+g);f*=Q,g*=Q}else{const Q=Math.floor((h+g)/(f+g)),U=(h-Q*f)/(Q-1),E=(h-(Q+1)*f)/Q;g=E<=0||Math.abs(g-U)<Math.abs(g-E)?U:E}if(m&&(r===3?this.ctx.setLineDash([0,f+g]):this.ctx.setLineDash([f,g])),r===3?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=e*2+1.1,this.ctx.strokeStyle=yA(A),this.ctx.stroke(),this.ctx.setLineDash([]),r===2){if(Ie(o[0])){const Q=o[3],U=o[0];this.ctx.beginPath(),this.pathCallbacks.formatPath([new O(Q.end.x,Q.end.y),new O(U.start.x,U.start.y)]),this.ctx.stroke()}if(Ie(o[1])){const Q=o[1],U=o[2];this.ctx.beginPath(),this.pathCallbacks.formatPath([new O(Q.end.x,Q.end.y),new O(U.start.x,U.start.y)]),this.ctx.stroke()}}this.ctx.restore()})}},hv=class{constructor(A){this.ctx=A}renderBorderImage(A,e,t,n,r,s,o,a){const i=e.naturalWidth||e.width,c=e.naturalHeight||e.height;if(i<=0||c<=0)return;const u=Math.min(t.unit==="percent"?t.top/100*c:Math.min(t.top,c),c),h=Math.min(t.unit==="percent"?t.right/100*i:Math.min(t.right,i),i),f=Math.min(t.unit==="percent"?t.bottom/100*c:Math.min(t.bottom,c),c),g=Math.min(t.unit==="percent"?t.left/100*i:Math.min(t.left,i),i),{left:m,top:Q,width:U,height:E}=A;if(U<=0||E<=0)return;const v=Math.min(r,E),F=Math.min(s,U),y=Math.min(o,E-v),x=Math.min(a,U-F);this.drawRegion(e,0,0,g,u,m,Q,x,v),this.drawRegion(e,i-h,0,h,u,m+U-F,Q,F,v),this.drawRegion(e,i-h,c-f,h,f,m+U-F,Q+E-y,F,y),this.drawRegion(e,0,c-f,g,f,m,Q+E-y,x,y);const R=[{sx:g,sy:0,sw:i-g-h,sh:u,dx:m+x,dy:Q,dw:U-x-F,dh:v,repeat:n.horizontal},{sx:i-h,sy:u,sw:h,sh:c-u-f,dx:m+U-F,dy:Q+v,dw:F,dh:E-v-y,repeat:n.vertical},{sx:g,sy:c-f,sw:i-g-h,sh:f,dx:m+x,dy:Q+E-y,dw:U-x-F,dh:y,repeat:n.horizontal},{sx:0,sy:u,sw:g,sh:c-u-f,dx:m,dy:Q+v,dw:x,dh:E-v-y,repeat:n.vertical}];for(const I of R){if(I.sw<=0||I.sh<=0||I.dw<=0||I.dh<=0)continue;const K=I.dw>=I.dh;I.repeat===0?this.ctx.drawImage(e,I.sx,I.sy,I.sw,I.sh,I.dx,I.dy,I.dw,I.dh):(I.repeat===1||I.repeat===2)&&this.drawRepeatedEdge(e,I,K,I.repeat===2)}if(t.fill){const I=g,K=u,N=i-g-h,Z=c-u-f,X=m+x,oA=Q+v,hA=U-x-F,OA=E-v-y;this.drawRegion(e,I,K,N,Z,X,oA,hA,OA)}}drawRegion(A,e,t,n,r,s,o,a,i){n>0&&r>0&&a>0&&i>0&&this.ctx.drawImage(A,e,t,n,r,s,o,a,i)}drawRepeatedEdge(A,e,t,n){const r=t?e.sw:e.sh,s=t?e.dw:e.dh;if(r<=0||s<=0)return;let o,a;n?(a=Math.max(1,Math.round(s/r)),o=s/a):(o=r,a=Math.ceil(s/o)),this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(e.dx,e.dy,e.dw,e.dh),this.ctx.clip();for(let i=0;i<a;i++){const c=i*o,u=s-c,h=Math.min(o,u);if(h<=0)break;t?this.ctx.drawImage(A,e.sx,e.sy,e.sw,e.sh,e.dx+c,e.dy,h,e.dh):this.ctx.drawImage(A,e.sx,e.sy,e.sw,e.sh,e.dx,e.dy+c,e.dw,h)}this.ctx.restore()}},fv=class{constructor(A,e){this.activeEffects=[],this.didSave=!1,this.saveAtDepth=-1,this.ctx=A.ctx,this.pathCallback=e}applyEffects(A){for(;this.activeEffects.length;)this.popEffect();this.didSave=!1,this.saveAtDepth=-1;const e=n=>Ju(n)||Ac(n)||ju(n),t=A.reduceRight((n,r,s)=>n!==-1?n:e(r)?s:-1,-1);for(let n=0;n<A.length;n++){const r=A[n];e(r)&&(this.didSave||(this.ctx.save(),this.didSave=!0),n===t&&(this.saveAtDepth=this.activeEffects.length)),this.applyEffect(r)}}applyEffect(A){Ju(A)?(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)):Ac(A)?(this.pathCallback.path(A.path),this.ctx.clip()):ju(A)?A.applyClip(this.ctx):Gk(A)?this.ctx.globalAlpha*=A.opacity:Vk(A)?this.ctx.globalCompositeOperation=A.compositeOperation:Zk(A)&&(this.ctx.filter=A.safeFilterString||"none",A.shadow&&(this.ctx.shadowOffsetX=A.shadow.offsetX,this.ctx.shadowOffsetY=A.shadow.offsetY,this.ctx.shadowBlur=A.shadow.blur,this.ctx.shadowColor=A.shadow.color)),this.activeEffects.push(A)}popEffect(){this.activeEffects.length!==0&&(this.didSave&&this.activeEffects.length-1===this.saveAtDepth&&(this.ctx.restore(),this.didSave=!1,this.saveAtDepth=-1),this.activeEffects.pop(),!this.didSave&&this.activeEffects.length===0&&(this.ctx.globalAlpha=1,this.ctx.globalCompositeOperation="source-over",this.ctx.filter="none",this.ctx.shadowOffsetX=0,this.ctx.shadowOffsetY=0,this.ctx.shadowBlur=0,this.ctx.shadowColor="rgba(0, 0, 0, 0)"))}getActiveEffectCount(){return this.activeEffects.length}hasActiveEffects(){return this.activeEffects.length>0}};const gv=(A,e,t,n,r)=>{let s=0,o=0,a=A,i=e,c=t.left,u=t.top,h=t.width,f=t.height;const g=h/f,m=a/i,Q=r?J(r[0],1):.5,U=r?J(r[1],1):.5;return n===2?m>g?(f=h/m,u+=(t.height-f)*U):(h=f*m,c+=(t.width-h)*Q):n===4?m>g?(a=i*g,s+=(A-a)*Q):(i=a/g,o+=(e-i)*U):n===8?(a>h?(s+=(a-h)*Q,a=h):(c+=(h-a)*Q,h=a),i>f?(o+=(i-f)*U,i=f):(u+=(f-i)*U,f=i)):n===16&&((m>g?h:f*m)<(a>h?a:h)?m>g?(f=h/m,u+=(t.height-f)*U):(h=f*m,c+=(t.width-h)*Q):(a>h?(s+=(a-h)*Q,a=h):(c+=(h-a)*Q,h=a),i>f?(o+=(i-f)*U,i=f):(u+=(f-i)*U,f=i))),{sx:s,sy:o,sw:a,sh:i,dx:c,dy:u,dw:h,dh:f}};function Bv(A,e,t,n,r,s,o,a){return T(this,null,function*(){var i,c;if(r instanceof Ch)try{const u=yield e.cache.match(r.src),h=A.imageSmoothingEnabled;o.imageRendering===2||o.imageRendering===1?A.imageSmoothingEnabled=!1:o.imageRendering===3&&(A.imageSmoothingEnabled=!0),a(r,s,u),A.imageSmoothingEnabled=h}catch(u){e.logger.error(`Error loading image ${r.src}`),(i=e.onError)==null||i.call(e,u instanceof Error?u:new Error(String(u)))}if(r instanceof bh&&a(r,s,r.canvas),r instanceof Qh)try{a(r,s,yield e.cache.match(r.svg))}catch(u){e.logger.error(`Error loading svg ${r.svg.substring(0,255)}`),(c=e.onError)==null||c.call(e,u instanceof Error?u:new Error(String(u)))}if(r instanceof Fh&&r.tree){const u=yield n(e,{scale:t.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}).render(r.tree);r.width&&r.height&&A.drawImage(u,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height)}})}function wv(A,e,t,n,r){if(n instanceof jn){const s=Math.min(n.bounds.width,n.bounds.height);n.type==="checkbox"&&n.checked?(A.save(),t([new O(n.bounds.left+s*.39363,n.bounds.top+s*.79),new O(n.bounds.left+s*.16,n.bounds.top+s*.5549),new O(n.bounds.left+s*.27347,n.bounds.top+s*.44071),new O(n.bounds.left+s*.39694,n.bounds.top+s*.5649),new O(n.bounds.left+s*.72983,n.bounds.top+s*.23),new O(n.bounds.left+s*.84,n.bounds.top+s*.34085),new O(n.bounds.left+s*.39363,n.bounds.top+s*.79)]),A.fillStyle=yA(Xu),A.fill(),A.restore()):n.type==="radio"&&n.checked&&(A.save(),A.beginPath(),A.arc(n.bounds.left+s/2,n.bounds.top+s/2,s/4,0,Math.PI*2,!0),A.fillStyle=yA(Xu),A.fill(),A.restore())}if(Qv(n)&&n.value.length){const[s]=e.createFontStyle(r);A.font=s;const o=J(r.fontSize,0),{baseline:a,height:i}=Hh(A,o);A.fillStyle=n instanceof jn&&n.isPlaceholder?yA(Hk):yA(r.color),A.textBaseline="alphabetic",A.textAlign=yv(n.styles.textAlign);const c=gs(n),u=n instanceof jn?mv(c,_c(n),i):c;let h=0;switch(n.styles.textAlign){case 1:h+=c.width/2;break;case 2:h+=c.width;break}let f=0;n instanceof jn&&(f=(c.height-i)/2);const g=c.add(h,f,0,0);A.save(),t([new O(u.left,u.top),new O(u.left+u.width,u.top),new O(u.left+u.width,u.top+u.height),new O(u.left,u.top+u.height)]),A.clip();const m=Cv(A,n.value,c.width,r.whiteSpace==="pre"||r.whiteSpace==="nowrap"),Q=Va(r.lineHeight,o);m.forEach((U,E)=>{let v=g.left;const F=A.measureText(U).width;switch(r.textAlign){case 1:v+=(c.width-F)/2;break;case 2:v+=c.width-F;break}const y=new He(v,g.top+E*Q,0,0);e.renderTextWithLetterSpacing(new Bn(U,y),r.letterSpacing,a,r.writingMode)}),A.restore(),A.textBaseline="alphabetic",A.textAlign="left"}}const mv=(A,e,t)=>A.height<t?new He(A.left,e.top,A.width,e.height):A,Cv=(A,e,t,n)=>{const r=[],s=e.split(`
1654
+ `);for(const o of s){if(n){r.push(o);continue}const a=o.split(/(\s+)/);let i="";for(const c of a){const u=i+c;A.measureText(u).width<=t||i===""?i=u:(r.push(i),i=c)}r.push(i)}return r};function bv(A,e,t,n,r,s){return T(this,null,function*(){var o;if(jA(r.styles.display,2048)){if(r.styles.listStyleImage!==null){const a=r.styles.listStyleImage;if(a.type===0){const i=a.url;try{const c=yield e.cache.match(i);A.drawImage(c,r.bounds.left-(c.width+10),r.bounds.top)}catch(c){e.logger.error(`Error loading list-style-image ${i}`),(o=e.onError)==null||o.call(e,c instanceof Error?c:new Error(String(c)))}}}else if(n.listValue&&r.styles.listStyleType!==-1){const[a]=t.createFontStyle(s);A.font=a,A.fillStyle=yA(s.color),A.textBaseline="middle",A.textAlign="right";const i=new He(r.bounds.left,r.bounds.top+J(r.styles.paddingTop,r.bounds.width),r.bounds.width,Va(s.lineHeight,s.fontSize.number)/2+1);t.renderTextWithLetterSpacing(new Bn(n.listValue,i),s.letterSpacing,Va(s.lineHeight,s.fontSize.number)/2+2,s.writingMode),A.textBaseline="bottom",A.textAlign="left"}}})}const Qv=A=>A instanceof Eh||A instanceof Uh?!0:A instanceof jn&&A.type!=="radio"&&A.type!=="checkbox",yv=A=>{switch(A){case 1:return"center";case 2:return"right";default:return"left"}};var Uv=class Oh{constructor(e,t){this.context=e,this.options=t,this.canvas=t.canvas?t.canvas:document.createElement("canvas");const n=this.canvas.getContext("2d");if(!n)throw new Error("Failed to get 2D rendering context from canvas");this.ctx=n,t.canvas||(this.canvas.width=Math.floor(t.width*t.scale),this.canvas.height=Math.floor(t.height*t.scale),this.canvas.style.width=`${t.width}px`,this.canvas.style.height=`${t.height}px`),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-t.x,-t.y),this.ctx.textBaseline="bottom",t.imageSmoothing!==void 0&&(this.ctx.imageSmoothingEnabled=t.imageSmoothing),t.imageSmoothingQuality&&(this.ctx.imageSmoothingQuality=t.imageSmoothingQuality),this.backgroundRenderer=new Ad({ctx:this.ctx,context:this.context,canvas:this.canvas,options:{width:t.width,height:t.height,scale:t.scale}}),this.borderRenderer=new pv({ctx:this.ctx},{path:r=>this.path(r),formatPath:r=>this.formatPath(r)}),this.borderImageRenderer=new hv(this.ctx),this.effectsRenderer=new fv({ctx:this.ctx},{path:r=>this.path(r)}),this.textRenderer=new av({ctx:this.ctx,options:{scale:t.scale}}),this.context.logger.debug(`Canvas renderer initialized (${t.width}x${t.height}) with scale ${t.scale}`)}renderStack(e){return T(this,null,function*(){e.element.container.styles.isVisible()&&(yield this.renderStackContent(e))})}renderNode(e){return T(this,null,function*(){if(e.container.debugRender)debugger;e.container.styles.isVisible()&&(yield this.renderNodeBackgroundAndBorders(e),yield this.renderNodeContent(e))})}renderReplacedElement(e,t,n){const r=n.naturalWidth||e.intrinsicWidth,s=n.naturalHeight||e.intrinsicHeight;if(n&&r>0&&s>0){const o=gs(e),a=Jo(t);this.path(a),this.ctx.save(),this.ctx.clip();const{sx:i,sy:c,sw:u,sh:h,dx:f,dy:g,dw:m,dh:Q}=gv(r,s,o,e.styles.objectFit,e.styles.objectPosition);this.ctx.drawImage(n,i,c,u,h,f,g,m,Q),this.ctx.restore()}}renderNodeContent(e){return T(this,null,function*(){this.effectsRenderer.applyEffects(e.getEffects(4));const t=e.container,n=e.curves,r=t.styles,s=gs(t);for(const o of t.textNodes)yield this.textRenderer.renderTextNode(o,r,s);yield Bv(this.ctx,this.context,{scale:this.options.scale,backgroundColor:this.options.backgroundColor,x:this.options.x,y:this.options.y,width:this.options.width,height:this.options.height},(o,a)=>new Oh(o,a),t,n,r,(o,a,i)=>this.renderReplacedElement(o,a,i)),wv(this.ctx,this.textRenderer,this.path.bind(this),t,r),yield bv(this.ctx,this.context,this.textRenderer,e,t,r)})}renderStackContent(e){return T(this,null,function*(){if(e.element.container.debugRender)debugger;const t=this.options.signal;yield this.renderNodeBackgroundAndBorders(e.element);for(const n of e.negativeZIndex){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");yield this.renderStack(n)}if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");yield this.renderNodeContent(e.element);for(const n of e.nonInlineLevel)yield this.renderNode(n);for(const n of e.nonPositionedFloats){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");yield this.renderStack(n)}for(const n of e.nonPositionedInlineLevel){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");yield this.renderStack(n)}for(const n of e.inlineLevel)yield this.renderNode(n);for(const n of e.zeroOrAutoZIndexOrTransformedOrOpacity){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");yield this.renderStack(n)}for(const n of e.positiveZIndex){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");yield this.renderStack(n)}})}mask(e){this.ctx.beginPath();const t=this.options.x,n=this.options.y;this.ctx.moveTo(t,n),this.ctx.lineTo(t+this.options.width,n),this.ctx.lineTo(t+this.options.width,n+this.options.height),this.ctx.lineTo(t,n+this.options.height),this.ctx.lineTo(t,n),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()}path(e){Rh(this.ctx,e)}formatPath(e){Dh(this.ctx,e)}renderNodeBackgroundAndBorders(e){return T(this,null,function*(){this.effectsRenderer.applyEffects(e.getEffects(2));const t=e.container.styles,n=!Et(t.backgroundColor)||t.backgroundImage.length,r=Fv(t),s=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],o=an(t.backgroundClip,0),a=Ev(o,e.curves);if((n||t.boxShadow.length)&&(r&&e.container.textNodes.length>0?yield this.renderTextClippedBackground(e):(this.ctx.save(),this.path(a),this.ctx.clip(),Et(t.backgroundColor)||(this.ctx.fillStyle=yA(t.backgroundColor),this.ctx.fill()),yield this.backgroundRenderer.renderBackgroundImage(e.container),this.ctx.restore()),t.boxShadow.slice(0).reverse().forEach(c=>{this.ctx.save();const u=Wo(e.curves),h=c.inset?0:BF,f=Ok(u,-h+(c.inset?1:-1)*c.spread.number,(c.inset?1:-1)*c.spread.number,c.spread.number*(c.inset?-2:2),c.spread.number*(c.inset?-2:2));c.inset?(this.path(u),this.ctx.clip(),this.mask(f)):(this.mask(u),this.ctx.clip(),this.path(f)),this.ctx.shadowOffsetX=c.offsetX.number+h,this.ctx.shadowOffsetY=c.offsetY.number,this.ctx.shadowColor=yA(c.color),this.ctx.shadowBlur=c.blur.number,this.ctx.fillStyle=c.inset?yA(c.color):"rgba(0,0,0,1)",this.ctx.fill(),this.ctx.restore()})),t.borderImageSource){const c=t.borderImageSource;if(c.type===0){const u=c.url;try{const h=yield this.context.cache.match(u);if(h){const f=e.container.bounds;this.borderImageRenderer.renderBorderImage(f,h,t.borderImageSlice,t.borderImageRepeat,Math.max(0,t.borderTopWidth),Math.max(0,t.borderRightWidth),Math.max(0,t.borderBottomWidth),Math.max(0,t.borderLeftWidth))}}catch(h){this.context.logger.error(`Error loading border-image ${u}`)}}return}let i=0;for(const c of s){if(c.style!==0&&!Et(c.color)&&c.width>0){const u=()=>T(this,null,function*(){c.style===2?yield this.borderRenderer.renderDashedDottedBorder(c.color,c.width,i,e.curves,2):c.style===3?yield this.borderRenderer.renderDashedDottedBorder(c.color,c.width,i,e.curves,3):c.style===4?yield this.borderRenderer.renderDoubleBorder(c.color,c.width,i,e.curves):yield this.borderRenderer.renderSolidBorder(c.color,i,e.curves)}),h=e.container.legendBounds;if(i===0&&h){const f=e.container.bounds,g=h.left-f.left,m=h.left+h.width-f.left;g>0&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(f.left,f.top,g,f.height),this.ctx.clip(),yield u(),this.ctx.restore());const Q=f.left+m,U=f.width-m;U>0&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(Q,f.top,U,f.height),this.ctx.clip(),yield u(),this.ctx.restore())}else yield u()}i++}})}render(e){return T(this,null,function*(){this.options.backgroundColor&&(this.ctx.fillStyle=yA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height));const t=Wk(e);return yield this.renderStack(t),this.effectsRenderer.applyEffects([]),this.canvas})}renderTextClippedBackground(e){return T(this,null,function*(){var m;const t=e.container,n=t.styles,r=t.bounds;if(r.width<=0||r.height<=0)return;const s=((m=this.canvas.ownerDocument)!=null?m:document).createElement("canvas"),o=Math.ceil(r.width),a=Math.ceil(r.height);s.width=o,s.height=a;const i=s.getContext("2d");if(!i)return;const[c]=this.textRenderer.createFontStyle(n);i.font=c,i.textBaseline="alphabetic",i.textAlign="left",i.direction=n.direction===1?"rtl":"ltr";const u=Lh(i,n.fontSize.number),h=new Ad({ctx:i,context:this.context,canvas:s,options:{width:o,height:a,scale:1}});Et(n.backgroundColor)||(i.fillStyle=yA(n.backgroundColor),i.fillRect(0,0,o,a)),i.save(),i.translate(-r.left,-r.top),yield h.renderBackgroundImage(t),i.restore(),i.globalCompositeOperation="destination-in",i.fillStyle="#000";const f=n.writingMode,g=n.letterSpacing;for(const Q of t.textNodes)for(const U of Q.textBounds){const E=U.bounds.left-r.left,v=U.bounds.top-r.top+u;g>0?this.renderTextMaskWithLetterSpacing(i,U,g,E,v,f):i.fillText(U.text,E,v)}this.ctx.drawImage(s,r.left,r.top)})}renderTextMaskWithLetterSpacing(e,t,n,r,s,o){const a=wn(t.text);let i=r;for(const c of a){if(Xo(o)){e.fillText(t.text,r,s);return}e.fillText(c,i,s),i+=e.measureText(c).width+n}}};const Ev=(A,e)=>{switch(A){case 0:return Wo(e);case 2:return Pk(e);default:return Jo(e)}},Fv=A=>A.backgroundClip.some(e=>e===3);var kv=class{constructor(A,e){this.context=A,this.options=e,this.canvas=e.canvas?e.canvas:document.createElement("canvas");const t=this.canvas.getContext("2d");if(!t)throw new Error("Failed to get 2D rendering context from canvas");this.ctx=t,this.canvas.width=Math.floor(e.width*e.scale),this.canvas.height=Math.floor(e.height*e.scale),this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`,this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-e.x,-e.y),this.context.logger.debug(`EXPERIMENTAL ForeignObject renderer initialized (${e.width}x${e.height} at ${e.x},${e.y}) with scale ${e.scale}`)}render(A){return T(this,null,function*(){var t;if((t=this.options.signal)!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");const e=yield ja(Ja(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A));return this.options.backgroundColor&&(this.ctx.fillStyle=yA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(e,-this.options.x*this.options.scale,-this.options.y*this.options.scale),this.canvas})}},or,vv=(or=class{constructor({id:e,enabled:t}){this.id=e,this.enabled=t,this.start=Date.now()}debug(...e){this.enabled&&(typeof window!="undefined"&&window.console&&typeof console.debug=="function"?console.debug(this.id,`${this.getTime()}ms`,...e):this.info(...e))}getTime(){return Date.now()-this.start}info(...e){this.enabled&&typeof window!="undefined"&&window.console&&typeof console.info=="function"&&console.info(this.id,`${this.getTime()}ms`,...e)}warn(...e){this.enabled&&(typeof window!="undefined"&&window.console&&typeof console.warn=="function"?console.warn(this.id,`${this.getTime()}ms`,...e):this.info(...e))}error(...e){this.enabled&&(typeof window!="undefined"&&window.console&&typeof console.error=="function"?console.error(this.id,`${this.getTime()}ms`,...e):this.info(...e))}},or.instances={},or),_v=class{constructor(A,e){var t;if(this.context=A,this._options=e,this._cache=new Map,this._pendingOperations=new Map,this._deferMode=!1,this._collectedUrls=new Set,this.maxSize=(t=e.maxCacheSize)!=null?t:100,this.maxSize<1)throw new Error("Cache maxSize must be at least 1");this.maxSize>1e4&&this.context.logger.warn(`Cache maxSize ${this.maxSize} is very large and may cause memory issues. Consider using a smaller value (recommended: 100-1000).`)}startDefer(){this._deferMode=!0}preloadAll(A=10){return T(this,null,function*(){this._deferMode=!1;const e=Array.from(this._collectedUrls);if(this._collectedUrls.clear(),e.length===0)return;const t=Math.max(1,Math.min(A,100));this.context.logger.debug(`Preloading ${e.length} image(s) with concurrency ${t}`);for(let n=0;n<e.length;n+=t){const r=e.slice(n,n+t).map(s=>this._addImageWithPending(s));yield Promise.allSettled(r)}})}addImage(A){if(this._deferMode)return!this.has(A)&&(Lr(A)||td(A))&&this._collectedUrls.add(A),Promise.resolve();const e=this._pendingOperations.get(A);if(e)return e;if(this.has(A)){const t=this._cache.get(A);return this._cache.delete(A),this._cache.set(A,t),Promise.resolve()}return Lr(A)||td(A)?this._addImageWithPending(A):Promise.resolve()}_addImageWithPending(A){const e=this._pendingOperations.get(A);if(e)return e;const t=this._addImageInternal(A);return this._pendingOperations.set(A,t),t.finally(()=>{this._pendingOperations.delete(A)}),t}_addImageInternal(A){return T(this,null,function*(){var n;const e=(n=this._options.imageTimeout)!=null?n:15e3,t=this.withTimeout(this.loadImage(A),e,`Timed out (${e}ms) loading image`);t.catch(r=>{this.context.logger.error(`Failed to load image ${A}: ${r instanceof Error?r.message:"Unknown error"}`)}),this.set(A,t)})}withTimeout(A,e,t){if(e<=0)return A;let n;const r=new Promise((s,o)=>{n=setTimeout(()=>o(new Error(t)),e)});return Promise.race([A,r]).finally(()=>{n!==void 0&&clearTimeout(n)})}match(A){const e=this._cache.get(A);if(e)return this._cache.delete(A),this._cache.set(A,e),e.value}set(A,e){if(this._cache.has(A))this._cache.delete(A);else if(this._cache.size>=this.maxSize){const t=this._cache.keys().next().value;t!==void 0&&(this._cache.delete(t),this.context.logger.debug(`Cache: Evicted LRU entry: ${t}`))}this._cache.set(A,{value:e})}size(){return this._cache.size}getMaxSize(){return this.maxSize}clear(){this._cache.clear()}loadImage(A){return T(this,null,function*(){const e=this.context.originChecker,t=i=>e.isSameOrigin(i),n=typeof this._options.customIsSameOrigin=="function"?yield this._options.customIsSameOrigin(A,t):t(A),r=!n&&this._options.allowTaint===!1&&!po(A)&&!Lr(A)&&typeof this._options.proxy!="string",s=!po(A)&&(this._options.useCORS===!0||r)&&JA.SUPPORT_CORS_IMAGES&&!n,o=!po(A)&&!n&&!Lr(A)&&typeof this._options.proxy=="string"&&JA.SUPPORT_CORS_XHR&&!s;if(!n&&this._options.allowTaint===!1&&!po(A)&&!Lr(A)&&!o&&!s)return;let a=A;return o&&(a=yield this.proxy(a)),this.context.logger.debug(`Added image ${A.substring(0,256)}`),yield new Promise((i,c)=>{const u=new Image;u.onload=()=>i(u),u.onerror=c,(Tv(a)||s)&&(u.crossOrigin="anonymous"),u.src=a,u.complete===!0&&setTimeout(()=>i(u),500)})})}has(A){return this._cache.has(A)}keys(){return Promise.resolve(Array.from(this._cache.keys()))}proxy(A){const e=this._options.proxy;if(!e)throw new Error("No proxy defined");const t=A.substring(0,256);return new Promise((n,r)=>{const s=JA.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=()=>{if(o.status===200)if(s==="text")n(o.response);else{const i=new FileReader;i.addEventListener("load",()=>n(i.result),!1),i.addEventListener("error",c=>r(c),!1),i.readAsDataURL(o.response)}else r(`Failed to proxy resource ${t} with status code ${o.status}`)},o.onerror=r;const a=e.indexOf("?")>-1?"&":"?";if(o.open("GET",`${e}${a}url=${encodeURIComponent(A)}&responseType=${s}`),s!=="text"&&o instanceof XMLHttpRequest&&(o.responseType=s),this._options.imageTimeout){const i=this._options.imageTimeout;o.timeout=i,o.ontimeout=()=>r(`Timed out (${i}ms) proxying ${t}`)}o.send()})}};const xv=/^data:image\/svg\+xml/i,Sv=/^data:image\/.*;base64,/i,Iv=/^data:image\/.*/i,td=A=>JA.SUPPORT_SVG_DRAWING||!Hv(A),po=A=>Iv.test(A),Tv=A=>Sv.test(A),Lr=A=>A.substring(0,4)==="blob",Hv=A=>A.slice(-3).toLowerCase()==="svg"||xv.test(A);var Lv=class{constructor(A){if(!A||!A.document)throw new Error("Valid window object required for OriginChecker");if(!A.location||!A.location.href)throw new Error("Window object must have valid location");this.link=A.document.createElement("a"),this.origin=this.getOrigin(A.location.href)}getOrigin(A){return this.link.href=A,this.link.href=this.link.href,this.link.protocol+this.link.hostname+this.link.port}isSameOrigin(A){return this.getOrigin(A)===this.origin}getContextOrigin(){return this.origin}},bn,Dv=(bn=class{constructor(e,t,n){var r,s;this.windowBounds=t,this.instanceName=`#${bn.instanceCount++}`,this.config=n,this.logger=new vv({id:this.instanceName,enabled:e.logging}),this.originChecker=new Lv(n.window),this.cache=(s=(r=e.cache)!=null?r:n.cache)!=null?s:new _v(this,e),this.onError=e.onError}},bn.instanceCount=1,bn);const ho=A=>{if(A!=null&&A.aborted)throw new DOMException("The operation was aborted.","AbortError")},Rv=A=>{["scale","width","height","imageTimeout","x","y","windowWidth","windowHeight","scrollX","scrollY"].forEach(e=>{const t=A[e];if(t!=null&&typeof t!="number"){const n=Number(t);Number.isNaN(n)||(A[e]=n)}})},Ov=A=>{var e,t,n;return{allowTaint:(e=A.allowTaint)!=null?e:!1,imageTimeout:(t=A.imageTimeout)!=null?t:15e3,proxy:A.proxy,useCORS:(n=A.useCORS)!=null?n:!1,customIsSameOrigin:A.customIsSameOrigin,maxCacheSize:A.maxCacheSize}},Mv=(A,e,t)=>{var n,r;return k({logging:(n=A.logging)!=null?n:!0,cache:(r=A.cache)!=null?r:e.cache},t)},Pv=800,Kv=600,nd=0,Nv=(A,e)=>{var n,r,s,o,a,i,c,u;const t=e;return{windowWidth:(r=(n=A.windowWidth)!=null?n:t.innerWidth)!=null?r:Pv,windowHeight:(o=(s=A.windowHeight)!=null?s:t.innerHeight)!=null?o:Kv,scrollX:(i=(a=A.scrollX)!=null?a:t.pageXOffset)!=null?i:nd,scrollY:(u=(c=A.scrollY)!=null?c:t.pageYOffset)!=null?u:nd}},zv=(A,e,t)=>{var n,r;return{allowTaint:(n=A.allowTaint)!=null?n:!1,onclone:A.onclone,ignoreElements:A.ignoreElements,iframeContainer:A.iframeContainer,inlineImages:t,copyStyles:t,cspNonce:(r=A.cspNonce)!=null?r:e.cspNonce}},$v=(A,e,t,n,r,s,o)=>{var a,i,c,u,h,f;return{canvas:A.canvas,backgroundColor:e,signal:A.signal,scale:(i=(a=A.scale)!=null?a:o)!=null?i:1,x:((c=A.x)!=null?c:0)+t,y:((u=A.y)!=null?u:0)+n,width:(h=A.width)!=null?h:Math.ceil(r),height:(f=A.height)!=null?f:Math.ceil(s),imageSmoothing:A.imageSmoothing,imageSmoothingQuality:A.imageSmoothingQuality}},Gv=(A,e,t)=>{const n=e.ownerDocument,r=n.documentElement?rr(A,getComputedStyle(n.documentElement).backgroundColor):ut.TRANSPARENT,s=n.body?rr(A,getComputedStyle(n.body).backgroundColor):ut.TRANSPARENT,o=typeof t=="string"?rr(A,t):t===null?ut.TRANSPARENT:4294967295;return e===n.documentElement?Et(r)?Et(s)?o:s:r:o},Vv=(A,e,t)=>T(null,null,function*(){var N,Z,X,oA,hA,OA;if(Rv(e),!e.skipValidation){const de=e.validator||YQ(),re=de.validateElement(A);if(!re.valid)throw new Error(re.error);const Re=de.validateOptions(e);if(!Re.valid)throw new Error(`Invalid options: ${Re.error}`)}if(!A||typeof A!="object")throw new Error("Invalid element provided as first argument");const n=A.ownerDocument;if(!n)throw new Error("Element is not attached to a Document");const r=n.defaultView;if(!r)throw new Error("Document is not attached to a Window");const s=Mv(e,t,Ov(e)),o=Nv(e,r),a=new He(o.scrollX,o.scrollY,o.windowWidth,o.windowHeight),i=new Dv(s,a,t),c=(Z=(N=e.enablePerformanceMonitoring)!=null?N:e.logging)!=null?Z:!1,u=new qQ(i,c);u.start("total",{width:o.windowWidth,height:o.windowHeight});const h=e.signal;ho(h);const f=(X=e.foreignObjectRendering)!=null?X:!1,g=zv(e,t,f);i.logger.debug(`Starting document clone with size ${a.width}x${a.height} scrolled to ${-a.left},${-a.top}`),u.start("clone");const m=new Yi(i,A,g),Q=m.clonedReferenceElement;if(!Q)throw new Error("Unable to find element in cloned iframe");const U=yield m.toIFrame(n,a);u.end("clone"),h!=null&&h.aborted&&(((oA=e.removeContainer)==null||oA)&&Yi.destroy(U),ho(h));const{width:E,height:v,left:F,top:y}=kc(Q)||eU(Q)?Ay(Q.ownerDocument):us(i,Q),x=Gv(i,Q,e.backgroundColor),R=$v(e,x,F,y,E,v,(hA=r.devicePixelRatio)!=null?hA:1);let I,K;try{return f?(i.logger.debug("Document cloned, using foreign object rendering"),u.start("render-foreignobject"),I=yield new kv(i,R).render(Q),u.end("render-foreignobject")):(i.logger.debug(`Document cloned, element located at ${F},${y} with size ${E}x${v} using computed rendering`),i.logger.debug("Starting DOM parsing"),u.start("parse"),ho(h),i.cache.startDefer(),K=_h(i,Q),u.end("parse"),u.start("preload"),yield i.cache.preloadAll(),u.end("preload"),x===K.styles.backgroundColor&&(K.styles.backgroundColor=ut.TRANSPARENT),i.logger.debug(`Starting renderer for element at ${R.x},${R.y} with size ${R.width}x${R.height}`),u.start("render"),ho(h),I=yield new Uv(i,R).render(K),u.end("render")),u.start("cleanup"),((OA=e.removeContainer)==null||OA)&&(Yi.destroy(U)||i.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),u.end("cleanup"),u.end("total"),i.logger.debug("Finished rendering"),c&&u.logSummary(),I}finally{K&&K.restoreTree()}}),Zv=(A,e={},t)=>Vv(A,e,JQ.fromElement(A,{cspNonce:e.cspNonce,cache:e.cache}));function Xv(A){return T(this,null,function*(){if(!(A instanceof HTMLElement))return{blob:null,error:null};try{const e=yield Zv(A,{backgroundColor:"#ffffff",logging:!1,useCORS:!0,scale:1,ignoreElements:n=>n instanceof Element&&n.hasAttribute("data-ap-sdk"),onclone:(n,r)=>{try{dc(r)}catch(s){}}}),t=yield Wv(e);return t?{blob:t,error:null}:{blob:null,error:"canvas.toBlob produced no image data"}}catch(e){return console.error("[Agent Platform SDK] screenshot capture failed:",e),{blob:null,error:e instanceof Error?e.message:String(e)}}})}function Wv(A){return new Promise(e=>{A.toBlob(t=>e(t),"image/png")})}const Jv={click:"🖱",inputText:"⌨",scroll:"↕",keypress:"⌤"};function jv(A,e){const{needsCredentials:t,canCreateTask:n,canCreatePlanning:r,captureType:s,hasOnReselect:o,hasOnAddAnother:a}=e;return`
1655
+ <div class="ap-sdk-panel__header">
1656
+ <span class="ap-sdk-panel__title">
1657
+ <span class="ap-sdk-panel__logo">AP</span>
1658
+ Capture to Agent Platform
1659
+ </span>
1660
+ <div class="ap-sdk-panel__header-actions">
1661
+ <button class="ap-sdk-panel__clear" aria-label="Clear selections" title="Clear selections" data-ap-clear-selections type="button">⟲</button>
1662
+ <button class="ap-sdk-panel__config" aria-label="Configure" data-ap-reconfigure>⚙</button>
1663
+ <button class="ap-sdk-panel__close" aria-label="Close" data-ap-close>×</button>
1664
+ </div>
1665
+ </div>
1666
+ <div class="ap-sdk-pick-list" data-ap-pick-list style="display:none"></div>
1667
+ <div class="ap-sdk-panel__context" data-ap-context>
1668
+ ${Mh(A)}
1669
+ </div>
1670
+ <div class="ap-sdk-panel__screenshot" data-ap-screenshot style="display:none"></div>
1671
+ <div class="ap-sdk-panel__pick-actions" data-ap-pick-actions>
1672
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-panel__btn--select-parent" data-ap-select-parent type="button">
1673
+ ⬆ Select parent
1674
+ </button>
1675
+ ${o?`
1676
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-panel__btn--reselect" data-ap-reselect type="button">
1677
+ ↻ Re-select
1678
+ </button>`:""}
1679
+ </div>
1680
+ ${t?`
1681
+ <div class="ap-sdk-credentials-section" data-ap-credentials>
1682
+ <p class="ap-sdk-credentials-heading">Connect to Agent Platform to continue</p>
1683
+ <p class="ap-sdk-config-hint">You'll be asked to approve this connection on Agent Platform's own sign-in page.</p>
1684
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-connect-required type="button">Connect via Agent Platform</button>
1685
+ </div>`:""}
1686
+ <div class="ap-sdk-panel__body">
1687
+ <div class="ap-sdk-panel__field">
1688
+ <label class="ap-sdk-panel__label" for="ap-sdk-note">Instruction</label>
1689
+ <textarea id="ap-sdk-note" class="ap-sdk-panel__textarea" rows="3"
1690
+ placeholder="Describe the task or planning session…" data-ap-note></textarea>
1691
+ </div>
1692
+ ${a?`
1693
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--add-another" data-ap-add-another disabled>
1694
+ + Add another
1695
+ </button>`:""}
1696
+ <div class="ap-sdk-panel__field">
1697
+ <div class="ap-sdk-panel__label">Type</div>
1698
+ <div class="ap-sdk-panel__toggle">
1699
+ ${r?`<button class="ap-sdk-panel__toggle-btn${s==="planning"?" ap-sdk-active":""}" data-ap-type="planning">Planning Session</button>`:""}
1700
+ ${n?`<button class="ap-sdk-panel__toggle-btn${s==="task"?" ap-sdk-active":""}" data-ap-type="task">Task</button>`:""}
1701
+ ${n?`<button class="ap-sdk-panel__toggle-btn${s==="automate"?" ap-sdk-active":""}" data-ap-type="automate">Automate</button>`:""}
1702
+ </div>
1703
+ </div>
1704
+ <div class="ap-sdk-panel__field" data-ap-automate-options style="display:none">
1705
+ <label class="ap-sdk-advanced__checkbox-label">
1706
+ <input type="checkbox" data-ap-allow-submit />
1707
+ Allow submit / confirm actions
1708
+ </label>
1709
+ <span class="ap-sdk-advanced__hint">Lets the agent click Submit, Confirm, Send, or Publish buttons to finish the task. It will still avoid payments and deletions unless you ask for them.</span>
1710
+ </div>
1711
+ </div>
1712
+ <div class="ap-sdk-panel__status" data-ap-status style="display:none"></div>
1713
+ <div class="ap-sdk-panel__footer">
1714
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-submit>Submit</button>
1715
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost" data-ap-cancel>Cancel</button>
1716
+ </div>
1717
+ `}function Mh(A){var e,t;return(e=A.interactionSteps)!=null&&e.length?`
1718
+ <div class="ap-sdk-panel__context-label">Recorded steps (${A.interactionSteps.length})</div>
1719
+ <div class="ap-sdk-panel__context-steps">
1720
+ ${A.interactionSteps.map(n=>`
1721
+ <div class="ap-sdk-panel__context-step">
1722
+ <span class="ap-sdk-panel__context-step-icon">${Jv[n.action]}</span>
1723
+ <span class="ap-sdk-panel__context-step-text">${fe(n.description)}</span>
1724
+ </div>
1725
+ `).join("")}
1726
+ </div>
1727
+ `:`
1728
+ <div class="ap-sdk-panel__context-label">Captured element</div>
1729
+ <div class="ap-sdk-panel__context-text" title="${fe((t=A.elementText)!=null?t:"")}">${fe(A.elementText||"(no text)")}</div>
1730
+ ${A.cssSelector?`<div class="ap-sdk-panel__context-selector" title="${fe(A.cssSelector)}">${fe(A.cssSelector)}</div>`:""}
1731
+ `}function Kt(A,e,t){if(!e){A.style.display="none",A.textContent="",A.innerHTML="";return}A.style.display="block",A.className=`ap-sdk-panel__status ap-sdk-panel__status--${e}`,A.textContent=t}function Yv(A,e,t,n,r){const s=e==="task"?"Task":"Planning",o=e==="task"?"Task created successfully!":"Planning session created!",a=e==="task"?"View task →":"View planning session →",i=t.length>55?`${t.slice(0,52)}…`:t;A.style.display="block",A.className="ap-sdk-panel__status",A.innerHTML=`
1732
+ <div class="ap-sdk-success-card">
1733
+ <svg class="ap-sdk-success-check" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
1734
+ <circle class="ap-sdk-success-check__circle" cx="24" cy="24" r="22"/>
1735
+ <path class="ap-sdk-success-check__tick" d="M14 24l7 7 13-14"/>
1736
+ </svg>
1737
+ <p class="ap-sdk-success-headline">${fe(o)}</p>
1738
+ <div class="ap-sdk-success-meta">
1739
+ <span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--${e}">${fe(s)}</span>
1740
+ <span class="ap-sdk-success-title" title="${fe(t)}">${fe(i)}</span>
1741
+ </div>
1742
+ <div class="ap-sdk-success-actions">
1743
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-success-view>${fe(a)}</button>
1744
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost" data-ap-success-close>Close</button>
1745
+ </div>
1746
+ </div>
1747
+ `,A.querySelector("[data-ap-success-view]").addEventListener("click",()=>window.open(n,"_blank","noopener,noreferrer")),A.querySelector("[data-ap-success-close]").addEventListener("click",r)}function ca(A,e){A.querySelectorAll("button, input, textarea, select").forEach(t=>{t.disabled=e})}function fe(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function qv(A,e){let t=null,n=null;const r=()=>{if(A.screenshotCapturing){e.style.display="block",e.className="ap-sdk-panel__screenshot",e.innerHTML='<div class="ap-sdk-screenshot__status">📸 Capturing screenshot…</div>';return}if(!A.currentScreenshotBlob){A.screenshotError?(e.style.display="block",e.className="ap-sdk-panel__screenshot",e.innerHTML=`
1748
+ <div class="ap-sdk-screenshot__status ap-sdk-screenshot__status--muted">Screenshot unavailable for this element.</div>
1749
+ <div class="ap-sdk-screenshot__error">${fe(A.screenshotError)}</div>
1750
+ `):(e.style.display="none",e.innerHTML="");return}t&&URL.revokeObjectURL(t),t=URL.createObjectURL(A.currentScreenshotBlob),e.style.display="block",e.className=`ap-sdk-panel__screenshot${A.screenshotIncluded?"":" ap-sdk-screenshot--excluded"}`,e.innerHTML=`
1751
+ <label class="ap-sdk-screenshot__toggle">
1752
+ <input type="checkbox" data-ap-screenshot-include ${A.screenshotIncluded?"checked":""} />
1753
+ Attach a screenshot of the selected element
1754
+ </label>
1755
+ <img class="ap-sdk-screenshot__thumb" src="${t}" alt="Screenshot of the selected element" />
1756
+ `,e.querySelector("[data-ap-screenshot-include]").addEventListener("change",o=>{A.screenshotIncluded=o.target.checked,e.classList.toggle("ap-sdk-screenshot--excluded",!A.screenshotIncluded)})};return{captureScreenshotFor:o=>{const a=Symbol();n=a,A.screenshotCapturing=!0,A.currentScreenshotBlob=null,A.screenshotIncluded=!1,A.screenshotError=null,r(),Xv(o).then(({blob:i,error:c})=>{n===a&&(A.currentScreenshotBlob=i,A.screenshotCapturing=!1,A.screenshotError=i?null:c!=null?c:"Unknown error",i||(A.screenshotIncluded=!1),r())})},renderScreenshotUi:r,invalidateInFlightCapture:()=>{n=null},cleanup:()=>{t&&(URL.revokeObjectURL(t),t=null)}}}function A_({state:A,els:e,screenshotCtl:t,defaultCaptureType:n,updateHighlight:r,onReselect:s,onAddAnother:o}){const{contextEl:a,pickListEl:i,pickActionsEl:c,noteEl:u,addAnotherBtn:h,selectParentBtn:f,reselectBtn:g,clearSelectionsBtn:m,typeButtons:Q,allowSubmitCheckbox:U,automateOptionsEl:E,statusEl:v}=e,F=()=>{WQ({captureType:A.captureType,note:u.value,completedPicks:A.completedPicks.map(({ctx:N,instruction:Z})=>({ctx:N,instruction:Z})),allowSubmit:A.allowSubmit,currentCtx:A.currentCtx})},y=N=>{N?(a.innerHTML=Mh(N),u.disabled=!1,u.placeholder="Describe the task or planning session…",setTimeout(()=>u.focus(),50)):(a.innerHTML=`
1757
+ <div class="ap-sdk-panel__context-label">Next element</div>
1758
+ <div class="ap-sdk-panel__context-text ap-sdk-awaiting-pick">👆 Hover and click any element on the page</div>
1759
+ `,u.disabled=!0,u.placeholder="Pick an element to continue…")},x=()=>{if(A.completedPicks.length===0){i.style.display="none",i.innerHTML="";return}i.style.display="block",i.innerHTML=A.completedPicks.map((N,Z)=>{var X;return`
1760
+ <div class="ap-sdk-pick-entry" data-pick-index="${Z}">
1761
+ <div class="ap-sdk-pick-entry__header">
1762
+ <span class="ap-sdk-pick-entry__number">${Z+1}</span>
1763
+ <span class="ap-sdk-pick-entry__element" title="${fe((X=N.ctx.elementText)!=null?X:"")}">${fe(N.ctx.elementText||"(no text)")}</span>
1764
+ <button class="ap-sdk-pick-entry__remove" data-ap-remove="${Z}" aria-label="Remove pick ${Z+1}">×</button>
1765
+ </div>
1766
+ <div class="ap-sdk-pick-entry__instruction">${fe(N.instruction)}</div>
1767
+ </div>
1768
+ `}).join(""),i.querySelectorAll("[data-ap-remove]").forEach(N=>{N.addEventListener("click",()=>{const Z=parseInt(N.dataset.apRemove,10);A.completedPicks.splice(Z,1),x(),F()})})},R=()=>{if(!A.currentPickedEl){c.style.display="none";return}c.style.display="",f.disabled=!A.currentPickedEl.parentElement||A.awaitingPick,g&&(g.disabled=A.awaitingPick)},I=()=>{h&&(h.disabled=!u.value.trim()||A.submitting||A.awaitingPick)},K=(N,Z)=>{A.currentCtx=N,A.currentPickedEl=Z,y(N),r(Z),R(),F()};return R(),m.addEventListener("click",()=>{A.completedPicks=[],A.allowSubmit=!1,A.captureType=n,u.value="",U.checked=!1,Q.forEach(N=>N.classList.toggle("ap-sdk-active",N.dataset.apType===A.captureType)),E.style.display="none",x(),yc(),Kt(v,null,""),I(),u.focus()}),f.addEventListener("click",()=>{var Z;const N=(Z=A.currentPickedEl)==null?void 0:Z.parentElement;N&&(K(Md(N),N),t.captureScreenshotFor(N))}),g&&s&&g.addEventListener("click",()=>{if(A.awaitingPick)return;const N=A.currentCtx,Z=A.currentPickedEl,X=A.currentScreenshotBlob,oA=A.screenshotIncluded,hA=A.screenshotError;A.awaitingPick=!0,R(),I(),y(null),t.invalidateInFlightCapture(),A.screenshotCapturing=!1,A.currentScreenshotBlob=null,A.screenshotError=null,t.renderScreenshotUi(),s((OA,de)=>{A.awaitingPick=!1,K(OA,de),t.captureScreenshotFor(de),I()},()=>{A.awaitingPick=!1,Z&&K(N,Z),A.currentScreenshotBlob=X,A.screenshotIncluded=oA,A.screenshotError=hA,t.renderScreenshotUi(),I()})}),h&&o&&(u.addEventListener("input",I),h.addEventListener("click",()=>{const N=u.value.trim();!N||A.awaitingPick||(A.completedPicks.push({ctx:A.currentCtx,instruction:N,screenshotBlob:A.screenshotIncluded?A.currentScreenshotBlob:null}),x(),u.value="",A.awaitingPick=!0,h.disabled=!0,R(),y(null),t.invalidateInFlightCapture(),A.screenshotCapturing=!1,A.currentScreenshotBlob=null,A.screenshotError=null,t.renderScreenshotUi(),F(),o((Z,X)=>{A.awaitingPick=!1,K(Z,X),t.captureScreenshotFor(X),I()}))})),{persistDraft:F,renderPickList:x}}function e_(A,e){A.style.display="block",A.className="ap-sdk-panel__status ap-sdk-panel__status--error",A.innerHTML=`
1769
+ <p>Your session expired.</p>
1770
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-reconnect type="button">Reconnect</button>
1771
+ `;const t=A.querySelector("[data-ap-reconnect]");t.addEventListener("click",()=>T(null,null,function*(){t.disabled=!0,t.textContent="Connecting…";try{yield e()}catch(n){Kt(A,"error",n instanceof Error?n.message:"Could not reconnect — please try again.")}}))}let St=null;function t_(){const A=new Uint32Array(4);return crypto.getRandomValues(A),Array.from(A,e=>e.toString(16)).join("")}function tc(A){if(St){const a=St;a.cleanup(),a.popup.closed||a.popup.close(),St=null}const e=A.replace(/\/+$/,""),t=new URL(e).origin,n=t_(),r=window.location.origin,s=`${e}/oauth/authorize?origin=${encodeURIComponent(r)}&state=${encodeURIComponent(n)}`,o=window.open(s,"ap-sdk-oauth","width=480,height=640");return o?new Promise((a,i)=>{let c=!1;function u(){window.removeEventListener("message",h),clearInterval(f),(St==null?void 0:St.popup)===o&&(St=null)}function h(g){if(g.origin!==t)return;const m=g.data;!m||m.type!=="ap-sdk-oauth"||m.state!==n||!m.code||(c=!0,u(),a({code:m.code}))}window.addEventListener("message",h);const f=window.setInterval(()=>{o.closed&&(u(),c||i(new Error("Connection cancelled.")))},500);St={popup:o,cleanup:u}}):Promise.reject(new Error("Popup blocked — please allow popups for this site and try again."))}const n_="https://agent-platform.tung.engineering",xc="ap-sdk-config";function r_(){try{const A=sessionStorage.getItem(xc);if(!A)return null;const e=JSON.parse(A);return!(e!=null&&e.backendUrl)||!(e!=null&&e.token)||!(e!=null&&e.projectCode)||!(e!=null&&e.expiresAt)?null:new Date(e.expiresAt).getTime()<=Date.now()?(Ph(),null):e}catch(A){return null}}function Ui(A){sessionStorage.setItem(xc,JSON.stringify(A)),o_({backendUrl:A.backendUrl,projectCode:A.projectCode})}function Ph(){sessionStorage.removeItem(xc)}const Kh="ap-sdk-last-connection";function s_(){try{const A=localStorage.getItem(Kh);if(!A)return null;const e=JSON.parse(A);return!(e!=null&&e.backendUrl)||!(e!=null&&e.projectCode)?null:e}catch(A){return null}}function o_(A){try{localStorage.setItem(Kh,JSON.stringify(A))}catch(e){}}let rA=null,jr=null;function Qt(){rA&&pt(rA),rA==null||rA.remove(),rA=null,jr==null||jr(),jr=null}function Sc(A){rA&&Qt(),rA=document.createElement("div"),rA.className="ap-sdk-panel",rA.setAttribute("data-ap-sdk","1"),rA.setAttribute("role","dialog"),rA.setAttribute("aria-modal","true"),rA.setAttribute("aria-label","Connect to Agent Platform");const e=s_();e?t(e):n(n_),document.body.appendChild(rA),dt(rA),jr=Cs(rA,ms);function t(s){if(!rA)return;rA.innerHTML=`
1681
1772
  <div class="ap-sdk-panel__header">
1682
1773
  <span class="ap-sdk-panel__title">
1683
1774
  <span class="ap-sdk-panel__logo">AP</span>
@@ -1687,7 +1778,7 @@ ${n}${r?`
1687
1778
  </div>
1688
1779
  <div class="ap-sdk-panel__body">
1689
1780
  <p class="ap-sdk-config-hint">
1690
- Reconnect to <strong>${As(i.backendUrl)}</strong>. You'll be asked to
1781
+ Reconnect to <strong>${la(s.backendUrl)}</strong>. You'll be asked to
1691
1782
  approve this connection on Agent Platform's own sign-in page.
1692
1783
  </p>
1693
1784
  </div>
@@ -1696,7 +1787,7 @@ ${n}${r?`
1696
1787
  <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-reconnect>Reconnect</button>
1697
1788
  <button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-use-different>Use a different connection</button>
1698
1789
  </div>
1699
- `;const a=X.querySelector("[data-ap-cfg-status]"),d=X.querySelector("[data-ap-reconnect]");X.querySelector("[data-ap-close]").addEventListener("click",()=>{Jt()}),X.querySelector("[data-ap-use-different]").addEventListener("click",()=>r(i.backendUrl)),d.addEventListener("click",()=>z(null,null,function*(){d.disabled=!0,d.textContent="Connecting…",pn(a,null,"");try{const{code:l}=yield Bs(i.backendUrl),{token:p,expiresAt:h}=yield Os({backendUrl:i.backendUrl},l,window.location.origin),g={backendUrl:i.backendUrl,token:p},m=yield ga(g);if(m.length===0){pn(a,"error","No projects found — check your account permissions."),d.disabled=!1,d.textContent="Reconnect";return}const k=m.find(Z=>Z.key===i.projectCode);if(k){Jt(),e({backendUrl:i.backendUrl,token:p,projectCode:k.key,expiresAt:h});return}const w=pa(window.location.href,m),v=w?m.find(Z=>Z.id===w):void 0;v?(Jt(),e({backendUrl:i.backendUrl,token:p,projectCode:v.key,expiresAt:h})):o(i.backendUrl,p,h,m)}catch(l){pn(a,"error",`Could not connect — ${l instanceof Error?l.message:"please try again"}`),d.disabled=!1,d.textContent="Reconnect"}}))}function r(i){if(!X)return;X.innerHTML=`
1790
+ `;const o=rA.querySelector("[data-ap-cfg-status]"),a=rA.querySelector("[data-ap-reconnect]");rA.querySelector("[data-ap-close]").addEventListener("click",()=>{Qt()}),rA.querySelector("[data-ap-use-different]").addEventListener("click",()=>n(s.backendUrl)),a.addEventListener("click",()=>T(null,null,function*(){a.disabled=!0,a.textContent="Connecting…",It(o,null,"");try{const{code:i}=yield tc(s.backendUrl),{token:c,expiresAt:u}=yield Fa({backendUrl:s.backendUrl},i,window.location.origin),h={backendUrl:s.backendUrl,token:c},f=yield $l(h);if(f.length===0){It(o,"error","No projects found — check your account permissions."),a.disabled=!1,a.textContent="Reconnect";return}const g=f.find(U=>U.key===s.projectCode);if(g){Qt(),A({backendUrl:s.backendUrl,token:c,projectCode:g.key,expiresAt:u});return}const m=Kl(window.location.href,f),Q=m?f.find(U=>U.id===m):void 0;Q?(Qt(),A({backendUrl:s.backendUrl,token:c,projectCode:Q.key,expiresAt:u})):r(s.backendUrl,c,u,f)}catch(i){It(o,"error",`Could not connect — ${i instanceof Error?i.message:"please try again"}`),a.disabled=!1,a.textContent="Reconnect"}}))}function n(s){if(!rA)return;rA.innerHTML=`
1700
1791
  <div class="ap-sdk-panel__header">
1701
1792
  <span class="ap-sdk-panel__title">
1702
1793
  <span class="ap-sdk-panel__logo">AP</span>
@@ -1709,7 +1800,7 @@ ${n}${r?`
1709
1800
  <label class="ap-sdk-panel__label" for="ap-sdk-cfg-url">Backend URL</label>
1710
1801
  <input id="ap-sdk-cfg-url" class="ap-sdk-panel__input" type="url"
1711
1802
  placeholder="https://your-platform.example.com"
1712
- value="${Ha(i)}" autocomplete="off" data-ap-cfg-url />
1803
+ value="${rd(s)}" autocomplete="off" data-ap-cfg-url />
1713
1804
  </div>
1714
1805
  <p class="ap-sdk-config-hint">
1715
1806
  You'll be asked to approve this connection on Agent Platform's own sign-in page.
@@ -1720,7 +1811,7 @@ ${n}${r?`
1720
1811
  <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-connect>Connect via Agent Platform</button>
1721
1812
  <button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-cancel>Cancel</button>
1722
1813
  </div>
1723
- `;const a=X.querySelector("[data-ap-cfg-url]"),d=X.querySelector("[data-ap-cfg-status]"),l=X.querySelector("[data-ap-connect]");X.querySelector("[data-ap-close]").addEventListener("click",()=>{Jt()}),X.querySelector("[data-ap-cancel]").addEventListener("click",()=>{Jt()}),l.addEventListener("click",()=>z(null,null,function*(){const p=a.value.trim();if(!p){pn(d,"error","Backend URL is required.");return}l.disabled=!0,l.textContent="Connecting…",pn(d,null,"");try{const{code:h}=yield Bs(p),{token:g,expiresAt:m}=yield Os({backendUrl:p},h,window.location.origin),w=yield ga({backendUrl:p,token:g});if(w.length===0){pn(d,"error","No projects found — check your account permissions."),l.disabled=!1,l.textContent="Connect via Agent Platform";return}const v=pa(window.location.href,w),Z=v?w.find(K=>K.id===v):void 0;if(Z){Jt(),e({backendUrl:p,token:g,projectCode:Z.key,expiresAt:m});return}o(p,g,m,w)}catch(h){pn(d,"error",`Could not connect — ${h instanceof Error?h.message:"please try again"}`),l.disabled=!1,l.textContent="Connect via Agent Platform"}})),setTimeout(()=>a.focus(),50)}function o(i,a,d,l){if(!X)return;const p=l.map(m=>`<option value="${Ha(m.key)}"${m.key===(t==null?void 0:t.projectCode)?" selected":""}>${As(m.name)} (${As(m.key)})</option>`).join("");X.innerHTML=`
1814
+ `;const o=rA.querySelector("[data-ap-cfg-url]"),a=rA.querySelector("[data-ap-cfg-status]"),i=rA.querySelector("[data-ap-connect]");rA.querySelector("[data-ap-close]").addEventListener("click",()=>{Qt()}),rA.querySelector("[data-ap-cancel]").addEventListener("click",()=>{Qt()}),i.addEventListener("click",()=>T(null,null,function*(){const c=o.value.trim();if(!c){It(a,"error","Backend URL is required.");return}i.disabled=!0,i.textContent="Connecting…",It(a,null,"");try{const{code:u}=yield tc(c),{token:h,expiresAt:f}=yield Fa({backendUrl:c},u,window.location.origin),m=yield $l({backendUrl:c,token:h});if(m.length===0){It(a,"error","No projects found — check your account permissions."),i.disabled=!1,i.textContent="Connect via Agent Platform";return}const Q=Kl(window.location.href,m),U=Q?m.find(E=>E.id===Q):void 0;if(U){Qt(),A({backendUrl:c,token:h,projectCode:U.key,expiresAt:f});return}r(c,h,f,m)}catch(u){It(a,"error",`Could not connect — ${u instanceof Error?u.message:"please try again"}`),i.disabled=!1,i.textContent="Connect via Agent Platform"}})),setTimeout(()=>o.focus(),50)}function r(s,o,a,i){if(!rA)return;const c=i.map(f=>`<option value="${rd(f.key)}"${f.key===(e==null?void 0:e.projectCode)?" selected":""}>${la(f.name)} (${la(f.key)})</option>`).join("");rA.innerHTML=`
1724
1815
  <div class="ap-sdk-panel__header">
1725
1816
  <span class="ap-sdk-panel__title">
1726
1817
  <span class="ap-sdk-panel__logo">AP</span>
@@ -1733,7 +1824,7 @@ ${n}${r?`
1733
1824
  <label class="ap-sdk-panel__label" for="ap-sdk-cfg-project">Project</label>
1734
1825
  <select id="ap-sdk-cfg-project" class="ap-sdk-panel__input" data-ap-cfg-project>
1735
1826
  <option value="">Select a project…</option>
1736
- ${p}
1827
+ ${c}
1737
1828
  </select>
1738
1829
  </div>
1739
1830
  </div>
@@ -1742,129 +1833,175 @@ ${n}${r?`
1742
1833
  <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-save>Save</button>
1743
1834
  <button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-back>Back</button>
1744
1835
  </div>
1745
- `;const h=X.querySelector("[data-ap-cfg-project]"),g=X.querySelector("[data-ap-cfg-status]");X.querySelector("[data-ap-close]").addEventListener("click",()=>{Jt()}),X.querySelector("[data-ap-back]").addEventListener("click",()=>r(i)),X.querySelector("[data-ap-save]").addEventListener("click",()=>{const m=h.value;if(!m){pn(g,"error","Please select a project.");return}Jt(),e({backendUrl:i,token:a,projectCode:m,expiresAt:d})})}}function pn(e,t,n){if(!t){e.style.display="none",e.textContent="";return}e.style.display="block",e.className=`ap-sdk-panel__status ap-sdk-panel__status--${t}`,e.textContent=n}function Ha(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function As(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}let W=null,et=null,Vt=null;function jr(){return W!==null}function qr(){W&&en(W),W==null||W.remove(),W=null,Vt==null||Vt(),Vt=null,et==null||et.destroy(),et=null}function xl(e,t,n,r,o,i,a,d,l,p,h=null,g){var an,yt,xe,Te;W&&qr();const m=!n.backendUrl||!n.token,k=ma(h,"tasks:write"),w=ma(h,"planning-sessions:write"),v={captureType:(an=g==null?void 0:g.captureType)!=null?an:!k&&w?"planning":"task",submitting:!1,completedPicks:(yt=g==null?void 0:g.completedPicks)!=null?yt:[],currentCtx:e,currentPickedEl:t,awaitingPick:!1,allowSubmit:(xe=g==null?void 0:g.allowSubmit)!=null?xe:!1};W=document.createElement("div"),W.className="ap-sdk-panel",W.setAttribute("data-ap-sdk","1"),W.setAttribute("role","dialog"),W.setAttribute("aria-modal","true"),W.setAttribute("aria-label","Capture to Agent Platform"),W.innerHTML=`
1836
+ `;const u=rA.querySelector("[data-ap-cfg-project]"),h=rA.querySelector("[data-ap-cfg-status]");rA.querySelector("[data-ap-close]").addEventListener("click",()=>{Qt()}),rA.querySelector("[data-ap-back]").addEventListener("click",()=>n(s)),rA.querySelector("[data-ap-save]").addEventListener("click",()=>{const f=u.value;if(!f){It(h,"error","Please select a project.");return}Qt(),A({backendUrl:s,token:o,projectCode:f,expiresAt:a})})}}function It(A,e,t){if(!e){A.style.display="none",A.textContent="";return}A.style.display="block",A.className=`ap-sdk-panel__status ap-sdk-panel__status--${e}`,A.textContent=t}function rd(A){return A.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function la(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const Ic="ap-sdk-active-automation";function i_(){try{const A=sessionStorage.getItem(Ic);if(!A)return null;const e=JSON.parse(A);return e!=null&&e.taskId&&(e!=null&&e.backendUrl)&&(e!=null&&e.title)?e:null}catch(A){return null}}function Nh(A){try{sessionStorage.setItem(Ic,JSON.stringify(A))}catch(e){}}function zh(){try{sessionStorage.removeItem(Ic)}catch(A){}}function Tc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _n=Tc();function $h(A){_n=A}var cn={exec:()=>null};function zn(A){let e=[];return t=>{let n=Math.max(0,Math.min(3,t-1)),r=e[n];return r||(r=A(n),e[n]=r),r}}function tA(A,e=""){let t=typeof A=="string"?A:A.source,n={replace:(r,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(ne.caret,"$1"),t=t.replace(r,o),n},getRegex:()=>new RegExp(t,e)};return n}var a_=((A="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+A)}catch(e){return!1}})(),ne={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:A=>new RegExp(`^( {0,3}${A})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:zn(A=>new RegExp(`^ {0,${A}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:zn(A=>new RegExp(`^ {0,${A}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:zn(A=>new RegExp(`^ {0,${A}}(?:\`\`\`|~~~)`)),headingBeginRegex:zn(A=>new RegExp(`^ {0,${A}}#`)),htmlBeginRegex:zn(A=>new RegExp(`^ {0,${A}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:zn(A=>new RegExp(`^ {0,${A}}>`))},c_=/^(?:[ \t]*(?:\n|$))+/,l_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,u_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ys=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,d_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Hc=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Gh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Vh=tA(Gh).replace(/bull/g,Hc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),p_=tA(Gh).replace(/bull/g,Hc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Lc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,h_=/^[^\n]+/,Dc=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,f_=tA(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Dc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),g_=tA(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Hc).getRegex(),Ei="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Rc=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,B_=tA("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Rc).replace("tag",Ei).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Zh=A=>tA(Lc).replace("hr",ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",A).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ei).getRegex(),w_=Zh(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),m_=Zh(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),C_=tA(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",m_).getRegex(),Oc={blockquote:C_,code:l_,def:f_,fences:u_,heading:d_,hr:ys,html:B_,lheading:Vh,list:g_,newline:c_,paragraph:w_,table:cn,text:h_},sd=tA("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ei).getRegex(),b_=$(k({},Oc),{lheading:p_,table:sd,paragraph:tA(Lc).replace("hr",ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",sd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ei).getRegex()}),Q_=$(k({},Oc),{html:tA(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Rc).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:tA(Lc).replace("hr",ys).replace("heading",` *#{1,6} *[^
1837
+ ]`).replace("lheading",Vh).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),y_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,U_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xh=/^( {2,}|\\)\n(?!\s*$)/,E_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ft=/[\p{P}\p{S}]/u,hr=/[\s\p{P}\p{S}]/u,Us=/[^\s\p{P}\p{S}]/u,F_=tA(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,hr).getRegex(),k_=/[\p{Pi}\p{Ps}"']/u,Wh=/(?!~)[\p{P}\p{S}]/u,v_=/(?!~)[\s\p{P}\p{S}]/u,__=/(?:[^\s\p{P}\p{S}]|~)/u,x_=tA(/link|precode-code|html/,"g").replace("link",new RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)")).replace("precode-",a_?"(?<!`)()":"(^^|[^`])").replace("code",new RegExp("(?<b>`+)[^`]+\\k<b>(?!`)")).replace("html",/<(?! )[^<>]*?>/).getRegex(),Jh=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,S_=tA(Jh,"u").replace(/punct/g,Ft).getRegex(),I_=tA(Jh,"u").replace(/punct/g,Wh).getRegex(),T_=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,H_=tA(T_,"u").replace(/openQuote/g,k_).replace(/punct/g,Ft).getRegex(),jh="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",L_=tA(jh,"gu").replace(/notPunctSpace/g,Us).replace(/punctSpace/g,hr).replace(/punct/g,Ft).getRegex(),D_=tA(jh,"gu").replace(/notPunctSpace/g,__).replace(/punctSpace/g,v_).replace(/punct/g,Wh).getRegex(),R_="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",O_=tA(R_,"gu").replace(/notPunctSpace/g,Us).replace(/punctSpace/g,hr).replace(/punct/g,Ft).getRegex(),M_=tA("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Us).replace(/punctSpace/g,hr).replace(/punct/g,Ft).getRegex(),P_="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",K_=tA(P_,"gu").replace(/notPunctSpace/g,Us).replace(/punctSpace/g,hr).replace(/punct/g,Ft).getRegex(),N_=tA(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Ft).getRegex(),z_="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",$_=tA(z_,"gu").replace(/notPunctSpace/g,Us).replace(/punctSpace/g,hr).replace(/punct/g,Ft).getRegex(),G_=tA(/\\(punct)/,"gu").replace(/punct/g,Ft).getRegex(),V_=tA(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Z_=tA(Rc).replace("(?:-->|$)","-->").getRegex(),X_=tA("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Z_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,W_=tA(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",jo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Yh=tA(/^!?\[(label)\]\[(ref)\]/).replace("label",jo).replace("ref",Dc).getRegex(),qh=tA(/^!?\[(ref)\](?:\[\])?/).replace("ref",Dc).getRegex(),J_=tA("reflink|nolink(?!\\()","g").replace("reflink",Yh).replace("nolink",qh).getRegex(),od=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mc={_backpedal:cn,anyPunctuation:G_,autolink:V_,blockSkip:x_,br:Xh,code:U_,del:cn,delLDelim:cn,delRDelim:cn,emStrongLDelim:S_,emStrongRDelimAst:L_,emStrongRDelimUnd:M_,escape:y_,link:W_,nolink:qh,punctuation:F_,reflink:Yh,reflinkSearch:J_,tag:X_,text:E_,url:cn},j_=$(k({},Mc),{emStrongLDelim:H_,emStrongRDelimAst:O_,emStrongRDelimUnd:K_,link:tA(/^!?\[(label)\]\((.*?)\)/).replace("label",jo).getRegex(),reflink:tA(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jo).getRegex()}),nc=$(k({},Mc),{emStrongRDelimAst:D_,emStrongLDelim:I_,delLDelim:N_,delRDelim:$_,url:tA(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",od).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:tA(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",od).getRegex()}),Y_=$(k({},nc),{br:tA(Xh).replace("{2,}","*").getRegex(),text:tA(nc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),fo={normal:Oc,gfm:b_,pedantic:Q_},Dr={normal:Mc,gfm:nc,breaks:Y_,pedantic:j_},q_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},id=A=>q_[A];function rt(A,e){if(e){if(ne.escapeTest.test(A))return A.replace(ne.escapeReplace,id)}else if(ne.escapeTestNoEncode.test(A))return A.replace(ne.escapeReplaceNoEncode,id);return A}function ad(A){try{A=encodeURI(A).replace(ne.percentDecode,"%")}catch(e){return null}return A}function cd(A,e){var s;let t=A.replace(ne.findPipe,(o,a,i)=>{let c=!1,u=a;for(;--u>=0&&i[u]==="\\";)c=!c;return c?"|":" |"}),n=t.split(ne.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!((s=n.at(-1))!=null&&s.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(ne.slashPipe,"|");return n}function Tt(A,e,t){let n=A.length;if(n===0)return"";let r=0;for(;r<n&&A.charAt(n-r-1)===e;)r++;return A.slice(0,n-r)}function ld(A){let e=A.split(`
1838
+ `),t=e.length-1;for(;t>=0&&ne.blankLine.test(e[t]);)t--;return e.length-t<=2?A:e.slice(0,t+1).join(`
1839
+ `)}function Ax(A,e){if(A.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<A.length;n++)if(A[n]==="\\")n++;else if(A[n]===e[0])t++;else if(A[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}function ex(A,e=0){let t=e,n="";for(let r of A)if(r===" "){let s=4-t%4;n+=" ".repeat(s),t+=s}else n+=r,t++;return n}function ud(A,e,t,n,r){let s=e.href,o=e.title||null,a=A[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let i={type:A[0].charAt(0)==="!"?"image":"link",raw:t,href:s,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,i}function tx(A,e,t){let n=A.match(t.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(`
1840
+ `).map(s=>{let o=s.match(t.other.beginningSpace);if(o===null)return s;let[a]=o;return a.length>=r.length?s.slice(r.length):s}).join(`
1841
+ `)}var Yo=class{constructor(A){dA(this,"options");dA(this,"rules");dA(this,"lexer");this.options=A||_n}space(A){let e=this.rules.block.newline.exec(A);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(A){let e=this.rules.block.code.exec(A);if(e){let t=this.options.pedantic?e[0]:ld(e[0]),n=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:n}}}fences(A){let e=this.rules.block.fences.exec(A);if(e){let t=e[0],n=tx(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(A){let e=this.rules.block.heading.exec(A);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let n=Tt(t,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(t=n.trim())}return{type:"heading",raw:Tt(e[0],`
1842
+ `),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(A){let e=this.rules.block.hr.exec(A);if(e)return{type:"hr",raw:Tt(e[0],`
1843
+ `)}}blockquote(A){let e=this.rules.block.blockquote.exec(A);if(e){let t=Tt(e[0],`
1844
+ `).split(`
1845
+ `),n="",r="",s=[];for(;t.length>0;){let o=!1,a=[],i;for(i=0;i<t.length;i++)if(this.rules.other.blockquoteStart.test(t[i]))a.push(t[i]),o=!0;else if(!o)a.push(t[i]);else break;t=t.slice(i);let c=a.join(`
1846
+ `),u=c.replace(this.rules.other.blockquoteSetextReplace,`
1847
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
1848
+ ${c}`:c,r=r?`${r}
1849
+ ${u}`:u;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,s,!0),this.lexer.state.top=h,t.length===0)break;let f=s.at(-1);if((f==null?void 0:f.type)==="code")break;if((f==null?void 0:f.type)==="blockquote"){let g=f,m=t.join(`
1850
+ `),Q=g.raw+`
1851
+ `+m.replace(this.rules.other.blockquoteSetextReplace2,""),U=this.blockquote(Q);s[s.length-1]=U,n=`${n}
1852
+ ${m}`,r=r.substring(0,r.length-g.text.length)+U.text;break}else if((f==null?void 0:f.type)==="list"){let g=f,m=g.raw+`
1853
+ `+t.join(`
1854
+ `),Q=this.list(m);s[s.length-1]=Q,n=n.substring(0,n.length-f.raw.length)+Q.raw,r=r.substring(0,r.length-g.raw.length)+Q.raw,t=m.substring(s.at(-1).raw.length).split(`
1855
+ `);continue}}return{type:"blockquote",raw:n,tokens:s,text:r}}}list(A){let e=this.rules.block.list.exec(A);if(e){let t=e[1].trim(),n=t.length>1,r={type:"list",raw:"",ordered:n,start:n?+t.slice(0,-1):"",loose:!1,items:[]};t=n?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=n?t:"[*+-]");let s=this.rules.other.listItemRegex(t),o=!1;for(;A;){let i=!1,c="",u="";if(!(e=s.exec(A))||this.rules.block.hr.test(A))break;c=e[0],A=A.substring(c.length);let h=ex(e[2].split(`
1856
+ `,1)[0],e[1].length),f=A.split(`
1857
+ `,1)[0],g=!h.trim(),m=0;if(this.options.pedantic?(m=2,u=h.trimStart()):g?m=e[1].length+1:(m=h.search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=h.slice(m),m+=e[1].length),g&&this.rules.other.blankLine.test(f)&&(c+=f+`
1858
+ `,A=A.substring(f.length+1),i=!0),!i){let Q=this.rules.other.nextBulletRegex(m),U=this.rules.other.hrRegex(m),E=this.rules.other.fencesBeginRegex(m),v=this.rules.other.headingBeginRegex(m),F=this.rules.other.htmlBeginRegex(m),y=this.rules.other.blockquoteBeginRegex(m);for(;A;){let x=A.split(`
1859
+ `,1)[0],R;if(f=x,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),R=f):R=f.replace(this.rules.other.tabCharGlobal," "),E.test(f)||v.test(f)||F.test(f)||y.test(f)||Q.test(f)||U.test(f))break;if(R.search(this.rules.other.nonSpaceChar)>=m||!f.trim())u+=`
1860
+ `+R.slice(m);else{if(g||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(h)||v.test(h)||U.test(h))break;u+=`
1861
+ `+f}g=!f.trim(),c+=x+`
1862
+ `,A=A.substring(x.length+1),h=R.slice(m)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),r.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(u),loose:!1,text:u,tokens:[]}),r.raw+=c}let a=r.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let i of r.items){this.lexer.state.top=!1,i.tokens=this.lexer.blockTokens(i.text,[]);let c=i.tokens[0];if(i.task&&((c==null?void 0:c.type)==="text"||(c==null?void 0:c.type)==="paragraph")){i.text=i.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}let u=this.rules.other.listTaskCheckbox.exec(i.raw);if(u){let h={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};i.checked=h.checked,r.loose?i.tokens[0]&&["paragraph","text"].includes(i.tokens[0].type)&&"tokens"in i.tokens[0]&&i.tokens[0].tokens?(i.tokens[0].raw=h.raw+i.tokens[0].raw,i.tokens[0].text=h.raw+i.tokens[0].text,i.tokens[0].tokens.unshift(h)):i.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):i.tokens.unshift(h)}}else i.task&&(i.task=!1);if(!r.loose){let u=i.tokens.filter(f=>f.type==="space"),h=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));r.loose=h}}if(r.loose)for(let i of r.items){i.loose=!0;for(let c of i.tokens)c.type==="text"&&(c.type="paragraph")}return r}}html(A){let e=this.rules.block.html.exec(A);if(e){let t=ld(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(A){let e=this.rules.block.def.exec(A);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:Tt(e[0],`
1863
+ `),href:n,title:r}}}table(A){var o;let e=this.rules.block.table.exec(A);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=cd(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
1864
+ `):[],s={type:"table",raw:Tt(e[0],`
1865
+ `),header:[],align:[],rows:[]};if(t.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<t.length;a++)s.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:s.align[a]});for(let a of r)s.rows.push(cd(a,s.header.length).map((i,c)=>({text:i,tokens:this.lexer.inline(i),header:!1,align:s.align[c]})));return s}}lheading(A){let e=this.rules.block.lheading.exec(A);if(e){let t=e[1].trim();return{type:"heading",raw:Tt(e[0],`
1866
+ `),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(A){let e=this.rules.block.paragraph.exec(A);if(e){let t=e[1].charAt(e[1].length-1)===`
1867
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(A){let e=this.rules.block.text.exec(A);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(A){let e=this.rules.inline.escape.exec(A);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(A){let e=this.rules.inline.tag.exec(A);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(A){let e=this.rules.inline.link.exec(A);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let s=Tt(t.slice(0,-1),"\\");if((t.length-s.length)%2===0)return}else{let s=Ax(e[2],"()");if(s===-2)return;if(s>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let n=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(n);s&&(n=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?n=n.slice(1):n=n.slice(1,-1)),ud(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(A,e){let t;if((t=this.rules.inline.reflink.exec(A))||(t=this.rules.inline.nolink.exec(A))){let n=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[n.toLowerCase()];if(!r){let s=t[0].charAt(0);return{type:"text",raw:s,text:s}}return ud(t,r,t[0],this.lexer,this.rules)}}emStrong(A,e,t=""){let n=this.rules.inline.emStrongLDelim.exec(A);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!t||this.rules.inline.punctuation.exec(t))){let r=[...n[0]].length-1,s,o,a=r,i=0,c=n[0][0],u=t===c,h=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*A.length+r);(n=h.exec(e))!==null;){if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!s)continue;if(o=[...s].length,n[3]||n[4]){a+=o;continue}else if(n[5]||n[6]){if(r%3&&!((r+o)%3)){i+=o;continue}if(u)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+i);let f=[...n[0]][0].length,g=A.slice(0,r+n.index+f+o);if(Math.min(r,o)%2){let Q=g.slice(1,-1);return{type:"em",raw:g,text:Q,tokens:this.lexer.inlineTokens(Q)}}let m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(A){let e=this.rules.inline.code.exec(A);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return n&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(A){let e=this.rules.inline.br.exec(A);if(e)return{type:"br",raw:e[0]}}del(A,e,t=""){let n=this.rules.inline.delLDelim.exec(A);if(n&&(!n[1]||!t||this.rules.inline.punctuation.exec(t))){let r=[...n[0]].length-1,s,o,a=r,i=this.rules.inline.delRDelim;for(i.lastIndex=0,e=e.slice(-1*A.length+r);(n=i.exec(e))!==null;){if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!s||(o=[...s].length,o!==r))continue;if(n[3]||n[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...n[0]][0].length,u=A.slice(0,r+n.index+c+o),h=u.slice(r,-r);return{type:"del",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(A){let e=this.rules.inline.autolink.exec(A);if(e){let t,n;return e[2]==="@"?(t=e[1],n="mailto:"+t):(t=e[1],n=t),{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}url(A){var t,n;let e;if(e=this.rules.inline.url.exec(A)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let o;do o=e[0],e[0]=(n=(t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])!=null?n:"";while(o!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(A){let e=this.rules.inline.text.exec(A);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},Ve=class rc{constructor(e){dA(this,"tokens");dA(this,"options");dA(this,"state");dA(this,"inlineQueue");dA(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_n,this.options.tokenizer=this.options.tokenizer||new Yo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:ne,block:fo.normal,inline:Dr.normal};this.options.pedantic?(t.block=fo.pedantic,t.inline=Dr.pedantic):this.options.gfm&&(t.block=fo.gfm,this.options.breaks?t.inline=Dr.breaks:t.inline=Dr.gfm),this.tokenizer.rules=t}static get rules(){return{block:fo,inline:Dr}}static lex(e,t){return new rc(t).lex(e)}static lexInline(e,t){return new rc(t).inlineTokens(e)}lex(e){e=e.replace(ne.carriageReturn,`
1868
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var s,o,a;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(ne.tabCharGlobal," ").replace(ne.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if((o=(s=this.options.extensions)==null?void 0:s.block)!=null&&o.some(u=>(i=u.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let u=t.at(-1);i.raw.length===1&&u!==void 0?u.raw+=`
1869
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let u=t.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
1870
+ `)?"":`
1871
+ `)+i.raw,u.text+=`
1872
+ `+i.text,this.inlineQueue.at(-1).src=u.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let u=t.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
1873
+ `)?"":`
1874
+ `)+i.raw,u.text+=`
1875
+ `+i.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let c=e;if((a=this.options.extensions)!=null&&a.startBlock){let u=1/0,h=e.slice(1),f;this.options.extensions.startBlock.forEach(g=>{f=g.call({lexer:this},h),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(this.state.top&&(i=this.tokenizer.paragraph(c))){let u=t.at(-1);n&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(`
1876
+ `)?"":`
1877
+ `)+i.raw,u.text+=`
1878
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(i),n=c.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let u=t.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
1879
+ `)?"":`
1880
+ `)+i.raw,u.text+=`
1881
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var a,i,c,u,h,f;this.tokenizer.lexer=this;let n=e;if(this.tokens.links){let g=Object.keys(this.tokens.links);g.length>0&&(n=n.replace(this.tokenizer.rules.inline.reflinkSearch,m=>g.includes(m.slice(m.lastIndexOf("[")+1,-1))?"["+"a".repeat(m.length-2)+"]":m))}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),n=n.replace(this.tokenizer.rules.inline.blockSkip,(g,m,Q)=>{let U=Q?Q.length:0;return g.slice(0,U)+"["+"a".repeat(g.length-U-2)+"]"}),n=(c=(i=(a=this.options.hooks)==null?void 0:a.emStrongMask)==null?void 0:i.call({lexer:this},n))!=null?c:n;let r=!1,s="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(s=""),r=!1;let g;if((h=(u=this.options.extensions)==null?void 0:u.inline)!=null&&h.some(Q=>(g=Q.call({lexer:this},e,t))?(e=e.substring(g.raw.length),t.push(g),!0):!1))continue;if(g=this.tokenizer.escape(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.tag(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.link(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(g.raw.length);let Q=t.at(-1);g.type==="text"&&(Q==null?void 0:Q.type)==="text"?(Q.raw+=g.raw,Q.text+=g.text):t.push(g);continue}if(g=this.tokenizer.emStrong(e,n,s)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.codespan(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.br(e)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.del(e,n,s)){e=e.substring(g.raw.length),t.push(g);continue}if(g=this.tokenizer.autolink(e)){e=e.substring(g.raw.length),t.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(e))){e=e.substring(g.raw.length),t.push(g);continue}let m=e;if((f=this.options.extensions)!=null&&f.startInline){let Q=1/0,U=e.slice(1),E;this.options.extensions.startInline.forEach(v=>{E=v.call({lexer:this},U),typeof E=="number"&&E>=0&&(Q=Math.min(Q,E))}),Q<1/0&&Q>=0&&(m=e.substring(0,Q+1))}if(g=this.tokenizer.inlineText(m)){e=e.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(s=g.raw.slice(-1)),r=!0;let Q=t.at(-1);(Q==null?void 0:Q.type)==="text"?(Q.raw+=g.raw,Q.text+=g.text):t.push(g);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},qo=class{constructor(A){dA(this,"options");dA(this,"parser");this.options=A||_n}space(A){return""}code({text:A,lang:e,escaped:t}){var s;let n=(s=(e||"").match(ne.notSpaceStart))==null?void 0:s[0],r=A.replace(ne.endingNewline,"")+`
1882
+ `;return n?'<pre><code class="language-'+rt(n)+'">'+(t?r:rt(r,!0))+`</code></pre>
1883
+ `:"<pre><code>"+(t?r:rt(r,!0))+`</code></pre>
1884
+ `}blockquote({tokens:A}){return`<blockquote>
1885
+ ${this.parser.parse(A)}</blockquote>
1886
+ `}html({text:A}){return A}def(A){return""}heading({tokens:A,depth:e}){return`<h${e}>${this.parser.parseInline(A)}</h${e}>
1887
+ `}hr(A){return`<hr>
1888
+ `}list(A){let e=A.ordered,t=A.start,n="";for(let o=0;o<A.items.length;o++){let a=A.items[o];n+=this.listitem(a)}let r=e?"ol":"ul",s=e&&t!==1?' start="'+t+'"':"";return"<"+r+s+`>
1889
+ `+n+"</"+r+`>
1890
+ `}listitem(A){return`<li>${this.parser.parse(A.tokens)}</li>
1891
+ `}checkbox({checked:A}){return"<input "+(A?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:A}){return`<p>${this.parser.parseInline(A)}</p>
1892
+ `}table(A){let e="",t="";for(let r=0;r<A.header.length;r++)t+=this.tablecell(A.header[r]);e+=this.tablerow({text:t});let n="";for(let r=0;r<A.rows.length;r++){let s=A.rows[r];t="";for(let o=0;o<s.length;o++)t+=this.tablecell(s[o]);n+=this.tablerow({text:t})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
1893
+ <thead>
1894
+ `+e+`</thead>
1895
+ `+n+`</table>
1896
+ `}tablerow({text:A}){return`<tr>
1897
+ ${A}</tr>
1898
+ `}tablecell(A){let e=this.parser.parseInline(A.tokens),t=A.header?"th":"td";return(A.align?`<${t} align="${A.align}">`:`<${t}>`)+e+`</${t}>
1899
+ `}strong({tokens:A}){return`<strong>${this.parser.parseInline(A)}</strong>`}em({tokens:A}){return`<em>${this.parser.parseInline(A)}</em>`}codespan({text:A}){return`<code>${rt(A,!0)}</code>`}br(A){return"<br>"}del({tokens:A}){return`<del>${this.parser.parseInline(A)}</del>`}link({href:A,title:e,tokens:t}){let n=this.parser.parseInline(t),r=ad(A);if(r===null)return n;A=r;let s='<a href="'+A+'"';return e&&(s+=' title="'+rt(e)+'"'),s+=">"+n+"</a>",s}image({href:A,title:e,text:t,tokens:n}){n&&(t=this.parser.parseInline(n,this.parser.textRenderer));let r=ad(A);if(r===null)return rt(t);A=r;let s=`<img src="${A}" alt="${rt(t)}"`;return e&&(s+=` title="${rt(e)}"`),s+=">",s}text(A){return"tokens"in A&&A.tokens?this.parser.parseInline(A.tokens):"escaped"in A&&A.escaped?A.text:rt(A.text)}},Pc=class{strong({text:A}){return A}em({text:A}){return A}codespan({text:A}){return A}del({text:A}){return A}html({text:A}){return A}text({text:A}){return A}link({text:A}){return""+A}image({text:A}){return""+A}br(){return""}checkbox({raw:A}){return A}},Ze=class sc{constructor(e){dA(this,"options");dA(this,"renderer");dA(this,"textRenderer");this.options=e||_n,this.options.renderer=this.options.renderer||new qo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Pc}static parse(e,t){return new sc(t).parse(e)}static parseInline(e,t){return new sc(t).parseInline(e)}parse(e){var n,r;this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let o=e[s];if((r=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&r[o.type]){let i=o,c=this.options.extensions.renderers[i.type].call({parser:this},i);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(i.type)){t+=c||"";continue}}let a=o;switch(a.type){case"space":{t+=this.renderer.space(a);break}case"hr":{t+=this.renderer.hr(a);break}case"heading":{t+=this.renderer.heading(a);break}case"code":{t+=this.renderer.code(a);break}case"table":{t+=this.renderer.table(a);break}case"blockquote":{t+=this.renderer.blockquote(a);break}case"list":{t+=this.renderer.list(a);break}case"checkbox":{t+=this.renderer.checkbox(a);break}case"html":{t+=this.renderer.html(a);break}case"def":{t+=this.renderer.def(a);break}case"paragraph":{t+=this.renderer.paragraph(a);break}case"text":{t+=this.renderer.text(a);break}default:{let i='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return t}parseInline(e,t=this.renderer){var r,s;this.renderer.parser=this;let n="";for(let o=0;o<e.length;o++){let a=e[o];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(a.type)){n+=c||"";continue}}let i=a;switch(i.type){case"escape":{n+=t.text(i);break}case"html":{n+=t.html(i);break}case"link":{n+=t.link(i);break}case"image":{n+=t.image(i);break}case"checkbox":{n+=t.checkbox(i);break}case"strong":{n+=t.strong(i);break}case"em":{n+=t.em(i);break}case"codespan":{n+=t.codespan(i);break}case"br":{n+=t.br(i);break}case"del":{n+=t.del(i);break}case"text":{n+=t.text(i);break}default:{let c='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}},Co,Yr=(Co=class{constructor(A){dA(this,"options");dA(this,"block");this.options=A||_n}preprocess(A){return A}postprocess(A){return A}processAllTokens(A){return A}emStrongMask(A){return A}provideLexer(A=this.block){return A?Ve.lex:Ve.lexInline}provideParser(A=this.block){return A?Ze.parse:Ze.parseInline}},dA(Co,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),dA(Co,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Co),nx=class{constructor(...A){dA(this,"defaults",Tc());dA(this,"options",this.setOptions);dA(this,"parse",this.parseMarkdown(!0));dA(this,"parseInline",this.parseMarkdown(!1));dA(this,"Parser",Ze);dA(this,"Renderer",qo);dA(this,"TextRenderer",Pc);dA(this,"Lexer",Ve);dA(this,"Tokenizer",Yo);dA(this,"Hooks",Yr);this.use(...A)}walkTokens(A,e){var n,r;let t=[];for(let s of A)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let o=s;for(let a of o.header)t=t.concat(this.walkTokens(a.tokens,e));for(let a of o.rows)for(let i of a)t=t.concat(this.walkTokens(i.tokens,e));break}case"list":{let o=s;t=t.concat(this.walkTokens(o.items,e));break}default:{let o=s;(r=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&r[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{let i=o[a].flat(1/0);t=t.concat(this.walkTokens(i,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...A){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return A.forEach(t=>{let n=k({},t);if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=e.renderers[r.name];s?e.renderers[r.name]=function(...o){let a=r.renderer.apply(this,o);return a===!1&&(a=s.apply(this,o)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[r.level];s?s.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),n.extensions=e),t.renderer){let r=this.defaults.renderer||new qo(this.defaults);for(let s in t.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,a=t.renderer[o],i=r[o];r[o]=(...c)=>{let u=a.apply(r,c);return u===!1&&(u=i.apply(r,c)),u||""}}n.renderer=r}if(t.tokenizer){let r=this.defaults.tokenizer||new Yo(this.defaults);for(let s in t.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,a=t.tokenizer[o],i=r[o];r[o]=(...c)=>{let u=a.apply(r,c);return u===!1&&(u=i.apply(r,c)),u}}n.tokenizer=r}if(t.hooks){let r=this.defaults.hooks||new Yr;for(let s in t.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,a=t.hooks[o],i=r[o];Yr.passThroughHooks.has(s)?r[o]=c=>{if(this.defaults.async&&Yr.passThroughHooksRespectAsync.has(s))return T(this,null,function*(){let h=yield a.call(r,c);return i.call(r,h)});let u=a.call(r,c);return i.call(r,u)}:r[o]=(...c)=>{if(this.defaults.async)return T(this,null,function*(){let h=yield a.apply(r,c);return h===!1&&(h=yield i.apply(r,c)),h});let u=a.apply(r,c);return u===!1&&(u=i.apply(r,c)),u}}n.hooks=r}if(t.walkTokens){let r=this.defaults.walkTokens,s=t.walkTokens;n.walkTokens=function(o){let a=[];return a.push(s.call(this,o)),r&&(a=a.concat(r.call(this,o))),a}}this.defaults=k(k({},this.defaults),n)}),this}setOptions(A){return this.defaults=k(k({},this.defaults),A),this}lexer(A,e){return Ve.lex(A,e!=null?e:this.defaults)}parser(A,e){return Ze.parse(A,e!=null?e:this.defaults)}parseMarkdown(A){return(e,t)=>{let n=k({},t),r=k(k({},this.defaults),n),s=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&n.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=A),r.async)return T(this,null,function*(){let o=r.hooks?yield r.hooks.preprocess(e):e,a=yield(r.hooks?yield r.hooks.provideLexer(A):A?Ve.lex:Ve.lexInline)(o,r),i=r.hooks?yield r.hooks.processAllTokens(a):a;r.walkTokens&&(yield Promise.all(this.walkTokens(i,r.walkTokens)));let c=yield(r.hooks?yield r.hooks.provideParser(A):A?Ze.parse:Ze.parseInline)(i,r);return r.hooks?yield r.hooks.postprocess(c):c}).catch(s);try{r.hooks&&(e=r.hooks.preprocess(e));let o=(r.hooks?r.hooks.provideLexer(A):A?Ve.lex:Ve.lexInline)(e,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let a=(r.hooks?r.hooks.provideParser(A):A?Ze.parse:Ze.parseInline)(o,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(o){return s(o)}}}onError(A,e){return t=>{if(t.message+=`
1900
+ Please report this to https://github.com/markedjs/marked.`,A){let n="<p>An error occurred:</p><pre>"+rt(t.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(t);throw t}}},Qn=new nx;function pA(A,e){return Qn.parse(A,e)}pA.options=pA.setOptions=function(A){return Qn.setOptions(A),pA.defaults=Qn.defaults,$h(pA.defaults),pA};pA.getDefaults=Tc;pA.defaults=_n;function rx(...A){return Qn.use(...A),pA.defaults=Qn.defaults,$h(pA.defaults),pA}pA.use=rx;pA.walkTokens=function(A,e){return Qn.walkTokens(A,e)};pA.parseInline=Qn.parseInline;pA.Parser=Ze;pA.parser=Ze.parse;pA.Renderer=qo;pA.TextRenderer=Pc;pA.Lexer=Ve;pA.lexer=Ve.lex;pA.Tokenizer=Yo;pA.Hooks=Yr;pA.parse=pA;pA.options;pA.setOptions;pA.walkTokens;pA.parseInline;Ze.parse;Ve.lex;/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:Af,setPrototypeOf:dd,isFrozen:sx,getPrototypeOf:ox,getOwnPropertyDescriptor:ix}=Object;let{freeze:le,seal:Le,create:oc}=Object,{apply:ic,construct:ac}=typeof Reflect!="undefined"&&Reflect;le||(le=function(e){return e});Le||(Le=function(e){return e});ic||(ic=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];return e.apply(t,r)});ac||(ac=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const go=ue(Array.prototype.forEach),ax=ue(Array.prototype.lastIndexOf),pd=ue(Array.prototype.pop),Rr=ue(Array.prototype.push),cx=ue(Array.prototype.splice),Fo=ue(String.prototype.toLowerCase),ua=ue(String.prototype.toString),da=ue(String.prototype.match),Or=ue(String.prototype.replace),lx=ue(String.prototype.indexOf),ux=ue(String.prototype.trim),$e=ue(Object.prototype.hasOwnProperty),oe=ue(RegExp.prototype.test),Mr=dx(TypeError);function ue(A){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ic(A,e,n)}}function dx(A){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ac(A,t)}}function eA(A,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fo;dd&&dd(A,null);let n=e.length;for(;n--;){let r=e[n];if(typeof r=="string"){const s=t(r);s!==r&&(sx(e)||(e[n]=s),r=s)}A[r]=!0}return A}function px(A){for(let e=0;e<A.length;e++)$e(A,e)||(A[e]=null);return A}function st(A){const e=oc(null);for(const[t,n]of Af(A))$e(A,t)&&(Array.isArray(n)?e[t]=px(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=st(n):e[t]=n);return e}function Pr(A,e){for(;A!==null;){const n=ix(A,e);if(n){if(n.get)return ue(n.get);if(typeof n.value=="function")return ue(n.value)}A=ox(A)}function t(){return null}return t}const hd=le(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),pa=le(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ha=le(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),hx=le(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fa=le(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),fx=le(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fd=le(["#text"]),gd=le(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ga=le(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Bd=le(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Bo=le(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),gx=Le(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Bx=Le(/<%[\w\W]*|[\w\W]*%>/gm),wx=Le(/\$\{[\w\W]*/gm),mx=Le(/^data-[\-\w.\u00B7-\uFFFF]+$/),Cx=Le(/^aria-[\-\w]+$/),ef=Le(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bx=Le(/^(?:\w+script|data):/i),Qx=Le(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tf=Le(/^html$/i),yx=Le(/^[a-z][.\w]*(-[.\w]+)+$/i);var wd=Object.freeze({__proto__:null,ARIA_ATTR:Cx,ATTR_WHITESPACE:Qx,CUSTOM_ELEMENT:yx,DATA_ATTR:mx,DOCTYPE_NAME:tf,ERB_EXPR:Bx,IS_ALLOWED_URI:ef,IS_SCRIPT_OR_DATA:bx,MUSTACHE_EXPR:gx,TMPLIT_EXPR:wx});const Kr={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ux=function(){return typeof window=="undefined"?null:window},Ex=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch(o){return console.warn("TrustedTypes policy "+s+" could not be created."),null}},md=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function nf(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ux();const e=G=>nf(G);if(e.version="3.3.1",e.removed=[],!A||!A.document||A.document.nodeType!==Kr.document||!A.Element)return e.isSupported=!1,e;let{document:t}=A;const n=t,r=n.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:a,Element:i,NodeFilter:c,NamedNodeMap:u=A.NamedNodeMap||A.MozNamedAttrMap,HTMLFormElement:h,DOMParser:f,trustedTypes:g}=A,m=i.prototype,Q=Pr(m,"cloneNode"),U=Pr(m,"remove"),E=Pr(m,"nextSibling"),v=Pr(m,"childNodes"),F=Pr(m,"parentNode");if(typeof o=="function"){const G=t.createElement("template");G.content&&G.content.ownerDocument&&(t=G.content.ownerDocument)}let y,x="";const{implementation:R,createNodeIterator:I,createDocumentFragment:K,getElementsByTagName:N}=t,{importNode:Z}=n;let X=md();e.isSupported=typeof Af=="function"&&typeof F=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:oA,ERB_EXPR:hA,TMPLIT_EXPR:OA,DATA_ATTR:de,ARIA_ATTR:re,IS_SCRIPT_OR_DATA:Re,ATTR_WHITESPACE:xn,CUSTOM_ELEMENT:gr}=wd;let{IS_ALLOWED_URI:qe}=wd,mA=null;const At=eA({},[...hd,...pa,...ha,...fa,...fd]);let fA=null;const Wt=eA({},[...gd,...ga,...Bd,...Bo]);let gA=Object.seal(oc(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),qA=null,Jt=null;const Oe=Object.seal(oc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let _A=!0,TA=!0,jt=!1,kt=!0,KA=!1,et=!0,be=!1,Qe=!1,gt=!1,xA=!1,tt=!1,Yt=!1,Es=!0,Br=!1;const ki="user-content-";let wr=!0,qt=!1,vt={},se=null;const mr=eA({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let BA=null;const Fs=eA({},["audio","video","img","source","image","track"]);let Cr=null;const ks=eA({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Sn="http://www.w3.org/1998/Math/MathML",In="http://www.w3.org/2000/svg",Me="http://www.w3.org/1999/xhtml";let _t=Me,An=!1,en=null;const vi=eA({},[Sn,In,Me],ua);let Tn=eA({},["mi","mo","mn","ms","mtext"]),Hn=eA({},["annotation-xml"]);const _i=eA({},["title","style","font","a","script"]);let Bt=null;const Pe=["application/xhtml+xml","text/html"],xi="text/html";let wA=null,xt=null;const vs=t.createElement("form"),br=function(b){return b instanceof RegExp||b instanceof Function},Ln=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(xt&&xt===b)){if((!b||typeof b!="object")&&(b={}),b=st(b),Bt=Pe.indexOf(b.PARSER_MEDIA_TYPE)===-1?xi:b.PARSER_MEDIA_TYPE,wA=Bt==="application/xhtml+xml"?ua:Fo,mA=$e(b,"ALLOWED_TAGS")?eA({},b.ALLOWED_TAGS,wA):At,fA=$e(b,"ALLOWED_ATTR")?eA({},b.ALLOWED_ATTR,wA):Wt,en=$e(b,"ALLOWED_NAMESPACES")?eA({},b.ALLOWED_NAMESPACES,ua):vi,Cr=$e(b,"ADD_URI_SAFE_ATTR")?eA(st(ks),b.ADD_URI_SAFE_ATTR,wA):ks,BA=$e(b,"ADD_DATA_URI_TAGS")?eA(st(Fs),b.ADD_DATA_URI_TAGS,wA):Fs,se=$e(b,"FORBID_CONTENTS")?eA({},b.FORBID_CONTENTS,wA):mr,qA=$e(b,"FORBID_TAGS")?eA({},b.FORBID_TAGS,wA):st({}),Jt=$e(b,"FORBID_ATTR")?eA({},b.FORBID_ATTR,wA):st({}),vt=$e(b,"USE_PROFILES")?b.USE_PROFILES:!1,_A=b.ALLOW_ARIA_ATTR!==!1,TA=b.ALLOW_DATA_ATTR!==!1,jt=b.ALLOW_UNKNOWN_PROTOCOLS||!1,kt=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,KA=b.SAFE_FOR_TEMPLATES||!1,et=b.SAFE_FOR_XML!==!1,be=b.WHOLE_DOCUMENT||!1,xA=b.RETURN_DOM||!1,tt=b.RETURN_DOM_FRAGMENT||!1,Yt=b.RETURN_TRUSTED_TYPE||!1,gt=b.FORCE_BODY||!1,Es=b.SANITIZE_DOM!==!1,Br=b.SANITIZE_NAMED_PROPS||!1,wr=b.KEEP_CONTENT!==!1,qt=b.IN_PLACE||!1,qe=b.ALLOWED_URI_REGEXP||ef,_t=b.NAMESPACE||Me,Tn=b.MATHML_TEXT_INTEGRATION_POINTS||Tn,Hn=b.HTML_INTEGRATION_POINTS||Hn,gA=b.CUSTOM_ELEMENT_HANDLING||{},b.CUSTOM_ELEMENT_HANDLING&&br(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(gA.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&br(b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(gA.attributeNameCheck=b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(gA.allowCustomizedBuiltInElements=b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),KA&&(TA=!1),tt&&(xA=!0),vt&&(mA=eA({},fd),fA=[],vt.html===!0&&(eA(mA,hd),eA(fA,gd)),vt.svg===!0&&(eA(mA,pa),eA(fA,ga),eA(fA,Bo)),vt.svgFilters===!0&&(eA(mA,ha),eA(fA,ga),eA(fA,Bo)),vt.mathMl===!0&&(eA(mA,fa),eA(fA,Bd),eA(fA,Bo))),b.ADD_TAGS&&(typeof b.ADD_TAGS=="function"?Oe.tagCheck=b.ADD_TAGS:(mA===At&&(mA=st(mA)),eA(mA,b.ADD_TAGS,wA))),b.ADD_ATTR&&(typeof b.ADD_ATTR=="function"?Oe.attributeCheck=b.ADD_ATTR:(fA===Wt&&(fA=st(fA)),eA(fA,b.ADD_ATTR,wA))),b.ADD_URI_SAFE_ATTR&&eA(Cr,b.ADD_URI_SAFE_ATTR,wA),b.FORBID_CONTENTS&&(se===mr&&(se=st(se)),eA(se,b.FORBID_CONTENTS,wA)),b.ADD_FORBID_CONTENTS&&(se===mr&&(se=st(se)),eA(se,b.ADD_FORBID_CONTENTS,wA)),wr&&(mA["#text"]=!0),be&&eA(mA,["html","head","body"]),mA.table&&(eA(mA,["tbody"]),delete qA.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Mr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Mr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=b.TRUSTED_TYPES_POLICY,x=y.createHTML("")}else y===void 0&&(y=Ex(g,r)),y!==null&&typeof x=="string"&&(x=y.createHTML(""));le&&le(b),xt=b}},Qr=eA({},[...pa,...ha,...hx]),_s=eA({},[...fa,...fx]),Si=function(b){let H=F(b);(!H||!H.tagName)&&(H={namespaceURI:_t,tagName:"template"});const M=Fo(b.tagName),uA=Fo(H.tagName);return en[b.namespaceURI]?b.namespaceURI===In?H.namespaceURI===Me?M==="svg":H.namespaceURI===Sn?M==="svg"&&(uA==="annotation-xml"||Tn[uA]):!!Qr[M]:b.namespaceURI===Sn?H.namespaceURI===Me?M==="math":H.namespaceURI===In?M==="math"&&Hn[uA]:!!_s[M]:b.namespaceURI===Me?H.namespaceURI===In&&!Hn[uA]||H.namespaceURI===Sn&&!Tn[uA]?!1:!_s[M]&&(_i[M]||!Qr[M]):!!(Bt==="application/xhtml+xml"&&en[b.namespaceURI]):!1},ye=function(b){Rr(e.removed,{element:b});try{F(b).removeChild(b)}catch(H){U(b)}},Ue=function(b,H){try{Rr(e.removed,{attribute:H.getAttributeNode(b),from:H})}catch(M){Rr(e.removed,{attribute:null,from:H})}if(H.removeAttribute(b),b==="is")if(xA||tt)try{ye(H)}catch(M){}else try{H.setAttribute(b,"")}catch(M){}},xs=function(b){let H=null,M=null;if(gt)b="<remove></remove>"+b;else{const SA=da(b,/^[\r\n\t ]+/);M=SA&&SA[0]}Bt==="application/xhtml+xml"&&_t===Me&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const uA=y?y.createHTML(b):b;if(_t===Me)try{H=new f().parseFromString(uA,Bt)}catch(SA){}if(!H||!H.documentElement){H=R.createDocument(_t,"template",null);try{H.documentElement.innerHTML=An?x:uA}catch(SA){}}const ZA=H.body||H.documentElement;return b&&M&&ZA.insertBefore(t.createTextNode(M),ZA.childNodes[0]||null),_t===Me?N.call(H,be?"html":"body")[0]:be?H.documentElement:ZA},yr=function(b){return I.call(b.ownerDocument||b,b,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ur=function(b){return b instanceof h&&(typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||!(b.attributes instanceof u)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function")},Ss=function(b){return typeof a=="function"&&b instanceof a};function Ke(G,b,H){go(G,M=>{M.call(e,b,H,xt)})}const Is=function(b){let H=null;if(Ke(X.beforeSanitizeElements,b,null),Ur(b))return ye(b),!0;const M=wA(b.nodeName);if(Ke(X.uponSanitizeElement,b,{tagName:M,allowedTags:mA}),et&&b.hasChildNodes()&&!Ss(b.firstElementChild)&&oe(/<[/\w!]/g,b.innerHTML)&&oe(/<[/\w!]/g,b.textContent)||b.nodeType===Kr.progressingInstruction||et&&b.nodeType===Kr.comment&&oe(/<[/\w]/g,b.data))return ye(b),!0;if(!(Oe.tagCheck instanceof Function&&Oe.tagCheck(M))&&(!mA[M]||qA[M])){if(!qA[M]&&Hs(M)&&(gA.tagNameCheck instanceof RegExp&&oe(gA.tagNameCheck,M)||gA.tagNameCheck instanceof Function&&gA.tagNameCheck(M)))return!1;if(wr&&!se[M]){const uA=F(b)||b.parentNode,ZA=v(b)||b.childNodes;if(ZA&&uA){const SA=ZA.length;for(let Ae=SA-1;Ae>=0;--Ae){const Ne=Q(ZA[Ae],!0);Ne.__removalCount=(b.__removalCount||0)+1,uA.insertBefore(Ne,E(b))}}}return ye(b),!0}return b instanceof i&&!Si(b)||(M==="noscript"||M==="noembed"||M==="noframes")&&oe(/<\/no(script|embed|frames)/i,b.innerHTML)?(ye(b),!0):(KA&&b.nodeType===Kr.text&&(H=b.textContent,go([oA,hA,OA],uA=>{H=Or(H,uA," ")}),b.textContent!==H&&(Rr(e.removed,{element:b.cloneNode()}),b.textContent=H)),Ke(X.afterSanitizeElements,b,null),!1)},Ts=function(b,H,M){if(Es&&(H==="id"||H==="name")&&(M in t||M in vs))return!1;if(!(TA&&!Jt[H]&&oe(de,H))){if(!(_A&&oe(re,H))){if(!(Oe.attributeCheck instanceof Function&&Oe.attributeCheck(H,b))){if(!fA[H]||Jt[H]){if(!(Hs(b)&&(gA.tagNameCheck instanceof RegExp&&oe(gA.tagNameCheck,b)||gA.tagNameCheck instanceof Function&&gA.tagNameCheck(b))&&(gA.attributeNameCheck instanceof RegExp&&oe(gA.attributeNameCheck,H)||gA.attributeNameCheck instanceof Function&&gA.attributeNameCheck(H,b))||H==="is"&&gA.allowCustomizedBuiltInElements&&(gA.tagNameCheck instanceof RegExp&&oe(gA.tagNameCheck,M)||gA.tagNameCheck instanceof Function&&gA.tagNameCheck(M))))return!1}else if(!Cr[H]){if(!oe(qe,Or(M,xn,""))){if(!((H==="src"||H==="xlink:href"||H==="href")&&b!=="script"&&lx(M,"data:")===0&&BA[b])){if(!(jt&&!oe(Re,Or(M,xn,"")))){if(M)return!1}}}}}}}return!0},Hs=function(b){return b!=="annotation-xml"&&da(b,gr)},Er=function(b){Ke(X.beforeSanitizeAttributes,b,null);const{attributes:H}=b;if(!H||Ur(b))return;const M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:fA,forceKeepAttr:void 0};let uA=H.length;for(;uA--;){const ZA=H[uA],{name:SA,namespaceURI:Ae,value:Ne}=ZA,nt=wA(SA),Fr=Ne;let NA=SA==="value"?Fr:ux(Fr);if(M.attrName=nt,M.attrValue=NA,M.keepAttr=!0,M.forceKeepAttr=void 0,Ke(X.uponSanitizeAttribute,b,M),NA=M.attrValue,Br&&(nt==="id"||nt==="name")&&(Ue(SA,b),NA=ki+NA),et&&oe(/((--!?|])>)|<\/(style|title|textarea)/i,NA)){Ue(SA,b);continue}if(nt==="attributename"&&da(NA,"href")){Ue(SA,b);continue}if(M.forceKeepAttr)continue;if(!M.keepAttr){Ue(SA,b);continue}if(!kt&&oe(/\/>/i,NA)){Ue(SA,b);continue}KA&&go([oA,hA,OA],Ds=>{NA=Or(NA,Ds," ")});const Ls=wA(b.nodeName);if(!Ts(Ls,nt,NA)){Ue(SA,b);continue}if(y&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Ae)switch(g.getAttributeType(Ls,nt)){case"TrustedHTML":{NA=y.createHTML(NA);break}case"TrustedScriptURL":{NA=y.createScriptURL(NA);break}}if(NA!==Fr)try{Ae?b.setAttributeNS(Ae,SA,NA):b.setAttribute(SA,NA),Ur(b)?ye(b):pd(e.removed)}catch(Ds){Ue(SA,b)}}Ke(X.afterSanitizeAttributes,b,null)},wt=function G(b){let H=null;const M=yr(b);for(Ke(X.beforeSanitizeShadowDOM,b,null);H=M.nextNode();)Ke(X.uponSanitizeShadowNode,H,null),Is(H),Er(H),H.content instanceof s&&G(H.content);Ke(X.afterSanitizeShadowDOM,b,null)};return e.sanitize=function(G){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H=null,M=null,uA=null,ZA=null;if(An=!G,An&&(G="<!-->"),typeof G!="string"&&!Ss(G))if(typeof G.toString=="function"){if(G=G.toString(),typeof G!="string")throw Mr("dirty is not a string, aborting")}else throw Mr("toString is not a function");if(!e.isSupported)return G;if(Qe||Ln(b),e.removed=[],typeof G=="string"&&(qt=!1),qt){if(G.nodeName){const Ne=wA(G.nodeName);if(!mA[Ne]||qA[Ne])throw Mr("root node is forbidden and cannot be sanitized in-place")}}else if(G instanceof a)H=xs("<!---->"),M=H.ownerDocument.importNode(G,!0),M.nodeType===Kr.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?H=M:H.appendChild(M);else{if(!xA&&!KA&&!be&&G.indexOf("<")===-1)return y&&Yt?y.createHTML(G):G;if(H=xs(G),!H)return xA?null:Yt?x:""}H&&gt&&ye(H.firstChild);const SA=yr(qt?G:H);for(;uA=SA.nextNode();)Is(uA),Er(uA),uA.content instanceof s&&wt(uA.content);if(qt)return G;if(xA){if(tt)for(ZA=K.call(H.ownerDocument);H.firstChild;)ZA.appendChild(H.firstChild);else ZA=H;return(fA.shadowroot||fA.shadowrootmode)&&(ZA=Z.call(n,ZA,!0)),ZA}let Ae=be?H.outerHTML:H.innerHTML;return be&&mA["!doctype"]&&H.ownerDocument&&H.ownerDocument.doctype&&H.ownerDocument.doctype.name&&oe(tf,H.ownerDocument.doctype.name)&&(Ae="<!DOCTYPE "+H.ownerDocument.doctype.name+`>
1901
+ `+Ae),KA&&go([oA,hA,OA],Ne=>{Ae=Or(Ae,Ne," ")}),y&&Yt?y.createHTML(Ae):Ae},e.setConfig=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ln(G),Qe=!0},e.clearConfig=function(){xt=null,Qe=!1},e.isValidAttribute=function(G,b,H){xt||Ln({});const M=wA(G),uA=wA(b);return Ts(M,uA,H)},e.addHook=function(G,b){typeof b=="function"&&Rr(X[G],b)},e.removeHook=function(G,b){if(b!==void 0){const H=ax(X[G],b);return H===-1?void 0:cx(X[G],H,1)[0]}return pd(X[G])},e.removeHooks=function(G){X[G]=[]},e.removeAllHooks=function(){X=md()},e}var Fx=nf();function rf(A){const e=pA.parse(A,{gfm:!0,breaks:!0,async:!1});return Fx.sanitize(e)}function kx(A){return T(this,null,function*(){var s;try{(s=A.focus)==null||s.call(A)}catch(o){}A.scrollIntoView({block:"center",inline:"center",behavior:"instant"});let e=A.getBoundingClientRect();e.width===0&&e.height===0&&(yield vx(),e=A.getBoundingClientRect());const t=e.left+e.width/2,n=e.top+e.height/2,r={bubbles:!0,cancelable:!0,clientX:t,clientY:n};typeof PointerEvent=="function"&&A.dispatchEvent(new PointerEvent("pointerdown",r)),A.dispatchEvent(new MouseEvent("mousedown",r)),typeof PointerEvent=="function"&&A.dispatchEvent(new PointerEvent("pointerup",r)),A.dispatchEvent(new MouseEvent("mouseup",r)),A.click()})}function vx(){return new Promise(A=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>A()):setTimeout(A,16)})}function _x(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var Ba={exports:{}};/*!
1902
+ * Pusher JavaScript Library v8.5.0
1903
+ * https://pusher.com/
1904
+ *
1905
+ * Copyright 2020, Pusher
1906
+ * Released under the MIT licence.
1907
+ */var Cd;function xx(){return Cd||(Cd=1,(function(A,e){(function(n,r){A.exports=r()})(self,()=>(()=>{var t={594(o,a){var i=this&&this.__extends||(function(){var v=function(F,y){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,R){x.__proto__=R}||function(x,R){for(var I in R)R.hasOwnProperty(I)&&(x[I]=R[I])},v(F,y)};return function(F,y){v(F,y);function x(){this.constructor=F}F.prototype=y===null?Object.create(y):(x.prototype=y.prototype,new x)}})();Object.defineProperty(a,"__esModule",{value:!0});var c=256,u=(function(){function v(F){F===void 0&&(F="="),this._paddingCharacter=F}return v.prototype.encodedLength=function(F){return this._paddingCharacter?(F+2)/3*4|0:(F*8+5)/6|0},v.prototype.encode=function(F){for(var y="",x=0;x<F.length-2;x+=3){var R=F[x]<<16|F[x+1]<<8|F[x+2];y+=this._encodeByte(R>>>18&63),y+=this._encodeByte(R>>>12&63),y+=this._encodeByte(R>>>6&63),y+=this._encodeByte(R>>>0&63)}var I=F.length-x;if(I>0){var R=F[x]<<16|(I===2?F[x+1]<<8:0);y+=this._encodeByte(R>>>18&63),y+=this._encodeByte(R>>>12&63),I===2?y+=this._encodeByte(R>>>6&63):y+=this._paddingCharacter||"",y+=this._paddingCharacter||""}return y},v.prototype.maxDecodedLength=function(F){return this._paddingCharacter?F/4*3|0:(F*6+7)/8|0},v.prototype.decodedLength=function(F){return this.maxDecodedLength(F.length-this._getPaddingLength(F))},v.prototype.decode=function(F){if(F.length===0)return new Uint8Array(0);for(var y=this._getPaddingLength(F),x=F.length-y,R=new Uint8Array(this.maxDecodedLength(x)),I=0,K=0,N=0,Z=0,X=0,oA=0,hA=0;K<x-4;K+=4)Z=this._decodeChar(F.charCodeAt(K+0)),X=this._decodeChar(F.charCodeAt(K+1)),oA=this._decodeChar(F.charCodeAt(K+2)),hA=this._decodeChar(F.charCodeAt(K+3)),R[I++]=Z<<2|X>>>4,R[I++]=X<<4|oA>>>2,R[I++]=oA<<6|hA,N|=Z&c,N|=X&c,N|=oA&c,N|=hA&c;if(K<x-1&&(Z=this._decodeChar(F.charCodeAt(K)),X=this._decodeChar(F.charCodeAt(K+1)),R[I++]=Z<<2|X>>>4,N|=Z&c,N|=X&c),K<x-2&&(oA=this._decodeChar(F.charCodeAt(K+2)),R[I++]=X<<4|oA>>>2,N|=oA&c),K<x-3&&(hA=this._decodeChar(F.charCodeAt(K+3)),R[I++]=oA<<6|hA,N|=hA&c),N!==0)throw new Error("Base64Coder: incorrect characters for decoding");return R},v.prototype._encodeByte=function(F){var y=F;return y+=65,y+=25-F>>>8&6,y+=51-F>>>8&-75,y+=61-F>>>8&-15,y+=62-F>>>8&3,String.fromCharCode(y)},v.prototype._decodeChar=function(F){var y=c;return y+=(42-F&F-44)>>>8&-c+F-43+62,y+=(46-F&F-48)>>>8&-c+F-47+63,y+=(47-F&F-58)>>>8&-c+F-48+52,y+=(64-F&F-91)>>>8&-c+F-65+0,y+=(96-F&F-123)>>>8&-c+F-97+26,y},v.prototype._getPaddingLength=function(F){var y=0;if(this._paddingCharacter){for(var x=F.length-1;x>=0&&F[x]===this._paddingCharacter;x--)y++;if(F.length<4||y>2)throw new Error("Base64Coder: incorrect padding")}return y},v})();a.Coder=u;var h=new u;function f(v){return h.encode(v)}a.encode=f;function g(v){return h.decode(v)}a.decode=g;var m=(function(v){i(F,v);function F(){return v!==null&&v.apply(this,arguments)||this}return F.prototype._encodeByte=function(y){var x=y;return x+=65,x+=25-y>>>8&6,x+=51-y>>>8&-75,x+=61-y>>>8&-13,x+=62-y>>>8&49,String.fromCharCode(x)},F.prototype._decodeChar=function(y){var x=c;return x+=(44-y&y-46)>>>8&-c+y-45+62,x+=(94-y&y-96)>>>8&-c+y-95+63,x+=(47-y&y-58)>>>8&-c+y-48+52,x+=(64-y&y-91)>>>8&-c+y-65+0,x+=(96-y&y-123)>>>8&-c+y-97+26,x},F})(u);a.URLSafeCoder=m;var Q=new m;function U(v){return Q.encode(v)}a.encodeURLSafe=U;function E(v){return Q.decode(v)}a.decodeURLSafe=E,a.encodedLength=function(v){return h.encodedLength(v)},a.maxDecodedLength=function(v){return h.maxDecodedLength(v)},a.decodedLength=function(v){return h.decodedLength(v)}},978(o,a){var i="utf8: invalid source encoding";function c(u){for(var h=[],f=0;f<u.length;f++){var g=u[f];if(g&128){var m=void 0;if(g<224){if(f>=u.length)throw new Error(i);var Q=u[++f];if((Q&192)!==128)throw new Error(i);g=(g&31)<<6|Q&63,m=128}else if(g<240){if(f>=u.length-1)throw new Error(i);var Q=u[++f],U=u[++f];if((Q&192)!==128||(U&192)!==128)throw new Error(i);g=(g&15)<<12|(Q&63)<<6|U&63,m=2048}else if(g<248){if(f>=u.length-2)throw new Error(i);var Q=u[++f],U=u[++f],E=u[++f];if((Q&192)!==128||(U&192)!==128||(E&192)!==128)throw new Error(i);g=(g&15)<<18|(Q&63)<<12|(U&63)<<6|E&63,m=65536}else throw new Error(i);if(g<m||g>=55296&&g<=57343)throw new Error(i);if(g>=65536){if(g>1114111)throw new Error(i);g-=65536,h.push(String.fromCharCode(55296|g>>10)),g=56320|g&1023}}h.push(String.fromCharCode(g))}return h.join("")}a.D4=c},721(o,a,i){o.exports=i(207).default},207(o,a,i){i.d(a,{default:()=>Ms});class c{constructor(l,d){this.lastId=0,this.prefix=l,this.name=d}create(l){this.lastId++;var d=this.lastId,B=this.prefix+d,C=this.name+"["+d+"]",S=!1,D=function(){S||(l.apply(null,arguments),S=!0)};return this[d]=D,{number:d,id:B,name:C,callback:D}}remove(l){delete this[l.number]}}var u=new c("_pusher_script_","Pusher.ScriptReceivers"),h={VERSION:"8.5.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""};const f=h;class g{constructor(l){this.options=l,this.receivers=l.receivers||u,this.loading={}}load(l,d,B){var C=this;if(C.loading[l]&&C.loading[l].length>0)C.loading[l].push(B);else{C.loading[l]=[B];var S=q.createScriptRequest(C.getPath(l,d)),D=C.receivers.create(function(z){if(C.receivers.remove(D),C.loading[l]){var Y=C.loading[l];delete C.loading[l];for(var sA=function(MA){MA||S.cleanup()},cA=0;cA<Y.length;cA++)Y[cA](z,sA)}});S.send(D)}}getRoot(l){var d,B=q.getDocument().location.protocol;return l&&l.useTLS||B==="https:"?d=this.options.cdn_https:d=this.options.cdn_http,d.replace(/\/*$/,"")+"/"+this.options.version}getPath(l,d){return this.getRoot(d)+"/"+l+this.options.suffix+".js"}}var m=new c("_pusher_dependencies","Pusher.DependenciesReceivers"),Q=new g({cdn_http:f.cdn_http,cdn_https:f.cdn_https,version:f.VERSION,suffix:f.dependency_suffix,receivers:m});const U={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},v={buildLogSuffix:function(p){const l="See:",d=U.urls[p];if(!d)return"";let B;return d.fullUrl?B=d.fullUrl:d.path&&(B=U.baseUrl+d.path),B?`${l} ${B}`:""}};var F;(function(p){p.UserAuthentication="user-authentication",p.ChannelAuthorization="channel-authorization"})(F||(F={}));class y extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class x extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class R extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class I extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class K extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class N extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class Z extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class X extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class oA extends Error{constructor(l,d){super(d),this.status=l,Object.setPrototypeOf(this,new.target.prototype)}}const OA=function(p,l,d,B,C){const S=q.createXHR();S.open("POST",d.endpoint,!0),S.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var D in d.headers)S.setRequestHeader(D,d.headers[D]);if(d.headersProvider!=null){let z=d.headersProvider();for(var D in z)S.setRequestHeader(D,z[D])}return S.onreadystatechange=function(){if(S.readyState===4)if(S.status===200){let z,Y=!1;try{z=JSON.parse(S.responseText),Y=!0}catch(sA){C(new oA(200,`JSON returned from ${B.toString()} endpoint was invalid, yet status code was 200. Data was: ${S.responseText}`),null)}Y&&C(null,z)}else{let z="";switch(B){case F.UserAuthentication:z=v.buildLogSuffix("authenticationEndpoint");break;case F.ChannelAuthorization:z=`Clients must be authorized to join private or presence channels. ${v.buildLogSuffix("authorizationEndpoint")}`;break}C(new oA(S.status,`Unable to retrieve auth string from ${B.toString()} endpoint - received status: ${S.status} from ${d.endpoint}. ${z}`),null)}},S.send(l),S};function de(p){return mA(gr(p))}var re=String.fromCharCode,Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xn=function(p){var l=p.charCodeAt(0);return l<128?p:l<2048?re(192|l>>>6)+re(128|l&63):re(224|l>>>12&15)+re(128|l>>>6&63)+re(128|l&63)},gr=function(p){return p.replace(/[^\x00-\x7F]/g,xn)},qe=function(p){var l=[0,2,1][p.length%3],d=p.charCodeAt(0)<<16|(p.length>1?p.charCodeAt(1):0)<<8|(p.length>2?p.charCodeAt(2):0),B=[Re.charAt(d>>>18),Re.charAt(d>>>12&63),l>=2?"=":Re.charAt(d>>>6&63),l>=1?"=":Re.charAt(d&63)];return B.join("")},mA=window.btoa||function(p){return p.replace(/[\s\S]{1,3}/g,qe)};class At{constructor(l,d,B,C){this.clear=d,this.timer=l(()=>{this.timer&&(this.timer=C(this.timer))},B)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}const fA=At;function Wt(p){window.clearTimeout(p)}function gA(p){window.clearInterval(p)}class qA extends fA{constructor(l,d){super(setTimeout,Wt,l,function(B){return d(),null})}}class Jt extends fA{constructor(l,d){super(setInterval,gA,l,function(B){return d(),B})}}var Oe={now(){return Date.now?Date.now():new Date().valueOf()},defer(p){return new qA(0,p)},method(p,...l){var d=Array.prototype.slice.call(arguments,1);return function(B){return B[p].apply(B,d.concat(arguments))}}};const _A=Oe;function TA(p,...l){for(var d=0;d<l.length;d++){var B=l[d];for(var C in B)B[C]&&B[C].constructor&&B[C].constructor===Object?p[C]=TA(p[C]||{},B[C]):p[C]=B[C]}return p}function jt(){for(var p=["Pusher"],l=0;l<arguments.length;l++)typeof arguments[l]=="string"?p.push(arguments[l]):p.push(se(arguments[l]));return p.join(" : ")}function kt(p,l){var d=Array.prototype.indexOf;if(p===null)return-1;if(d&&p.indexOf===d)return p.indexOf(l);for(var B=0,C=p.length;B<C;B++)if(p[B]===l)return B;return-1}function KA(p,l){for(var d in p)Object.prototype.hasOwnProperty.call(p,d)&&l(p[d],d,p)}function et(p){var l=[];return KA(p,function(d,B){l.push(B)}),l}function be(p){var l=[];return KA(p,function(d){l.push(d)}),l}function Qe(p,l,d){for(var B=0;B<p.length;B++)l.call(d||window,p[B],B,p)}function gt(p,l){for(var d=[],B=0;B<p.length;B++)d.push(l(p[B],B,p,d));return d}function xA(p,l){var d={};return KA(p,function(B,C){d[C]=l(B)}),d}function tt(p,l){l=l||function(C){return!!C};for(var d=[],B=0;B<p.length;B++)l(p[B],B,p,d)&&d.push(p[B]);return d}function Yt(p,l){var d={};return KA(p,function(B,C){(l&&l(B,C,p,d)||B)&&(d[C]=B)}),d}function Es(p){var l=[];return KA(p,function(d,B){l.push([B,d])}),l}function Br(p,l){for(var d=0;d<p.length;d++)if(l(p[d],d,p))return!0;return!1}function ki(p,l){for(var d=0;d<p.length;d++)if(!l(p[d],d,p))return!1;return!0}function wr(p){return xA(p,function(l){return typeof l=="object"&&(l=se(l)),encodeURIComponent(de(l.toString()))})}function qt(p){var l=Yt(p,function(B){return B!==void 0}),d=gt(Es(wr(l)),_A.method("join","=")).join("&");return d}function vt(p){var l=[],d=[];return(function B(C,S){var D,z,Y;switch(typeof C){case"object":if(!C)return null;for(D=0;D<l.length;D+=1)if(l[D]===C)return{$ref:d[D]};if(l.push(C),d.push(S),Object.prototype.toString.apply(C)==="[object Array]")for(Y=[],D=0;D<C.length;D+=1)Y[D]=B(C[D],S+"["+D+"]");else{Y={};for(z in C)Object.prototype.hasOwnProperty.call(C,z)&&(Y[z]=B(C[z],S+"["+JSON.stringify(z)+"]"))}return Y;case"number":case"string":case"boolean":return C}})(p,"$")}function se(p){try{return JSON.stringify(p)}catch(l){return JSON.stringify(vt(p))}}class mr{constructor(){this.globalLog=l=>{window.console&&window.console.log&&window.console.log(l)}}debug(...l){this.log(this.globalLog,l)}warn(...l){this.log(this.globalLogWarn,l)}error(...l){this.log(this.globalLogError,l)}globalLogWarn(l){window.console&&window.console.warn?window.console.warn(l):this.globalLog(l)}globalLogError(l){window.console&&window.console.error?window.console.error(l):this.globalLogWarn(l)}log(l,...d){var B=jt.apply(this,arguments);Ms.log?Ms.log(B):Ms.logToConsole&&l.bind(this)(B)}}const BA=new mr;var Fs=function(p,l,d,B,C){(d.headers!==void 0||d.headersProvider!=null)&&BA.warn(`To send headers with the ${B.toString()} request, you must use AJAX, rather than JSONP.`);var S=p.nextAuthCallbackID.toString();p.nextAuthCallbackID++;var D=p.getDocument(),z=D.createElement("script");p.auth_callbacks[S]=function(cA){C(null,cA)};var Y="Pusher.auth_callbacks['"+S+"']";z.src=d.endpoint+"?callback="+encodeURIComponent(Y)+"&"+l;var sA=D.getElementsByTagName("head")[0]||D.documentElement;sA.insertBefore(z,sA.firstChild)};const Cr=Fs;class ks{constructor(l){this.src=l}send(l){var d=this,B="Error loading "+d.src;d.script=document.createElement("script"),d.script.id=l.id,d.script.src=d.src,d.script.type="text/javascript",d.script.charset="UTF-8",d.script.addEventListener?(d.script.onerror=function(){l.callback(B)},d.script.onload=function(){l.callback(null)}):d.script.onreadystatechange=function(){(d.script.readyState==="loaded"||d.script.readyState==="complete")&&l.callback(null)},d.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(d.errorScript=document.createElement("script"),d.errorScript.id=l.id+"_error",d.errorScript.text=l.name+"('"+B+"');",d.script.async=d.errorScript.async=!1):d.script.async=!0;var C=document.getElementsByTagName("head")[0];C.insertBefore(d.script,C.firstChild),d.errorScript&&C.insertBefore(d.errorScript,d.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Sn{constructor(l,d){this.url=l,this.data=d}send(l){if(!this.request){var d=qt(this.data),B=this.url+"/"+l.number+"?"+d;this.request=q.createScriptRequest(B),this.request.send(l)}}cleanup(){this.request&&this.request.cleanup()}}var In=function(p,l){return function(d,B){var C="http"+(l?"s":"")+"://",S=C+(p.host||p.options.host)+p.options.path,D=q.createJSONPRequest(S,d),z=q.ScriptReceivers.create(function(Y,sA){u.remove(z),D.cleanup(),sA&&sA.host&&(p.host=sA.host),B&&B(Y,sA)});D.send(z)}},Me={name:"jsonp",getAgent:In};const _t=Me;function An(p,l,d){var B=p+(l.useTLS?"s":""),C=l.useTLS?l.hostTLS:l.hostNonTLS;return B+"://"+C+d}function en(p,l){var d="/app/"+p,B="?protocol="+f.PROTOCOL+"&client=js&version="+f.VERSION+(l?"&"+l:"");return d+B}var vi={getInitial:function(p,l){var d=(l.httpPath||"")+en(p,"flash=false");return An("ws",l,d)}},Tn={getInitial:function(p,l){var d=(l.httpPath||"/pusher")+en(p);return An("http",l,d)}},Hn={getInitial:function(p,l){return An("http",l,l.httpPath||"/pusher")},getPath:function(p,l){return en(p)}};class _i{constructor(){this._callbacks={}}get(l){return this._callbacks[Bt(l)]}add(l,d,B){var C=Bt(l);this._callbacks[C]=this._callbacks[C]||[],this._callbacks[C].push({fn:d,context:B})}remove(l,d,B){if(!l&&!d&&!B){this._callbacks={};return}var C=l?[Bt(l)]:et(this._callbacks);d||B?this.removeCallback(C,d,B):this.removeAllCallbacks(C)}removeCallback(l,d,B){Qe(l,function(C){this._callbacks[C]=tt(this._callbacks[C]||[],function(S){return d&&d!==S.fn||B&&B!==S.context}),this._callbacks[C].length===0&&delete this._callbacks[C]},this)}removeAllCallbacks(l){Qe(l,function(d){delete this._callbacks[d]},this)}}function Bt(p){return"_"+p}class Pe{constructor(l){this.callbacks=new _i,this.global_callbacks=[],this.failThrough=l}bind(l,d,B){return this.callbacks.add(l,d,B),this}bind_global(l){return this.global_callbacks.push(l),this}unbind(l,d,B){return this.callbacks.remove(l,d,B),this}unbind_global(l){return l?(this.global_callbacks=tt(this.global_callbacks||[],d=>d!==l),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(l,d,B){for(var C=0;C<this.global_callbacks.length;C++)this.global_callbacks[C](l,d);var S=this.callbacks.get(l),D=[];if(B?D.push(d,B):d&&D.push(d),S&&S.length>0)for(var C=0;C<S.length;C++)S[C].fn.apply(S[C].context||window,D);else this.failThrough&&this.failThrough(l,d);return this}}class xi extends Pe{constructor(l,d,B,C,S){super(),this.initialize=q.transportConnectionInitializer,this.hooks=l,this.name=d,this.priority=B,this.key=C,this.options=S,this.state="new",this.timeline=S.timeline,this.activityTimeout=S.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var l=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(l,this.options)}catch(d){return _A.defer(()=>{this.onError(d),this.changeState("closed")}),!1}return this.bindListeners(),BA.debug("Connecting",{transport:this.name,url:l}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(l){return this.state==="open"?(_A.defer(()=>{this.socket&&this.socket.send(l)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(l){this.emit("error",{type:"WebSocketError",error:l}),this.timeline.error(this.buildTimelineMessage({error:l.toString()}))}onClose(l){l?this.changeState("closed",{code:l.code,reason:l.reason,wasClean:l.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(l){this.emit("message",l)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=l=>{this.onError(l)},this.socket.onclose=l=>{this.onClose(l)},this.socket.onmessage=l=>{this.onMessage(l)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(l,d){this.state=l,this.timeline.info(this.buildTimelineMessage({state:l,params:d})),this.emit(l,d)}buildTimelineMessage(l){return TA({cid:this.id},l)}}class wA{constructor(l){this.hooks=l}isSupported(l){return this.hooks.isSupported(l)}createConnection(l,d,B,C){return new xi(this.hooks,l,d,B,C)}}var xt=new wA({urls:vi,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!q.getWebSocketAPI()},isSupported:function(){return!!q.getWebSocketAPI()},getSocket:function(p){return q.createWebSocket(p)}}),vs={urls:Tn,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},br=TA({getSocket:function(p){return q.HTTPFactory.createStreamingSocket(p)}},vs),Ln=TA({getSocket:function(p){return q.HTTPFactory.createPollingSocket(p)}},vs),Qr={isSupported:function(){return q.isXHRSupported()}},_s=new wA(TA({},br,Qr)),Si=new wA(TA({},Ln,Qr)),ye={ws:xt,xhr_streaming:_s,xhr_polling:Si};const Ue=ye;var xs=new wA({file:"sockjs",urls:Hn,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(p,l){return new window.SockJS(p,null,{js_path:Q.getPath("sockjs",{useTLS:l.useTLS}),ignore_null_origin:l.ignoreNullOrigin})},beforeOpen:function(p,l){p.send(JSON.stringify({path:l}))}}),yr={isSupported:function(p){var l=q.isXDRSupported(p.useTLS);return l}},Ur=new wA(TA({},br,yr)),Ss=new wA(TA({},Ln,yr));Ue.xdr_streaming=Ur,Ue.xdr_polling=Ss,Ue.sockjs=xs;const Ke=Ue;class Is extends Pe{constructor(){super();var l=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){l.emit("online")},!1),window.addEventListener("offline",function(){l.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Ts=new Is;class Hs{constructor(l,d,B){this.manager=l,this.transport=d,this.minPingDelay=B.minPingDelay,this.maxPingDelay=B.maxPingDelay,this.pingDelay=void 0}createConnection(l,d,B,C){C=TA({},C,{activityTimeout:this.pingDelay});var S=this.transport.createConnection(l,d,B,C),D=null,z=function(){S.unbind("open",z),S.bind("closed",Y),D=_A.now()},Y=sA=>{if(S.unbind("closed",Y),sA.code===1002||sA.code===1003)this.manager.reportDeath();else if(!sA.wasClean&&D){var cA=_A.now()-D;cA<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(cA/2,this.minPingDelay))}};return S.bind("open",z),S}isSupported(l){return this.manager.isAlive()&&this.transport.isSupported(l)}}const Er={decodeMessage:function(p){try{var l=JSON.parse(p.data),d=l.data;if(typeof d=="string")try{d=JSON.parse(l.data)}catch(C){}var B={event:l.event,channel:l.channel,data:d};return l.user_id&&(B.user_id=l.user_id),B}catch(C){throw{type:"MessageParseError",error:C,data:p.data}}},encodeMessage:function(p){return JSON.stringify(p)},processHandshake:function(p){var l=Er.decodeMessage(p);if(l.event==="pusher:connection_established"){if(!l.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:l.data.socket_id,activityTimeout:l.data.activity_timeout*1e3}}else{if(l.event==="pusher:error")return{action:this.getCloseAction(l.data),error:this.getCloseError(l.data)};throw"Invalid handshake"}},getCloseAction:function(p){return p.code<4e3?p.code>=1002&&p.code<=1004?"backoff":null:p.code===4e3?"tls_only":p.code<4100?"refused":p.code<4200?"backoff":p.code<4300?"retry":"refused"},getCloseError:function(p){return p.code!==1e3&&p.code!==1001?{type:"PusherError",data:{code:p.code,message:p.reason||p.message}}:null}},wt=Er;class G extends Pe{constructor(l,d){super(),this.id=l,this.transport=d,this.activityTimeout=d.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(l){return this.transport.send(l)}send_event(l,d,B){var C={event:l,data:d};return B&&(C.channel=B),BA.debug("Event sent",C),this.send(wt.encodeMessage(C))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var l={message:B=>{var C;try{C=wt.decodeMessage(B)}catch(S){this.emit("error",{type:"MessageParseError",error:S,data:B.data})}if(C!==void 0){switch(BA.debug("Event recd",C),C.event){case"pusher:error":this.emit("error",{type:"PusherError",data:C.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",C)}},activity:()=>{this.emit("activity")},error:B=>{this.emit("error",B)},closed:B=>{d(),B&&B.code&&this.handleCloseEvent(B),this.transport=null,this.emit("closed")}},d=()=>{KA(l,(B,C)=>{this.transport.unbind(C,B)})};KA(l,(B,C)=>{this.transport.bind(C,B)})}handleCloseEvent(l){var d=wt.getCloseAction(l),B=wt.getCloseError(l);B&&this.emit("error",B),d&&this.emit(d,{action:d,error:B})}}class b{constructor(l,d){this.transport=l,this.callback=d,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=l=>{this.unbindListeners();var d;try{d=wt.processHandshake(l)}catch(B){this.finish("error",{error:B}),this.transport.close();return}d.action==="connected"?this.finish("connected",{connection:new G(d.id,this.transport),activityTimeout:d.activityTimeout}):(this.finish(d.action,{error:d.error}),this.transport.close())},this.onClosed=l=>{this.unbindListeners();var d=wt.getCloseAction(l)||"backoff",B=wt.getCloseError(l);this.finish(d,{error:B})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(l,d){this.callback(TA({transport:this.transport,action:l},d))}}class H{constructor(l,d){this.timeline=l,this.options=d||{}}send(l,d){this.timeline.isEmpty()||this.timeline.send(q.TimelineTransport.getAgent(this,l),d)}}class M extends Pe{constructor(l,d){super(function(B,C){BA.debug("No callbacks on "+l+" for "+B)}),this.name=l,this.pusher=d,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(l,d){return d(null,{auth:""})}trigger(l,d){if(l.indexOf("client-")!==0)throw new y("Event '"+l+"' does not start with 'client-'");if(!this.subscribed){var B=v.buildLogSuffix("triggeringClientEvents");BA.warn(`Client event triggered before channel 'subscription_succeeded' event . ${B}`)}return this.pusher.send_event(l,d,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(l){var d=l.event,B=l.data;if(d==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(l);else if(d==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(l);else if(d.indexOf("pusher_internal:")!==0){var C={};this.emit(d,B,C)}}handleSubscriptionSucceededEvent(l){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",l.data)}handleSubscriptionCountEvent(l){l.data.subscription_count&&(this.subscriptionCount=l.data.subscription_count),this.emit("pusher:subscription_count",l.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(l,d)=>{l?(this.subscriptionPending=!1,BA.error(l.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:l.message},l instanceof oA?{status:l.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:d.auth,channel_data:d.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class uA extends M{authorize(l,d){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:l},d)}}class ZA{constructor(){this.reset()}get(l){return Object.prototype.hasOwnProperty.call(this.members,l)?{id:l,info:this.members[l]}:null}each(l){KA(this.members,(d,B)=>{l(this.get(B))})}setMyID(l){this.myID=l}onSubscription(l){this.members=l.presence.hash,this.count=l.presence.count,this.me=this.get(this.myID)}addMember(l){return this.get(l.user_id)===null&&this.count++,this.members[l.user_id]=l.user_info,this.get(l.user_id)}removeMember(l){var d=this.get(l.user_id);return d&&(delete this.members[l.user_id],this.count--),d}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var SA=function(p,l,d,B){function C(S){return S instanceof d?S:new d(function(D){D(S)})}return new(d||(d=Promise))(function(S,D){function z(cA){try{sA(B.next(cA))}catch(MA){D(MA)}}function Y(cA){try{sA(B.throw(cA))}catch(MA){D(MA)}}function sA(cA){cA.done?S(cA.value):C(cA.value).then(z,Y)}sA((B=B.apply(p,l||[])).next())})};class Ae extends uA{constructor(l,d){super(l,d),this.members=new ZA}authorize(l,d){super.authorize(l,(B,C)=>SA(this,void 0,void 0,function*(){if(!B)if(C=C,C.channel_data!=null){var S=JSON.parse(C.channel_data);this.members.setMyID(S.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let D=v.buildLogSuffix("authorizationEndpoint");BA.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${D}, or the user should be signed in.`),d("Invalid auth response");return}d(B,C)}))}handleEvent(l){var d=l.event;if(d.indexOf("pusher_internal:")===0)this.handleInternalEvent(l);else{var B=l.data,C={};l.user_id&&(C.user_id=l.user_id),this.emit(d,B,C)}}handleInternalEvent(l){var d=l.event,B=l.data;switch(d){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(l);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(l);break;case"pusher_internal:member_added":var C=this.members.addMember(B);this.emit("pusher:member_added",C);break;case"pusher_internal:member_removed":var S=this.members.removeMember(B);S&&this.emit("pusher:member_removed",S);break}}handleSubscriptionSucceededEvent(l){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(l.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Ne=i(978),nt=i(594);class Fr extends uA{constructor(l,d,B){super(l,d),this.key=null,this.nacl=B}authorize(l,d){super.authorize(l,(B,C)=>{if(B){d(B,C);return}let S=C.shared_secret;if(!S){d(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=(0,nt.decode)(S),delete C.shared_secret,d(null,C)})}trigger(l,d){throw new N("Client events are not currently supported for encrypted channels")}handleEvent(l){var d=l.event,B=l.data;if(d.indexOf("pusher_internal:")===0||d.indexOf("pusher:")===0){super.handleEvent(l);return}this.handleEncryptedEvent(d,B)}handleEncryptedEvent(l,d){if(!this.key){BA.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!d.ciphertext||!d.nonce){BA.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+d);return}let B=(0,nt.decode)(d.ciphertext);if(B.length<this.nacl.secretbox.overheadLength){BA.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${B.length}`);return}let C=(0,nt.decode)(d.nonce);if(C.length<this.nacl.secretbox.nonceLength){BA.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${C.length}`);return}let S=this.nacl.secretbox.open(B,C,this.key);if(S===null){BA.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(D,z)=>{if(D){BA.error(`Failed to make a request to the authEndpoint: ${z}. Unable to fetch new key, so dropping encrypted event`);return}if(S=this.nacl.secretbox.open(B,C,this.key),S===null){BA.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(l,this.getDataToEmit(S))});return}this.emit(l,this.getDataToEmit(S))}getDataToEmit(l){let d=(0,Ne.D4)(l);try{return JSON.parse(d)}catch(B){return d}}}class NA extends Pe{constructor(l,d){super(),this.state="initialized",this.connection=null,this.key=l,this.options=d,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var B=q.getNetwork();B.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),B.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(l){this.key=l,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(l){return this.connection?this.connection.send(l):!1}send_event(l,d,B){return this.connection?this.connection.send_event(l,d,B):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var l=(d,B)=>{d?this.runner=this.strategy.connect(0,l):B.action==="error"?(this.emit("error",{type:"HandshakeError",error:B.error}),this.timeline.error({handshakeError:B.error})):(this.abortConnecting(),this.handshakeCallbacks[B.action](B))};this.runner=this.strategy.connect(0,l)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var l=this.abandonConnection();l.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(l){this.timeline.info({action:"retry",delay:l}),l>0&&this.emit("connecting_in",Math.round(l/1e3)),this.retryTimer=new qA(l||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new qA(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new qA(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new qA(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(l){return TA({},l,{message:d=>{this.resetActivityCheck(),this.emit("message",d)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:d=>{this.emit("error",d)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(l){return TA({},l,{connected:d=>{this.activityTimeout=Math.min(this.options.activityTimeout,d.activityTimeout,d.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(d.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let l=d=>B=>{B.error&&this.emit("error",{type:"WebSocketError",error:B.error}),d(B)};return{tls_only:l(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:l(()=>{this.disconnect()}),backoff:l(()=>{this.retryIn(1e3)}),retry:l(()=>{this.retryIn(0)})}}setConnection(l){this.connection=l;for(var d in this.connectionCallbacks)this.connection.bind(d,this.connectionCallbacks[d]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var l in this.connectionCallbacks)this.connection.unbind(l,this.connectionCallbacks[l]);var d=this.connection;return this.connection=null,d}}updateState(l,d){var B=this.state;if(this.state=l,B!==l){var C=l;C==="connected"&&(C+=" with new socket ID "+d.socket_id),BA.debug("State changed",B+" -> "+C),this.timeline.info({state:l,params:d}),this.emit("state_change",{previous:B,current:l}),this.emit(l,d)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Ls{constructor(){this.channels={}}add(l,d){return this.channels[l]||(this.channels[l]=Ds(l,d)),this.channels[l]}all(){return be(this.channels)}find(l){return this.channels[l]}remove(l){var d=this.channels[l];return delete this.channels[l],d}disconnect(){KA(this.channels,function(l){l.disconnect()})}}function Ds(p,l){if(p.indexOf("private-encrypted-")===0){if(l.config.nacl)return mt.createEncryptedChannel(p,l,l.config.nacl);let d="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",B=v.buildLogSuffix("encryptedChannelSupport");throw new N(`${d}. ${B}`)}else{if(p.indexOf("private-")===0)return mt.createPrivateChannel(p,l);if(p.indexOf("presence-")===0)return mt.createPresenceChannel(p,l);if(p.indexOf("#")===0)throw new x('Cannot create a channel with name "'+p+'".');return mt.createChannel(p,l)}}var Pf={createChannels(){return new Ls},createConnectionManager(p,l){return new NA(p,l)},createChannel(p,l){return new M(p,l)},createPrivateChannel(p,l){return new uA(p,l)},createPresenceChannel(p,l){return new Ae(p,l)},createEncryptedChannel(p,l,d){return new Fr(p,l,d)},createTimelineSender(p,l){return new H(p,l)},createHandshake(p,l){return new b(p,l)},createAssistantToTheTransportManager(p,l,d){return new Hs(p,l,d)}};const mt=Pf;class jc{constructor(l){this.options=l||{},this.livesLeft=this.options.lives||1/0}getAssistant(l){return mt.createAssistantToTheTransportManager(this,l,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class tn{constructor(l,d){this.strategies=l,this.loop=!!d.loop,this.failFast=!!d.failFast,this.timeout=d.timeout,this.timeoutLimit=d.timeoutLimit}isSupported(){return Br(this.strategies,_A.method("isSupported"))}connect(l,d){var B=this.strategies,C=0,S=this.timeout,D=null,z=(Y,sA)=>{sA?d(null,sA):(C=C+1,this.loop&&(C=C%B.length),C<B.length?(S&&(S=S*2,this.timeoutLimit&&(S=Math.min(S,this.timeoutLimit))),D=this.tryStrategy(B[C],l,{timeout:S,failFast:this.failFast},z)):d(!0))};return D=this.tryStrategy(B[C],l,{timeout:S,failFast:this.failFast},z),{abort:function(){D.abort()},forceMinPriority:function(Y){l=Y,D&&D.forceMinPriority(Y)}}}tryStrategy(l,d,B,C){var S=null,D=null;return B.timeout>0&&(S=new qA(B.timeout,function(){D.abort(),C(!0)})),D=l.connect(d,function(z,Y){z&&S&&S.isRunning()&&!B.failFast||(S&&S.ensureAborted(),C(z,Y))}),{abort:function(){S&&S.ensureAborted(),D.abort()},forceMinPriority:function(z){D.forceMinPriority(z)}}}}class Ii{constructor(l){this.strategies=l}isSupported(){return Br(this.strategies,_A.method("isSupported"))}connect(l,d){return Kf(this.strategies,l,function(B,C){return function(S,D){if(C[B].error=S,S){Nf(C)&&d(!0);return}Qe(C,function(z){z.forceMinPriority(D.transport.priority)}),d(null,D)}})}}function Kf(p,l,d){var B=gt(p,function(C,S,D,z){return C.connect(l,d(S,z))});return{abort:function(){Qe(B,zf)},forceMinPriority:function(C){Qe(B,function(S){S.forceMinPriority(C)})}}}function Nf(p){return ki(p,function(l){return!!l.error})}function zf(p){!p.error&&!p.aborted&&(p.abort(),p.aborted=!0)}class $f{constructor(l,d,B){this.strategy=l,this.transports=d,this.ttl=B.ttl||18e5,this.usingTLS=B.useTLS,this.timeline=B.timeline}isSupported(){return this.strategy.isSupported()}connect(l,d){var B=this.usingTLS,C=Gf(B),S=C&&C.cacheSkipCount?C.cacheSkipCount:0,D=[this.strategy];if(C&&C.timestamp+this.ttl>=_A.now()){var z=this.transports[C.transport];z&&(["ws","wss"].includes(C.transport)||S>3?(this.timeline.info({cached:!0,transport:C.transport,latency:C.latency}),D.push(new tn([z],{timeout:C.latency*2+1e3,failFast:!0}))):S++)}var Y=_A.now(),sA=D.pop().connect(l,function cA(MA,Ps){MA?(Yc(B),D.length>0?(Y=_A.now(),sA=D.pop().connect(l,cA)):d(MA)):(Vf(B,Ps.transport.name,_A.now()-Y,S),d(null,Ps))});return{abort:function(){sA.abort()},forceMinPriority:function(cA){l=cA,sA&&sA.forceMinPriority(cA)}}}}function Ti(p){return"pusherTransport"+(p?"TLS":"NonTLS")}function Gf(p){var l=q.getLocalStorage();if(l)try{var d=l[Ti(p)];if(d)return JSON.parse(d)}catch(B){Yc(p)}return null}function Vf(p,l,d,B){var C=q.getLocalStorage();if(C)try{C[Ti(p)]=se({timestamp:_A.now(),transport:l,latency:d,cacheSkipCount:B})}catch(S){}}function Yc(p){var l=q.getLocalStorage();if(l)try{delete l[Ti(p)]}catch(d){}}class Rs{constructor(l,{delay:d}){this.strategy=l,this.options={delay:d}}isSupported(){return this.strategy.isSupported()}connect(l,d){var B=this.strategy,C,S=new qA(this.options.delay,function(){C=B.connect(l,d)});return{abort:function(){S.ensureAborted(),C&&C.abort()},forceMinPriority:function(D){l=D,C&&C.forceMinPriority(D)}}}}class kr{constructor(l,d,B){this.test=l,this.trueBranch=d,this.falseBranch=B}isSupported(){var l=this.test()?this.trueBranch:this.falseBranch;return l.isSupported()}connect(l,d){var B=this.test()?this.trueBranch:this.falseBranch;return B.connect(l,d)}}class Zf{constructor(l){this.strategy=l}isSupported(){return this.strategy.isSupported()}connect(l,d){var B=this.strategy.connect(l,function(C,S){S&&B.abort(),d(C,S)});return B}}function vr(p){return function(){return p.isSupported()}}var Xf=function(p,l,d){var B={};function C(ul,Gg,Vg,Zg,Xg){var dl=d(p,ul,Gg,Vg,Zg,Xg);return B[ul]=dl,dl}var S=Object.assign({},l,{hostNonTLS:p.wsHost+":"+p.wsPort,hostTLS:p.wsHost+":"+p.wssPort,httpPath:p.wsPath}),D=Object.assign({},S,{useTLS:!0}),z=Object.assign({},l,{hostNonTLS:p.httpHost+":"+p.httpPort,hostTLS:p.httpHost+":"+p.httpsPort,httpPath:p.httpPath}),Y={loop:!0,timeout:15e3,timeoutLimit:6e4},sA=new jc({minPingDelay:1e4,maxPingDelay:p.activityTimeout}),cA=new jc({lives:2,minPingDelay:1e4,maxPingDelay:p.activityTimeout}),MA=C("ws","ws",3,S,sA),Ps=C("wss","ws",3,D,sA),Pg=C("sockjs","sockjs",1,z),sl=C("xhr_streaming","xhr_streaming",1,z,cA),Kg=C("xdr_streaming","xdr_streaming",1,z,cA),ol=C("xhr_polling","xhr_polling",1,z),Ng=C("xdr_polling","xdr_polling",1,z),il=new tn([MA],Y),zg=new tn([Ps],Y),$g=new tn([Pg],Y),al=new tn([new kr(vr(sl),sl,Kg)],Y),cl=new tn([new kr(vr(ol),ol,Ng)],Y),ll=new tn([new kr(vr(al),new Ii([al,new Rs(cl,{delay:4e3})]),cl)],Y),Di=new kr(vr(ll),ll,$g),Ri;return l.useTLS?Ri=new Ii([il,new Rs(Di,{delay:2e3})]):Ri=new Ii([il,new Rs(zg,{delay:2e3}),new Rs(Di,{delay:5e3})]),new $f(new Zf(new kr(vr(MA),Ri,Di)),B,{ttl:18e5,timeline:l.timeline,useTLS:l.useTLS})};const Wf=Xf;function Jf(){var p=this;p.timeline.info(p.buildTimelineMessage({transport:p.name+(p.options.useTLS?"s":"")})),p.hooks.isInitialized()?p.changeState("initialized"):p.hooks.file?(p.changeState("initializing"),Q.load(p.hooks.file,{useTLS:p.options.useTLS},function(l,d){p.hooks.isInitialized()?(p.changeState("initialized"),d(!0)):(l&&p.onError(l),p.onClose(),d(!1))})):p.onClose()}var jf={getRequest:function(p){var l=new window.XDomainRequest;return l.ontimeout=function(){p.emit("error",new R),p.close()},l.onerror=function(d){p.emit("error",d),p.close()},l.onprogress=function(){l.responseText&&l.responseText.length>0&&p.onChunk(200,l.responseText)},l.onload=function(){l.responseText&&l.responseText.length>0&&p.onChunk(200,l.responseText),p.emit("finished",200),p.close()},l},abortRequest:function(p){p.ontimeout=p.onerror=p.onprogress=p.onload=null,p.abort()}};const Yf=jf,qf=256*1024;class Ag extends Pe{constructor(l,d,B){super(),this.hooks=l,this.method=d,this.url=B}start(l){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},q.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(l)}close(){this.unloader&&(q.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(l,d){for(;;){var B=this.advanceBuffer(d);if(B)this.emit("chunk",{status:l,data:B});else break}this.isBufferTooLong(d)&&this.emit("buffer_too_long")}advanceBuffer(l){var d=l.slice(this.position),B=d.indexOf(`
1908
+ `);return B!==-1?(this.position+=B+1,d.slice(0,B)):null}isBufferTooLong(l){return this.position===l.length&&l.length>qf}}var Hi;(function(p){p[p.CONNECTING=0]="CONNECTING",p[p.OPEN=1]="OPEN",p[p.CLOSED=3]="CLOSED"})(Hi||(Hi={}));const nn=Hi;var eg=1;class tg{constructor(l,d){this.hooks=l,this.session=Al(1e3)+"/"+og(8),this.location=ng(d),this.readyState=nn.CONNECTING,this.openStream()}send(l){return this.sendRaw(JSON.stringify([l]))}ping(){this.hooks.sendHeartbeat(this)}close(l,d){this.onClose(l,d,!0)}sendRaw(l){if(this.readyState===nn.OPEN)try{return q.createSocketRequest("POST",qc(rg(this.location,this.session))).start(l),!0}catch(d){return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(l,d,B){this.closeStream(),this.readyState=nn.CLOSED,this.onclose&&this.onclose({code:l,reason:d,wasClean:B})}onChunk(l){if(l.status===200){this.readyState===nn.OPEN&&this.onActivity();var d,B=l.data.slice(0,1);switch(B){case"o":d=JSON.parse(l.data.slice(1)||"{}"),this.onOpen(d);break;case"a":d=JSON.parse(l.data.slice(1)||"[]");for(var C=0;C<d.length;C++)this.onEvent(d[C]);break;case"m":d=JSON.parse(l.data.slice(1)||"null"),this.onEvent(d);break;case"h":this.hooks.onHeartbeat(this);break;case"c":d=JSON.parse(l.data.slice(1)||"[]"),this.onClose(d[0],d[1],!0);break}}}onOpen(l){this.readyState===nn.CONNECTING?(l&&l.hostname&&(this.location.base=sg(this.location.base,l.hostname)),this.readyState=nn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(l){this.readyState===nn.OPEN&&this.onmessage&&this.onmessage({data:l})}onActivity(){this.onactivity&&this.onactivity()}onError(l){this.onerror&&this.onerror(l)}openStream(){this.stream=q.createSocketRequest("POST",qc(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",l=>{this.onChunk(l)}),this.stream.bind("finished",l=>{this.hooks.onFinished(this,l)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(l){_A.defer(()=>{this.onError(l),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function ng(p){var l=/([^\?]*)\/*(\??.*)/.exec(p);return{base:l[1],queryString:l[2]}}function rg(p,l){return p.base+"/"+l+"/xhr_send"}function qc(p){var l=p.indexOf("?")===-1?"?":"&";return p+l+"t="+ +new Date+"&n="+eg++}function sg(p,l){var d=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(p);return d[1]+l+d[3]}function Al(p){return q.randomInt(p)}function og(p){for(var l=[],d=0;d<p;d++)l.push(Al(32).toString(32));return l.join("")}const ig=tg;var ag={getReceiveURL:function(p,l){return p.base+"/"+l+"/xhr_streaming"+p.queryString},onHeartbeat:function(p){p.sendRaw("[]")},sendHeartbeat:function(p){p.sendRaw("[]")},onFinished:function(p,l){p.onClose(1006,"Connection interrupted ("+l+")",!1)}};const cg=ag;var lg={getReceiveURL:function(p,l){return p.base+"/"+l+"/xhr"+p.queryString},onHeartbeat:function(){},sendHeartbeat:function(p){p.sendRaw("[]")},onFinished:function(p,l){l===200?p.reconnect():p.onClose(1006,"Connection interrupted ("+l+")",!1)}};const ug=lg;var dg={getRequest:function(p){var l=q.getXHRAPI(),d=new l;return d.onreadystatechange=d.onprogress=function(){switch(d.readyState){case 3:d.responseText&&d.responseText.length>0&&p.onChunk(d.status,d.responseText);break;case 4:d.responseText&&d.responseText.length>0&&p.onChunk(d.status,d.responseText),p.emit("finished",d.status),p.close();break}},d},abortRequest:function(p){p.onreadystatechange=null,p.abort()}};const pg=dg;var hg={createStreamingSocket(p){return this.createSocket(cg,p)},createPollingSocket(p){return this.createSocket(ug,p)},createSocket(p,l){return new ig(p,l)},createXHR(p,l){return this.createRequest(pg,p,l)},createRequest(p,l,d){return new Ag(p,l,d)}};const el=hg;el.createXDR=function(p,l){return this.createRequest(Yf,p,l)};var fg={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:u,DependenciesReceivers:m,getDefaultStrategy:Wf,Transports:Ke,transportConnectionInitializer:Jf,HTTPFactory:el,TimelineTransport:_t,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(p){window.Pusher=p;var l=()=>{this.onDocumentBody(p.ready)};window.JSON?l():Q.load("json2",{},l)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:OA,jsonp:Cr}},onDocumentBody(p){document.body?p():setTimeout(()=>{this.onDocumentBody(p)},0)},createJSONPRequest(p,l){return new Sn(p,l)},createScriptRequest(p){return new ks(p)},getLocalStorage(){try{return window.localStorage}catch(p){return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var p=this.getXHRAPI();return new p},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Ts},createWebSocket(p){var l=this.getWebSocketAPI();return new l(p)},createSocketRequest(p,l){if(this.isXHRSupported())return this.HTTPFactory.createXHR(p,l);if(this.isXDRSupported(l.indexOf("https:")===0))return this.HTTPFactory.createXDR(p,l);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var p=this.getXHRAPI();return!!p&&new p().withCredentials!==void 0},isXDRSupported(p){var l=p?"https:":"http:",d=this.getProtocol();return!!window.XDomainRequest&&d===l},addUnloadListener(p){window.addEventListener!==void 0?window.addEventListener("unload",p,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",p)},removeUnloadListener(p){window.addEventListener!==void 0?window.removeEventListener("unload",p,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",p)},randomInt(p){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*p)}};const q=fg;var Li;(function(p){p[p.ERROR=3]="ERROR",p[p.INFO=6]="INFO",p[p.DEBUG=7]="DEBUG"})(Li||(Li={}));const Os=Li;class gg{constructor(l,d,B){this.key=l,this.session=d,this.events=[],this.options=B||{},this.sent=0,this.uniqueID=0}log(l,d){l<=this.options.level&&(this.events.push(TA({},d,{timestamp:_A.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(l){this.log(Os.ERROR,l)}info(l){this.log(Os.INFO,l)}debug(l){this.log(Os.DEBUG,l)}isEmpty(){return this.events.length===0}send(l,d){var B=TA({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],l(B,(C,S)=>{C||this.sent++,d&&d(C,S)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Bg{constructor(l,d,B,C){this.name=l,this.priority=d,this.transport=B,this.options=C||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(l,d){if(this.isSupported()){if(this.priority<l)return tl(new I,d)}else return tl(new X,d);var B=!1,C=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),S=null,D=function(){C.unbind("initialized",D),C.connect()},z=function(){S=mt.createHandshake(C,function(MA){B=!0,cA(),d(null,MA)})},Y=function(MA){cA(),d(MA)},sA=function(){cA();var MA;MA=se(C),d(new K(MA))},cA=function(){C.unbind("initialized",D),C.unbind("open",z),C.unbind("error",Y),C.unbind("closed",sA)};return C.bind("initialized",D),C.bind("open",z),C.bind("error",Y),C.bind("closed",sA),C.initialize(),{abort:()=>{B||(cA(),S?S.close():C.close())},forceMinPriority:MA=>{B||this.priority<MA&&(S?S.close():C.close())}}}}function tl(p,l){return _A.defer(function(){l(p)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:wg}=q;var mg=function(p,l,d,B,C,S){var D=wg[d];if(!D)throw new Z(d);var z=(!p.enabledTransports||kt(p.enabledTransports,l)!==-1)&&(!p.disabledTransports||kt(p.disabledTransports,l)===-1),Y;return z?(C=Object.assign({ignoreNullOrigin:p.ignoreNullOrigin},C),Y=new Bg(l,B,S?S.getAssistant(D):D,C)):Y=Cg,Y},Cg={isSupported:function(){return!1},connect:function(p,l){var d=_A.defer(function(){l(new X)});return{abort:function(){d.ensureAborted()},forceMinPriority:function(){}}}};function bg(p){if(p==null)throw"You must pass an options object";if(p.cluster==null)throw"Options object must provide a cluster";"disableStats"in p&&BA.warn("The disableStats option is deprecated in favor of enableStats")}const Qg=(p,l)=>{var d="socket_id="+encodeURIComponent(p.socketId);for(var B in l.params)d+="&"+encodeURIComponent(B)+"="+encodeURIComponent(l.params[B]);if(l.paramsProvider!=null){let C=l.paramsProvider();for(var B in C)d+="&"+encodeURIComponent(B)+"="+encodeURIComponent(C[B])}return d},yg=p=>{if(typeof q.getAuthorizers()[p.transport]=="undefined")throw`'${p.transport}' is not a recognized auth transport`;return(l,d)=>{const B=Qg(l,p);q.getAuthorizers()[p.transport](q,B,p,F.UserAuthentication,d)}},Ug=(p,l)=>{var d="socket_id="+encodeURIComponent(p.socketId);d+="&channel_name="+encodeURIComponent(p.channelName);for(var B in l.params)d+="&"+encodeURIComponent(B)+"="+encodeURIComponent(l.params[B]);if(l.paramsProvider!=null){let C=l.paramsProvider();for(var B in C)d+="&"+encodeURIComponent(B)+"="+encodeURIComponent(C[B])}return d},Eg=p=>{if(typeof q.getAuthorizers()[p.transport]=="undefined")throw`'${p.transport}' is not a recognized auth transport`;return(l,d)=>{const B=Ug(l,p);q.getAuthorizers()[p.transport](q,B,p,F.ChannelAuthorization,d)}},Fg=(p,l,d)=>{const B={authTransport:l.transport,authEndpoint:l.endpoint,auth:{params:l.params,headers:l.headers}};return(C,S)=>{const D=p.channel(C.channelName);d(D,B).authorize(C.socketId,S)}};function nl(p,l){let d={activityTimeout:p.activityTimeout||f.activityTimeout,cluster:p.cluster,httpPath:p.httpPath||f.httpPath,httpPort:p.httpPort||f.httpPort,httpsPort:p.httpsPort||f.httpsPort,pongTimeout:p.pongTimeout||f.pongTimeout,statsHost:p.statsHost||f.stats_host,unavailableTimeout:p.unavailableTimeout||f.unavailableTimeout,wsPath:p.wsPath||f.wsPath,wsPort:p.wsPort||f.wsPort,wssPort:p.wssPort||f.wssPort,enableStats:Sg(p),httpHost:kg(p),useTLS:xg(p),wsHost:vg(p),userAuthenticator:Ig(p),channelAuthorizer:Hg(p,l)};return"disabledTransports"in p&&(d.disabledTransports=p.disabledTransports),"enabledTransports"in p&&(d.enabledTransports=p.enabledTransports),"ignoreNullOrigin"in p&&(d.ignoreNullOrigin=p.ignoreNullOrigin),"timelineParams"in p&&(d.timelineParams=p.timelineParams),"nacl"in p&&(d.nacl=p.nacl),d}function kg(p){return p.httpHost?p.httpHost:p.cluster?`sockjs-${p.cluster}.pusher.com`:f.httpHost}function vg(p){return p.wsHost?p.wsHost:_g(p.cluster)}function _g(p){return`ws-${p}.pusher.com`}function xg(p){return q.getProtocol()==="https:"?!0:p.forceTLS!==!1}function Sg(p){return"enableStats"in p?p.enableStats:"disableStats"in p?!p.disableStats:!1}const rl=p=>"customHandler"in p&&p.customHandler!=null;function Ig(p){const l=Object.assign(Object.assign({},f.userAuthentication),p.userAuthentication);return rl(l)?l.customHandler:yg(l)}function Tg(p,l){let d;if("channelAuthorization"in p)d=Object.assign(Object.assign({},f.channelAuthorization),p.channelAuthorization);else if(d={transport:p.authTransport||f.authTransport,endpoint:p.authEndpoint||f.authEndpoint},"auth"in p&&("params"in p.auth&&(d.params=p.auth.params),"headers"in p.auth&&(d.headers=p.auth.headers)),"authorizer"in p)return{customHandler:Fg(l,d,p.authorizer)};return d}function Hg(p,l){const d=Tg(p,l);return rl(d)?d.customHandler:Eg(d)}class Lg extends Pe{constructor(l){super(function(d,B){BA.debug(`No callbacks on watchlist events for ${d}`)}),this.pusher=l,this.bindWatchlistInternalEvent()}handleEvent(l){l.data.events.forEach(d=>{this.emit(d.name,d)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",l=>{var d=l.event;d==="pusher_internal:watchlist_events"&&this.handleEvent(l)})}}function Dg(){let p,l;return{promise:new Promise((B,C)=>{p=B,l=C}),resolve:p,reject:l}}const Rg=Dg;class Og extends Pe{constructor(l){super(function(d,B){BA.debug("No callbacks on user for "+d)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(d,B)=>{if(d){BA.warn(`Error during signin: ${d}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:B.auth,user_data:B.user_data})},this.pusher=l,this.pusher.connection.bind("state_change",({previous:d,current:B})=>{d!=="connected"&&B==="connected"&&this._signin(),d==="connected"&&B!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new Lg(l),this.pusher.connection.bind("message",d=>{var B=d.event;B==="pusher:signin_success"&&this._onSigninSuccess(d.data),this.serverToUserChannel&&this.serverToUserChannel.name===d.channel&&this.serverToUserChannel.handleEvent(d)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(l){try{this.user_data=JSON.parse(l.user_data)}catch(d){BA.error(`Failed parsing user data after signin: ${l.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){BA.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const l=d=>{d.subscriptionPending&&d.subscriptionCancelled?d.reinstateSubscription():!d.subscriptionPending&&this.pusher.connection.state==="connected"&&d.subscribe()};this.serverToUserChannel=new M(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((d,B)=>{d.indexOf("pusher_internal:")===0||d.indexOf("pusher:")===0||this.emit(d,B)}),l(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:l,resolve:d}=Rg();l.done=!1;const B=()=>{l.done=!0};l.then(B).catch(B),this.signinDonePromise=l,this._signinDoneResolve=d}}class XA{static ready(){XA.isReady=!0;for(var l=0,d=XA.instances.length;l<d;l++)XA.instances[l].connect()}static getClientFeatures(){return et(Yt({ws:q.Transports.ws},function(l){return l.isSupported({})}))}constructor(l,d){Mg(l),bg(d),this.key=l,this.options=d,this.config=nl(this.options,this),this.channels=mt.createChannels(),this.global_emitter=new Pe,this.sessionID=q.randomInt(1e9),this.timeline=new gg(this.key,this.sessionID,{cluster:this.config.cluster,features:XA.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Os.INFO,version:f.VERSION}),this.config.enableStats&&(this.timelineSender=mt.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+q.TimelineTransport.name}));var B=C=>q.getDefaultStrategy(this.config,C,mg);this.connection=mt.createConnectionManager(this.key,{getStrategy:B,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",C=>{var S=C.event,D=S.indexOf("pusher_internal:")===0;if(C.channel){var z=this.channel(C.channel);z&&z.handleEvent(C)}D||this.global_emitter.emit(C.event,C.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",C=>{BA.warn(C)}),XA.instances.push(this),this.timeline.info({instances:XA.instances.length}),this.user=new Og(this),XA.isReady&&this.connect()}switchCluster(l){const{appKey:d,cluster:B}=l;this.key=d,this.options=Object.assign(Object.assign({},this.options),{cluster:B}),this.config=nl(this.options,this),this.connection.switchCluster(this.key)}channel(l){return this.channels.find(l)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var l=this.connection.isUsingTLS(),d=this.timelineSender;this.timelineSenderTimer=new Jt(6e4,function(){d.send(l)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(l,d,B){return this.global_emitter.bind(l,d,B),this}unbind(l,d,B){return this.global_emitter.unbind(l,d,B),this}bind_global(l){return this.global_emitter.bind_global(l),this}unbind_global(l){return this.global_emitter.unbind_global(l),this}unbind_all(l){return this.global_emitter.unbind_all(),this}subscribeAll(){var l;for(l in this.channels.channels)this.channels.channels.hasOwnProperty(l)&&this.subscribe(l)}subscribe(l){var d=this.channels.add(l,this);return d.subscriptionPending&&d.subscriptionCancelled?d.reinstateSubscription():!d.subscriptionPending&&this.connection.state==="connected"&&d.subscribe(),d}unsubscribe(l){var d=this.channels.find(l);d&&d.subscriptionPending?d.cancelSubscription():(d=this.channels.remove(l),d&&d.subscribed&&d.unsubscribe())}send_event(l,d,B){return this.connection.send_event(l,d,B)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}XA.instances=[],XA.isReady=!1,XA.logToConsole=!1,XA.Runtime=q,XA.ScriptReceivers=q.ScriptReceivers,XA.DependenciesReceivers=q.DependenciesReceivers,XA.auth_callbacks=q.auth_callbacks;const Ms=XA;function Mg(p){if(p==null)throw"You must pass your app key when you instantiate Pusher."}q.setup(XA)}},n={};function r(o){var a=n[o];if(a!==void 0)return a.exports;var i=n[o]={exports:{}};return t[o].call(i.exports,i,i.exports,r),i.exports}r.d=(o,a)=>{for(var i in a)r.o(a,i)&&!r.o(o,i)&&Object.defineProperty(o,i,{enumerable:!0,get:a[i]})},r.o=(o,a)=>Object.prototype.hasOwnProperty.call(o,a);var s=r(721);return s})())})(Ba)),Ba.exports}var Sx=xx();const Ix=_x(Sx);let We=null,$n=null;function Tx(A){return T(this,null,function*(){return $n||($n=T(null,null,function*(){const e=A.backendUrl.replace(/\/+$/,""),t=yield ls(`${e}/api/settings`,{headers:{Authorization:`Bearer ${A.token}`}});if(!t.ok)throw new Error(`Failed to fetch settings: HTTP ${t.status}`);const n=yield t.json();We=new Ix(n.pusher.key,{cluster:n.pusher.cluster||"local",forceTLS:!0,wsHost:n.pusher.wsHost||void 0,wsPort:n.pusher.wssPort,wssPort:n.pusher.wssPort,enabledTransports:n.pusher.wsHost?["ws"]:void 0,channelAuthorization:{customHandler:({socketId:r,channelName:s},o)=>{ls(`${e}/api/pusher/auth`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${A.token}`},body:JSON.stringify({socket_id:r,channel_name:s})}).then(a=>a.json()).then(a=>o(null,a)).catch(a=>o(a instanceof Error?a:new Error(String(a)),null))}}})}),$n.catch(()=>{$n=null}),$n)})}function Hx(A){if(!A||!We)return null;let e=!1;const t=({current:n})=>{n==="connected"&&e?(e=!1,A()):n!=="connected"&&(e=!0)};return We.connection.bind("state_change",t),()=>We==null?void 0:We.connection.unbind("state_change",t)}function Lx(A,e,t){return T(this,null,function*(){if(yield Tx(A),!We)return()=>{};const n=We.subscribe(`private-task-${e}`);t.onStatusUpdate&&n.bind(Ns.TASK_STATUS_UPDATED,t.onStatusUpdate),t.onInteractionCreated&&n.bind(Ns.TASK_INTERACTION_CREATED,t.onInteractionCreated),t.onInteractionAnswered&&n.bind(Ns.TASK_INTERACTION_ANSWERED,t.onInteractionAnswered),t.onBrowserCommandCreated&&n.bind(Ns.TASK_BROWSER_COMMAND_CREATED,t.onBrowserCommandCreated);const r=Hx(t.onReconnect);return()=>{n.unbind_all(),We==null||We.unsubscribe(`private-task-${e}`),r==null||r()}})}function sf(A,e){const t=a=>T(null,null,function*(){if(w.currentTaskId!==A||!w.runnerEl||w.state.kind!=="idle"&&w.state.kind!=="connecting"||w.handledCommandIds.has(a.commandId))return;w.handledCommandIds.add(a.commandId);const i={id:a.commandId,taskId:a.taskId,action:a.action,selector:a.selector,value:a.value,description:a.description,status:"pending",createdAt:new Date().toISOString()};ln({kind:"executing",command:i,actionsRun:w.state.kind==="idle"?w.state.actionsRun:0}),yield bd(i,e,A)}),n=a=>{if(!(w.currentTaskId!==A||!w.runnerEl)&&Wx.has(a)){if(w.state.kind==="executing")ln({kind:"finishing",status:a,actionsRun:w.state.actionsRun});else if(w.state.kind==="connecting"||w.state.kind==="idle"){const i=w.state.kind==="idle"?w.state.actionsRun:0;ln({kind:"finished",status:a,actionsRun:i})}}},r=a=>{w.currentTaskId!==A||!w.runnerEl||(a.outputChunk&&yd([a.outputChunk]),n(a.status))},s=()=>T(null,null,function*(){var a;if(!(w.currentTaskId!==A||!w.runnerEl))try{const i=yield No(e,A);w.currentTaskId===A&&w.runnerEl&&(w.currentQuestion=(a=i[0])!=null?a:null,yn())}catch(i){}}),o=()=>T(null,null,function*(){var a;try{const[i,c,u,h]=yield Promise.all([yp(e,A),RQ(e,A),No(e,A),LQ(e,A)]);if(w.currentTaskId!==A||!w.runnerEl)return;yd(c),w.currentQuestion=(a=u[0])!=null?a:null,yn(),n(i.status),h&&h.status==="pending"&&(w.state.kind==="idle"||w.state.kind==="connecting")&&!w.handledCommandIds.has(h.id)?(w.handledCommandIds.add(h.id),ln({kind:"executing",command:h,actionsRun:w.state.kind==="idle"?w.state.actionsRun:0}),yield bd(h,e,A)):w.state.kind==="connecting"&&ln({kind:"idle",actionsRun:0})}catch(i){}});o(),Lx(e,A,{onStatusUpdate:r,onInteractionCreated:s,onInteractionAnswered:s,onBrowserCommandCreated:t,onReconnect:()=>{o()}}).then(a=>{if(w.currentTaskId!==A||w.state.kind==="finished"){a();return}w.unsubscribeTaskChannel=a})}function ko(){var e;w.cancelArmed=!1,w.cancelArmTimeout&&(clearTimeout(w.cancelArmTimeout),w.cancelArmTimeout=null),w.cancelDisarmDocListener&&(document.removeEventListener("click",w.cancelDisarmDocListener,!0),w.cancelDisarmDocListener=null);const A=(e=w.runnerEl)==null?void 0:e.querySelector("[data-ap-runner-cancel]");A&&(A.textContent="Cancel task")}function Dx(A,e){return T(this,null,function*(){if(w.currentTaskId!==e||!w.runnerEl)return;const t=w.runnerEl.querySelector("[data-ap-runner-cancel]");t&&(t.disabled=!0);try{yield MQ(A,e)}catch(n){t&&(t.disabled=!1)}})}function of(){if(!w.currentTaskId||!w.currentApiOpts||!w.currentBackendUrl||!w.currentCaptureTitle)return;const A=w.currentTaskId,e=w.currentApiOpts;Nh({taskId:A,backendUrl:w.currentBackendUrl,title:w.currentCaptureTitle}),w.timerHandle&&clearInterval(w.timerHandle),Ai(),w.timerHandle=setInterval(Ai,af);const t=w.state.kind==="finished"?w.state.actionsRun:0;w.handledCommandIds=new Set,w.state={kind:"idle",actionsRun:t},Kc(),sf(A,e)}function bd(A,e,t){return T(this,null,function*(){var o,a,i;let n="done",r;try{if(A.action==="getContext"){const c=A.selector?document.querySelector(A.selector):document.body;if(!c)throw new Error(`element not found (${A.selector})`);if(gl(c))throw new Error("Target element is in a sensitive or excluded region and cannot be automated");(o=w.highlightOverlay)==null||o.update(c),r=Px(c)}else{if(!A.selector)throw new Error(`${A.action} command is missing a selector`);const c=document.querySelector(A.selector);if(!c)throw new Error(`element not found (${A.selector})`);if(gl(c))throw new Error("Target element is in a sensitive or excluded region and cannot be automated");if((a=w.highlightOverlay)==null||a.update(c),A.action==="click")yield kx(c),r="Clicked";else{if(A.value===void 0)throw new Error("inputText command is missing a value");Kx(c,A.value),r="Entered text"}}}catch(c){n="error",r=c instanceof Error?c.message:"Unknown error executing command"}if(w.currentTaskId===t&&w.runnerEl&&$x(n,A,r),yield Mx(e,t,A.id,n,r),w.currentTaskId!==t||!w.runnerEl)return;(i=w.highlightOverlay)==null||i.hide();const s=(w.state.kind==="executing"||w.state.kind==="finishing"?w.state.actionsRun:0)+1;w.state.kind==="finishing"?ln({kind:"finished",status:w.state.status,actionsRun:s}):w.state.kind==="executing"&&ln({kind:"idle",actionsRun:s})})}function Rx(A){return T(this,null,function*(){var n;if(!w.runnerEl||!w.currentQuestion||!w.currentTaskId||w.chatSubmitInFlight)return;const e=w.currentTaskId,t=w.currentApiOpts;if(t){w.chatSubmitInFlight=!0;try{const r={selectedOption:A};yield Up(t,e,w.currentQuestion.id,r),w.currentQuestion=null,yn();const s=yield No(t,e);w.currentTaskId===e&&w.runnerEl&&(w.currentQuestion=(n=s[0])!=null?n:null,yn())}catch(r){const s=w.runnerEl.querySelector("[data-ap-runner-chat-error]");s&&(s.textContent="Failed to send your answer — try again.",s.style.display="block")}finally{w.chatSubmitInFlight=!1}}})}function Ox(A,e){return T(this,null,function*(){var o;if(!w.runnerEl||w.chatSubmitInFlight||w.state.kind==="finished"&&w.state.status==="failed")return;const t=w.runnerEl.querySelector("[data-ap-runner-chat-input]"),n=w.runnerEl.querySelector("[data-ap-runner-chat-error]"),r=w.runnerEl.querySelector("[data-ap-runner-chat-send]");if(!t||!n||!r)return;const s=t.value.trim();if(s){w.chatSubmitInFlight=!0,r.disabled=!0,n.style.display="none";try{if(w.currentQuestion){yield Up(A,e,w.currentQuestion.id,s),w.currentQuestion=null,yn();try{const a=yield No(A,e);w.currentTaskId===e&&w.runnerEl&&(w.currentQuestion=(o=a[0])!=null?o:null,yn())}catch(a){}}else yield OQ(A,e,s),w.state.kind==="finished"&&of();t.value=""}catch(a){n.textContent=a instanceof Error?a.message:"Failed to send — try again.",n.style.display="block"}finally{w.chatSubmitInFlight=!1,r.disabled=!1}}})}function Mx(A,e,t,n,r){return T(this,null,function*(){try{yield DQ(A,e,t,n,r)}catch(s){}})}function Px(A){const e=A.cloneNode(!0);e.querySelectorAll("script, style, noscript").forEach(r=>r.remove()),Od(e),dc(e);let t=e.outerHTML,n=!1;return t.length>Ud&&(t=t.slice(0,Ud),n=!0),`URL: ${location.href}
1909
+ Title: ${document.title}
1910
+
1911
+ ${t}${n?`
1912
+ … (truncated)`:""}`}function Kx(A,e){var s;const n=A instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,r=(s=Object.getOwnPropertyDescriptor(n,"value"))==null?void 0:s.set;if(!r)throw new Error("target element does not accept text input");r.call(A,e),A.dispatchEvent(new Event("input",{bubbles:!0})),A.dispatchEvent(new Event("change",{bubbles:!0}))}function Nx(A){if(!w.runnerEl||!w.currentTaskId||!w.currentBackendUrl)return;const e=w.runnerEl.querySelector("[data-ap-runner-summary]");if(!e)return;const t=`${w.currentBackendUrl.replace(/\/+$/,"")}/tasks/${w.currentTaskId}`,n=A==="completed"?"Automation complete!":"Automation ended",r=A==="completed",s=r?"ap-sdk-panel__btn--secondary":"ap-sdk-panel__btn--primary";e.style.display="block",e.innerHTML=`
1913
+ <div class="ap-sdk-success-card">
1914
+ <p class="ap-sdk-success-headline">${Nc(n)}</p>
1915
+ ${r?`
1916
+ <div class="ap-sdk-runner__approval" data-ap-runner-approval>
1917
+ <div class="ap-sdk-runner__approval-actions">
1918
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary ap-sdk-panel__btn--block" data-ap-runner-approve><span class="ap-sdk-btn-icon" aria-hidden="true">✓</span>Approve</button>
1919
+ <button class="ap-sdk-runner__text-btn ap-sdk-runner__text-btn--danger" data-ap-runner-reject>Reject</button>
1920
+ </div>
1921
+ <div class="ap-sdk-runner__reject-form" data-ap-runner-reject-form style="display:none">
1922
+ <textarea class="ap-sdk-panel__textarea" rows="2" placeholder="What was wrong? (optional)" data-ap-runner-reject-feedback></textarea>
1923
+ <div class="ap-sdk-runner__reject-hint">Leave blank to reject permanently, or add details so the agent can retry with your feedback.</div>
1924
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--danger ap-sdk-panel__btn--block" data-ap-runner-reject-submit>Reject Permanently</button>
1925
+ </div>
1926
+ <div class="ap-sdk-runner__approval-error" data-ap-runner-approval-error style="display:none"></div>
1927
+ </div>
1928
+ <div class="ap-sdk-runner__divider"></div>`:""}
1929
+ <div class="ap-sdk-success-actions ap-sdk-success-actions--stacked">
1930
+ <button class="ap-sdk-panel__btn ${s} ap-sdk-panel__btn--block" data-ap-runner-view>View task<span class="ap-sdk-btn-icon ap-sdk-btn-icon--trailing" aria-hidden="true">↗</span></button>
1931
+ <button class="ap-sdk-runner__text-btn" data-ap-runner-close>Close</button>
1932
+ </div>
1933
+ </div>
1934
+ `,e.querySelector("[data-ap-runner-view]").addEventListener("click",()=>window.open(t,"_blank","noopener,noreferrer")),e.querySelector("[data-ap-runner-close]").addEventListener("click",()=>{const o=w.closeHandler;cc(),o==null||o()}),r&&zx(e)}function zx(A){const e=A.querySelector("[data-ap-runner-approve]"),t=A.querySelector("[data-ap-runner-reject]"),n=A.querySelector("[data-ap-runner-reject-form]"),r=A.querySelector("[data-ap-runner-reject-feedback]"),s=A.querySelector("[data-ap-runner-reject-submit]"),o=A.querySelector("[data-ap-runner-approval-error]"),a=A.querySelector(".ap-sdk-runner__approval-actions"),i=u=>{o.textContent=u,o.style.display="block"};e.addEventListener("click",()=>T(null,null,function*(){if(!w.currentTaskId||!w.currentApiOpts)return;const u=w.currentTaskId,h=w.currentApiOpts;e.disabled=!0,t.disabled=!0,o.style.display="none";try{yield PQ(h,u),a.innerHTML='<span class="ap-sdk-status-badge ap-sdk-status-badge--approved">✓ Approved</span>',n.style.display="none"}catch(f){e.disabled=!1,t.disabled=!1,i(f instanceof Error?f.message:"Failed to approve — try again.")}})),t.addEventListener("click",()=>{n.style.display=n.style.display==="none"?"block":"none",n.style.display==="block"&&r.focus()});const c=()=>{s.textContent=r.value.trim()?"Reject & Continue":"Reject Permanently"};r.addEventListener("input",c),s.addEventListener("click",()=>T(null,null,function*(){if(!w.currentTaskId||!w.currentApiOpts)return;const u=w.currentTaskId,h=w.currentApiOpts,f=r.value.trim();s.disabled=!0,e.disabled=!0,o.style.display="none",s.textContent="Rejecting…";try{yield KQ(h,u,f),f?of():(a.innerHTML='<span class="ap-sdk-status-badge ap-sdk-status-badge--rejected">✕ Rejected</span>',n.style.display="none")}catch(g){s.disabled=!1,e.disabled=!1,c(),i(g instanceof Error?g.message:"Failed to reject — try again.")}}))}function Qd(){var e;const A=(e=w.runnerEl)==null?void 0:e.querySelector("[data-ap-runner-log]");A&&(A.scrollTop=A.scrollHeight)}function vo(){if(!w.runnerEl)return;const A=w.runnerEl.querySelector("[data-ap-runner-scroll-toggle]");A&&(A.textContent=w.autoScrollEnabled?"Auto ↓":"Manual",A.title=w.autoScrollEnabled?"Disable auto-scroll":"Enable auto-scroll",A.classList.toggle("ap-sdk-runner__scroll-toggle--active",w.autoScrollEnabled))}function Kc(){if(!w.runnerEl)return;const A=w.runnerEl.querySelector("[data-ap-runner-status]"),e=w.runnerEl.querySelector("[data-ap-runner-counter]"),t=w.runnerEl.querySelector("[data-ap-runner-log]"),n=w.runnerEl.querySelector("[data-ap-runner-hint]");if(!A||!e||!t||!n)return;const r="actionsRun"in w.state?w.state.actionsRun:0;e.textContent=`${r} action${r===1?"":"s"}`,vo(),w.state.kind==="finished"?(A.textContent=w.state.status.replace(/_/g," "),A.className=`ap-sdk-status-badge ap-sdk-status-badge--${w.state.status.replace(/_/g,"-")}`,n.style.display="none",Nx(w.state.status)):(A.textContent="running",A.className="ap-sdk-status-badge ap-sdk-status-badge--in-progress",n.style.display="block");const s=t.querySelector("[data-ap-runner-placeholder]");if(w.logEntries.length===0&&(w.state.kind==="connecting"||w.state.kind==="idle")){if(!s){const u=document.createElement("div");u.className="ap-sdk-runner__placeholder",u.setAttribute("data-ap-runner-placeholder","1"),u.textContent="Waiting for the agent's first action…",t.appendChild(u)}}else s==null||s.remove();yn();const o=w.runnerEl.querySelector("[data-ap-runner-chat-input]"),a=w.runnerEl.querySelector("[data-ap-runner-chat-send]");if(o&&a){const u=w.state.kind==="finished"&&w.state.status==="failed";o.disabled=u,a.disabled=u||w.chatSubmitInFlight,u&&(o.placeholder="This task failed — start a new automation to continue.")}const i=w.runnerEl.querySelector("[data-ap-runner-cancel]");i&&(i.style.display=w.state.kind==="finished"?"none":"");const c=w.runnerEl.querySelector("[data-ap-runner-summary]");c&&w.state.kind!=="finished"&&(c.style.display="none",c.innerHTML="")}function yn(){var r;if(!w.runnerEl)return;const A=w.runnerEl.querySelector("[data-ap-runner-question]"),e=w.runnerEl.querySelector("[data-ap-runner-chat-input]");if(!A||!e)return;if(!w.currentQuestion){A.style.display="none",A.innerHTML="",e.placeholder="Send a message to the agent…";return}const t=w.currentQuestion.questionMetadata,n=(r=t==null?void 0:t.options)!=null?r:[];if(e.placeholder="Type your answer…",A.style.display="block",A.innerHTML=`
1935
+ <div class="ap-sdk-runner__question-label">${Nc((t==null?void 0:t.header)||"The agent has a question")}</div>
1936
+ <div class="ap-sdk-runner__question-text ap-sdk-markdown">${rf((t==null?void 0:t.question)||w.currentQuestion.question)}</div>
1937
+ ${n.length>0?'<div class="ap-sdk-runner__question-options" data-ap-runner-question-options></div>':""}
1938
+ `,n.length>0){const s=A.querySelector("[data-ap-runner-question-options]");for(const o of n){const a=document.createElement("button");a.type="button",a.className="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-runner__question-option",a.textContent=o.label,a.addEventListener("click",()=>void Rx(o.label)),s.appendChild(a)}}}function Ai(){if(!w.runnerEl||w.runStartedAt===null)return;const A=w.runnerEl.querySelector("[data-ap-runner-timer]");if(!A)return;const e=Math.max(0,Math.floor((Date.now()-w.runStartedAt)/1e3)),t=String(Math.floor(e/60)).padStart(2,"0"),n=String(e%60).padStart(2,"0");A.textContent=`${t}:${n}`}function $x(A,e,t){var u,h;const n=A==="done"?"✓":"✗",r=e.selector?` \`${e.selector}\``:"",s=e.description||`${e.action}${r}`,o=A==="done"&&e.action==="getContext"?`read context (${(u=t==null?void 0:t.length)!=null?u:0} chars)`:t,a=o?` — ${o}`:"";if(w.logEntries.push({status:A,text:`${n} ${s}${a}`}),!w.runnerEl)return;const i=w.runnerEl.querySelector("[data-ap-runner-log]");if(!i)return;(h=i.querySelector("[data-ap-runner-placeholder]"))==null||h.remove();const c=document.createElement("div");c.className=`ap-sdk-runner__log-entry ap-sdk-runner__log-entry--${A}`,c.textContent=w.logEntries[w.logEntries.length-1].text,i.appendChild(c),w.autoScrollEnabled&&(i.scrollTop=i.scrollHeight)}function Gx(A){var e,t;return(t=(e=A.display)==null?void 0:e.variant)!=null?t:A.sdkEventType}function Vx(A){const e=Gx(A);return(A.stream==="stdout"||A.stream==="stderr"||A.stream==="sdk_event"&&(e==="text"||e==="thinking"))&&A.data.trim()||null}function yd(A){var n;const e=A.filter(r=>r.sequence>w.lastRenderedChunkSequence).sort((r,s)=>r.sequence-s.sequence);if(e.length===0||(w.lastRenderedChunkSequence=Math.max(w.lastRenderedChunkSequence,...e.map(r=>r.sequence)),!w.runnerEl))return;const t=w.runnerEl.querySelector("[data-ap-runner-log]");if(t)for(const r of e){const s=Vx(r);if(!s)continue;(n=t.querySelector("[data-ap-runner-placeholder]"))==null||n.remove();const o=document.createElement("div");o.className=`ap-sdk-runner__log-entry ap-sdk-runner__log-entry--output ap-sdk-runner__log-entry--${r.stream}`,r.stream==="sdk_event"?(o.classList.add("ap-sdk-markdown"),o.innerHTML=rf(s)):o.textContent=s,t.appendChild(o),w.autoScrollEnabled&&(t.scrollTop=t.scrollHeight)}}function Zx(A){return A.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Nc(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const af=1e3,Xx=32,Ud=15e3,Wx=new Set(["completed","failed","cancelled"]),Jx=4e3,w={runnerEl:null,runnerResizeCleanup:null,runnerDragCleanup:null,timerHandle:null,highlightOverlay:null,closeHandler:null,currentCaptureTitle:null,cancelArmed:!1,cancelArmTimeout:null,cancelDisarmDocListener:null,state:{kind:"connecting"},logEntries:[],autoScrollEnabled:!0,runStartedAt:null,currentTaskId:null,currentBackendUrl:null,currentApiOpts:null,lastRenderedChunkSequence:-1,currentQuestion:null,chatSubmitInFlight:!1,unsubscribeTaskChannel:null,handledCommandIds:new Set};function ln(A){var e,t;w.state=A,w.state.kind==="idle"&&w.runStartedAt===null&&(w.runStartedAt=Date.now(),Ai(),w.timerHandle=setInterval(Ai,af)),w.state.kind==="finished"&&(w.timerHandle&&(clearInterval(w.timerHandle),w.timerHandle=null),(e=w.unsubscribeTaskChannel)==null||e.call(w),w.unsubscribeTaskChannel=null,(t=w.highlightOverlay)==null||t.hide(),zh()),Kc()}function cc(){var A,e,t,n,r;ko(),zh(),w.timerHandle&&clearInterval(w.timerHandle),w.timerHandle=null,(A=w.unsubscribeTaskChannel)==null||A.call(w),w.unsubscribeTaskChannel=null,(e=w.highlightOverlay)==null||e.destroy(),w.highlightOverlay=null,w.runnerEl&&pt(w.runnerEl),(t=w.runnerEl)==null||t.remove(),w.runnerEl=null,(n=w.runnerResizeCleanup)==null||n.call(w),w.runnerResizeCleanup=null,(r=w.runnerDragCleanup)==null||r.call(w),w.runnerDragCleanup=null,w.closeHandler=null,w.state={kind:"connecting"},w.logEntries=[],w.autoScrollEnabled=!0,w.runStartedAt=null,w.currentTaskId=null,w.currentBackendUrl=null,w.currentApiOpts=null,w.currentCaptureTitle=null,w.lastRenderedChunkSequence=-1,w.currentQuestion=null,w.chatSubmitInFlight=!1,w.handledCommandIds=new Set}function zc(A,e,t,n,r){w.runnerEl&&cc(),w.closeHandler=r!=null?r:null,w.state={kind:"connecting"},w.logEntries=[],w.autoScrollEnabled=!0,w.runStartedAt=null,w.lastRenderedChunkSequence=-1,w.currentQuestion=null,w.chatSubmitInFlight=!1,w.handledCommandIds=new Set,w.currentTaskId=A,w.currentBackendUrl=t,w.currentApiOpts=e,w.currentCaptureTitle=n,Nh({taskId:A,backendUrl:t,title:n});const s=document.createElement("div");w.runnerEl=s,s.className="ap-sdk-panel",s.setAttribute("data-ap-sdk","1"),s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-label","Automation in progress");const o=n.length>55?`${n.slice(0,52)}…`:n;s.innerHTML=`
1746
1939
  <div class="ap-sdk-panel__header">
1747
1940
  <span class="ap-sdk-panel__title">
1748
1941
  <span class="ap-sdk-panel__logo">AP</span>
1749
- Capture to Agent Platform
1942
+ Automating page
1750
1943
  </span>
1751
1944
  <div class="ap-sdk-panel__header-actions">
1752
- <button class="ap-sdk-panel__config" aria-label="Configure" data-ap-reconfigure>⚙</button>
1753
1945
  <button class="ap-sdk-panel__close" aria-label="Close" data-ap-close>×</button>
1754
1946
  </div>
1755
1947
  </div>
1756
- <div class="ap-sdk-pick-list" data-ap-pick-list style="display:none"></div>
1757
- <div class="ap-sdk-panel__context" data-ap-context>
1758
- ${Fa(e)}
1759
- </div>
1760
- <div class="ap-sdk-panel__pick-actions" data-ap-pick-actions>
1761
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-panel__btn--select-parent" data-ap-select-parent type="button">
1762
- ⬆ Select parent
1763
- </button>
1764
- ${l?`
1765
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-panel__btn--reselect" data-ap-reselect type="button">
1766
- ↻ Re-select
1767
- </button>`:""}
1768
- </div>
1769
- ${m?`
1770
- <div class="ap-sdk-credentials-section" data-ap-credentials>
1771
- <p class="ap-sdk-credentials-heading">Connect to Agent Platform to continue</p>
1772
- <p class="ap-sdk-config-hint">You'll be asked to approve this connection on Agent Platform's own sign-in page.</p>
1773
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-connect-required type="button">Connect via Agent Platform</button>
1774
- </div>`:""}
1775
- <div class="ap-sdk-panel__body">
1776
- <div class="ap-sdk-panel__field">
1777
- <label class="ap-sdk-panel__label" for="ap-sdk-note">Instruction</label>
1778
- <textarea id="ap-sdk-note" class="ap-sdk-panel__textarea" rows="3"
1779
- placeholder="Describe the task or planning session…" data-ap-note></textarea>
1780
- </div>
1781
- ${d?`
1782
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--add-another" data-ap-add-another disabled>
1783
- + Add another
1784
- </button>`:""}
1785
- <div class="ap-sdk-panel__field">
1786
- <div class="ap-sdk-panel__label">Type</div>
1787
- <div class="ap-sdk-panel__toggle">
1788
- ${w?`<button class="ap-sdk-panel__toggle-btn${v.captureType==="planning"?" ap-sdk-active":""}" data-ap-type="planning">Planning Session</button>`:""}
1789
- ${k?`<button class="ap-sdk-panel__toggle-btn${v.captureType==="task"?" ap-sdk-active":""}" data-ap-type="task">Task</button>`:""}
1790
- ${k?`<button class="ap-sdk-panel__toggle-btn${v.captureType==="automate"?" ap-sdk-active":""}" data-ap-type="automate">Automate</button>`:""}
1791
- </div>
1948
+ <div class="ap-sdk-runner__meta">
1949
+ <div class="ap-sdk-runner__meta-row">
1950
+ <span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--automate">Automate</span>
1951
+ <span class="ap-sdk-runner__title" title="${Zx(n)}">${Nc(o)}</span>
1792
1952
  </div>
1793
- <div class="ap-sdk-panel__field" data-ap-automate-options style="display:none">
1794
- <label class="ap-sdk-advanced__checkbox-label">
1795
- <input type="checkbox" data-ap-allow-submit />
1796
- Allow submit / confirm actions
1797
- </label>
1798
- <span class="ap-sdk-advanced__hint">Lets the agent click Submit, Confirm, Send, or Publish buttons to finish the task. It will still avoid payments and deletions unless you ask for them.</span>
1953
+ <div class="ap-sdk-runner__meta-row ap-sdk-runner__meta-row--controls">
1954
+ <span class="ap-sdk-runner__counter" data-ap-runner-counter>0 actions</span>
1955
+ <span class="ap-sdk-runner__timer" data-ap-runner-timer>00:00</span>
1956
+ <span class="ap-sdk-status-badge ap-sdk-status-badge--in-progress" data-ap-runner-status>running</span>
1957
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-runner__cancel-btn" data-ap-runner-cancel type="button">Cancel task</button>
1799
1958
  </div>
1800
1959
  </div>
1801
- <div class="ap-sdk-panel__status" data-ap-status style="display:none"></div>
1802
- <div class="ap-sdk-panel__footer">
1803
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-submit>Submit</button>
1804
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost" data-ap-cancel>Cancel</button>
1960
+ <div class="ap-sdk-runner__log-toolbar">
1961
+ <button type="button" class="ap-sdk-runner__scroll-toggle" data-ap-runner-scroll-toggle>Auto ↓</button>
1962
+ <button type="button" class="ap-sdk-runner__scroll-jump" data-ap-runner-scroll-jump title="Jump to latest output">Jump to latest</button>
1805
1963
  </div>
1806
- `,W.addEventListener("wheel",H=>{H.stopPropagation()},{passive:!0}),W.addEventListener("touchmove",H=>{H.stopPropagation()},{passive:!0});const Z=W.querySelector(".ap-sdk-panel__body"),K=Pk(Z,n,(Te=r==null?void 0:r.id)!=null?Te:null);document.body.appendChild(W),et=Gs(),v.currentPickedEl&&et.update(v.currentPickedEl),Qt(W),ni(W,ti);const M=W.querySelector("[data-ap-close]"),E=W.querySelector("[data-ap-cancel]"),T=W.querySelector("[data-ap-submit]"),C=W.querySelector("[data-ap-note]"),N=W.querySelector("[data-ap-status]"),J=W.querySelectorAll("[data-ap-type]"),ye=W.querySelector("[data-ap-automate-options]"),Oe=W.querySelector("[data-ap-allow-submit]"),Be=W.querySelector("[data-ap-pick-list]"),te=W.querySelector("[data-ap-context]"),we=W.querySelector("[data-ap-add-another]"),ot=W.querySelector("[data-ap-pick-actions]"),nn=W.querySelector("[data-ap-select-parent]"),rn=W.querySelector("[data-ap-reselect]"),dt=()=>{v.currentPickedEl&&(et==null||et.update(v.currentPickedEl))};window.addEventListener("scroll",dt,{capture:!0,passive:!0}),window.addEventListener("resize",dt),Vt=()=>{window.removeEventListener("scroll",dt,!0),window.removeEventListener("resize",dt)};const It=H=>{H?(te.innerHTML=Fa(H),C.disabled=!1,C.placeholder="Describe the task or planning session…",setTimeout(()=>C.focus(),50)):(te.innerHTML=`
1807
- <div class="ap-sdk-panel__context-label">Next element</div>
1808
- <div class="ap-sdk-panel__context-text ap-sdk-awaiting-pick">👆 Hover and click any element on the page</div>
1809
- `,C.disabled=!0,C.placeholder="Pick an element to continue…")},on=()=>{if(v.completedPicks.length===0){Be.style.display="none",Be.innerHTML="";return}Be.style.display="block",Be.innerHTML=v.completedPicks.map((H,oe)=>{var Q;return`
1810
- <div class="ap-sdk-pick-entry" data-pick-index="${oe}">
1811
- <div class="ap-sdk-pick-entry__header">
1812
- <span class="ap-sdk-pick-entry__number">${oe+1}</span>
1813
- <span class="ap-sdk-pick-entry__element" title="${ut((Q=H.ctx.elementText)!=null?Q:"")}">${ut(H.ctx.elementText||"(no text)")}</span>
1814
- <button class="ap-sdk-pick-entry__remove" data-ap-remove="${oe}" aria-label="Remove pick ${oe+1}">×</button>
1815
- </div>
1816
- <div class="ap-sdk-pick-entry__instruction">${ut(H.instruction)}</div>
1817
- </div>
1818
- `}).join(""),Be.querySelectorAll("[data-ap-remove]").forEach(H=>{H.addEventListener("click",()=>{const oe=parseInt(H.dataset.apRemove,10);v.completedPicks.splice(oe,1),on()})})},sn=()=>{if(!v.currentPickedEl){ot.style.display="none";return}ot.style.display="",nn.disabled=!v.currentPickedEl.parentElement||v.awaitingPick,rn&&(rn.disabled=v.awaitingPick)},$t=()=>{we&&(we.disabled=!C.value.trim()||v.submitting||v.awaitingPick)},pe=(H,oe)=>{v.currentCtx=H,v.currentPickedEl=oe,It(H),et==null||et.update(oe),sn()};sn(),g&&(C.value=g.note,Oe.checked=g.allowSubmit,ye.style.display=v.captureType==="automate"?"":"none",on(),Jn(N,"success","Reconnected — your draft was kept.")),nn.addEventListener("click",()=>{var oe;const H=(oe=v.currentPickedEl)==null?void 0:oe.parentElement;H&&pe(Qa(H),H)}),rn&&l&&rn.addEventListener("click",()=>{if(v.awaitingPick)return;const H=v.currentCtx,oe=v.currentPickedEl;v.awaitingPick=!0,sn(),$t(),It(null),l((Q,Ne)=>{v.awaitingPick=!1,pe(Q,Ne),$t()},()=>{v.awaitingPick=!1,oe&&pe(H,oe),$t()})});const vt=()=>{qr(),p==null||p()},_e=()=>({captureType:v.captureType,note:C.value,completedPicks:v.completedPicks,currentCtx:v.currentCtx,currentPickedEl:v.currentPickedEl,allowSubmit:v.allowSubmit});M.addEventListener("click",vt),E.addEventListener("click",vt);const yn=W.querySelector("[data-ap-connect-required]");yn&&a&&yn.addEventListener("click",()=>{const H=_e();vt(),a(H)}),J.forEach(H=>{H.addEventListener("click",()=>{v.captureType=H.dataset.apType,J.forEach(oe=>oe.classList.toggle("ap-sdk-active",oe===H)),ye.style.display=v.captureType==="automate"?"":"none"})}),Oe.addEventListener("change",()=>{v.allowSubmit=Oe.checked});const le=W.querySelector("[data-ap-reconfigure]");a?le.addEventListener("click",()=>{const H=_e();vt(),a(H)}):le.style.display="none",we&&d&&(C.addEventListener("input",$t),we.addEventListener("click",()=>{const H=C.value.trim();!H||v.awaitingPick||(v.completedPicks.push({ctx:v.currentCtx,instruction:H}),on(),C.value="",v.awaitingPick=!0,we.disabled=!0,sn(),It(null),d((oe,Q)=>{v.awaitingPick=!1,pe(oe,Q),$t()}))}));const Ge=()=>z(null,null,function*(){var Ft,wt;if(v.submitting)return;if(m){Jn(N,"error","Connect to Agent Platform first.");return}const H=n.backendUrl,oe=n.token,Q=C.value.trim();if(!Q){Jn(N,"error","Please enter an instruction.");return}v.submitting=!0,Ps(W,!0),Jn(N,null,""),T.textContent="Submitting…";const Ne={backendUrl:H,token:oe},We=K.getOptions(),je=[...v.completedPicks,{ctx:v.currentCtx,instruction:Q}];try{const De={id:r==null?void 0:r.id,key:o};let Ce,ze,Ue;if(je.length===1)if(v.captureType==="task")Ce=(yield $s(Ne,{project:De,note:Q,ctx:v.currentCtx,advancedOpts:We})).id,ze="task",Ue=Q.slice(0,120)||v.currentCtx.pageTitle||"Browser capture";else if(v.captureType==="planning"){let Ye=yd(Q,D(y({},v.currentCtx),{ancestry:v.currentCtx.outerTree||v.currentCtx.ancestry}));(Ft=v.currentCtx.innerTree)!=null&&Ft.trim()&&(Ye+=`
1964
+ <div class="ap-sdk-runner__log" data-ap-runner-log></div>
1965
+ <div class="ap-sdk-runner__chat" data-ap-runner-chat>
1966
+ <div class="ap-sdk-runner__question" data-ap-runner-question style="display:none"></div>
1967
+ <form class="ap-sdk-runner__chat-form" data-ap-runner-chat-form>
1968
+ <input
1969
+ type="text"
1970
+ class="ap-sdk-runner__chat-input"
1971
+ data-ap-runner-chat-input
1972
+ placeholder="Send a message to the agent…"
1973
+ autocomplete="off"
1974
+ />
1975
+ <button type="submit" class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-runner-chat-send>Send</button>
1976
+ </form>
1977
+ <div class="ap-sdk-runner__chat-error" data-ap-runner-chat-error style="display:none"></div>
1978
+ </div>
1979
+ <div class="ap-sdk-runner__hint" data-ap-runner-hint>Closing keeps the task running — resume anytime from My Captures.</div>
1980
+ <div class="ap-sdk-panel__status" data-ap-runner-summary style="display:none"></div>
1981
+ `,s.addEventListener("wheel",a=>{a.stopPropagation()},{passive:!0}),s.addEventListener("touchmove",a=>{a.stopPropagation()},{passive:!0}),document.body.appendChild(s),w.highlightOverlay=uc(),dt(s),w.runnerResizeCleanup=Qc(s,bc),w.runnerDragCleanup=Cs(s,ms),s.querySelector("[data-ap-close]").addEventListener("click",()=>{cc(),r==null||r()}),s.querySelector("[data-ap-runner-chat-form]").addEventListener("submit",a=>{a.preventDefault(),Ox(e,A)}),s.querySelector("[data-ap-runner-cancel]").addEventListener("click",a=>{a.stopPropagation();const i=a.currentTarget;if(!w.cancelArmed){w.cancelArmed=!0,i.textContent="Confirm",w.cancelArmTimeout=setTimeout(ko,Jx),w.cancelDisarmDocListener=c=>{c.target!==i&&ko()},document.addEventListener("click",w.cancelDisarmDocListener,!0);return}ko(),Dx(e,A)}),s.querySelector("[data-ap-runner-scroll-toggle]").addEventListener("click",()=>{w.autoScrollEnabled=!w.autoScrollEnabled,w.autoScrollEnabled&&Qd(),vo()}),s.querySelector("[data-ap-runner-scroll-jump]").addEventListener("click",()=>{w.autoScrollEnabled=!0,Qd(),vo()}),s.querySelector("[data-ap-runner-log]").addEventListener("scroll",()=>{if(!w.autoScrollEnabled||!w.runnerEl)return;const a=w.runnerEl.querySelector("[data-ap-runner-log]");a.scrollHeight-a.scrollTop-a.clientHeight>Xx&&(w.autoScrollEnabled=!1,vo())}),Kc(),sf(A,e)}const $c="ap-sdk-captures",jx=50;function fr(){try{const A=localStorage.getItem($c);return A?JSON.parse(A):[]}catch(A){return[]}}function Yx(A){const e=fr(),t=[A,...e].slice(0,jx);try{localStorage.setItem($c,JSON.stringify(t))}catch(n){}}function qx(){try{localStorage.removeItem($c)}catch(A){}}function cf(A){var o,a,i,c,u;if(A.id){const h=document.querySelector(`label[for="${CSS.escape(A.id)}"]`),f=(o=h==null?void 0:h.textContent)==null?void 0:o.trim();if(f)return f}const e=A.closest("label"),t=(a=e==null?void 0:e.textContent)==null?void 0:a.trim();if(t)return t;const n=(i=A.getAttribute("aria-label"))==null?void 0:i.trim();if(n)return n;const r=(c=A.placeholder)==null?void 0:c.trim();if(r)return r;const s=(u=A.getAttribute("name"))==null?void 0:u.trim();return s||A.tagName.toLowerCase()}function AS(A,e){return`Click "${A}" ${e.toLowerCase()}`}function lf(A,e,t){return t?`Typed [redacted] into ${A}`:`Typed "${e}" into ${A}`}function Ed(A,e){return`Scrolled to (${A}, ${e})`}function eS(A,e){return e?`Pressed "${A}" in ${e}`:`Pressed "${A}"`}function uf(A){return A.map((e,t)=>`${t+1}. ${e.description}`).join(`
1982
+ `)}const tS=400,nS=new Set(["Enter","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]),rS=new Set(["Control","Meta","Alt","Shift"]);function sS(A){if(rS.has(A.key))return null;const e=[];return A.ctrlKey&&e.push("Ctrl"),A.metaKey&&e.push("Cmd"),A.altKey&&e.push("Alt"),e.length>0?(e.push(A.key.length===1?A.key.toUpperCase():A.key),e.join("+")):nS.has(A.key)?A.key:null}function oS(A){return A instanceof HTMLInputElement||A instanceof HTMLTextAreaElement||A instanceof HTMLSelectElement?cf(A):Do(A)||A.tagName.toLowerCase()}let lr=[],ie=null,ei=null,he=null,at=null,ct=null;function df(){ei&&(ei.textContent=`● Recording — ${lr.length} step${lr.length===1?"":"s"}`)}function lc(){ct&&(clearTimeout(ct),ct=null),at&&(lr.push(at),at=null,df())}function wa(A){lc(),lr.push(A),df()}function iS(A){var e,t,n;return A instanceof HTMLSelectElement&&(n=(t=(e=A.selectedOptions[0])==null?void 0:e.textContent)==null?void 0:t.trim())!=null?n:A.value}function aS(A,e){he&&he(),lr=[],at=null,ie=document.createElement("div"),ie.className="ap-sdk-recorder-bar",ie.setAttribute("data-ap-sdk","1"),ie.innerHTML=`
1983
+ <span class="ap-sdk-recorder-bar__counter" data-ap-recorder-counter>● Recording — 0 steps</span>
1984
+ <button class="ap-sdk-recorder-bar__btn ap-sdk-recorder-bar__btn--stop" data-ap-recorder-stop type="button">Stop</button>
1985
+ <button class="ap-sdk-recorder-bar__btn ap-sdk-recorder-bar__btn--discard" data-ap-recorder-discard type="button">Discard</button>
1986
+ `,document.body.appendChild(ie),dt(ie),ei=ie.querySelector("[data-ap-recorder-counter]");const t=()=>{lc();const i=lr;he==null||he(),A(i)},n=()=>{he==null||he()};ie.querySelector("[data-ap-recorder-stop]").addEventListener("click",t),ie.querySelector("[data-ap-recorder-discard]").addEventListener("click",n);const r=i=>{if(rs(i.target))return;const c=i.target;wa({action:"click",cssSelector:bo(c),elementText:Do(c),description:AS(Do(c),c.tagName),capturedAt:new Date().toISOString()})},s=i=>{if(rs(i.target))return;const c=i.target;if(!(c instanceof HTMLInputElement)&&!(c instanceof HTMLTextAreaElement)&&!(c instanceof HTMLSelectElement))return;const u=cf(c),h=Rd(c),f=h?"[redacted]":iS(c);wa($(k({action:"inputText",cssSelector:bo(c),elementText:u,value:f},h?{redacted:!0}:{}),{description:lf(u,f,h),capturedAt:new Date().toISOString()}))},o=()=>{const i=Math.round(window.scrollX),c=Math.round(window.scrollY);at?(at.scrollX=i,at.scrollY=c,at.description=Ed(i,c)):at={action:"scroll",scrollX:i,scrollY:c,description:Ed(i,c),capturedAt:new Date().toISOString()},ct&&clearTimeout(ct),ct=setTimeout(()=>{ct=null,lc()},tS)},a=i=>{if(i.key==="Escape"){n();return}if(rs(i.target))return;const c=sS(i);if(!c)return;const u=i.target instanceof Element?i.target:document.body,h=oS(u);wa({action:"keypress",cssSelector:bo(u),elementText:h,key:c,description:eS(c,h),capturedAt:new Date().toISOString()})};document.addEventListener("click",r,{capture:!0}),document.addEventListener("change",s,{capture:!0}),window.addEventListener("scroll",o,{capture:!0,passive:!0}),document.addEventListener("keydown",a,{capture:!0}),he=()=>{document.removeEventListener("click",r,{capture:!0}),document.removeEventListener("change",s,{capture:!0}),window.removeEventListener("scroll",o,{capture:!0}),document.removeEventListener("keydown",a,{capture:!0}),ct&&(clearTimeout(ct),ct=null),at=null,ie&&pt(ie),ie==null||ie.remove(),ie=null,ei=null,he=null}}function cS(){he==null||he()}function _o(){return he!==null}const lS="data-ap-sdk",uS="ap-sdk-fab",Fd="ap-sdk-fab--dragging",Gc="ap-sdk-fab--open",pf="ap-sdk-fab-pos",ti="ap-sdk-fab--left-edge",dS='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M15 13v2"/><path d="M9 13v2"/></svg>',pS='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m3 3 7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/><path d="m13 13 6 6"/></svg>',hS='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="8"/></svg>',fS='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>';let P=null,ot=null,Ht=null,Lt=null,Fe=null,Vn=null,Zn=null,Xn=null,xo=null,ss=null,sr=null,So=null,Io=null,To=null,hf=0,ff=0,gf=0,Bf=0,Yn=!1,Ge=!1,os=null,pn=null;function gS(){os=A=>{if(!P){Ho();return}if(!Yn){if(Math.hypot(A.clientX-gf,A.clientY-Bf)<5)return;Yn=!0,Ge=!0,P.classList.add(Fd)}BS(A.clientX-hf,A.clientY-ff)},pn=()=>{if(!P){Ho();return}Yn?(Yn=!1,P.classList.remove(Fd),P.style.transition="",wS(P.getBoundingClientRect())):P.style.transition="",Ho()},window.addEventListener("pointermove",os),window.addEventListener("pointerup",pn),window.addEventListener("pointercancel",pn)}function Ho(){os&&(window.removeEventListener("pointermove",os),os=null),pn&&(window.removeEventListener("pointerup",pn),window.removeEventListener("pointercancel",pn),pn=null)}function BS(A,e){if(!P)return;const t=P.offsetWidth||52,n=P.offsetHeight||52;P.style.top=`${Math.max(0,Math.min(e,window.innerHeight-n))}px`,P.style.left=`${Math.max(0,Math.min(A,window.innerWidth-t))}px`,P.style.bottom="auto",P.style.right="auto"}function wS(A){if(!P)return;const t=Math.max(16,Math.min(window.innerHeight-A.bottom,window.innerHeight-52-16)),n=A.left+A.width/2<window.innerWidth/2?"left":"right";P.style.top="auto",P.style.bottom=`${t}px`,n==="left"?(P.style.right="auto",P.style.left="16px",P.classList.add(ti)):(P.style.left="auto",P.style.right="16px",P.classList.remove(ti));try{localStorage.setItem(pf,JSON.stringify({edge:n,bottom:t}))}catch(r){}}function mS(){if(P)try{const A=localStorage.getItem(pf);if(!A)return;const e=JSON.parse(A);if(typeof e.bottom!="number"||e.edge!=="left"&&e.edge!=="right")return;const n=Math.max(16,Math.min(e.bottom,window.innerHeight-52-16));P.style.top="auto",P.style.bottom=`${n}px`,e.edge==="left"?(P.style.right="auto",P.style.left="16px",P.classList.add(ti)):(P.style.left="auto",P.style.right="16px",P.classList.remove(ti))}catch(A){}}function qn(){P==null||P.classList.remove(Gc),sr&&(window.removeEventListener("pointerdown",sr,{capture:!0}),sr=null)}function CS(){P&&(P.classList.add(Gc),sr=A=>{!P||P.contains(A.target)||qn()},requestAnimationFrame(()=>{sr&&window.addEventListener("pointerdown",sr,{capture:!0})}))}function wo(A){return new DOMParser().parseFromString(A,"text/html").body.firstElementChild}function wf(A,e,t){var a;if(So=A,Io=e,To=t,P)return;P=document.createElement("div"),P.className=uS,P.setAttribute(lS,"1"),Vn=document.createElement("div"),Vn.className="ap-sdk-fab__row";const n=document.createElement("span");n.className="ap-sdk-fab__label",n.textContent="View captures",Fe=document.createElement("button"),Fe.className="ap-sdk-fab__list ap-sdk-fab__sub",Fe.setAttribute("aria-label","My captures"),Fe.setAttribute("title","View my captures"),Fe.appendChild(wo(fS));const r=document.createElement("span");r.className="ap-sdk-fab__badge",r.setAttribute("data-ap-badge",""),r.style.display="none",Fe.appendChild(r),Vn.appendChild(n),Vn.appendChild(Fe),Zn=document.createElement("div"),Zn.className="ap-sdk-fab__row";const s=document.createElement("span");s.className="ap-sdk-fab__label",s.textContent="Capture element",Ht=document.createElement("button"),Ht.className="ap-sdk-fab__capture ap-sdk-fab__sub",Ht.setAttribute("aria-label","Capture element"),Ht.setAttribute("title","Capture element to Agent Platform"),Ht.appendChild(wo(pS)),Zn.appendChild(s),Zn.appendChild(Ht),Xn=document.createElement("div"),Xn.className="ap-sdk-fab__row";const o=document.createElement("span");o.className="ap-sdk-fab__label",o.textContent="Record interaction",Lt=document.createElement("button"),Lt.className="ap-sdk-fab__record ap-sdk-fab__sub",Lt.setAttribute("aria-label","Record interaction"),Lt.setAttribute("title","Record a sequence of interactions"),Lt.appendChild(wo(hS)),Xn.appendChild(o),Xn.appendChild(Lt),ot=document.createElement("button"),ot.className="ap-sdk-fab__main",ot.setAttribute("aria-label","Agent Platform"),ot.setAttribute("title","Agent Platform"),ot.appendChild(wo(dS)),P.appendChild(Vn),P.appendChild(Zn),P.appendChild(Xn),P.appendChild(ot),ot.addEventListener("click",i=>{if(Ge){Ge=!1;return}i.preventDefault(),i.stopPropagation(),P!=null&&P.classList.contains(Gc)?qn():CS()}),Ht.addEventListener("click",i=>{if(Ge){Ge=!1;return}i.preventDefault(),i.stopPropagation(),qn(),!tr()&&!_o()&&So&&So()}),Lt.addEventListener("click",i=>{if(Ge){Ge=!1;return}i.preventDefault(),i.stopPropagation(),qn(),!tr()&&!_o()&&Io&&Io()}),Fe.addEventListener("click",i=>{if(Ge){Ge=!1;return}i.preventDefault(),i.stopPropagation(),qn(),To&&To()}),ss=i=>{if(!P||!(P===i.target||P.contains(i.target)))return;const c=P.getBoundingClientRect();hf=i.clientX-c.left,ff=i.clientY-c.top,gf=i.clientX,Bf=i.clientY,Yn=!1,Ge=!1,P.style.transition="none",i.stopPropagation(),gS()},window.addEventListener("pointerdown",ss,{capture:!0}),((a=document.body)!=null?a:document.documentElement).appendChild(P),dt(P),mS(),xo=setInterval(()=>{ot&&ot.classList.toggle("ap-sdk-fab__main--active",tr()||_o())},200)}function Un(A){const e=Fe==null?void 0:Fe.querySelector("[data-ap-badge]");e&&(A>0?(e.textContent=String(A),e.style.display=""):e.style.display="none")}function mf(){Yn=!1,Ge=!1,Ho(),qn(),xo&&(clearInterval(xo),xo=null),ss&&(window.removeEventListener("pointerdown",ss,{capture:!0}),ss=null),P&&pt(P),P==null||P.remove(),P=null,ot=null,Ht=null,Lt=null,Fe=null,Vn=null,Zn=null,Xn=null,So=null,Io=null,To=null}function Cf(A,e){return T(this,null,function*(){try{if(A.type==="planning"){const n=yield TQ(e,A.id);return{capture:A,status:n.status,approved:n.status==="approved"}}const t=yield yp(e,A.id);return{capture:A,status:t.status,approved:t.approved===!0}}catch(t){return{capture:A,status:"unavailable",approved:!1}}})}function bf(A){return A.filter(e=>!e.approved).length}function Qf(A){return T(this,null,function*(){const e=fr();if(!A||e.length===0){Un(e.length);return}const t=yield Promise.all(e.map(n=>Cf(n,A)));Un(bf(t))})}function kd(A){return A.screenshotBlob?`
1819
1987
 
1988
+ (A screenshot of the selected element is attached.)`:""}function bS(A){return A.map((e,t)=>{var r,s;const n=[`## Pick ${t+1}`,""];return(r=e.ctx.interactionSteps)!=null&&r.length?n.push("Recorded steps:",uf(e.ctx.interactionSteps)):(n.push(`Element: ${e.ctx.elementText||"(no text)"}`),e.ctx.cssSelector&&n.push(`Selector: ${e.ctx.cssSelector}`),e.ctx.ancestry&&n.push(`Ancestry: ${e.ctx.ancestry}`)),n.push(`Page: ${e.ctx.pageTitle} (${e.ctx.pageUrl})`),(s=e.ctx.innerTree)!=null&&s.trim()&&n.push(`
1820
1989
  Element tree:
1821
- ${v.currentCtx.innerTree}`),(wt=v.currentCtx.interactionSteps)!=null&&wt.length&&(Ye+=`
1990
+ ${e.ctx.innerTree}`),e.screenshotBlob&&n.push(`Screenshot: attached (see screenshot-${t+1}.png)`),n.push("",`Instruction:
1991
+ ${e.instruction}`),n.join(`
1992
+ `)}).join(`
1822
1993
 
1823
- Recorded steps:
1824
- ${ll(v.currentCtx.interactionSteps)}`),Ce=(yield fa(Ne,De,Ye,We)).id,ze="planning",Ue=Q.slice(0,120)||v.currentCtx.pageTitle||"Planning session"}else Ce=(yield ha(Ne,{project:De,note:Q,ctx:v.currentCtx,advancedOpts:We,allowSubmit:v.allowSubmit})).id,ze="automate",Ue=Q.slice(0,120)||v.currentCtx.pageTitle||"Browser automation";else{const Ye=c_(je),st=je[0].instruction.slice(0,120)||je[0].ctx.pageTitle||"Multi-element capture",xt=je.map(Ae=>Ae.instruction).filter(Boolean).join(`
1994
+ ---
1995
+
1996
+ `)}function QS(i){return T(this,arguments,function*({opts:A,advancedOpts:e,allPicks:t,captureType:n,note:r,allowSubmit:s,project:o,projectCode:a}){var m,Q;const u=t.some(U=>!!U.screenshotBlob)?(yield Promise.all(t.map((U,E)=>U.screenshotBlob?vQ(A,U.screenshotBlob,`screenshot-${E+1}.png`).then(v=>v.id).catch(()=>null):Promise.resolve(null)))).filter(U=>U!==null):[],h={id:o==null?void 0:o.id,key:a};let f,g;if(t.length===1){const U=r+kd(t[0]),E=t[0].ctx;if(n==="task")f=(yield Ea(A,{project:h,note:U,ctx:E,advancedOpts:e,extraFileIds:u})).id,g=r.slice(0,120)||E.pageTitle||"Browser capture";else if(n==="planning"){let v=EB(r,$(k({},E),{ancestry:E.outerTree||E.ancestry}));(m=E.innerTree)!=null&&m.trim()&&(v+=`
1825
1997
 
1826
- `);v.captureType==="task"?(Ce=(yield $s(Ne,{project:De,note:Ye,ctx:je[0].ctx,advancedOpts:We,titleOverride:st,type:$c,titleInstruction:xt})).id,ze="task",Ue=st):v.captureType==="planning"?(Ce=(yield fa(Ne,De,Ye,We)).id,ze="planning",Ue=st):(Ce=(yield ha(Ne,{project:De,note:Ye,ctx:je[0].ctx,advancedOpts:We,titleOverride:st,titleInstruction:xt,allowSubmit:v.allowSubmit})).id,ze="automate",Ue=st)}if(Ik({id:Ce,type:ze,title:Ue,backendUrl:H,createdAt:new Date().toISOString()}),vl(Ne).catch(()=>{}),ze==="automate"){vt(),pi(Ce,Ne,H,Ue,p);return}const fr=ze==="task"?`${H.replace(/\/+$/,"")}/tasks/${Ce}`:`${H.replace(/\/+$/,"")}/planning/${Ce}`;u_(N,ze,Ue,fr,vt),W.classList.add("ap-sdk-panel--success"),Vt==null||Vt(),Vt=null,et==null||et.hide(),v.submitting=!1,Ps(W,!1)}catch(De){De instanceof Oc?l_(N,()=>z(null,null,function*(){const{code:Ce}=yield Bs(H),{token:ze,expiresAt:Ue}=yield Os({backendUrl:H},Ce,window.location.origin);rs({backendUrl:H,token:ze,projectCode:o,expiresAt:Ue}),n.token=ze,i({backendUrl:H,token:ze}),yield Ge()})):Jn(N,"error",De instanceof Error?De.message:"An unexpected error occurred."),v.submitting=!1,Ps(W,!1),T.textContent="Submit"}});T.addEventListener("click",Ge),setTimeout(()=>C.focus(),50)}const a_={click:"🖱",inputText:"⌨",scroll:"↕",keypress:"⌤"};function Fa(e){var t,n;return(t=e.interactionSteps)!=null&&t.length?`
1827
- <div class="ap-sdk-panel__context-label">Recorded steps (${e.interactionSteps.length})</div>
1828
- <div class="ap-sdk-panel__context-steps">
1829
- ${e.interactionSteps.map(r=>`
1830
- <div class="ap-sdk-panel__context-step">
1831
- <span class="ap-sdk-panel__context-step-icon">${a_[r.action]}</span>
1832
- <span class="ap-sdk-panel__context-step-text">${ut(r.description)}</span>
1833
- </div>
1834
- `).join("")}
1835
- </div>
1836
- `:`
1837
- <div class="ap-sdk-panel__context-label">Captured element</div>
1838
- <div class="ap-sdk-panel__context-text" title="${ut((n=e.elementText)!=null?n:"")}">${ut(e.elementText||"(no text)")}</div>
1839
- ${e.cssSelector?`<div class="ap-sdk-panel__context-selector" title="${ut(e.cssSelector)}">${ut(e.cssSelector)}</div>`:""}
1840
- `}function c_(e){return e.map((t,n)=>{var o,i;const r=[`## Pick ${n+1}`,""];return(o=t.ctx.interactionSteps)!=null&&o.length?r.push("Recorded steps:",ll(t.ctx.interactionSteps)):(r.push(`Element: ${t.ctx.elementText||"(no text)"}`),t.ctx.cssSelector&&r.push(`Selector: ${t.ctx.cssSelector}`),t.ctx.ancestry&&r.push(`Ancestry: ${t.ctx.ancestry}`)),r.push(`Page: ${t.ctx.pageTitle} (${t.ctx.pageUrl})`),(i=t.ctx.innerTree)!=null&&i.trim()&&r.push(`
1841
1998
  Element tree:
1842
- ${t.ctx.innerTree}`),r.push("",`Instruction:
1843
- ${t.instruction}`),r.join(`
1844
- `)}).join(`
1999
+ ${E.innerTree}`),(Q=E.interactionSteps)!=null&&Q.length&&(v+=`
1845
2000
 
1846
- ---
2001
+ Recorded steps:
2002
+ ${uf(E.interactionSteps)}`),v+=kd(t[0]),f=(yield zl(A,h,v,e,u)).id,g=r.slice(0,120)||E.pageTitle||"Planning session"}else f=(yield Nl(A,{project:h,note:U,ctx:E,advancedOpts:e,allowSubmit:s,extraFileIds:u})).id,g=r.slice(0,120)||E.pageTitle||"Browser automation"}else{const U=bS(t),E=t[0].instruction.slice(0,120)||t[0].ctx.pageTitle||"Multi-element capture",v=t.map(F=>F.instruction).filter(Boolean).join(`
1847
2003
 
1848
- `)}function Jn(e,t,n){if(!t){e.style.display="none",e.textContent="",e.innerHTML="";return}e.style.display="block",e.className=`ap-sdk-panel__status ap-sdk-panel__status--${t}`,e.textContent=n}function l_(e,t){e.style.display="block",e.className="ap-sdk-panel__status ap-sdk-panel__status--error",e.innerHTML=`
1849
- <p>Your session expired.</p>
1850
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-reconnect type="button">Reconnect</button>
1851
- `;const n=e.querySelector("[data-ap-reconnect]");n.addEventListener("click",()=>z(null,null,function*(){n.disabled=!0,n.textContent="Connecting…";try{yield t()}catch(r){Jn(e,"error",r instanceof Error?r.message:"Could not reconnect — please try again.")}}))}function u_(e,t,n,r,o){const i=t==="task"?"Task":"Planning",a=t==="task"?"Task created successfully!":"Planning session created!",d=t==="task"?"View task →":"View planning session →",l=n.length>55?`${n.slice(0,52)}…`:n;e.style.display="block",e.className="ap-sdk-panel__status",e.innerHTML=`
1852
- <div class="ap-sdk-success-card">
1853
- <svg class="ap-sdk-success-check" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
1854
- <circle class="ap-sdk-success-check__circle" cx="24" cy="24" r="22"/>
1855
- <path class="ap-sdk-success-check__tick" d="M14 24l7 7 13-14"/>
1856
- </svg>
1857
- <p class="ap-sdk-success-headline">${ut(a)}</p>
1858
- <div class="ap-sdk-success-meta">
1859
- <span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--${t}">${ut(i)}</span>
1860
- <span class="ap-sdk-success-title" title="${ut(n)}">${ut(l)}</span>
1861
- </div>
1862
- <div class="ap-sdk-success-actions">
1863
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-success-view>${ut(d)}</button>
1864
- <button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost" data-ap-success-close>Close</button>
1865
- </div>
1866
- </div>
1867
- `,e.querySelector("[data-ap-success-view]").addEventListener("click",()=>window.open(r,"_blank","noopener,noreferrer")),e.querySelector("[data-ap-success-close]").addEventListener("click",o)}function Ps(e,t){e.querySelectorAll("button, input, textarea, select").forEach(n=>{n.disabled=t})}function ut(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}let ae=null;function Sl(){return ae!==null}function zn(){ae&&en(ae),ae==null||ae.remove(),ae=null}function d_(e){return e==="task"?"Task":e==="planning"?"Planning":"Automate"}function p_(e){if(ae){zn();return}ae=document.createElement("div"),ae.className="ap-sdk-panel",ae.setAttribute("data-ap-sdk","1"),ae.setAttribute("role","dialog"),ae.setAttribute("aria-modal","true"),ae.setAttribute("aria-label","My captures"),ae.addEventListener("wheel",t=>{t.stopPropagation()},{passive:!0}),ae.addEventListener("touchmove",t=>{t.stopPropagation()},{passive:!0}),ae.innerHTML=`
2004
+ `);n==="task"?(f=(yield Ea(A,{project:h,note:U,ctx:t[0].ctx,advancedOpts:e,titleOverride:E,type:Cp,titleInstruction:v,extraFileIds:u})).id,g=E):n==="planning"?(f=(yield zl(A,h,U,e,u)).id,g=E):(f=(yield Nl(A,{project:h,note:U,ctx:t[0].ctx,advancedOpts:e,titleOverride:E,titleInstruction:v,allowSubmit:s,extraFileIds:u})).id,g=E)}return{createdId:f,captureType:n,captureTitle:g}})}function yS(A){const{state:e,apiOpts:t,project:n,projectCode:r,needsCredentials:s,statusEl:o,submitBtn:a,panelEl:i,screenshotEl:c,noteEl:u,advancedOptionsRef:h,onClose:f,onCredentialsSaved:g,closeAndCleanup:m,clearTrackCleanup:Q,hideHighlight:U}=A,E=()=>T(null,null,function*(){if(e.submitting)return;if(s){Kt(o,"error","Connect to Agent Platform first.");return}const v=t.backendUrl,F=t.token,y=u.value.trim();if(!y){Kt(o,"error","Please enter an instruction.");return}e.submitting=!0,ca(i,!0),Kt(o,null,""),a.textContent="Submitting…";const x={backendUrl:v,token:F},R=h.getOptions(),I=[...e.completedPicks,{ctx:e.currentCtx,instruction:y,screenshotBlob:e.screenshotIncluded?e.currentScreenshotBlob:null}];try{const{createdId:K,captureType:N,captureTitle:Z}=yield QS({opts:x,advancedOpts:R,allPicks:I,captureType:e.captureType,note:y,allowSubmit:e.allowSubmit,project:n,projectCode:r});if(Yx({id:K,type:N,title:Z,backendUrl:v,createdAt:new Date().toISOString()}),yc(),Qf(x).catch(()=>{}),N==="automate"){m(),zc(K,x,v,Z,f);return}const X=N==="task"?`${v.replace(/\/+$/,"")}/tasks/${K}`:`${v.replace(/\/+$/,"")}/planning/${K}`;Yv(o,N,Z,X,m),i.classList.add("ap-sdk-panel--success"),Q(),U(),c.style.display="none",e.submitting=!1,ca(i,!1)}catch(K){K instanceof bp?e_(o,()=>T(null,null,function*(){const{code:N}=yield tc(v),{token:Z,expiresAt:X}=yield Fa({backendUrl:v},N,window.location.origin);Ui({backendUrl:v,token:Z,projectCode:r,expiresAt:X}),t.token=Z,g({backendUrl:v,token:Z}),yield E()})):Kt(o,"error",K instanceof Error?K.message:"An unexpected error occurred."),e.submitting=!1,ca(i,!1),a.textContent="Submit"}});return E}let AA=null,ce=null,yt=null,qr=null,As=null;function is(){return AA!==null}function Bs(){AA&&pt(AA),AA==null||AA.remove(),AA=null,yt==null||yt(),yt=null,qr==null||qr(),qr=null,As==null||As(),As=null,ce==null||ce.destroy(),ce=null}function yf(A,e,t,n,r,s,o,a,i,c,u=null,h){var Oe,_A,TA,jt,kt,KA,et,be,Qe,gt;AA&&Bs();const f=!t.backendUrl||!t.token,g=Gl(u,"tasks:write"),m=Gl(u,"planning-sessions:write"),Q=!g&&m?"planning":"task",U=h?null:kp(),E={captureType:(_A=(Oe=h==null?void 0:h.captureType)!=null?Oe:U==null?void 0:U.captureType)!=null?_A:Q,submitting:!1,completedPicks:(jt=(TA=h==null?void 0:h.completedPicks)!=null?TA:U==null?void 0:U.completedPicks)!=null?jt:[],currentCtx:A,currentPickedEl:e,awaitingPick:!1,allowSubmit:(KA=(kt=h==null?void 0:h.allowSubmit)!=null?kt:U==null?void 0:U.allowSubmit)!=null?KA:!1,currentScreenshotBlob:(et=h==null?void 0:h.currentScreenshotBlob)!=null?et:null,screenshotCapturing:!1,screenshotIncluded:(be=h==null?void 0:h.screenshotIncluded)!=null?be:!1,screenshotError:(Qe=h==null?void 0:h.screenshotError)!=null?Qe:null};AA=document.createElement("div"),AA.className="ap-sdk-panel",AA.setAttribute("data-ap-sdk","1"),AA.setAttribute("role","dialog"),AA.setAttribute("aria-modal","true"),AA.setAttribute("aria-label","Capture to Agent Platform"),AA.innerHTML=jv(A,{needsCredentials:f,canCreateTask:g,canCreatePlanning:m,captureType:E.captureType,hasOnReselect:!!i,hasOnAddAnother:!!a}),AA.addEventListener("wheel",xA=>{xA.stopPropagation()},{passive:!0}),AA.addEventListener("touchmove",xA=>{xA.stopPropagation()},{passive:!0});const v=AA.querySelector(".ap-sdk-panel__body"),F=NQ(v,t,(gt=n==null?void 0:n.id)!=null?gt:null);document.body.appendChild(AA),ce=uc(),E.currentPickedEl&&ce.update(E.currentPickedEl),dt(AA),qr=Qc(AA,bc),As=Cs(AA,ms);const y=AA.querySelector("[data-ap-close]"),x=AA.querySelector("[data-ap-cancel]"),R=AA.querySelector("[data-ap-submit]"),I=AA.querySelector("[data-ap-note]"),K=AA.querySelector("[data-ap-status]"),N=AA.querySelectorAll("[data-ap-type]"),Z=AA.querySelector("[data-ap-automate-options]"),X=AA.querySelector("[data-ap-allow-submit]"),oA=AA.querySelector("[data-ap-pick-list]"),hA=AA.querySelector("[data-ap-context]"),OA=AA.querySelector("[data-ap-screenshot]"),de=AA.querySelector("[data-ap-add-another]"),re=AA.querySelector("[data-ap-pick-actions]"),Re=AA.querySelector("[data-ap-select-parent]"),xn=AA.querySelector("[data-ap-reselect]"),gr=AA.querySelector("[data-ap-clear-selections]"),qe=qv(E,OA),mA=()=>{E.currentPickedEl&&(ce==null||ce.update(E.currentPickedEl))};window.addEventListener("scroll",mA,{capture:!0,passive:!0}),window.addEventListener("resize",mA),yt=()=>{window.removeEventListener("scroll",mA,!0),window.removeEventListener("resize",mA),qe.cleanup()};const At=A_({state:E,els:{contextEl:hA,pickListEl:oA,pickActionsEl:re,noteEl:I,addAnotherBtn:de,selectParentBtn:Re,reselectBtn:xn,clearSelectionsBtn:gr,typeButtons:N,allowSubmitCheckbox:X,automateOptionsEl:Z,statusEl:K},screenshotCtl:qe,defaultCaptureType:Q,updateHighlight:xA=>ce==null?void 0:ce.update(xA),onReselect:i,onAddAnother:a});h?(I.value=h.note,X.checked=h.allowSubmit,Z.style.display=E.captureType==="automate"?"":"none",At.renderPickList(),Kt(K,"success","Reconnected — your draft was kept."),qe.renderScreenshotUi()):U?(I.value=U.note,X.checked=U.allowSubmit,Z.style.display=E.captureType==="automate"?"":"none",At.renderPickList(),Kt(K,"success","Restored your previous selections."),qe.renderScreenshotUi()):E.currentPickedEl&&qe.captureScreenshotFor(E.currentPickedEl);const fA=()=>{Bs(),c==null||c()},Wt=()=>({captureType:E.captureType,note:I.value,completedPicks:E.completedPicks,currentCtx:E.currentCtx,currentPickedEl:E.currentPickedEl,allowSubmit:E.allowSubmit,currentScreenshotBlob:E.currentScreenshotBlob,screenshotIncluded:E.screenshotIncluded,screenshotError:E.screenshotError});y.addEventListener("click",fA),x.addEventListener("click",fA);const gA=AA.querySelector("[data-ap-connect-required]");gA&&o&&gA.addEventListener("click",()=>{const xA=Wt();fA(),o(xA)}),N.forEach(xA=>{xA.addEventListener("click",()=>{E.captureType=xA.dataset.apType,N.forEach(tt=>tt.classList.toggle("ap-sdk-active",tt===xA)),Z.style.display=E.captureType==="automate"?"":"none",At.persistDraft()})}),X.addEventListener("change",()=>{E.allowSubmit=X.checked,At.persistDraft()}),I.addEventListener("input",At.persistDraft);const qA=AA.querySelector("[data-ap-reconfigure]");o?qA.addEventListener("click",()=>{const xA=Wt();fA(),o(xA)}):qA.style.display="none";const Jt=yS({state:E,apiOpts:t,project:n,projectCode:r,needsCredentials:f,statusEl:K,submitBtn:R,panelEl:AA,screenshotEl:OA,noteEl:I,advancedOptionsRef:F,onClose:c,onCredentialsSaved:s,closeAndCleanup:fA,clearTrackCleanup:()=>{yt==null||yt(),yt=null},hideHighlight:()=>ce==null?void 0:ce.hide()});R.addEventListener("click",Jt),setTimeout(()=>I.focus(),50)}let lA=null,es=null,ts=null;function Uf(){return lA!==null}function mn(){lA&&pt(lA),lA==null||lA.remove(),lA=null,es==null||es(),es=null,ts==null||ts(),ts=null}function US(A){return A==="task"?"Task":A==="planning"?"Planning":"Automate"}function ES(A){if(lA){mn();return}lA=document.createElement("div"),lA.className="ap-sdk-panel",lA.setAttribute("data-ap-sdk","1"),lA.setAttribute("role","dialog"),lA.setAttribute("aria-modal","true"),lA.setAttribute("aria-label","My captures"),lA.addEventListener("wheel",e=>{e.stopPropagation()},{passive:!0}),lA.addEventListener("touchmove",e=>{e.stopPropagation()},{passive:!0}),lA.innerHTML=`
1868
2005
  <div class="ap-sdk-panel__header">
1869
2006
  <span class="ap-sdk-panel__title">
1870
2007
  <span class="ap-sdk-panel__logo">AP</span>
@@ -1877,18 +2014,27 @@ ${t.instruction}`),r.join(`
1877
2014
  <button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-clear-history>Clear history</button>
1878
2015
  <button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-close-list>Close</button>
1879
2016
  </div>
1880
- `,document.body.appendChild(ae),Qt(ae),ni(ae,ti),ae.querySelector("[data-ap-close]").addEventListener("click",()=>{zn()}),ae.querySelector("[data-ap-close-list]").addEventListener("click",()=>{zn()}),ae.querySelector("[data-ap-clear-history]").addEventListener("click",()=>{$k(),On(0),Ba(e)}),Ba(e)}function Ba(e){if(!ae)return;const t=ae.querySelector("[data-ap-list-body]"),n=hr();if(n.length===0){t.innerHTML='<p class="ap-sdk-list-empty">No captures yet. Use the capture button to get started.</p>';return}if(t.innerHTML=n.map(r=>`
2017
+ `,document.body.appendChild(lA),dt(lA),es=Qc(lA,bc),ts=Cs(lA,ms),lA.querySelector("[data-ap-close]").addEventListener("click",()=>{mn()}),lA.querySelector("[data-ap-close-list]").addEventListener("click",()=>{mn()}),lA.querySelector("[data-ap-clear-history]").addEventListener("click",()=>{qx(),Un(0),vd(A)}),vd(A)}function vd(A){if(!lA)return;const e=lA.querySelector("[data-ap-list-body]"),t=fr();if(t.length===0){e.innerHTML='<p class="ap-sdk-list-empty">No captures yet. Use the capture button to get started.</p>';return}if(e.innerHTML=t.map(n=>`
1881
2018
  <div class="ap-sdk-list-item">
1882
2019
  <div class="ap-sdk-list-item__row">
1883
- <span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--${r.type}">${d_(r.type)}</span>
1884
- <span class="ap-sdk-list-item__title" title="${_o(r.title)}">${g_(r.title)}</span>
2020
+ <span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--${n.type}">${US(n.type)}</span>
2021
+ <span class="ap-sdk-list-item__title" title="${mo(n.title)}">${vS(n.title)}</span>
1885
2022
  </div>
1886
2023
  <div class="ap-sdk-list-item__row">
1887
- <span class="ap-sdk-status-badge" data-ap-status="${_o(r.id)}">${e?"…":"—"}</span>
1888
- ${r.type==="automate"&&e?`<button class="ap-sdk-list-item__link" data-ap-resume="${_o(r.id)}">Resume →</button>`:`<a class="ap-sdk-list-item__link" href="${_o(f_(r))}" target="_blank" rel="noopener noreferrer">View →</a>`}
2024
+ <span class="ap-sdk-status-badge" data-ap-status="${mo(n.id)}">${A?"…":"—"}</span>
2025
+ ${n.type==="automate"&&A?`<button class="ap-sdk-list-item__link" data-ap-resume="${mo(n.id)}">Resume →</button>`:`<a class="ap-sdk-list-item__link" href="${mo(kS(n))}" target="_blank" rel="noopener noreferrer">View →</a>`}
1889
2026
  </div>
1890
2027
  </div>
1891
- `).join(""),e){const r=e;Promise.all(n.map(o=>h_(o,r))).then(o=>{On(_l(o))}),t.querySelectorAll("[data-ap-resume]").forEach(o=>{o.addEventListener("click",()=>{const i=o.dataset.apResume,a=n.find(d=>d.id===i);a&&(zn(),pi(a.id,r,a.backendUrl,a.title,()=>{}))})})}}function h_(e,t){return z(this,null,function*(){const n=yield kl(e,t),r=ae==null?void 0:ae.querySelector(`[data-ap-status="${CSS.escape(e.id)}"]`);return r&&(r.textContent=n.status.replace(/_/g," "),r.className=`ap-sdk-status-badge ap-sdk-status-badge--${n.status.replace(/_/g,"-")}`),n})}function f_(e){const t=e.backendUrl.replace(/\/+$/,"");return e.type==="planning"?`${t}/planning/${e.id}`:`${t}/tasks/${e.id}`}function _o(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function g_(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}let bt=null,Jo=!1;function m_(){bt==null||bt.disconnect(),Array.from(document.body.querySelectorAll(':scope > [data-ap-sdk="1"]')).forEach(e=>document.body.appendChild(e)),bt&&bt.observe(document.body,{childList:!0}),Jo=!1}function Tl(){bt||(bt=new MutationObserver(e=>{!e.some(n=>Array.from(n.addedNodes).some(r=>r instanceof Element&&r.getAttribute("data-ap-sdk")!=="1"))||Jo||(Jo=!0,queueMicrotask(m_))}),bt.observe(document.body,{childList:!0}))}function b_(){bt==null||bt.disconnect(),bt=null,Jo=!1}const k_={click:"🖱",inputText:"⌨",scroll:"↕",keypress:"⌤"};let Re=null,gn=[];function Io(){Re&&en(Re),Re==null||Re.remove(),Re=null,gn=[]}function __(e,t,n){Re&&Io(),gn=[...e],Re=document.createElement("div"),Re.className="ap-sdk-panel ap-sdk-record-review",Re.setAttribute("data-ap-sdk","1"),Re.setAttribute("role","dialog"),Re.setAttribute("aria-modal","true"),Re.setAttribute("aria-label","Review recorded steps"),Re.innerHTML=`
2028
+ `).join(""),A){const n=A;Promise.all(t.map(r=>FS(r,n))).then(r=>{Un(bf(r))}),e.querySelectorAll("[data-ap-resume]").forEach(r=>{r.addEventListener("click",()=>{const s=r.dataset.apResume,o=t.find(a=>a.id===s);o&&(mn(),zc(o.id,n,o.backendUrl,o.title,()=>{}))})})}}function FS(A,e){return T(this,null,function*(){const t=yield Cf(A,e),n=lA==null?void 0:lA.querySelector(`[data-ap-status="${CSS.escape(A.id)}"]`);return n&&(n.textContent=t.status.replace(/_/g," "),n.className=`ap-sdk-status-badge ap-sdk-status-badge--${t.status.replace(/_/g,"-")}`),t})}function kS(A){const e=A.backendUrl.replace(/\/+$/,"");return A.type==="planning"?`${e}/planning/${A.id}`:`${e}/tasks/${A.id}`}function mo(A){return A.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function vS(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}let xe=null,ni=!1;function _S(){xe==null||xe.disconnect(),Array.from(document.body.querySelectorAll(':scope > [data-ap-sdk="1"]')).forEach(A=>document.body.appendChild(A)),xe&&xe.observe(document.body,{childList:!0}),ni=!1}function Ef(){xe||(xe=new MutationObserver(A=>{!A.some(t=>Array.from(t.addedNodes).some(n=>n instanceof Element&&n.getAttribute("data-ap-sdk")!=="1"))||ni||(ni=!0,queueMicrotask(_S))}),xe.observe(document.body,{childList:!0}))}function xS(){xe==null||xe.disconnect(),xe=null,ni=!1}let ee=null;function En(){ee&&pt(ee),ee==null||ee.remove(),ee=null}function _d(A){const e=A.note.trim();return e?e.length>80?`${e.slice(0,77)}…`:e:A.completedPicks.length>0?`${A.completedPicks.length} saved pick${A.completedPicks.length===1?"":"s"}`:"Untitled draft"}function Ff(A){if(ee)return;const e=kp();e&&(ee=document.createElement("div"),ee.className="ap-sdk-resume-banner",ee.setAttribute("data-ap-sdk","1"),ee.setAttribute("role","status"),ee.innerHTML=`
2029
+ <div>
2030
+ <span class="ap-sdk-resume-banner__title">Resume your draft?</span>
2031
+ <span class="ap-sdk-resume-banner__summary" title="${SS(_d(e))}">${kf(_d(e))}</span>
2032
+ </div>
2033
+ <div class="ap-sdk-resume-banner__actions">
2034
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-resume-draft type="button">Resume</button>
2035
+ <button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-discard-draft type="button">Discard</button>
2036
+ </div>
2037
+ `,document.body.appendChild(ee),dt(ee),ee.querySelector("[data-ap-resume-draft]").addEventListener("click",()=>{En(),A(e)}),ee.querySelector("[data-ap-discard-draft]").addEventListener("click",()=>{yc(),En()}))}function kf(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function SS(A){return kf(A)}const IS={click:"🖱",inputText:"⌨",scroll:"↕",keypress:"⌤"};let LA=null,Dt=[],ns=null;function Lo(){LA&&pt(LA),LA==null||LA.remove(),LA=null,Dt=[],ns==null||ns(),ns=null}function TS(A,e,t){LA&&Lo(),Dt=[...A],LA=document.createElement("div"),LA.className="ap-sdk-panel ap-sdk-record-review",LA.setAttribute("data-ap-sdk","1"),LA.setAttribute("role","dialog"),LA.setAttribute("aria-modal","true"),LA.setAttribute("aria-label","Review recorded steps"),LA.innerHTML=`
1892
2038
  <div class="ap-sdk-panel__header">
1893
2039
  <span class="ap-sdk-panel__title">
1894
2040
  <span class="ap-sdk-panel__logo">AP</span>
@@ -1903,11 +2049,11 @@ ${t.instruction}`),r.join(`
1903
2049
  <button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-review-continue>Continue</button>
1904
2050
  <button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost" data-ap-review-cancel>Cancel</button>
1905
2051
  </div>
1906
- `,document.body.appendChild(Re),Qt(Re);const r=Re.querySelector("[data-ap-review-list]"),o=Re.querySelector("[data-ap-review-continue]"),i=()=>{if(gn.length===0){r.innerHTML='<p class="ap-sdk-list-empty">No steps recorded.</p>',o.disabled=!0;return}o.disabled=!1,r.innerHTML=gn.map((d,l)=>{var p;return`
1907
- <div class="ap-sdk-record-step" data-step-index="${l}">
1908
- <span class="ap-sdk-record-step__icon">${k_[d.action]}</span>
1909
- ${d.action==="inputText"&&!d.redacted?`<input class="ap-sdk-record-step__input" type="text" value="${v_((p=d.value)!=null?p:"")}" data-ap-step-value />`:`<span class="ap-sdk-record-step__description">${El(d.description)}</span>`}
1910
- <button class="ap-sdk-record-step__remove" data-ap-step-remove="${l}" aria-label="Remove step ${l+1}">✕</button>
2052
+ `,document.body.appendChild(LA),dt(LA),ns=Cs(LA,ms);const n=LA.querySelector("[data-ap-review-list]"),r=LA.querySelector("[data-ap-review-continue]"),s=()=>{if(Dt.length===0){n.innerHTML='<p class="ap-sdk-list-empty">No steps recorded.</p>',r.disabled=!0;return}r.disabled=!1,n.innerHTML=Dt.map((a,i)=>{var c;return`
2053
+ <div class="ap-sdk-record-step" data-step-index="${i}">
2054
+ <span class="ap-sdk-record-step__icon">${IS[a.action]}</span>
2055
+ ${a.action==="inputText"&&!a.redacted?`<input class="ap-sdk-record-step__input" type="text" value="${HS((c=a.value)!=null?c:"")}" data-ap-step-value />`:`<span class="ap-sdk-record-step__description">${vf(a.description)}</span>`}
2056
+ <button class="ap-sdk-record-step__remove" data-ap-step-remove="${i}" aria-label="Remove step ${i+1}">✕</button>
1911
2057
  </div>
1912
- `}).join(""),r.querySelectorAll("[data-ap-step-remove]").forEach(d=>{d.addEventListener("click",()=>{const l=parseInt(d.dataset.apStepRemove,10);gn.splice(l,1),i()})}),r.querySelectorAll("[data-ap-step-value]").forEach(d=>{const l=d.closest("[data-step-index]"),p=parseInt(l.dataset.stepIndex,10);d.addEventListener("input",()=>{var g;const h=gn[p];h.value=d.value,h.description=cl((g=h.elementText)!=null?g:"",d.value,!1)})})};i();const a=()=>{Io()};Re.querySelector("[data-ap-review-close]").addEventListener("click",a),Re.querySelector("[data-ap-review-cancel]").addEventListener("click",a),o.addEventListener("click",()=>{if(gn.length===0)return;const d=gn,l=D(y({},Va()),{pageUrl:window.location.href,pageTitle:document.title,interactionSteps:d});Io(),t(l)})}function El(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function v_(e){return El(e)}let q=null,Vo=null,Yo=null,Xo=null;function _i(e,t,n){Vo=e,Yo=t,Xo=n,ml(e,t,n)}const Cl="#agent-platform-web-sdk",Al="ap-sdk-fab-unlocked";let Ln=null;function Pl(){try{if(localStorage.getItem(Al)==="1")return!0}catch(e){}return window.location.hash===Cl}function Ga(){try{localStorage.setItem(Al,"1")}catch(e){}}function Rl(e){return z(this,null,function*(){var t,n,r,o;if(Fr(),e.requestTimeoutMs!=null&&xm(e.requestTimeoutMs),!(q&&q.projectCode===e.projectCode&&q.backendUrl===((t=e.backendUrl)!=null?t:null)&&q.token===((n=e.token)!=null?n:null))){if(q={projectCode:e.projectCode,backendUrl:(r=e.backendUrl)!=null?r:null,token:(o=e.token)!=null?o:null,project:null,resolvingProject:!1,permissions:null},_i(()=>Ll(),()=>w_(),()=>yi()),On(hr().length),q.backendUrl&&q.token){const i=q.backendUrl,a=q.token;yield Nl(),vl({backendUrl:i,token:a}).catch(()=>{}),Ol({backendUrl:i,token:a}).catch(()=>{});const d=Fm();d&&pi(d.taskId,{backendUrl:i,token:a},d.backendUrl,d.title,()=>{})}Tl()}})}function vi(e,t){return z(this,null,function*(){if(!q)throw new Error("AgentPlatformSDK: call init() first.");q.backendUrl=e,q.token=t,q.project=null,q.permissions=null,yield Nl(),Ol({backendUrl:e,token:t}).catch(()=>{})})}function Ll(){if(!q)throw new Error("AgentPlatformSDK: call init() first.");if(tr())return;Fr();const e=(t,n,r)=>{xl(t,n,{backendUrl:q.backendUrl,token:q.token},q.project,q.projectCode,o=>z(null,null,function*(){yield vi(o.backendUrl,o.token)}),o=>{ki(i=>{rs(i),os(i).then(()=>e(o.currentCtx,o.currentPickedEl,o)).catch(console.error)})},o=>{bs((i,a)=>{jr()&&o(i,a)},()=>{zl()})},(o,i)=>{bs((a,d)=>{jr()&&o(a,d)},()=>{jr()&&i()})},()=>{tr()&&Ws()},q.permissions,r)};bs((t,n)=>z(null,null,function*(){Sl()&&zn(),e(t,n)}),()=>{})}function y_(){Ws()}function w_(){if(!q)throw new Error("AgentPlatformSDK: call init() first.");if(Co())return;Fr();const e=(t,n)=>{xl(t,null,{backendUrl:q.backendUrl,token:q.token},q.project,q.projectCode,r=>z(null,null,function*(){yield vi(r.backendUrl,r.token)}),r=>{ki(o=>{rs(o),os(o).then(()=>e(r.currentCtx,r)).catch(console.error)})},void 0,void 0,()=>{},q.permissions,n)};Hk(t=>{__(t,n=>e(n))})}function zl(){jr()&&qr()}function x_(){return tr()}function Il(){b_(),Ln&&(window.removeEventListener("hashchange",Ln),Ln=null),Ws(),Fk(),Io(),qr(),zn(),bl(),Vo=null,Yo=null,Xo=null,q=null}function $l(){if(typeof window=="undefined"||typeof document=="undefined")return;Fr();const e=o_(),t=()=>{e?os(e).catch(console.error):(_i(()=>Hr(),()=>Hr(),()=>yi()),On(hr().length),Tl())};if(Pl()){Ga(),t();return}Ln=()=>{window.location.hash===Cl&&(Ga(),window.removeEventListener("hashchange",Ln),Ln=null,t())},window.addEventListener("hashchange",Ln)}function S_(){Vo&&Yo&&Xo&&ml(Vo,Yo,Xo)}function T_(){bl()}function Hr(){ki(e=>{rs(e),os(e).catch(console.error)})}function E_(){yl(),Il(),Fr(),Pl()&&(_i(()=>Hr(),()=>Hr(),()=>yi()),On(hr().length))}function os(e){return z(this,null,function*(){yield Rl({projectCode:e.projectCode,backendUrl:e.backendUrl,token:e.token})})}function yi(){if(Sl()){zn();return}jr()&&qr();const e=q!=null&&q.backendUrl&&(q!=null&&q.token)?{backendUrl:q.backendUrl,token:q.token}:null;p_(e)}function Ol(e){return z(this,null,function*(){const t=yield Pm(e);q&&(q.permissions=t.permissions)})}function Nl(){return z(this,null,function*(){if(!(!q||!q.backendUrl||!q.token||q.project||q.resolvingProject)){q.resolvingProject=!0;try{q.project=yield Sm({backendUrl:q.backendUrl,token:q.token},q.projectCode)}catch(e){}finally{q&&(q.resolvingProject=!1)}}})}$l();exports.activateElementPicker=Ll;exports.autoInit=$l;exports.clearConfig=E_;exports.closePanelIfOpen=zl;exports.configure=Hr;exports.deactivateElementPicker=y_;exports.destroy=Il;exports.hideFab=T_;exports.init=Rl;exports.isPickerRunning=x_;exports.showFab=S_;exports.updateCredentials=vi;
2058
+ `}).join(""),n.querySelectorAll("[data-ap-step-remove]").forEach(a=>{a.addEventListener("click",()=>{const i=parseInt(a.dataset.apStepRemove,10);Dt.splice(i,1),s()})}),n.querySelectorAll("[data-ap-step-value]").forEach(a=>{const i=a.closest("[data-step-index]"),c=parseInt(i.dataset.stepIndex,10);a.addEventListener("input",()=>{var h;const u=Dt[c];u.value=a.value,u.description=lf((h=u.elementText)!=null?h:"",a.value,!1)})})};s();const o=()=>{Lo()};LA.querySelector("[data-ap-review-close]").addEventListener("click",o),LA.querySelector("[data-ap-review-cancel]").addEventListener("click",o),r.addEventListener("click",()=>{if(Dt.length===0)return;const a=Dt,i=$(k({},Td()),{pageUrl:window.location.href,pageTitle:document.title,interactionSteps:a});Lo(),e(i)})}function vf(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function HS(A){return vf(A)}let W=null,ri=null,si=null,oi=null;function Vc(A,e,t){ri=A,si=e,oi=t,wf(A,e,t)}const _f="#agent-platform-web-sdk",xf="ap-sdk-fab-unlocked";let hn=null;function Sf(){try{if(localStorage.getItem(xf)==="1")return!0}catch(A){}return window.location.hash===_f}function xd(){try{localStorage.setItem(xf,"1")}catch(A){}}function If(A){return T(this,null,function*(){var t,n,r,s,o;if(ws(),A.requestTimeoutMs!=null&&kQ(A.requestTimeoutMs),SB((t=A.exclusionSelector)!=null?t:null),W&&W.projectCode===A.projectCode&&W.backendUrl===((n=A.backendUrl)!=null?n:null)&&W.token===((r=A.token)!=null?r:null))return;W={projectCode:A.projectCode,backendUrl:(s=A.backendUrl)!=null?s:null,token:(o=A.token)!=null?o:null,project:null,resolvingProject:!1,permissions:null},Vc(()=>Hf(),()=>DS(),()=>Jc()),Un(fr().length);let e=!1;if(W.backendUrl&&W.token){const a=W.backendUrl,i=W.token;yield Mf(),Qf({backendUrl:a,token:i}).catch(()=>{}),Of({backendUrl:a,token:i}).catch(()=>{});const c=i_();c&&(zc(c.taskId,{backendUrl:a,token:i},c.backendUrl,c.title,()=>{}),e=!0)}e||Ff(Tf),Ef()})}function Zc(A,e){return T(this,null,function*(){if(!W)throw new Error("AgentPlatformSDK: call init() first.");W.backendUrl=A,W.token=e,W.project=null,W.permissions=null,yield Mf(),Of({backendUrl:A,token:e}).catch(()=>{})})}function Xc(A,e,t){if(!W)throw new Error("AgentPlatformSDK: call init() first.");yf(A,e,{backendUrl:W.backendUrl,token:W.token},W.project,W.projectCode,n=>T(null,null,function*(){yield Zc(n.backendUrl,n.token)}),n=>{Sc(r=>{Ui(r),Fi(r).then(()=>Xc(n.currentCtx,n.currentPickedEl,n)).catch(console.error)})},n=>{ba((r,s)=>{is()&&n(r,s)},()=>{Lf()})},(n,r)=>{ba((s,o)=>{is()&&n(s,o)},()=>{is()&&r()})},()=>{tr()&&pc()},W.permissions,t)}function Wc(A,e){if(!W)throw new Error("AgentPlatformSDK: call init() first.");yf(A,null,{backendUrl:W.backendUrl,token:W.token},W.project,W.projectCode,t=>T(null,null,function*(){yield Zc(t.backendUrl,t.token)}),t=>{Sc(n=>{Ui(n),Fi(n).then(()=>Wc(t.currentCtx,t)).catch(console.error)})},void 0,void 0,()=>{},W.permissions,e)}function Tf(A){var e;if(!W){ur();return}(e=A.currentCtx.interactionSteps)!=null&&e.length?Wc(A.currentCtx,void 0):Xc(A.currentCtx,null,void 0)}function Hf(){if(!W)throw new Error("AgentPlatformSDK: call init() first.");tr()||(En(),ws(),ba((A,e)=>T(null,null,function*(){Uf()&&mn(),Xc(A,e)}),()=>{}))}function LS(){pc()}function DS(){if(!W)throw new Error("AgentPlatformSDK: call init() first.");_o()||(En(),ws(),aS(A=>{TS(A,e=>Wc(e))}))}function Lf(){is()&&Bs()}function RS(){return tr()}function Df(){xS(),hn&&(window.removeEventListener("hashchange",hn),hn=null),pc(),cS(),Lo(),Bs(),mn(),En(),mf(),ri=null,si=null,oi=null,W=null}function Rf(){if(typeof window=="undefined"||typeof document=="undefined")return;ws();const A=r_(),e=()=>{A?Fi(A).catch(console.error):(Vc(()=>ur(),()=>ur(),()=>Jc()),Un(fr().length),Ff(Tf),Ef())};if(Sf()){xd(),e();return}hn=()=>{window.location.hash===_f&&(xd(),window.removeEventListener("hashchange",hn),hn=null,e())},window.addEventListener("hashchange",hn)}function OS(){ri&&si&&oi&&wf(ri,si,oi)}function MS(){mf()}function ur(){En(),Sc(A=>{Ui(A),Fi(A).catch(console.error)})}function PS(){Ph(),Df(),ws(),Sf()&&(Vc(()=>ur(),()=>ur(),()=>Jc()),Un(fr().length))}function Fi(A){return T(this,null,function*(){yield If({projectCode:A.projectCode,backendUrl:A.backendUrl,token:A.token})})}function Jc(){if(Uf()){mn();return}En(),is()&&Bs();const A=W!=null&&W.backendUrl&&(W!=null&&W.token)?{backendUrl:W.backendUrl,token:W.token}:null;ES(A)}function Of(A){return T(this,null,function*(){const e=yield HQ(A);W&&(W.permissions=e.permissions)})}function Mf(){return T(this,null,function*(){if(!(!W||!W.backendUrl||!W.token||W.project||W.resolvingProject)){W.resolvingProject=!0;try{W.project=yield _Q({backendUrl:W.backendUrl,token:W.token},W.projectCode)}catch(A){}finally{W&&(W.resolvingProject=!1)}}})}Rf();exports.activateElementPicker=Hf;exports.autoInit=Rf;exports.clearConfig=PS;exports.closePanelIfOpen=Lf;exports.configure=ur;exports.deactivateElementPicker=LS;exports.destroy=Df;exports.hideFab=MS;exports.init=If;exports.isPickerRunning=RS;exports.showFab=OS;exports.updateCredentials=Zc;
1913
2059
  //# sourceMappingURL=web-sdk.cjs.map