@tung-engineering/agent-platform-web-sdk 0.0.89 → 0.0.91
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/README.md +8 -2
- package/dist/web-sdk.cjs +404 -313
- package/dist/web-sdk.cjs.map +1 -1
- package/dist/web-sdk.min.js +390 -299
- package/dist/web-sdk.min.js.map +1 -1
- package/dist/web-sdk.mjs +16760 -8332
- package/dist/web-sdk.mjs.map +1 -1
- package/package.json +2 -1
package/dist/web-sdk.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var HS=Object.defineProperty,LS=Object.defineProperties;var DS=Object.getOwnPropertyDescriptors;var jf=Object.getOwnPropertySymbols;var RS=Object.prototype.hasOwnProperty,OS=Object.prototype.propertyIsEnumerable;var ye=Math.pow,nl=(pA,KA,jA)=>KA in pA?HS(pA,KA,{enumerable:!0,configurable:!0,writable:!0,value:jA}):pA[KA]=jA,k=(pA,KA)=>{for(var jA in KA||(KA={}))RS.call(KA,jA)&&nl(pA,jA,KA[jA]);if(jf)for(var jA of jf(KA))OS.call(KA,jA)&&nl(pA,jA,KA[jA]);return pA},$=(pA,KA)=>LS(pA,DS(KA));var gA=(pA,KA,jA)=>nl(pA,typeof KA!="symbol"?KA+"":KA,jA);var I=(pA,KA,jA)=>new Promise((il,Ri)=>{var al=Tt=>{try{Ts(jA.next(Tt))}catch(Hs){Ri(Hs)}},cl=Tt=>{try{Ts(jA.throw(Tt))}catch(Hs){Ri(Hs)}},Ts=Tt=>Tt.done?il(Tt.value):Promise.resolve(Tt.value).then(al,cl);Ts((jA=jA.apply(pA,KA)).next())});var AgentPlatformWebSdk=(function(pA){"use strict";var Hf,je,Le,Fn,hr,vn,Ci;const Ag=[`
|
|
2
2
|
:where([data-ap-sdk][popover]) {
|
|
3
3
|
position: fixed;
|
|
4
4
|
margin: 0;
|
|
@@ -540,6 +540,60 @@ var Y_=Object.defineProperty,V_=Object.defineProperties;var X_=Object.getOwnProp
|
|
|
540
540
|
white-space: nowrap;
|
|
541
541
|
}
|
|
542
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
|
+
|
|
543
597
|
.ap-sdk-credentials-section {
|
|
544
598
|
padding: 0 16px 12px;
|
|
545
599
|
border-bottom: 1px solid #f3f4f6;
|
|
@@ -1528,192 +1582,47 @@ button.ap-sdk-list-item__link {
|
|
|
1528
1582
|
gap: 8px;
|
|
1529
1583
|
}
|
|
1530
1584
|
`].join(`
|
|
1531
|
-
`);let
|
|
1532
|
-
`)}return
|
|
1533
|
-
`)}const Yn=new Set;let Vn=null,ko=!1,Ts=!1;function Lu(e){if(e.getAttribute("aria-modal")==="false")return!1;const t=getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function Iu(){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(!(Yn.has(r)||r.hasAttribute("data-ap-sdk"))&&r.isConnected&&Lu(r))return!0}return!1}function Qi(){const e=Iu(),t=e&&!Ts;Ts=e;for(const n of Yn){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 ea(e){if(!(e instanceof Node))return!1;for(const t of Yn)if(t===e||t.contains(e))return!0;return!1}function Xn(e){(ea(e.target)||"relatedTarget"in e&&ea(e.relatedTarget))&&e.stopPropagation()}function $u(){ko||(window.addEventListener("focusin",Xn,!0),window.addEventListener("focusout",Xn,!0),window.addEventListener("pointerdown",Xn,!0),ko=!0),!Vn&&(Vn=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")&&Qi()}),Vn.observe(document.documentElement,{attributes:!0,attributeFilter:["open","inert","aria-hidden","role"],childList:!0,subtree:!0}))}function Mt(e){"showPopover"in e&&(e.setAttribute("popover","manual"),Yn.add(e),$u(),Qi())}function Ut(e){if(Yn.delete(e),Yn.size===0&&(Vn&&(Vn.disconnect(),Vn=null),ko&&(window.removeEventListener("focusin",Xn,!0),window.removeEventListener("focusout",Xn,!0),window.removeEventListener("pointerdown",Xn,!0),ko=!1),Ts=!1),"hidePopover"in e)try{e.hidePopover()}catch(t){}}function Es(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),Mt(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:()=>{Ut(t),t.remove()}}}const ta=/^cc-|current-password|new-password/i,zu=/token|secret|password|apikey|auth/i,As="[redacted]",Cs="[data-ap-sdk-exclude]";let Ps=null;function Ou(e){Ps=(e==null?void 0:e.trim())||null}function Nu(){return Ps?`${Cs}, ${Ps}`:Cs}function na(e){let t;try{if(t=Nu(),e.matches(t)){e.textContent="";return}for(const n of Array.from(e.querySelectorAll(t)))n.remove()}catch(n){for(const r of Array.from(e.querySelectorAll(Cs)))r.remove()}}function Du(e){if(e instanceof HTMLInputElement&&e.type==="password")return!0;const t=e.getAttribute("autocomplete");return!!t&&ta.test(t)}function ra(e){const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){n instanceof HTMLInputElement&&n.type==="password"&&n.setAttribute("value",As);const r=n.getAttribute("autocomplete");r&&ta.test(r)&&n.setAttribute("value",As);for(const o of Array.from(n.attributes))zu.test(o.name)&&n.setAttribute(o.name,As)}}const Mu="🎯 Click any element to capture";let fn=null,Oe=null,qe=null;function Cr(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 Uu(){var e,t;return((t=(e=window.matchMedia)==null?void 0:e.call(window,"(pointer: coarse)").matches)!=null?t:!1)||"ontouchstart"in window}function oa(e){fn==null||fn.update(e)}function sa(e){const t=Ki(),n=Cu(e),r=Pu(e);let o=e,i;try{const a=e.cloneNode(!0);ra(a),na(a),o=a,i=a.outerHTML.slice(0,4e3)}catch(a){}return v(v({pageUrl:window.location.href,pageTitle:document.title,elementText:go(o),cssSelector:fo(e),innerTree:wu(o),outerTree:Au(e),elementOuterHtml:i,ancestry:n},r),t)}function Rs(e,t){qe&&qe();const n=Uu();fn=Es(),Oe=document.createElement("div"),Oe.className="ap-sdk-picker-cursor",Oe.setAttribute("data-ap-sdk","1"),Oe.textContent=n?"Tap any element to preview":Mu,document.body.appendChild(Oe),Mt(Oe);let r=null,o=null;const i=h=>{qe==null||qe(),e(sa(h),h)},a=h=>{if(o=h,oa(h),!Oe)return;Oe.classList.add("ap-sdk-picker-cursor--confirm"),Oe.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",S=>{S.preventDefault(),S.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",S=>{S.preventDefault(),S.stopPropagation(),o!=null&&o.parentElement&&a(o.parentElement)});const y=document.createElement("button");y.type="button",y.className="ap-sdk-picker-cursor__btn ap-sdk-picker-cursor__btn--primary",y.textContent="✓ Select",y.setAttribute("data-ap-sdk","1"),y.addEventListener("click",S=>{S.preventDefault(),S.stopPropagation(),o&&i(o)}),Oe.appendChild(g),Oe.appendChild(m),Oe.appendChild(k),Oe.appendChild(y)},d=h=>{Cr(h.target)||(r=h.target,oa(r))},l=h=>{var m;if(Cr(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}),Oe&&Ut(Oe),Oe==null||Oe.remove(),fn==null||fn.destroy(),fn=null,Oe=null,o=null,qe=null}}function Ls(){qe==null||qe()}function Kn(){return qe!==null}const _o={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 w(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 Qn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ia extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const aa={};function gn(e){return aa}function ca(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 Is(e,t){return typeof t=="bigint"?t.toString():t}function vo(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function $s(e){return e==null}function zs(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ju(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/ku(10,i)}const la=Symbol("evaluating");function ne(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==la)return r===void 0&&(r=la,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Ln(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function mn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ua(e){return JSON.stringify(e)}function Zu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const da="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Pr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const qu=vo(()=>{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 er(e){if(Pr(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Pr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function pa(e){return er(e)?v({},e):Array.isArray(e)?[...e]:e}const Hu=new Set(["string","number","symbol"]);function tr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bn(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"?M(v({},t),{error:()=>t.error}):t}function Fu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Bu={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 Gu(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=mn(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 Ln(this,"shape",a),a},checks:[]});return bn(e,i)}function Wu(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=mn(e._zod.def,{get shape(){const a=v({},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 Ln(this,"shape",a),a},checks:[]});return bn(e,i)}function Ju(e,t){if(!er(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=mn(e._zod.def,{get shape(){const i=v(v({},e._zod.def.shape),t);return Ln(this,"shape",i),i}});return bn(e,o)}function Yu(e,t){if(!er(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=mn(e._zod.def,{get shape(){const r=v(v({},e._zod.def.shape),t);return Ln(this,"shape",r),r}});return bn(e,n)}function Vu(e,t){const n=mn(e._zod.def,{get shape(){const r=v(v({},e._zod.def.shape),t._zod.def.shape);return Ln(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return bn(e,n)}function Xu(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=mn(t._zod.def,{get shape(){const d=t._zod.def.shape,l=v({},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 Ln(this,"shape",l),l},checks:[]});return bn(t,a)}function Ku(e,t,n){const r=mn(t._zod.def,{get shape(){const o=t._zod.def.shape,i=v({},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 Ln(this,"shape",i),i}});return bn(t,r)}function nr(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 rr(e,t){return t.map(n=>{var o;var r;return(o=(r=n).path)!=null||(r.path=[]),n.path.unshift(e),n})}function yo(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,y;const r=M(v({},e),{path:(o=e.path)!=null?o:[]});if(!e.message){const S=(y=(k=(g=(p=yo((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:yo((l=t==null?void 0:t.error)==null?void 0:l.call(t,e)))!=null?g:yo((h=n.customError)==null?void 0:h.call(n,e)))!=null?k:yo((m=n.localeError)==null?void 0:m.call(n,e)))!=null?y:"Invalid input";r.message=S}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function Os(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Rr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:v({},t)}const ha=(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,Is,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},fa=w("$ZodError",ha),ga=w("$ZodError",ha,{Parent:Error});function Qu(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 ed(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 Ns=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 Qn;if(a.issues.length){const l=new((d=o==null?void 0:o.Err)!=null?d:e)(a.issues.map(p=>kn(p,i,gn())));throw da(l,o==null?void 0:o.callee),l}return a.value},Ds=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,gn())));throw da(l,o==null?void 0:o.callee),l}return a.value}),wo=e=>(t,n,r)=>{const o=r?M(v({},r),{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Qn;return i.issues.length?{success:!1,error:new(e!=null?e:fa)(i.issues.map(a=>kn(a,o,gn())))}:{success:!0,data:i.value}},td=wo(ga),xo=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,gn())))}:{success:!0,data:i.value}}),nd=xo(ga),rd=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ns(e)(t,n,o)},od=e=>(t,n,r)=>Ns(e)(t,n,r),sd=e=>(t,n,r)=>z(null,null,function*(){const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ds(e)(t,n,o)}),id=e=>(t,n,r)=>z(null,null,function*(){return Ds(e)(t,n,r)}),ad=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return wo(e)(t,n,o)},cd=e=>(t,n,r)=>wo(e)(t,n,r),ld=e=>(t,n,r)=>z(null,null,function*(){const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return xo(e)(t,n,o)}),ud=e=>(t,n,r)=>z(null,null,function*(){return xo(e)(t,n,r)}),dd=/^[cC][^\s-]{8,}$/,pd=/^[0-9a-z]+$/,hd=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,fd=/^[0-9a-vA-V]{20}$/,gd=/^[A-Za-z0-9]{27}$/,md=/^[a-zA-Z0-9_-]{21}$/,bd=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kd=/^([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})$/,ma=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)$/,_d=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vd="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function yd(){return new RegExp(vd,"u")}const wd=/^(?:(?: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])$/,xd=/^(([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}|:))$/,Sd=/^((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])$/,Td=/^(([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])$/,Ed=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ba=/^[A-Za-z0-9_-]*$/,Ad=/^\+[1-9]\d{6,14}$/,ka="(?:(?:\\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])))",Cd=new RegExp(`^${ka}$`);function _a(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 Pd(e){return new RegExp(`^${_a(e)}$`)}function Rd(e){const t=_a({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(`^${ka}T(?:${r})$`)}const Ld=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}$`)},Id=/^-?\d+$/,va=/^-?\d+(?:\.\d+)?$/,$d=/^(?:true|false)$/i,zd=/^[^A-Z]*$/,Od=/^[^a-z]*$/,st=w("$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=[])}),ya={number:"number",bigint:"bigint",object:"date"},wa=w("$ZodCheckLessThan",(e,t)=>{st.init(e,t);const n=ya[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})}}),xa=w("$ZodCheckGreaterThan",(e,t)=>{st.init(e,t);const n=ya[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})}}),Nd=w("$ZodCheckMultipleOf",(e,t)=>{st.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):ju(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})}}),Dd=w("$ZodCheckNumberFormat",(e,t)=>{var a;st.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]=Bu[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=Id)}),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})}}),Md=w("$ZodCheckMaxLength",(e,t)=>{var r;var n;st.init(e,t),(r=(n=e._zod.def).when)!=null||(n.when=o=>{const i=o.value;return!$s(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=Os(i);o.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ud=w("$ZodCheckMinLength",(e,t)=>{var r;var n;st.init(e,t),(r=(n=e._zod.def).when)!=null||(n.when=o=>{const i=o.value;return!$s(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=Os(i);o.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),jd=w("$ZodCheckLengthEquals",(e,t)=>{var r;var n;st.init(e,t),(r=(n=e._zod.def).when)!=null||(n.when=o=>{const i=o.value;return!$s(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=Os(i),l=a>t.length;o.issues.push(M(v({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}))}}),So=w("$ZodCheckStringFormat",(e,t)=>{var o,i;var n,r;st.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(M(v({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=()=>{})}),Zd=w("$ZodCheckRegex",(e,t)=>{So.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})}}),qd=w("$ZodCheckLowerCase",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=zd),So.init(e,t)}),Hd=w("$ZodCheckUpperCase",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Od),So.init(e,t)}),Fd=w("$ZodCheckIncludes",(e,t)=>{st.init(e,t);const n=tr(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})}}),Bd=w("$ZodCheckStartsWith",(e,t)=>{var r;st.init(e,t);const n=new RegExp(`^${tr(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})}}),Gd=w("$ZodCheckEndsWith",(e,t)=>{var r;st.init(e,t);const n=new RegExp(`.*${tr(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})}}),Wd=w("$ZodCheckOverwrite",(e,t)=>{st.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Jd{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(`
|
|
1534
|
-
`).filter(
|
|
1535
|
-
`))}}const Yd={major:4,minor:3,patch:5},me=w("$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=Yd;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=nr(p),k;for(const y of h){if(y._zod.def.when){if(!y._zod.def.when(p))continue}else if(m)continue;const S=p.issues.length,$=y._zod.check(p);if($ instanceof Promise&&(g==null?void 0:g.async)===!1)throw new Qn;if(k||$ instanceof Promise)k=(k!=null?k:Promise.resolve()).then(()=>z(null,null,function*(){yield $,p.issues.length!==S&&(m||(m=nr(p,S)))}));else{if(p.issues.length===S)continue;m||(m=nr(p,S))}}return k?k.then(()=>p):p},l=(p,h,g)=>{if(nr(p))return p.aborted=!0,p;const m=d(h,r,g);if(m instanceof Promise){if(g.async===!1)throw new Qn;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:[]},M(v({},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 Qn;return g.then(m=>d(m,r,h))}return d(g,r,h)}}ne(e,"~standard",()=>({validate:d=>{var l;try{const p=td(e,d);return p.success?{value:p.data}:{issues:(l=p.error)==null?void 0:l.issues}}catch(p){return nd(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}))}),Ms=w("$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:Ld(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=w("$ZodStringFormat",(e,t)=>{So.init(e,t),Ms.init(e,t)}),Vd=w("$ZodGUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=kd),be.init(e,t)}),Xd=w("$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=ma(i))}else(r=t.pattern)!=null||(t.pattern=ma());be.init(e,t)}),Kd=w("$ZodEmail",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=_d),be.init(e,t)}),Qd=w("$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})}}}),ep=w("$ZodEmoji",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=yd()),be.init(e,t)}),tp=w("$ZodNanoID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=md),be.init(e,t)}),np=w("$ZodCUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=dd),be.init(e,t)}),rp=w("$ZodCUID2",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=pd),be.init(e,t)}),op=w("$ZodULID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=hd),be.init(e,t)}),sp=w("$ZodXID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=fd),be.init(e,t)}),ip=w("$ZodKSUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=gd),be.init(e,t)}),ap=w("$ZodISODateTime",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Rd(t)),be.init(e,t)}),cp=w("$ZodISODate",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Cd),be.init(e,t)}),lp=w("$ZodISOTime",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Pd(t)),be.init(e,t)}),up=w("$ZodISODuration",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=bd),be.init(e,t)}),dp=w("$ZodIPv4",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=wd),be.init(e,t),e._zod.bag.format="ipv4"}),pp=w("$ZodIPv6",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=xd),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})}}}),hp=w("$ZodCIDRv4",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Sd),be.init(e,t)}),fp=w("$ZodCIDRv6",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Td),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 Sa(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch(t){return!1}}const gp=w("$ZodBase64",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ed),be.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Sa(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function mp(e){if(!ba.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Sa(n)}const bp=w("$ZodBase64URL",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=ba),be.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{mp(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),kp=w("$ZodE164",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ad),be.init(e,t)});function _p(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 vp=w("$ZodJWT",(e,t)=>{be.init(e,t),e._zod.check=n=>{_p(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Ta=w("$ZodNumber",(e,t)=>{var n;me.init(e,t),e._zod.pattern=(n=e._zod.bag.pattern)!=null?n:va,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(v({expected:"number",code:"invalid_type",input:i,inst:e},a?{received:a}:{})),r}}),yp=w("$ZodNumberFormat",(e,t)=>{Dd.init(e,t),Ta.init(e,t)}),wp=w("$ZodBoolean",(e,t)=>{me.init(e,t),e._zod.pattern=$d,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}}),xp=w("$ZodAny",(e,t)=>{me.init(e,t),e._zod.parse=n=>n}),Sp=w("$ZodUnknown",(e,t)=>{me.init(e,t),e._zod.parse=n=>n}),Tp=w("$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 Ea(e,t,n){e.issues.length&&t.issues.push(...rr(n,e.issues)),t.value[n]=e.value}const Ep=w("$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=>Ea(p,n,a))):Ea(l,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function To(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...rr(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Aa(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=Fu(e.shape);return M(v({},e),{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)})}function Ca(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=>To(k,n,g,t,h))):To(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 Ap=w("$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=v({},d);return Object.defineProperty(t,"shape",{value:l}),l}})}const r=vo(()=>Aa(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=Pr,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],y=k._zod.optout==="optional",S=k._zod.run({value:p[m],issues:[]},l);S instanceof Promise?h.push(S.then($=>To($,d,m,p,y))):To(S,d,m,p,y)}return i?Ca(h,p,d,l,r.value,e):h.length?Promise.all(h).then(()=>d):d}}),Cp=w("$ZodObjectJIT",(e,t)=>{Ap.init(e,t);const n=e._zod.parse,r=vo(()=>Aa(t)),o=m=>{var A;const k=new Jd(["shape","payload","ctx"]),y=r.value,S=T=>{const L=ua(T);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};k.write("const input = payload.value;");const $=Object.create(null);let E=0;for(const T of y.keys)$[T]=`key_${E++}`;k.write("const newResult = {};");for(const T of y.keys){const L=$[T],q=ua(T),H=m[T],se=((A=H==null?void 0:H._zod)==null?void 0:A.optout)==="optional";k.write(`const ${L} = ${S(T)};`),se?k.write(`
|
|
1536
|
-
if (${
|
|
1537
|
-
if (${
|
|
1538
|
-
payload.issues = payload.issues.concat(${
|
|
1585
|
+
`);let ll=!1;function Er(){if(ll)return;const A=document.createElement("style");A.setAttribute("data-ap-sdk","1"),A.textContent=Ag,document.head.appendChild(A),ll=!0}function Ls(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 Ds(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 eg=["role","type","name","href","src","alt","title","for","placeholder","data-testid"];function Rs(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 eg)o(a);return`${e}${t}${n}${r.join("")}`}function tg(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 ng(A,e=5,t=10){function n(r,s){const o=Rs(r),a=" ".repeat(s),i=Array.from(r.children).slice(0,t);if(s>=e||i.length===0){const c=tg(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 rg='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"]',sg={fieldset:"legend",table:"caption",figure:"figcaption",details:"summary"};function Os(A,e){const t=A.replace(/\s+/g," ").trim();return t.length>e?t.slice(0,e)+"…":t}function og(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(rg);)r=r.parentElement;if(r===A){const s=((t=n.textContent)!=null?t:"").trim();if(s)return s}}return""}function ig(A,e=80){var o,a,i;const t=sg[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 Os(c,e)}const n=og(A);if(n)return Os(n,e);const r=(i=A.getAttribute("aria-label"))==null?void 0:i.trim();if(r)return Os(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 Os(c,e)}return""}function ag(A,e=6){const t=[],n=new Set;let r=A;for(;r&&r!==document.body&&t.length<e;){const s=r===A?"":ig(r),o=s&&!n.has(s)?`${Rs(r)} ["${s}"]`:Rs(r);s&&n.add(s),t.unshift(o),r=r.parentElement}return t.join(" > ")||Rs(A)}function ul(A,e){return A.length>e?A.slice(0,e)+"… (truncated)":A}function kr(A){var n;const e=document.querySelector(A);return((n=e==null?void 0:e.content)==null?void 0:n.trim())||void 0}function dl(){const A=e=>{try{return e()}catch(t){return}};return{description:A(()=>kr('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(()=>kr('meta[property="og:title"]')),ogDescription:A(()=>kr('meta[property="og:description"]')),ogType:A(()=>kr('meta[property="og:type"]')),ogSiteName:A(()=>kr('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?ul(e,1e3):void 0}),capturedAt:new Date().toISOString()}}function cg(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 lg(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}: ${ul(o,120)}`:a}return{elementRole:e,elementAriaLabel:t,enclosingSection:n}}function ug(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 Dn=new Set;let Rn=null,Ps=!1,Oi=!1;function dg(A){if(A.getAttribute("aria-modal")==="false")return!1;const e=getComputedStyle(A);return e.display!=="none"&&e.visibility!=="hidden"}function pg(){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(!(Dn.has(n)||n.hasAttribute("data-ap-sdk"))&&n.isConnected&&dg(n))return!0}return!1}function pl(){const A=pg(),e=A&&!Oi;Oi=A;for(const t of Dn){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 hl(A){if(!(A instanceof Node))return!1;for(const e of Dn)if(e===A||e.contains(A))return!0;return!1}function On(A){(hl(A.target)||"relatedTarget"in A&&hl(A.relatedTarget))&&A.stopPropagation()}function hg(){Ps||(window.addEventListener("focusin",On,!0),window.addEventListener("focusout",On,!0),window.addEventListener("pointerdown",On,!0),Ps=!0),!Rn&&(Rn=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")&&pl()}),Rn.observe(document.documentElement,{attributes:!0,attributeFilter:["open","inert","aria-hidden","role"],childList:!0,subtree:!0}))}function rt(A){"showPopover"in A&&(A.setAttribute("popover","manual"),Dn.add(A),hg(),pl())}function st(A){if(Dn.delete(A),Dn.size===0&&(Rn&&(Rn.disconnect(),Rn=null),Ps&&(window.removeEventListener("focusin",On,!0),window.removeEventListener("focusout",On,!0),window.removeEventListener("pointerdown",On,!0),Ps=!1),Oi=!1),"hidePopover"in A)try{A.hidePopover()}catch(e){}}function Pi(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),rt(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:()=>{st(e),e.remove()}}}const fl=/^cc-|current-password|new-password/i,fg=/token|secret|password|apikey|auth/i,Mi="[redacted]",Ms="[data-ap-sdk-exclude]";let Ki=null;function gg(A){Ki=(A==null?void 0:A.trim())||null}function gl(){return Ki?`${Ms}, ${Ki}`:Ms}function Ni(A){let e;try{if(e=gl(),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(Ms)))n.remove()}}function Bl(A){if(A instanceof HTMLInputElement&&A.type==="password")return!0;const e=A.getAttribute("autocomplete");return!!e&&fl.test(e)}function wl(A){if(Bl(A))return!0;try{return A.closest(gl())!==null}catch(e){return A.closest(Ms)!==null}}function ml(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&&fl.test(n)&&t.setAttribute("value",Mi);for(const r of Array.from(t.attributes))fg.test(r.name)&&t.setAttribute(r.name,Mi)}}const Bg="🎯 Click any element to capture";let Ht=null,NA=null,qA=null;function Fr(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 wg(){var A,e;return((e=(A=window.matchMedia)==null?void 0:A.call(window,"(pointer: coarse)").matches)!=null?e:!1)||"ontouchstart"in window}function Cl(A){Ht==null||Ht.update(A)}function bl(A){const e=dl(),t=cg(A),n=lg(A);let r=A,s;try{const o=A.cloneNode(!0);ml(o),Ni(o),r=o,s=o.outerHTML.slice(0,4e3)}catch(o){}return k(k({pageUrl:window.location.href,pageTitle:document.title,elementText:Ds(r),cssSelector:Ls(A),innerTree:ng(r),outerTree:ag(A),elementOuterHtml:s,ancestry:t},n),e)}function $i(A,e){qA&&qA();const t=wg();Ht=Pi(),NA=document.createElement("div"),NA.className="ap-sdk-picker-cursor",NA.setAttribute("data-ap-sdk","1"),NA.textContent=t?"Tap any element to preview":Bg,document.body.appendChild(NA),rt(NA);let n=null,r=null;const s=u=>{qA==null||qA(),A(bl(u),u)},o=u=>{if(r=u,Cl(u),!NA)return;NA.classList.add("ap-sdk-picker-cursor--confirm"),NA.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",b=>{b.preventDefault(),b.stopPropagation(),qA==null||qA(),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",b=>{b.preventDefault(),b.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",b=>{b.preventDefault(),b.stopPropagation(),r&&s(r)}),NA.appendChild(h),NA.appendChild(f),NA.appendChild(g),NA.appendChild(m)},a=u=>{Fr(u.target)||(n=u.target,Cl(n))},i=u=>{var f;if(Fr(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"&&(qA==null||qA(),e())};t||document.addEventListener("mouseover",a,{capture:!0}),document.addEventListener("click",i,{capture:!0}),document.addEventListener("keydown",c,{capture:!0}),qA=()=>{t||document.removeEventListener("mouseover",a,{capture:!0}),document.removeEventListener("click",i,{capture:!0}),document.removeEventListener("keydown",c,{capture:!0}),NA&&st(NA),NA==null||NA.remove(),Ht==null||Ht.destroy(),Ht=null,NA=null,r=null,qA=null}}function zi(){qA==null||qA()}function Pn(){return qA!==null}const Ks={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(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 Mn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ql extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const yl={};function Lt(A){return yl}function Ul(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 Vi(A,e){return typeof e=="bigint"?e.toString():e}function Ns(A){return{get value(){{const e=A();return Object.defineProperty(this,"value",{value:e}),e}}}}function Gi(A){return A==null}function Zi(A){const e=A.startsWith("^")?1:0,t=A.endsWith("$")?A.length-1:A.length;return A.slice(e,t)}function mg(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/ye(10,s)}const El=Symbol("evaluating");function iA(A,e,t){let n;Object.defineProperty(A,e,{get(){if(n!==El)return n===void 0&&(n=El,n=t()),n},set(r){Object.defineProperty(A,e,{value:r})},configurable:!0})}function nn(A,e,t){Object.defineProperty(A,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Dt(...A){const e={};for(const t of A){const n=Object.getOwnPropertyDescriptors(t);Object.assign(e,n)}return Object.defineProperties({},e)}function kl(A){return JSON.stringify(A)}function Cg(A){return A.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Fl="captureStackTrace"in Error?Error.captureStackTrace:(...A)=>{};function vr(A){return typeof A=="object"&&A!==null&&!Array.isArray(A)}const bg=Ns(()=>{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 Kn(A){if(vr(A)===!1)return!1;const e=A.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(vr(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function vl(A){return Kn(A)?k({},A):Array.isArray(A)?[...A]:A}const Qg=new Set(["string","number","symbol"]);function Nn(A){return A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rt(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 yg(A){return Object.keys(A).filter(e=>A[e]._zod.optin==="optional"&&A[e]._zod.optout==="optional")}const Ug={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 Eg(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=Dt(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 nn(this,"shape",o),o},checks:[]});return Rt(A,s)}function kg(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=Dt(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 nn(this,"shape",o),o},checks:[]});return Rt(A,s)}function Fg(A,e){if(!Kn(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=Dt(A._zod.def,{get shape(){const s=k(k({},A._zod.def.shape),e);return nn(this,"shape",s),s}});return Rt(A,r)}function vg(A,e){if(!Kn(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=Dt(A._zod.def,{get shape(){const n=k(k({},A._zod.def.shape),e);return nn(this,"shape",n),n}});return Rt(A,t)}function _g(A,e){const t=Dt(A._zod.def,{get shape(){const n=k(k({},A._zod.def.shape),e._zod.def.shape);return nn(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return Rt(A,t)}function xg(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=Dt(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 nn(this,"shape",i),i},checks:[]});return Rt(e,o)}function Sg(A,e,t){const n=Dt(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 nn(this,"shape",s),s}});return Rt(e,n)}function $n(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 zn(A,e){return e.map(t=>{var r;var n;return(r=(n=t).path)!=null||(n.path=[]),t.path.unshift(A),t})}function $s(A){return typeof A=="string"?A:A==null?void 0:A.message}function Ot(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 b=(m=(g=(h=(c=$s((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:$s((i=e==null?void 0:e.error)==null?void 0:i.call(e,A)))!=null?h:$s((u=t.customError)==null?void 0:u.call(t,A)))!=null?g:$s((f=t.localeError)==null?void 0:f.call(t,A)))!=null?m:"Invalid input";n.message=b}return delete n.inst,delete n.continue,e!=null&&e.reportInput||delete n.input,n}function Xi(A){return Array.isArray(A)?"array":typeof A=="string"?"string":"unknown"}function _r(...A){const[e,t,n]=A;return typeof e=="string"?{message:e,code:"custom",input:t,inst:n}:k({},e)}const _l=(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,Vi,2),Object.defineProperty(A,"toString",{value:()=>A.message,enumerable:!1})},xl=x("$ZodError",_l),Sl=x("$ZodError",_l,{Parent:Error});function Ig(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 Tg(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 Wi=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 Mn;if(o.issues.length){const i=new((a=r==null?void 0:r.Err)!=null?a:A)(o.issues.map(c=>Ot(c,s,Lt())));throw Fl(i,r==null?void 0:r.callee),i}return o.value},Ji=A=>(e,t,n,r)=>I(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=>Ot(c,s,Lt())));throw Fl(i,r==null?void 0:r.callee),i}return o.value}),zs=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 Mn;return s.issues.length?{success:!1,error:new(A!=null?A:xl)(s.issues.map(o=>Ot(o,r,Lt())))}:{success:!0,data:s.value}},Hg=zs(Sl),Vs=A=>(e,t,n)=>I(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=>Ot(o,r,Lt())))}:{success:!0,data:s.value}}),Lg=Vs(Sl),Dg=A=>(e,t,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Wi(A)(e,t,r)},Rg=A=>(e,t,n)=>Wi(A)(e,t,n),Og=A=>(e,t,n)=>I(null,null,function*(){const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ji(A)(e,t,r)}),Pg=A=>(e,t,n)=>I(null,null,function*(){return Ji(A)(e,t,n)}),Mg=A=>(e,t,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return zs(A)(e,t,r)},Kg=A=>(e,t,n)=>zs(A)(e,t,n),Ng=A=>(e,t,n)=>I(null,null,function*(){const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Vs(A)(e,t,r)}),$g=A=>(e,t,n)=>I(null,null,function*(){return Vs(A)(e,t,n)}),zg=/^[cC][^\s-]{8,}$/,Vg=/^[0-9a-z]+$/,Gg=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Zg=/^[0-9a-vA-V]{20}$/,Xg=/^[A-Za-z0-9]{27}$/,Wg=/^[a-zA-Z0-9_-]{21}$/,Jg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jg=/^([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})$/,Il=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)$/,Yg=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function AB(){return new RegExp(qg,"u")}const eB=/^(?:(?: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])$/,tB=/^(([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}|:))$/,nB=/^((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])$/,rB=/^(([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])$/,sB=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Tl=/^[A-Za-z0-9_-]*$/,oB=/^\+[1-9]\d{6,14}$/,Hl="(?:(?:\\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])))",iB=new RegExp(`^${Hl}$`);function Ll(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 aB(A){return new RegExp(`^${Ll(A)}$`)}function cB(A){const e=Ll({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(`^${Hl}T(?:${n})$`)}const lB=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}$`)},uB=/^-?\d+$/,Dl=/^-?\d+(?:\.\d+)?$/,dB=/^(?:true|false)$/i,pB=/^[^A-Z]*$/,hB=/^[^a-z]*$/,fe=x("$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=[])}),Rl={number:"number",bigint:"bigint",object:"date"},Ol=x("$ZodCheckLessThan",(A,e)=>{fe.init(A,e);const t=Rl[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})}}),Pl=x("$ZodCheckGreaterThan",(A,e)=>{fe.init(A,e);const t=Rl[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})}}),fB=x("$ZodCheckMultipleOf",(A,e)=>{fe.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):mg(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})}}),gB=x("$ZodCheckNumberFormat",(A,e)=>{var o;fe.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]=Ug[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=uB)}),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})}}),BB=x("$ZodCheckMaxLength",(A,e)=>{var n;var t;fe.init(A,e),(n=(t=A._zod.def).when)!=null||(t.when=r=>{const s=r.value;return!Gi(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=Xi(s);r.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:s,inst:A,continue:!e.abort})}}),wB=x("$ZodCheckMinLength",(A,e)=>{var n;var t;fe.init(A,e),(n=(t=A._zod.def).when)!=null||(t.when=r=>{const s=r.value;return!Gi(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=Xi(s);r.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:s,inst:A,continue:!e.abort})}}),mB=x("$ZodCheckLengthEquals",(A,e)=>{var n;var t;fe.init(A,e),(n=(t=A._zod.def).when)!=null||(t.when=r=>{const s=r.value;return!Gi(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=Xi(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}))}}),Gs=x("$ZodCheckStringFormat",(A,e)=>{var r,s;var t,n;fe.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=()=>{})}),CB=x("$ZodCheckRegex",(A,e)=>{Gs.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})}}),bB=x("$ZodCheckLowerCase",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=pB),Gs.init(A,e)}),QB=x("$ZodCheckUpperCase",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=hB),Gs.init(A,e)}),yB=x("$ZodCheckIncludes",(A,e)=>{fe.init(A,e);const t=Nn(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})}}),UB=x("$ZodCheckStartsWith",(A,e)=>{var n;fe.init(A,e);const t=new RegExp(`^${Nn(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})}}),EB=x("$ZodCheckEndsWith",(A,e)=>{var n;fe.init(A,e);const t=new RegExp(`.*${Nn(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})}}),kB=x("$ZodCheckOverwrite",(A,e)=>{fe.init(A,e),A._zod.check=t=>{t.value=e.tx(t.value)}});class FB{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 vB={major:4,minor:3,patch:5},bA=x("$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=vB;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=$n(c),g;for(const m of u){if(m._zod.def.when){if(!m._zod.def.when(c))continue}else if(f)continue;const b=c.issues.length,U=m._zod.check(c);if(U instanceof Promise&&(h==null?void 0:h.async)===!1)throw new Mn;if(g||U instanceof Promise)g=(g!=null?g:Promise.resolve()).then(()=>I(null,null,function*(){yield U,c.issues.length!==b&&(f||(f=$n(c,b)))}));else{if(c.issues.length===b)continue;f||(f=$n(c,b))}}return g?g.then(()=>c):c},i=(c,u,h)=>{if($n(c))return c.aborted=!0,c;const f=a(u,n,h);if(f instanceof Promise){if(h.async===!1)throw new Mn;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 Mn;return h.then(f=>a(f,n,u))}return a(h,n,u)}}iA(A,"~standard",()=>({validate:a=>{var i;try{const c=Hg(A,a);return c.success?{value:c.data}:{issues:(i=c.error)==null?void 0:i.issues}}catch(c){return Lg(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}))}),ji=x("$ZodString",(A,e)=>{var t,n,r;bA.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:lB(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}}),QA=x("$ZodStringFormat",(A,e)=>{Gs.init(A,e),ji.init(A,e)}),_B=x("$ZodGUID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=jg),QA.init(A,e)}),xB=x("$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=Il(s))}else(n=e.pattern)!=null||(e.pattern=Il());QA.init(A,e)}),SB=x("$ZodEmail",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Yg),QA.init(A,e)}),IB=x("$ZodURL",(A,e)=>{QA.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})}}}),TB=x("$ZodEmoji",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=AB()),QA.init(A,e)}),HB=x("$ZodNanoID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Wg),QA.init(A,e)}),LB=x("$ZodCUID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=zg),QA.init(A,e)}),DB=x("$ZodCUID2",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Vg),QA.init(A,e)}),RB=x("$ZodULID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Gg),QA.init(A,e)}),OB=x("$ZodXID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Zg),QA.init(A,e)}),PB=x("$ZodKSUID",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Xg),QA.init(A,e)}),MB=x("$ZodISODateTime",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=cB(e)),QA.init(A,e)}),KB=x("$ZodISODate",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=iB),QA.init(A,e)}),NB=x("$ZodISOTime",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=aB(e)),QA.init(A,e)}),$B=x("$ZodISODuration",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Jg),QA.init(A,e)}),zB=x("$ZodIPv4",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=eB),QA.init(A,e),A._zod.bag.format="ipv4"}),VB=x("$ZodIPv6",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=tB),QA.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})}}}),GB=x("$ZodCIDRv4",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=nB),QA.init(A,e)}),ZB=x("$ZodCIDRv6",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=rB),QA.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 Ml(A){if(A==="")return!0;if(A.length%4!==0)return!1;try{return atob(A),!0}catch(e){return!1}}const XB=x("$ZodBase64",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=sB),QA.init(A,e),A._zod.bag.contentEncoding="base64",A._zod.check=n=>{Ml(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:A,continue:!e.abort})}});function WB(A){if(!Tl.test(A))return!1;const e=A.replace(/[-_]/g,n=>n==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return Ml(t)}const JB=x("$ZodBase64URL",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=Tl),QA.init(A,e),A._zod.bag.contentEncoding="base64url",A._zod.check=n=>{WB(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:A,continue:!e.abort})}}),jB=x("$ZodE164",(A,e)=>{var t;(t=e.pattern)!=null||(e.pattern=oB),QA.init(A,e)});function YB(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 qB=x("$ZodJWT",(A,e)=>{QA.init(A,e),A._zod.check=t=>{YB(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:A,continue:!e.abort})}}),Kl=x("$ZodNumber",(A,e)=>{var t;bA.init(A,e),A._zod.pattern=(t=A._zod.bag.pattern)!=null?t:Dl,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}}),Aw=x("$ZodNumberFormat",(A,e)=>{gB.init(A,e),Kl.init(A,e)}),ew=x("$ZodBoolean",(A,e)=>{bA.init(A,e),A._zod.pattern=dB,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}}),tw=x("$ZodAny",(A,e)=>{bA.init(A,e),A._zod.parse=t=>t}),nw=x("$ZodUnknown",(A,e)=>{bA.init(A,e),A._zod.parse=t=>t}),rw=x("$ZodNever",(A,e)=>{bA.init(A,e),A._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:A}),t)});function Nl(A,e,t){A.issues.length&&e.issues.push(...zn(t,A.issues)),e.value[t]=A.value}const sw=x("$ZodArray",(A,e)=>{bA.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=>Nl(c,t,o))):Nl(i,t,o)}return s.length?Promise.all(s).then(()=>t):t}});function Zs(A,e,t,n,r){if(A.issues.length){if(r&&!(t in n))return;e.issues.push(...zn(t,A.issues))}A.value===void 0?t in n&&(e.value[t]=void 0):e.value[t]=A.value}function $l(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=yg(A.shape);return $(k({},A),{keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)})}function zl(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=>Zs(g,t,h,e,u))):Zs(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 ow=x("$ZodObject",(A,e)=>{bA.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=Ns(()=>$l(e));iA(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=vr,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",b=g._zod.run({value:c[f],issues:[]},i);b instanceof Promise?u.push(b.then(U=>Zs(U,a,f,c,m))):Zs(b,a,f,c,m)}return s?zl(u,c,a,i,n.value,A):u.length?Promise.all(u).then(()=>a):a}}),iw=x("$ZodObjectJIT",(A,e)=>{ow.init(A,e);const t=A._zod.parse,n=Ns(()=>$l(e)),r=f=>{var F;const g=new FB(["shape","payload","ctx"]),m=n.value,b=y=>{const _=kl(y);return`shape[${_}]._zod.run({ value: input[${_}], 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 _=U[y],R=kl(y),H=f[y],z=((F=H==null?void 0:H._zod)==null?void 0:F.optout)==="optional";g.write(`const ${_} = ${b(y)};`),z?g.write(`
|
|
1590
|
+
if (${_}.issues.length) {
|
|
1591
|
+
if (${R} in input) {
|
|
1592
|
+
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|
1539
1593
|
...iss,
|
|
1540
|
-
path: iss.path ? [${
|
|
1594
|
+
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
1541
1595
|
})));
|
|
1542
1596
|
}
|
|
1543
1597
|
}
|
|
1544
1598
|
|
|
1545
|
-
if (${
|
|
1546
|
-
if (${
|
|
1547
|
-
newResult[${
|
|
1599
|
+
if (${_}.value === undefined) {
|
|
1600
|
+
if (${R} in input) {
|
|
1601
|
+
newResult[${R}] = undefined;
|
|
1548
1602
|
}
|
|
1549
1603
|
} else {
|
|
1550
|
-
newResult[${
|
|
1604
|
+
newResult[${R}] = ${_}.value;
|
|
1551
1605
|
}
|
|
1552
1606
|
|
|
1553
|
-
`):
|
|
1554
|
-
if (${
|
|
1555
|
-
payload.issues = payload.issues.concat(${
|
|
1607
|
+
`):g.write(`
|
|
1608
|
+
if (${_}.issues.length) {
|
|
1609
|
+
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|
1556
1610
|
...iss,
|
|
1557
|
-
path: iss.path ? [${
|
|
1611
|
+
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
1558
1612
|
})));
|
|
1559
1613
|
}
|
|
1560
1614
|
|
|
1561
|
-
if (${
|
|
1562
|
-
if (${
|
|
1563
|
-
newResult[${
|
|
1615
|
+
if (${_}.value === undefined) {
|
|
1616
|
+
if (${R} in input) {
|
|
1617
|
+
newResult[${R}] = undefined;
|
|
1564
1618
|
}
|
|
1565
1619
|
} else {
|
|
1566
|
-
newResult[${
|
|
1620
|
+
newResult[${R}] = ${_}.value;
|
|
1567
1621
|
}
|
|
1568
1622
|
|
|
1569
|
-
`)}k.write("payload.value = newResult;"),k.write("return payload;");const j=k.compile();return(T,L)=>j(m,T,L)};let i;const a=Pr,d=!aa.jitless,p=d&&qu.value,h=t.catchall;let g;e._zod.parse=(m,k)=>{g!=null||(g=r.value);const y=m.value;return a(y)?d&&p&&(k==null?void 0:k.async)===!1&&k.jitless!==!0?(i||(i=o(t.shape)),m=i(m,k),h?Ca([],y,m,k,g,e):m):n(m,k):(m.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),m)}});function Pa(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=>!nr(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,gn())))}),t)}const Ra=w("$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=>zs(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=>Pa(l,o,e,i)):Pa(d,o,e,i)}}),Pp=w("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ra.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=vo(()=>{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(!Pr(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)}}),Rp=w("$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])=>La(n,l,p)):La(n,i,a)}});function Us(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(er(e)&&er(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o=v(v({},e),t);for(const i of r){const a=Us(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=Us(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 La(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(M(v({},o),{keys:i})),nr(e))return e;const a=Us(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 Lp=w("$ZodRecord",(e,t)=>{me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!er(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(...rr(p,g.issues)),n.value[p]=g.value})):(h.issues.length&&n.issues.push(...rr(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"&&va.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,gn())),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(...rr(d,g.issues)),n.value[l.value]=g.value})):(h.issues.length&&n.issues.push(...rr(d,h.issues)),n.value[l.value]=h.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Ip=w("$ZodEnum",(e,t)=>{me.init(e,t);const n=ca(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Hu.has(typeof o)).map(o=>typeof o=="string"?tr(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}}),$p=w("$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"?tr(r):r?tr(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}}),zp=w("$ZodTransform",(e,t)=>{me.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ia(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 Qn;return n.value=o,n}});function Ia(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const $a=w("$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(`^(${zs(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=>Ia(i,n.value)):Ia(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Op=w("$ZodExactOptional",(e,t)=>{$a.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)}),Np=w("$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(`^(${zs(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)}),Dp=w("$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=>za(i,t)):za(o,t)}});function za(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Mp=w("$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))}),Up=w("$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=>Oa(i,e)):Oa(o,e)}});function Oa(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 jp=w("$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(M(v({},n),{error:{issues:i.issues.map(a=>kn(a,r,gn()))},input:n.value})),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue(M(v({},n),{error:{issues:o.issues.map(i=>kn(i,r,gn()))},input:n.value})),n.issues=[]),n)}}),Zp=w("$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=>Eo(a,t.in,r)):Eo(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Eo(i,t.out,r)):Eo(o,t.out,r)}});function Eo(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const qp=w("$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(Na):Na(o)}});function Na(e){return e.value=Object.freeze(e.value),e}const Hp=w("$ZodCustom",(e,t)=>{st.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=>Da(i,n,r,e));Da(o,n,r,e)}});function Da(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(Rr(i))}}var Ma;class Fp{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=v({},(r=this.get(n))!=null?r:{});delete o.id;const i=v(v({},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 Bp(){return new Fp}(eu=(Ma=globalThis).__zod_globalRegistry)!=null||(Ma.__zod_globalRegistry=Bp());const Lr=globalThis.__zod_globalRegistry;function Gp(e,t){return new e(v({type:"string"},U(t)))}function Wp(e,t){return new e(v({type:"string",format:"email",check:"string_format",abort:!1},U(t)))}function Ua(e,t){return new e(v({type:"string",format:"guid",check:"string_format",abort:!1},U(t)))}function Jp(e,t){return new e(v({type:"string",format:"uuid",check:"string_format",abort:!1},U(t)))}function Yp(e,t){return new e(v({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4"},U(t)))}function Vp(e,t){return new e(v({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6"},U(t)))}function Xp(e,t){return new e(v({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7"},U(t)))}function Kp(e,t){return new e(v({type:"string",format:"url",check:"string_format",abort:!1},U(t)))}function Qp(e,t){return new e(v({type:"string",format:"emoji",check:"string_format",abort:!1},U(t)))}function eh(e,t){return new e(v({type:"string",format:"nanoid",check:"string_format",abort:!1},U(t)))}function th(e,t){return new e(v({type:"string",format:"cuid",check:"string_format",abort:!1},U(t)))}function nh(e,t){return new e(v({type:"string",format:"cuid2",check:"string_format",abort:!1},U(t)))}function rh(e,t){return new e(v({type:"string",format:"ulid",check:"string_format",abort:!1},U(t)))}function oh(e,t){return new e(v({type:"string",format:"xid",check:"string_format",abort:!1},U(t)))}function sh(e,t){return new e(v({type:"string",format:"ksuid",check:"string_format",abort:!1},U(t)))}function ih(e,t){return new e(v({type:"string",format:"ipv4",check:"string_format",abort:!1},U(t)))}function ah(e,t){return new e(v({type:"string",format:"ipv6",check:"string_format",abort:!1},U(t)))}function ch(e,t){return new e(v({type:"string",format:"cidrv4",check:"string_format",abort:!1},U(t)))}function lh(e,t){return new e(v({type:"string",format:"cidrv6",check:"string_format",abort:!1},U(t)))}function uh(e,t){return new e(v({type:"string",format:"base64",check:"string_format",abort:!1},U(t)))}function dh(e,t){return new e(v({type:"string",format:"base64url",check:"string_format",abort:!1},U(t)))}function ph(e,t){return new e(v({type:"string",format:"e164",check:"string_format",abort:!1},U(t)))}function hh(e,t){return new e(v({type:"string",format:"jwt",check:"string_format",abort:!1},U(t)))}function fh(e,t){return new e(v({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null},U(t)))}function gh(e,t){return new e(v({type:"string",format:"date",check:"string_format"},U(t)))}function mh(e,t){return new e(v({type:"string",format:"time",check:"string_format",precision:null},U(t)))}function bh(e,t){return new e(v({type:"string",format:"duration",check:"string_format"},U(t)))}function kh(e,t){return new e(v({type:"number",checks:[]},U(t)))}function _h(e,t){return new e(v({type:"number",check:"number_format",abort:!1,format:"safeint"},U(t)))}function vh(e,t){return new e(v({type:"boolean"},U(t)))}function yh(e){return new e({type:"any"})}function wh(e){return new e({type:"unknown"})}function xh(e,t){return new e(v({type:"never"},U(t)))}function ja(e,t){return new wa(M(v({check:"less_than"},U(t)),{value:e,inclusive:!1}))}function js(e,t){return new wa(M(v({check:"less_than"},U(t)),{value:e,inclusive:!0}))}function Za(e,t){return new xa(M(v({check:"greater_than"},U(t)),{value:e,inclusive:!1}))}function Zs(e,t){return new xa(M(v({check:"greater_than"},U(t)),{value:e,inclusive:!0}))}function qa(e,t){return new Nd(M(v({check:"multiple_of"},U(t)),{value:e}))}function Ha(e,t){return new Md(M(v({check:"max_length"},U(t)),{maximum:e}))}function Ao(e,t){return new Ud(M(v({check:"min_length"},U(t)),{minimum:e}))}function Fa(e,t){return new jd(M(v({check:"length_equals"},U(t)),{length:e}))}function Sh(e,t){return new Zd(M(v({check:"string_format",format:"regex"},U(t)),{pattern:e}))}function Th(e){return new qd(v({check:"string_format",format:"lowercase"},U(e)))}function Eh(e){return new Hd(v({check:"string_format",format:"uppercase"},U(e)))}function Ah(e,t){return new Fd(M(v({check:"string_format",format:"includes"},U(t)),{includes:e}))}function Ch(e,t){return new Bd(M(v({check:"string_format",format:"starts_with"},U(t)),{prefix:e}))}function Ph(e,t){return new Gd(M(v({check:"string_format",format:"ends_with"},U(t)),{suffix:e}))}function or(e){return new Wd({check:"overwrite",tx:e})}function Rh(e){return or(t=>t.normalize(e))}function Lh(){return or(e=>e.trim())}function Ih(){return or(e=>e.toLowerCase())}function $h(){return or(e=>e.toUpperCase())}function zh(){return or(e=>Zu(e))}function Oh(e,t,n){return new e(v({type:"array",element:t},U(n)))}function Nh(e,t,n){return new e(v({type:"custom",check:"custom",fn:t},U(n)))}function Dh(e){const t=Mh(n=>(n.addIssue=r=>{var o,i,a,d;if(typeof r=="string")n.issues.push(Rr(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(Rr(l))}},e(n.value,n)));return t}function Mh(e,t){const n=new st(v({check:"custom"},U(t)));return n._zod.check=e,n}function Ba(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:Lr,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 Re(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=M(v({},n),{schemaPath:[...n.schemaPath,e],path:n.path});if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,k);else{const S=a.schema,$=t.processors[o.type];if(!$)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);$(e,t,S,k)}const y=e._zod.parent;y&&(a.ref||(a.ref=y),Re(y,t,k),t.seen.get(y).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Ye(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 Ga(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 S,$,E,j,A;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const T=(S=e.external.registry.get(h[0]))==null?void 0:S.id,L=($=e.external.uri)!=null?$:(H=>H);if(T)return{ref:L(T)};const q=(j=(E=h[1].defId)!=null?E:h[1].schema.id)!=null?j:`schema${e.counter++}`;return h[1].defId=q,{defId:q,ref:`${L("__shared")}#/${g}/${q}`}}if(h[1]===n)return{ref:"#"};const k=`#/${g}/`,y=(A=h[1].schema.id)!=null?A:`__schema${e.counter++}`;return{defId:y,ref:k+y}},i=h=>{if(h[1].schema.$ref)return;const g=h[1],{ref:m,defId:k}=o(h);g.def=v({},g.schema),k&&(g.defId=k);const y=g.schema;for(const S in y)delete y[S];y.$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>
|
|
1623
|
+
`)}g.write("payload.value = newResult;"),g.write("return payload;");const v=g.compile();return(y,_)=>v(f,y,_)};let s;const o=vr,a=!yl.jitless,c=a&&bg.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?zl([],m,f,g,h,A):f):t(f,g):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:A}),f)}});function Vl(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=>!$n(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=>Ot(o,n,Lt())))}),e)}const Gl=x("$ZodUnion",(A,e)=>{bA.init(A,e),iA(A._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),iA(A._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),iA(A._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),iA(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=>Zi(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=>Vl(i,r,A,s)):Vl(a,r,A,s)}}),aw=x("$ZodDiscriminatedUnion",(A,e)=>{e.inclusive=!1,Gl.init(A,e);const t=A._zod.parse;iA(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=Ns(()=>{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(!vr(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)}}),cw=x("$ZodIntersection",(A,e)=>{bA.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])=>Zl(t,i,c)):Zl(t,s,o)}});function Yi(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(Kn(A)&&Kn(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=Yi(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=Yi(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 Zl(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})),$n(A))return A;const o=Yi(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 lw=x("$ZodRecord",(A,e)=>{bA.init(A,e),A._zod.parse=(t,n)=>{const r=t.value;if(!Kn(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(...zn(c,h.issues)),t.value[c]=h.value})):(u.issues.length&&t.issues.push(...zn(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"&&Dl.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=>Ot(h,n,Lt())),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(...zn(a,h.issues)),t.value[i.value]=h.value})):(u.issues.length&&t.issues.push(...zn(a,u.issues)),t.value[i.value]=u.value)}}return s.length?Promise.all(s).then(()=>t):t}}),uw=x("$ZodEnum",(A,e)=>{bA.init(A,e);const t=Ul(e.entries),n=new Set(t);A._zod.values=n,A._zod.pattern=new RegExp(`^(${t.filter(r=>Qg.has(typeof r)).map(r=>typeof r=="string"?Nn(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}}),dw=x("$ZodLiteral",(A,e)=>{if(bA.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"?Nn(n):n?Nn(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}}),pw=x("$ZodTransform",(A,e)=>{bA.init(A,e),A._zod.parse=(t,n)=>{if(n.direction==="backward")throw new Ql(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 Mn;return t.value=r,t}});function Xl(A,e){return A.issues.length&&e===void 0?{issues:[],value:void 0}:A}const Wl=x("$ZodOptional",(A,e)=>{bA.init(A,e),A._zod.optin="optional",A._zod.optout="optional",iA(A._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),iA(A._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Zi(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=>Xl(s,t.value)):Xl(r,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,n)}}),hw=x("$ZodExactOptional",(A,e)=>{Wl.init(A,e),iA(A._zod,"values",()=>e.innerType._zod.values),iA(A._zod,"pattern",()=>e.innerType._zod.pattern),A._zod.parse=(t,n)=>e.innerType._zod.run(t,n)}),fw=x("$ZodNullable",(A,e)=>{bA.init(A,e),iA(A._zod,"optin",()=>e.innerType._zod.optin),iA(A._zod,"optout",()=>e.innerType._zod.optout),iA(A._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Zi(t.source)}|null)$`):void 0}),iA(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)}),gw=x("$ZodDefault",(A,e)=>{bA.init(A,e),A._zod.optin="optional",iA(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=>Jl(s,e)):Jl(r,e)}});function Jl(A,e){return A.value===void 0&&(A.value=e.defaultValue),A}const Bw=x("$ZodPrefault",(A,e)=>{bA.init(A,e),A._zod.optin="optional",iA(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))}),ww=x("$ZodNonOptional",(A,e)=>{bA.init(A,e),iA(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=>jl(s,A)):jl(r,A)}});function jl(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 mw=x("$ZodCatch",(A,e)=>{bA.init(A,e),iA(A._zod,"optin",()=>e.innerType._zod.optin),iA(A._zod,"optout",()=>e.innerType._zod.optout),iA(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=>Ot(o,n,Lt()))},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=>Ot(s,n,Lt()))},input:t.value})),t.issues=[]),t)}}),Cw=x("$ZodPipe",(A,e)=>{bA.init(A,e),iA(A._zod,"values",()=>e.in._zod.values),iA(A._zod,"optin",()=>e.in._zod.optin),iA(A._zod,"optout",()=>e.out._zod.optout),iA(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=>Xs(o,e.in,n)):Xs(s,e.in,n)}const r=e.in._zod.run(t,n);return r instanceof Promise?r.then(s=>Xs(s,e.out,n)):Xs(r,e.out,n)}});function Xs(A,e,t){return A.issues.length?(A.aborted=!0,A):e._zod.run({value:A.value,issues:A.issues},t)}const bw=x("$ZodReadonly",(A,e)=>{bA.init(A,e),iA(A._zod,"propValues",()=>e.innerType._zod.propValues),iA(A._zod,"values",()=>e.innerType._zod.values),iA(A._zod,"optin",()=>{var t,n;return(n=(t=e.innerType)==null?void 0:t._zod)==null?void 0:n.optin}),iA(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(Yl):Yl(r)}});function Yl(A){return A.value=Object.freeze(A.value),A}const Qw=x("$ZodCustom",(A,e)=>{fe.init(A,e),bA.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=>ql(s,t,n,A));ql(r,t,n,A)}});function ql(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(_r(s))}}var Au;class yw{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 Uw(){return new yw}(Hf=(Au=globalThis).__zod_globalRegistry)!=null||(Au.__zod_globalRegistry=Uw());const xr=globalThis.__zod_globalRegistry;function Ew(A,e){return new A(k({type:"string"},V(e)))}function kw(A,e){return new A(k({type:"string",format:"email",check:"string_format",abort:!1},V(e)))}function eu(A,e){return new A(k({type:"string",format:"guid",check:"string_format",abort:!1},V(e)))}function Fw(A,e){return new A(k({type:"string",format:"uuid",check:"string_format",abort:!1},V(e)))}function vw(A,e){return new A(k({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4"},V(e)))}function _w(A,e){return new A(k({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6"},V(e)))}function xw(A,e){return new A(k({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7"},V(e)))}function Sw(A,e){return new A(k({type:"string",format:"url",check:"string_format",abort:!1},V(e)))}function Iw(A,e){return new A(k({type:"string",format:"emoji",check:"string_format",abort:!1},V(e)))}function Tw(A,e){return new A(k({type:"string",format:"nanoid",check:"string_format",abort:!1},V(e)))}function Hw(A,e){return new A(k({type:"string",format:"cuid",check:"string_format",abort:!1},V(e)))}function Lw(A,e){return new A(k({type:"string",format:"cuid2",check:"string_format",abort:!1},V(e)))}function Dw(A,e){return new A(k({type:"string",format:"ulid",check:"string_format",abort:!1},V(e)))}function Rw(A,e){return new A(k({type:"string",format:"xid",check:"string_format",abort:!1},V(e)))}function Ow(A,e){return new A(k({type:"string",format:"ksuid",check:"string_format",abort:!1},V(e)))}function Pw(A,e){return new A(k({type:"string",format:"ipv4",check:"string_format",abort:!1},V(e)))}function Mw(A,e){return new A(k({type:"string",format:"ipv6",check:"string_format",abort:!1},V(e)))}function Kw(A,e){return new A(k({type:"string",format:"cidrv4",check:"string_format",abort:!1},V(e)))}function Nw(A,e){return new A(k({type:"string",format:"cidrv6",check:"string_format",abort:!1},V(e)))}function $w(A,e){return new A(k({type:"string",format:"base64",check:"string_format",abort:!1},V(e)))}function zw(A,e){return new A(k({type:"string",format:"base64url",check:"string_format",abort:!1},V(e)))}function Vw(A,e){return new A(k({type:"string",format:"e164",check:"string_format",abort:!1},V(e)))}function Gw(A,e){return new A(k({type:"string",format:"jwt",check:"string_format",abort:!1},V(e)))}function Zw(A,e){return new A(k({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null},V(e)))}function Xw(A,e){return new A(k({type:"string",format:"date",check:"string_format"},V(e)))}function Ww(A,e){return new A(k({type:"string",format:"time",check:"string_format",precision:null},V(e)))}function Jw(A,e){return new A(k({type:"string",format:"duration",check:"string_format"},V(e)))}function jw(A,e){return new A(k({type:"number",checks:[]},V(e)))}function Yw(A,e){return new A(k({type:"number",check:"number_format",abort:!1,format:"safeint"},V(e)))}function qw(A,e){return new A(k({type:"boolean"},V(e)))}function Am(A){return new A({type:"any"})}function em(A){return new A({type:"unknown"})}function tm(A,e){return new A(k({type:"never"},V(e)))}function tu(A,e){return new Ol($(k({check:"less_than"},V(e)),{value:A,inclusive:!1}))}function qi(A,e){return new Ol($(k({check:"less_than"},V(e)),{value:A,inclusive:!0}))}function nu(A,e){return new Pl($(k({check:"greater_than"},V(e)),{value:A,inclusive:!1}))}function Aa(A,e){return new Pl($(k({check:"greater_than"},V(e)),{value:A,inclusive:!0}))}function ru(A,e){return new fB($(k({check:"multiple_of"},V(e)),{value:A}))}function su(A,e){return new BB($(k({check:"max_length"},V(e)),{maximum:A}))}function Ws(A,e){return new wB($(k({check:"min_length"},V(e)),{minimum:A}))}function ou(A,e){return new mB($(k({check:"length_equals"},V(e)),{length:A}))}function nm(A,e){return new CB($(k({check:"string_format",format:"regex"},V(e)),{pattern:A}))}function rm(A){return new bB(k({check:"string_format",format:"lowercase"},V(A)))}function sm(A){return new QB(k({check:"string_format",format:"uppercase"},V(A)))}function om(A,e){return new yB($(k({check:"string_format",format:"includes"},V(e)),{includes:A}))}function im(A,e){return new UB($(k({check:"string_format",format:"starts_with"},V(e)),{prefix:A}))}function am(A,e){return new EB($(k({check:"string_format",format:"ends_with"},V(e)),{suffix:A}))}function Vn(A){return new kB({check:"overwrite",tx:A})}function cm(A){return Vn(e=>e.normalize(A))}function lm(){return Vn(A=>A.trim())}function um(){return Vn(A=>A.toLowerCase())}function dm(){return Vn(A=>A.toUpperCase())}function pm(){return Vn(A=>Cg(A))}function hm(A,e,t){return new A(k({type:"array",element:e},V(t)))}function fm(A,e,t){return new A(k({type:"custom",check:"custom",fn:e},V(t)))}function gm(A){const e=Bm(t=>(t.addIssue=n=>{var r,s,o,a;if(typeof n=="string")t.issues.push(_r(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(_r(i))}},A(t.value,t)));return e}function Bm(A,e){const t=new fe(k({check:"custom"},V(e)));return t._zod.check=A,t}function iu(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:xr,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 OA(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 b=o.schema,U=e.processors[r.type];if(!U)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);U(A,e,b,g)}const m=A._zod.parent;m&&(o.ref||(o.ref=m),OA(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"&&ie(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 au(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 b,U,E,v,F;const h=A.target==="draft-2020-12"?"$defs":"definitions";if(A.external){const y=(b=A.external.registry.get(u[0]))==null?void 0:b.id,_=(U=A.external.uri)!=null?U:(H=>H);if(y)return{ref:_(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:`${_("__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 b in m)delete m[b];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>
|
|
1570
1624
|
|
|
1571
|
-
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 Wa(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 E,j,A;const m=e.seen.get(g);if(m.ref===null)return;const k=(E=m.def)!=null?E:m.schema,y=v({},k),S=m.ref;if(m.ref=null,S){r(S);const T=e.seen.get(S),L=T.schema;if(L.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(k.allOf=(j=k.allOf)!=null?j:[],k.allOf.push(L)):Object.assign(k,L),Object.assign(k,y),g._zod.parent===S)for(const H in k)H==="$ref"||H==="allOf"||H in y||delete k[H];if(L.$ref)for(const H in k)H==="$ref"||H==="allOf"||H in T.def&&JSON.stringify(k[H])===JSON.stringify(T.def[H])&&delete k[H]}const $=g._zod.parent;if($&&$!==S){r($);const T=e.seen.get($);if(T!=null&&T.schema.$ref&&(k.$ref=T.schema.$ref,T.def))for(const L in k)L==="$ref"||L==="allOf"||L in T.def&&JSON.stringify(k[L])===JSON.stringify(T.def[L])&&delete k[L]}e.override({zodSchema:g,jsonSchema:k,path:(A=m.path)!=null?A:[]})};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:M(v({},t["~standard"]),{jsonSchema:{input:Co(t,"input",e.processors),output:Co(t,"output",e.processors)}}),enumerable:!1,writable:!1}),g}catch(g){throw new Error("Error converting schema to JSON.")}}function Ye(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 Ye(r.element,n);if(r.type==="set")return Ye(r.valueType,n);if(r.type==="lazy")return Ye(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 Ye(r.innerType,n);if(r.type==="intersection")return Ye(r.left,n)||Ye(r.right,n);if(r.type==="record"||r.type==="map")return Ye(r.keyType,n)||Ye(r.valueType,n);if(r.type==="pipe")return Ye(r.in,n)||Ye(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Ye(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Ye(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Ye(o,n))return!0;return!!(r.rest&&Ye(r.rest,n))}return!1}const Uh=(e,t={})=>n=>{const r=Ba(M(v({},n),{processors:t}));return Re(e,r),Ga(r,e),Wa(r,e)},Co=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r!=null?r:{},a=Ba(M(v({},o!=null?o:{}),{target:i,io:t,processors:n}));return Re(e,a),Ga(a,e),Wa(a,e)},jh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zh=(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=jh[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=>M(v({},t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{}),{pattern:m.source}))])}},qh=(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)},Hh=(e,t,n,r)=>{n.type="boolean"},Fh=(e,t,n,r)=>{n.not={}},Bh=(e,t,n,r)=>{},Gh=(e,t,n,r)=>{},Wh=(e,t,n,r)=>{const o=e._zod.def,i=ca(o.entries);i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),n.enum=i},Jh=(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},Yh=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Vh=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Xh=(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=Re(i.element,t,M(v({},r),{path:[...r.path,"items"]}))},Kh=(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]=Re(a[h],t,M(v({},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=Re(i.catchall,t,M(v({},r),{path:[...r.path,"additionalProperties"]}))):t.io==="output"&&(o.additionalProperties=!1)},Qh=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,a=o.options.map((d,l)=>Re(d,t,M(v({},r),{path:[...r.path,i?"oneOf":"anyOf",l]})));i?n.oneOf=a:n.anyOf=a},ef=(e,t,n,r)=>{const o=e._zod.def,i=Re(o.left,t,M(v({},r),{path:[...r.path,"allOf",0]})),a=Re(o.right,t,M(v({},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},tf=(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=Re(i.valueType,t,M(v({},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=Re(i.keyType,t,M(v({},r),{path:[...r.path,"propertyNames"]}))),o.additionalProperties=Re(i.valueType,t,M(v({},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)}},nf=(e,t,n,r)=>{const o=e._zod.def,i=Re(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"}]},rf=(e,t,n,r)=>{const o=e._zod.def;Re(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},of=(e,t,n,r)=>{const o=e._zod.def;Re(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},sf=(e,t,n,r)=>{const o=e._zod.def;Re(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)))},af=(e,t,n,r)=>{const o=e._zod.def;Re(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},cf=(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;Re(i,t,r);const a=t.seen.get(e);a.ref=i},lf=(e,t,n,r)=>{const o=e._zod.def;Re(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},Ja=(e,t,n,r)=>{const o=e._zod.def;Re(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},uf=w("ZodISODateTime",(e,t)=>{ap.init(e,t),we.init(e,t)});function df(e){return fh(uf,e)}const pf=w("ZodISODate",(e,t)=>{cp.init(e,t),we.init(e,t)});function hf(e){return gh(pf,e)}const ff=w("ZodISOTime",(e,t)=>{lp.init(e,t),we.init(e,t)});function gf(e){return mh(ff,e)}const mf=w("ZodISODuration",(e,t)=>{up.init(e,t),we.init(e,t)});function bf(e){return bh(mf,e)}const dt=w("ZodError",(e,t)=>{fa.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>ed(e,n)},flatten:{value:n=>Qu(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Is,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Is,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),kf=Ns(dt),_f=Ds(dt),vf=wo(dt),yf=xo(dt),wf=rd(dt),xf=od(dt),Sf=sd(dt),Tf=id(dt),Ef=ad(dt),Af=cd(dt),Cf=ld(dt),Pf=ud(dt),ke=w("ZodType",(e,t)=>(me.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Co(e,"input"),output:Co(e,"output")}}),e.toJSONSchema=Uh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>{var r;return e.clone(mn(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)=>bn(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>kf(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>vf(e,n,r),e.parseAsync=(n,r)=>z(null,null,function*(){return _f(e,n,r,{callee:e.parseAsync})}),e.safeParseAsync=(n,r)=>z(null,null,function*(){return yf(e,n,r)}),e.spa=e.safeParseAsync,e.encode=(n,r)=>wf(e,n,r),e.decode=(n,r)=>xf(e,n,r),e.encodeAsync=(n,r)=>z(null,null,function*(){return Sf(e,n,r)}),e.decodeAsync=(n,r)=>z(null,null,function*(){return Tf(e,n,r)}),e.safeEncode=(n,r)=>Ef(e,n,r),e.safeDecode=(n,r)=>Af(e,n,r),e.safeEncodeAsync=(n,r)=>z(null,null,function*(){return Cf(e,n,r)}),e.safeDecodeAsync=(n,r)=>z(null,null,function*(){return Pf(e,n,r)}),e.refine=(n,r)=>e.check(Sg(n,r)),e.superRefine=n=>e.check(Tg(n)),e.overwrite=n=>e.check(or(n)),e.optional=()=>oc(e),e.exactOptional=()=>dg(e),e.nullable=()=>sc(e),e.nullish=()=>oc(sc(e)),e.nonoptional=n=>bg(e,n),e.array=()=>ct(e),e.or=n=>ng([e,n]),e.and=n=>sg(e,n),e.transform=n=>ac(e,lg(n)),e.default=n=>fg(e,n),e.prefault=n=>mg(e,n),e.catch=n=>_g(e,n),e.pipe=n=>ac(e,n),e.readonly=()=>wg(e),e.describe=n=>{const r=e.clone();return Lr.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=Lr.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Lr.get(e);const r=e.clone();return Lr.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Ya=w("_ZodString",(e,t)=>{var r,o,i;Ms.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(a,d,l)=>Zh(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(Sh(...a)),e.includes=(...a)=>e.check(Ah(...a)),e.startsWith=(...a)=>e.check(Ch(...a)),e.endsWith=(...a)=>e.check(Ph(...a)),e.min=(...a)=>e.check(Ao(...a)),e.max=(...a)=>e.check(Ha(...a)),e.length=(...a)=>e.check(Fa(...a)),e.nonempty=(...a)=>e.check(Ao(1,...a)),e.lowercase=a=>e.check(Th(a)),e.uppercase=a=>e.check(Eh(a)),e.trim=()=>e.check(Lh()),e.normalize=(...a)=>e.check(Rh(...a)),e.toLowerCase=()=>e.check(Ih()),e.toUpperCase=()=>e.check($h()),e.slugify=()=>e.check(zh())}),Rf=w("ZodString",(e,t)=>{Ms.init(e,t),Ya.init(e,t),e.email=n=>e.check(Wp(Lf,n)),e.url=n=>e.check(Kp(If,n)),e.jwt=n=>e.check(hh(Wf,n)),e.emoji=n=>e.check(Qp($f,n)),e.guid=n=>e.check(Ua(Va,n)),e.uuid=n=>e.check(Jp(Po,n)),e.uuidv4=n=>e.check(Yp(Po,n)),e.uuidv6=n=>e.check(Vp(Po,n)),e.uuidv7=n=>e.check(Xp(Po,n)),e.nanoid=n=>e.check(eh(zf,n)),e.guid=n=>e.check(Ua(Va,n)),e.cuid=n=>e.check(th(Of,n)),e.cuid2=n=>e.check(nh(Nf,n)),e.ulid=n=>e.check(rh(Df,n)),e.base64=n=>e.check(uh(Ff,n)),e.base64url=n=>e.check(dh(Bf,n)),e.xid=n=>e.check(oh(Mf,n)),e.ksuid=n=>e.check(sh(Uf,n)),e.ipv4=n=>e.check(ih(jf,n)),e.ipv6=n=>e.check(ah(Zf,n)),e.cidrv4=n=>e.check(ch(qf,n)),e.cidrv6=n=>e.check(lh(Hf,n)),e.e164=n=>e.check(ph(Gf,n)),e.datetime=n=>e.check(df(n)),e.date=n=>e.check(hf(n)),e.time=n=>e.check(gf(n)),e.duration=n=>e.check(bf(n))});function P(e){return Gp(Rf,e)}const we=w("ZodStringFormat",(e,t)=>{be.init(e,t),Ya.init(e,t)}),Lf=w("ZodEmail",(e,t)=>{Kd.init(e,t),we.init(e,t)}),Va=w("ZodGUID",(e,t)=>{Vd.init(e,t),we.init(e,t)}),Po=w("ZodUUID",(e,t)=>{Xd.init(e,t),we.init(e,t)}),If=w("ZodURL",(e,t)=>{Qd.init(e,t),we.init(e,t)}),$f=w("ZodEmoji",(e,t)=>{ep.init(e,t),we.init(e,t)}),zf=w("ZodNanoID",(e,t)=>{tp.init(e,t),we.init(e,t)}),Of=w("ZodCUID",(e,t)=>{np.init(e,t),we.init(e,t)}),Nf=w("ZodCUID2",(e,t)=>{rp.init(e,t),we.init(e,t)}),Df=w("ZodULID",(e,t)=>{op.init(e,t),we.init(e,t)}),Mf=w("ZodXID",(e,t)=>{sp.init(e,t),we.init(e,t)}),Uf=w("ZodKSUID",(e,t)=>{ip.init(e,t),we.init(e,t)}),jf=w("ZodIPv4",(e,t)=>{dp.init(e,t),we.init(e,t)}),Zf=w("ZodIPv6",(e,t)=>{pp.init(e,t),we.init(e,t)}),qf=w("ZodCIDRv4",(e,t)=>{hp.init(e,t),we.init(e,t)}),Hf=w("ZodCIDRv6",(e,t)=>{fp.init(e,t),we.init(e,t)}),Ff=w("ZodBase64",(e,t)=>{gp.init(e,t),we.init(e,t)}),Bf=w("ZodBase64URL",(e,t)=>{bp.init(e,t),we.init(e,t)}),Gf=w("ZodE164",(e,t)=>{kp.init(e,t),we.init(e,t)}),Wf=w("ZodJWT",(e,t)=>{vp.init(e,t),we.init(e,t)}),Xa=w("ZodNumber",(e,t)=>{var r,o,i,a,d,l,p,h,g;Ta.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(m,k,y)=>qh(e,m,k),e.gt=(m,k)=>e.check(Za(m,k)),e.gte=(m,k)=>e.check(Zs(m,k)),e.min=(m,k)=>e.check(Zs(m,k)),e.lt=(m,k)=>e.check(ja(m,k)),e.lte=(m,k)=>e.check(js(m,k)),e.max=(m,k)=>e.check(js(m,k)),e.int=m=>e.check(Ka(m)),e.safe=m=>e.check(Ka(m)),e.positive=m=>e.check(Za(0,m)),e.nonnegative=m=>e.check(Zs(0,m)),e.negative=m=>e.check(ja(0,m)),e.nonpositive=m=>e.check(js(0,m)),e.multipleOf=(m,k)=>e.check(qa(m,k)),e.step=(m,k)=>e.check(qa(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 jt(e){return kh(Xa,e)}const Jf=w("ZodNumberFormat",(e,t)=>{yp.init(e,t),Xa.init(e,t)});function Ka(e){return _h(Jf,e)}const Yf=w("ZodBoolean",(e,t)=>{wp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Hh(e,n,r)});function _e(e){return vh(Yf,e)}const Vf=w("ZodAny",(e,t)=>{xp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Bh()});function Qa(){return yh(Vf)}const Xf=w("ZodUnknown",(e,t)=>{Sp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gh()});function ec(){return wh(Xf)}const Kf=w("ZodNever",(e,t)=>{Tp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fh(e,n,r)});function Qf(e){return xh(Kf,e)}const eg=w("ZodArray",(e,t)=>{Ep.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Xh(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Ao(n,r)),e.nonempty=n=>e.check(Ao(1,n)),e.max=(n,r)=>e.check(Ha(n,r)),e.length=(n,r)=>e.check(Fa(n,r)),e.unwrap=()=>e.element});function ct(e,t){return Oh(eg,e,t)}const tg=w("ZodObject",(e,t)=>{Cp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Kh(e,n,r,o),ne(e,"shape",()=>t.shape),e.keyof=()=>pt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone(M(v({},e._zod.def),{catchall:n})),e.passthrough=()=>e.clone(M(v({},e._zod.def),{catchall:ec()})),e.loose=()=>e.clone(M(v({},e._zod.def),{catchall:ec()})),e.strict=()=>e.clone(M(v({},e._zod.def),{catchall:Qf()})),e.strip=()=>e.clone(M(v({},e._zod.def),{catchall:void 0})),e.extend=n=>Ju(e,n),e.safeExtend=n=>Yu(e,n),e.merge=n=>Vu(e,n),e.pick=n=>Gu(e,n),e.omit=n=>Wu(e,n),e.partial=(...n)=>Xu(rc,e,n[0]),e.required=(...n)=>Ku(ic,e,n[0])});function fe(e,t){const n=v({type:"object",shape:e!=null?e:{}},U(t));return new tg(n)}const tc=w("ZodUnion",(e,t)=>{Ra.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qh(e,n,r,o),e.options=t.options});function ng(e,t){return new tc(v({type:"union",options:e},U(t)))}const rg=w("ZodDiscriminatedUnion",(e,t)=>{tc.init(e,t),Pp.init(e,t)});function nc(e,t,n){return new rg(v({type:"union",options:t,discriminator:e},U(n)))}const og=w("ZodIntersection",(e,t)=>{Rp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ef(e,n,r,o)});function sg(e,t){return new og({type:"intersection",left:e,right:t})}const ig=w("ZodRecord",(e,t)=>{Lp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tf(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Zt(e,t,n){return new ig(v({type:"record",keyType:e,valueType:t},U(n)))}const qs=w("ZodEnum",(e,t)=>{Ip.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Wh(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 qs(M(v(M(v({},t),{checks:[]}),U(o)),{entries:i}))},e.exclude=(r,o)=>{const i=v({},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 qs(M(v(M(v({},t),{checks:[]}),U(o)),{entries:i}))}});function pt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new qs(v({type:"enum",entries:n},U(t)))}const ag=w("ZodLiteral",(e,t)=>{$p.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Jh(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 ht(e,t){return new ag(v({type:"literal",values:Array.isArray(e)?e:[e]},U(t)))}const cg=w("ZodTransform",(e,t)=>{zp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Vh(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ia(e.constructor.name);n.addIssue=i=>{var a,d,l;if(typeof i=="string")n.issues.push(Rr(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(Rr(p))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function lg(e){return new cg({type:"transform",transform:e})}const rc=w("ZodOptional",(e,t)=>{$a.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ja(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function oc(e){return new rc({type:"optional",innerType:e})}const ug=w("ZodExactOptional",(e,t)=>{Op.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ja(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function dg(e){return new ug({type:"optional",innerType:e})}const pg=w("ZodNullable",(e,t)=>{Np.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function sc(e){return new pg({type:"nullable",innerType:e})}const hg=w("ZodDefault",(e,t)=>{Dp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>of(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function fg(e,t){return new hg({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():pa(t)}})}const gg=w("ZodPrefault",(e,t)=>{Mp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function mg(e,t){return new gg({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():pa(t)}})}const ic=w("ZodNonOptional",(e,t)=>{Up.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function bg(e,t){return new ic(v({type:"nonoptional",innerType:e},U(t)))}const kg=w("ZodCatch",(e,t)=>{jp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>af(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _g(e,t){return new kg({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const vg=w("ZodPipe",(e,t)=>{Zp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cf(e,n,r,o),e.in=t.in,e.out=t.out});function ac(e,t){return new vg({type:"pipe",in:e,out:t})}const yg=w("ZodReadonly",(e,t)=>{qp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function wg(e){return new yg({type:"readonly",innerType:e})}const xg=w("ZodCustom",(e,t)=>{Hp.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Yh(e,n)});function Sg(e,t={}){return Nh(xg,e,t)}function Tg(e){return Dh(e)}const Eg=fe({name:P().min(1).max(100).optional(),command:P().min(1).max(500),args:ct(P()).optional(),failOnError:_e().default(!0).optional(),timeout:jt().int().min(1e3).max(3e5).default(3e4).optional(),workingDirectory:P().optional(),env:Zt(P(),P()).optional(),runOnBackground:_e().optional(),agentTags:ct(P()).optional()});fe({name:P(),command:P(),success:_e(),exitCode:jt().optional(),stdout:P().optional(),stderr:P().optional(),error:P().optional(),duration:jt(),failOnError:_e()});const In=fe({path:P(),extraCommands:ct(Eg).optional(),id:P().uuid().optional(),rotationKey:P().optional(),usageStatus:pt(["free","in_use"]).optional(),agentTags:ct(P()).optional()}),Ag=nc("operation",[In.extend({operation:ht("create"),content:P().optional(),contentPath:P().optional(),encoding:pt(["utf-8","base64"]).optional()}),In.extend({operation:ht("merge"),data:Zt(P(),Qa()),mergeStrategy:pt(["deep","shallow"]).optional(),arrayMergeStrategy:pt(["concat","replace"]).optional()}),In.extend({operation:ht("modify"),content:P().optional(),contentPath:P().optional(),createIfMissing:_e().optional()}),In.extend({operation:ht("delete"),ignoreIfMissing:_e().optional()}),In.extend({operation:ht("createDirectory"),contentPath:P().optional(),mode:jt().optional(),ignoreIfExists:_e().optional()}),In.extend({operation:ht("download"),url:P().url(),headers:Zt(P(),P()).optional(),timeout:jt().min(1e3).max(3e5).optional()}),In.extend({operation:ht("gitClone"),gitUrl:P(),gitSecretKey:P().optional(),sourceBranch:P().optional(),targetBranch:P().optional(),originalBranch:P().optional(),defaultBranch:P().optional()})]);var Ae=(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))(Ae||{});const Cg=fe({type:pt(["json","file","regex"]).describe("Extraction method"),source:P().describe("Source to extract from (file path or stdout/stderr)"),schema:fe({}).passthrough().optional().describe("JSON schema for validation"),pattern:P().optional().describe("Regex pattern for extraction")}),Pg=fe({type:pt(["issue_update","bulk_issue_update","notification","webhook"]).describe("Hook type"),config:Qa().describe("Hook-specific configuration")});fe({command:P().optional().describe("Legacy — unused in SDK mode"),args:ct(P()).optional().describe("Legacy — unused in SDK mode"),env:Zt(P(),P()).optional().describe("Environment variables"),workingDirectory:P().optional().describe("Working directory for command execution"),fileOperations:ct(Ag).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:Cg.optional().describe("Schema for extracting result data"),postExecutionHooks:ct(Pg).optional().describe("Hooks to run after task completion"),executionMode:pt(["claudeAgentSdk","openaiAgentSdk","opencodeSdk","cursorSdk","codexSdk"]).optional().default("claudeAgentSdk").describe("Execution mode (default: claudeAgentSdk)"),executionPlan:nc("executionMode",[fe({executionMode:ht("claudeAgentSdk"),promptText:P(),sdkOptions:fe({model:P(),permissionMode:pt(["plan","acceptEdits","bypassPermissions","ask"]),settingSources:ct(P()),allowDangerouslySkipPermissions:_e(),persistSession:_e(),streamSdkEvents:_e().optional(),allowedTools:ct(P()).optional(),settings:fe({enabledPlugins:Zt(P(),_e())}),env:Zt(P(),P()).optional()}),resume:fe({sessionId:P().optional(),continue:_e()}).optional()}),fe({executionMode:ht("opencodeSdk"),promptText:P(),sdkOptions:fe({provider:P(),model:P(),allowedTools:ct(P()).optional(),env:Zt(P(),P()).optional()}),resume:fe({sessionId:P().optional(),continue:_e()}).optional()}),fe({executionMode:ht("openaiAgentSdk"),promptText:P(),sdkOptions:fe({model:P(),env:Zt(P(),P()).optional()}),resume:fe({sessionId:P().optional(),continue:_e()}).optional()}),fe({executionMode:ht("codexSdk"),promptText:P(),sdkOptions:fe({model:P().optional(),sandboxMode:pt(["read-only","workspace-write","danger-full-access"]).optional(),approvalPolicy:pt(["never","on-request","on-failure","untrusted"]).optional(),env:Zt(P(),P()).optional()}),resume:fe({sessionId:P().optional(),continue:_e()}).optional()}),fe({executionMode:ht("cursorSdk"),promptText:P(),sdkOptions:fe({model:P(),env:Zt(P(),P()).optional()}),resume:fe({sessionId:P().optional(),continue:_e()}).optional()})]).optional().describe("Backend-built prompt + resolved SDK options for this phase"),planEnabled:_e().optional().default(!1).describe("Enable planning phase (computed at runtime for agent)"),planContent:P().optional().describe("Final approved plan content"),planApproved:_e().optional().describe("Plan approval status"),planApprovedAt:P().optional().describe("ISO timestamp of approval"),planRejected:_e().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(fe({feedback:P(),rejectedAt:P()})).optional().describe("All rejection messages in chronological order"),notificationChannelPlanMessageId:jt().optional(),notificationChannelPlanMessageSentAt:P().optional(),notificationChannelCompletedMessageId:jt().optional(),notificationChannelFailedMessageId:jt().optional(),streamSdkEvents:_e().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:_e().optional().describe("True when planApproved was cleared for rePlan=true retry — indicates the plan had been approved before"),planComments:ct(fe({id:P(),selectedText:P(),startOffset:jt(),endOffset:jt(),commentText:P(),createdAt:P()})).optional().describe("Inline review comments attached to the plan"),hasAiConfigSecrets:_e().optional().describe("True when AI Config has secret-backed env vars; agent must fetch resolved values via /tasks/:id/resolve-secrets"),hasCredentials:_e().optional().describe("True when the task has credentials attached; agent must fetch resolved values via /tasks/:id/resolve-credentials"),mcpServersMode:pt(["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:_e().optional().describe("When true, the MCP server registers browser_interact and browser_get_context (browser_automate tasks only)")}),Ae.PENDING+"",Ae.CANCELLED,Ae.ASSIGNED+"",Ae.CANCELLED,Ae.IN_PROGRESS+"",Ae.CANCELLED,Ae.FAILED,Ae.WAITING_FOR_INPUT+"",Ae.CANCELLED,Ae.WAITING_FOR_PLAN_APPROVAL+"",Ae.CANCELLED,Ae.PLAN_APPROVED+"",Ae.CANCELLED,Ae.PLAN_REJECTED+"",Ae.CANCELLED,Ae.COMPLETED+"",Ae.RESULT_REJECTED+"",Ae.CANCELLED,Ae.FAILED+"",Ae.CANCELLED+"";const cc="browser_capture",Rg="browser_automate";function lc(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 Lg(e,t){const n=lc(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===lc(r)}function uc(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:[])Lg(n,d)&&d.length>o&&(o=d.length,r=a.id);return r}class dc extends Error{}function pc(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 dc(n):new Error(n)}return e.json()})}let hc=3e4;function Ig(e){Number.isFinite(e)&&e>0&&(hc=e)}function Ro(r){return z(this,arguments,function*(e,t={},n=hc){const o=new AbortController,i=setTimeout(()=>o.abort(),n);try{return yield fetch(e,M(v({},t),{credentials:"omit",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 He(e,t,n,r){return z(this,null,function*(){const i=`${e.backendUrl.replace(/\/+$/,"")}/api${n}`,a=yield Ro(i,{method:t,headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:r!==void 0?JSON.stringify(r):void 0});return pc(a)})}function $g(e,t){return z(this,null,function*(){return He(e,"GET",`/projects/by-key/${encodeURIComponent(t)}`)})}const zg=["project","note","ctx"];function Og(e){var n,r;const t=zg.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 Hs(e,t){return z(this,null,function*(){var h,g,m,k,y,S;Og(t);const{project:n,note:r,ctx:o,advancedOpts:i,titleOverride:a,titleInstruction:d,allowSubmit:l,type:p=cc}=t;return He(e,"POST","/tasks",M(v(v(v(v(v(v(v(v(v(v(v(v(M(v({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}:{}),(y=i==null?void 0:i.selectedSlashCommandIds)!=null&&y.length?{selectedSlashCommandIds:i.selectedSlashCommandIds}:{}),(S=i==null?void 0:i.selectedRemoteContextProviderIds)!=null&&S.length?{selectedRemoteContextProviderIds:i.selectedRemoteContextProviderIds}:{}),{metadata:v({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 fc(e,t){return z(this,null,function*(){return Hs(e,M(v({},t),{type:Rg}))})}function gc(e,t,n,r){return z(this,null,function*(){var o;return He(e,"POST","/planning-sessions",v(M(v({},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 Ng(e,t){return z(this,null,function*(){const n=t?`?projectId=${encodeURIComponent(t)}`:"";return He(e,"GET",`/claude-templates${n}`)})}function mc(e,t){return z(this,null,function*(){return He(e,"GET",`/tasks/${t}`)})}function Dg(e,t){return z(this,null,function*(){return He(e,"GET",`/planning-sessions/${t}`)})}function bc(e){return z(this,null,function*(){return He(e,"GET","/projects")})}function Mg(e){return z(this,null,function*(){return(yield He(e,"GET","/tenants/current")).membership})}function kc(e,t){if(!e||e.includes("tenant:*")||e.includes(t))return!0;const n=t.split(":")[0];return e.includes(`${n}:*`)}function Fs(e,t,n){return z(this,null,function*(){const o=`${e.backendUrl.replace(/\/+$/,"")}/api/auth/tokens/exchange-code`,i=yield Ro(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,origin:n})});return pc(i)})}function Ug(e,t){return z(this,null,function*(){return He(e,"GET",`/tasks/${t}/browser-commands/pending`)})}function jg(e,t,n,r,o){return z(this,null,function*(){return He(e,"POST",`/tasks/${t}/browser-commands/${n}/result`,{status:r,message:o})})}function Zg(e,t){return z(this,null,function*(){return He(e,"GET",`/tasks/${t}/chunks`)})}function qg(e,t,n){return z(this,null,function*(){return He(e,"POST",`/tasks/${t}/instructions`,{content:n})})}function Hg(e,t){return z(this,null,function*(){return He(e,"POST",`/tasks/${t}/cancel`)})}function Fg(e,t){return z(this,null,function*(){return He(e,"POST",`/tasks/${t}/approve-result`)})}function Bg(e,t,n){return z(this,null,function*(){return He(e,"POST",`/tasks/${t}/reject-result`,{feedback:n})})}function Lo(e,t){return z(this,null,function*(){return He(e,"GET",`/tasks/${t}/interactions?filter=unanswered`)})}function _c(e,t,n,r){return z(this,null,function*(){return He(e,"POST",`/tasks/${t}/interactions/${n}/answer`,{answer:r})})}function Gg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bs={exports:{}};/*!
|
|
1572
|
-
* Pusher JavaScript Library v8.5.0
|
|
1573
|
-
* https://pusher.com/
|
|
1574
|
-
*
|
|
1575
|
-
* Copyright 2020, Pusher
|
|
1576
|
-
* Released under the MIT licence.
|
|
1577
|
-
*/var vc;function Wg(){return vc||(vc=1,(function(e,t){(function(r,o){e.exports=o()})(self,()=>(()=>{var n={594(a,d){var l=this&&this.__extends||(function(){var j=function(A,T){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,q){L.__proto__=q}||function(L,q){for(var H in q)q.hasOwnProperty(H)&&(L[H]=q[H])},j(A,T)};return function(A,T){j(A,T);function L(){this.constructor=A}A.prototype=T===null?Object.create(T):(L.prototype=T.prototype,new L)}})();Object.defineProperty(d,"__esModule",{value:!0});var p=256,h=(function(){function j(A){A===void 0&&(A="="),this._paddingCharacter=A}return j.prototype.encodedLength=function(A){return this._paddingCharacter?(A+2)/3*4|0:(A*8+5)/6|0},j.prototype.encode=function(A){for(var T="",L=0;L<A.length-2;L+=3){var q=A[L]<<16|A[L+1]<<8|A[L+2];T+=this._encodeByte(q>>>18&63),T+=this._encodeByte(q>>>12&63),T+=this._encodeByte(q>>>6&63),T+=this._encodeByte(q>>>0&63)}var H=A.length-L;if(H>0){var q=A[L]<<16|(H===2?A[L+1]<<8:0);T+=this._encodeByte(q>>>18&63),T+=this._encodeByte(q>>>12&63),H===2?T+=this._encodeByte(q>>>6&63):T+=this._paddingCharacter||"",T+=this._paddingCharacter||""}return T},j.prototype.maxDecodedLength=function(A){return this._paddingCharacter?A/4*3|0:(A*6+7)/8|0},j.prototype.decodedLength=function(A){return this.maxDecodedLength(A.length-this._getPaddingLength(A))},j.prototype.decode=function(A){if(A.length===0)return new Uint8Array(0);for(var T=this._getPaddingLength(A),L=A.length-T,q=new Uint8Array(this.maxDecodedLength(L)),H=0,se=0,je=0,nt=0,ee=0,Se=0,at=0;se<L-4;se+=4)nt=this._decodeChar(A.charCodeAt(se+0)),ee=this._decodeChar(A.charCodeAt(se+1)),Se=this._decodeChar(A.charCodeAt(se+2)),at=this._decodeChar(A.charCodeAt(se+3)),q[H++]=nt<<2|ee>>>4,q[H++]=ee<<4|Se>>>2,q[H++]=Se<<6|at,je|=nt&p,je|=ee&p,je|=Se&p,je|=at&p;if(se<L-1&&(nt=this._decodeChar(A.charCodeAt(se)),ee=this._decodeChar(A.charCodeAt(se+1)),q[H++]=nt<<2|ee>>>4,je|=nt&p,je|=ee&p),se<L-2&&(Se=this._decodeChar(A.charCodeAt(se+2)),q[H++]=ee<<4|Se>>>2,je|=Se&p),se<L-3&&(at=this._decodeChar(A.charCodeAt(se+3)),q[H++]=Se<<6|at,je|=at&p),je!==0)throw new Error("Base64Coder: incorrect characters for decoding");return q},j.prototype._encodeByte=function(A){var T=A;return T+=65,T+=25-A>>>8&6,T+=51-A>>>8&-75,T+=61-A>>>8&-15,T+=62-A>>>8&3,String.fromCharCode(T)},j.prototype._decodeChar=function(A){var T=p;return T+=(42-A&A-44)>>>8&-p+A-43+62,T+=(46-A&A-48)>>>8&-p+A-47+63,T+=(47-A&A-58)>>>8&-p+A-48+52,T+=(64-A&A-91)>>>8&-p+A-65+0,T+=(96-A&A-123)>>>8&-p+A-97+26,T},j.prototype._getPaddingLength=function(A){var T=0;if(this._paddingCharacter){for(var L=A.length-1;L>=0&&A[L]===this._paddingCharacter;L--)T++;if(A.length<4||T>2)throw new Error("Base64Coder: incorrect padding")}return T},j})();d.Coder=h;var g=new h;function m(j){return g.encode(j)}d.encode=m;function k(j){return g.decode(j)}d.decode=k;var y=(function(j){l(A,j);function A(){return j!==null&&j.apply(this,arguments)||this}return A.prototype._encodeByte=function(T){var L=T;return L+=65,L+=25-T>>>8&6,L+=51-T>>>8&-75,L+=61-T>>>8&-13,L+=62-T>>>8&49,String.fromCharCode(L)},A.prototype._decodeChar=function(T){var L=p;return L+=(44-T&T-46)>>>8&-p+T-45+62,L+=(94-T&T-96)>>>8&-p+T-95+63,L+=(47-T&T-58)>>>8&-p+T-48+52,L+=(64-T&T-91)>>>8&-p+T-65+0,L+=(96-T&T-123)>>>8&-p+T-97+26,L},A})(h);d.URLSafeCoder=y;var S=new y;function $(j){return S.encode(j)}d.encodeURLSafe=$;function E(j){return S.decode(j)}d.decodeURLSafe=E,d.encodedLength=function(j){return g.encodedLength(j)},d.maxDecodedLength=function(j){return g.maxDecodedLength(j)},d.decodedLength=function(j){return g.decodedLength(j)}},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 y=void 0;if(k<224){if(m>=h.length)throw new Error(l);var S=h[++m];if((S&192)!==128)throw new Error(l);k=(k&31)<<6|S&63,y=128}else if(k<240){if(m>=h.length-1)throw new Error(l);var S=h[++m],$=h[++m];if((S&192)!==128||($&192)!==128)throw new Error(l);k=(k&15)<<12|(S&63)<<6|$&63,y=2048}else if(k<248){if(m>=h.length-2)throw new Error(l);var S=h[++m],$=h[++m],E=h[++m];if((S&192)!==128||($&192)!==128||(E&192)!==128)throw new Error(l);k=(k&15)<<18|(S&63)<<12|($&63)<<6|E&63,y=65536}else throw new Error(l);if(k<y||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:()=>ws});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+"]",x=!1,R=function(){x||(s.apply(null,arguments),x=!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 x=Y.createScriptRequest(b.getPath(s,c)),R=b.receivers.create(function(D){if(b.receivers.remove(R),b.loading[s]){var J=b.loading[s];delete b.loading[s];for(var te=function($e){$e||x.cleanup()},ie=0;ie<J.length;ie++)J[ie](D,te)}});x.send(R)}}getRoot(s){var c,f=Y.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 y=new p("_pusher_dependencies","Pusher.DependenciesReceivers"),S=new k({cdn_http:m.cdn_http,cdn_https:m.cdn_https,version:m.VERSION,suffix:m.dependency_suffix,receivers:y});const $={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"}}},j={buildLogSuffix:function(u){const s="See:",c=$.urls[u];if(!c)return"";let f;return c.fullUrl?f=c.fullUrl:c.path&&(f=$.baseUrl+c.path),f?`${s} ${f}`:""}};var A;(function(u){u.UserAuthentication="user-authentication",u.ChannelAuthorization="channel-authorization"})(A||(A={}));class T extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class L extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class q extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class H extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class se extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class je extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class nt extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class ee extends Error{constructor(s){super(s),Object.setPrototypeOf(this,new.target.prototype)}}class Se extends Error{constructor(s,c){super(c),this.status=s,Object.setPrototypeOf(this,new.target.prototype)}}const At=function(u,s,c,f,b){const x=Y.createXHR();x.open("POST",c.endpoint,!0),x.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var R in c.headers)x.setRequestHeader(R,c.headers[R]);if(c.headersProvider!=null){let D=c.headersProvider();for(var R in D)x.setRequestHeader(R,D[R])}return x.onreadystatechange=function(){if(x.readyState===4)if(x.status===200){let D,J=!1;try{D=JSON.parse(x.responseText),J=!0}catch(te){b(new Se(200,`JSON returned from ${f.toString()} endpoint was invalid, yet status code was 200. Data was: ${x.responseText}`),null)}J&&b(null,D)}else{let D="";switch(f){case A.UserAuthentication:D=j.buildLogSuffix("authenticationEndpoint");break;case A.ChannelAuthorization:D=`Clients must be authorized to join private or presence channels. ${j.buildLogSuffix("authorizationEndpoint")}`;break}b(new Se(x.status,`Unable to retrieve auth string from ${f.toString()} endpoint - received status: ${x.status} from ${c.endpoint}. ${D}`),null)}},x.send(s),x};function vr(u){return ye(Yt(u))}var Jt=String.fromCharCode,Ct="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yr=function(u){var s=u.charCodeAt(0);return s<128?u:s<2048?Jt(192|s>>>6)+Jt(128|s&63):Jt(224|s>>>12&15)+Jt(128|s>>>6&63)+Jt(128|s&63)},Yt=function(u){return u.replace(/[^\x00-\x7F]/g,yr)},an=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=[Ct.charAt(c>>>18),Ct.charAt(c>>>12&63),s>=2?"=":Ct.charAt(c>>>6&63),s>=1?"=":Ct.charAt(c&63)];return f.join("")},ye=window.btoa||function(u){return u.replace(/[\s\S]{1,3}/g,an)};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 ge=Vt;function Pt(u){window.clearTimeout(u)}function le(u){window.clearInterval(u)}class Le extends ge{constructor(s,c){super(setTimeout,Pt,s,function(f){return c(),null})}}class En extends ge{constructor(s,c){super(setInterval,le,s,function(f){return c(),f})}}var Rt={now(){return Date.now?Date.now():new Date().valueOf()},defer(u){return new Le(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 Te=Rt;function Pe(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]=Pe(u[b]||{},f[b]):u[b]=f[b]}return u}function Fn(){for(var u=["Pusher"],s=0;s<arguments.length;s++)typeof arguments[s]=="string"?u.push(arguments[s]):u.push(ue(arguments[s]));return u.join(" : ")}function An(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 Ne(u,s){for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&s(u[c],c,u)}function Xt(u){var s=[];return Ne(u,function(c,f){s.push(f)}),s}function bt(u){var s=[];return Ne(u,function(c){s.push(c)}),s}function kt(u,s,c){for(var f=0;f<u.length;f++)s.call(c||window,u[f],f,u)}function cn(u,s){for(var c=[],f=0;f<u.length;f++)c.push(s(u[f],f,u,c));return c}function F(u,s){var c={};return Ne(u,function(f,b){c[b]=s(f)}),c}function re(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 xe(u,s){var c={};return Ne(u,function(f,b){(s&&s(f,b,u,c)||f)&&(c[b]=f)}),c}function rt(u){var s=[];return Ne(u,function(c,f){s.push([f,c])}),s}function _t(u,s){for(var c=0;c<u.length;c++)if(s(u[c],c,u))return!0;return!1}function Lt(u,s){for(var c=0;c<u.length;c++)if(!s(u[c],c,u))return!1;return!0}function Cn(u){return F(u,function(s){return typeof s=="object"&&(s=ue(s)),encodeURIComponent(vr(s.toString()))})}function Kt(u){var s=xe(u,function(f){return f!==void 0}),c=cn(rt(Cn(s)),Te.method("join","=")).join("&");return c}function De(u){var s=[],c=[];return(function f(b,x){var R,D,J;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(x),Object.prototype.toString.apply(b)==="[object Array]")for(J=[],R=0;R<b.length;R+=1)J[R]=f(b[R],x+"["+R+"]");else{J={};for(D in b)Object.prototype.hasOwnProperty.call(b,D)&&(J[D]=f(b[D],x+"["+JSON.stringify(D)+"]"))}return J;case"number":case"string":case"boolean":return b}})(u,"$")}function ue(u){try{return JSON.stringify(u)}catch(s){return JSON.stringify(De(u))}}class Ie{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=Fn.apply(this,arguments);ws.log?ws.log(f):ws.logToConsole&&s.bind(this)(f)}}const X=new Ie;var wr=function(u,s,c,f,b){(c.headers!==void 0||c.headersProvider!=null)&&X.warn(`To send headers with the ${f.toString()} request, you must use AJAX, rather than JSONP.`);var x=u.nextAuthCallbackID.toString();u.nextAuthCallbackID++;var R=u.getDocument(),D=R.createElement("script");u.auth_callbacks[x]=function(ie){b(null,ie)};var J="Pusher.auth_callbacks['"+x+"']";D.src=c.endpoint+"?callback="+encodeURIComponent(J)+"&"+s;var te=R.getElementsByTagName("head")[0]||R.documentElement;te.insertBefore(D,te.firstChild)};const ot=wr;class It{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 ln{constructor(s,c){this.url=s,this.data=c}send(s){if(!this.request){var c=Kt(this.data),f=this.url+"/"+s.number+"?"+c;this.request=Y.createScriptRequest(f),this.request.send(s)}}cleanup(){this.request&&this.request.cleanup()}}var $t=function(u,s){return function(c,f){var b="http"+(s?"s":"")+"://",x=b+(u.host||u.options.host)+u.options.path,R=Y.createJSONPRequest(x,c),D=Y.ScriptReceivers.create(function(J,te){h.remove(D),R.cleanup(),te&&te.host&&(u.host=te.host),f&&f(J,te)});R.send(D)}},zt={name:"jsonp",getAgent:$t};const Pn=zt;function Bn(u,s,c){var f=u+(s.useTLS?"s":""),b=s.useTLS?s.hostTLS:s.hostNonTLS;return f+"://"+b+c}function Gn(u,s){var c="/app/"+u,f="?protocol="+m.PROTOCOL+"&client=js&version="+m.VERSION+(s?"&"+s:"");return c+f}var zi={getInitial:function(u,s){var c=(s.httpPath||"")+Gn(u,"flash=false");return Bn("ws",s,c)}},xr={getInitial:function(u,s){var c=(s.httpPath||"/pusher")+Gn(u);return Bn("http",s,c)}},Sr={getInitial:function(u,s){return Bn("http",s,s.httpPath||"/pusher")},getPath:function(u,s){return Gn(u)}};class Oi{constructor(){this._callbacks={}}get(s){return this._callbacks[un(s)]}add(s,c,f){var b=un(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?[un(s)]:Xt(this._callbacks);c||f?this.removeCallback(b,c,f):this.removeAllCallbacks(b)}removeCallback(s,c,f){kt(s,function(b){this._callbacks[b]=re(this._callbacks[b]||[],function(x){return c&&c!==x.fn||f&&f!==x.context}),this._callbacks[b].length===0&&delete this._callbacks[b]},this)}removeAllCallbacks(s){kt(s,function(c){delete this._callbacks[c]},this)}}function un(u){return"_"+u}class Ot{constructor(s){this.callbacks=new Oi,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=re(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 x=this.callbacks.get(s),R=[];if(f?R.push(c,f):c&&R.push(c),x&&x.length>0)for(var b=0;b<x.length;b++)x[b].fn.apply(x[b].context||window,R);else this.failThrough&&this.failThrough(s,c);return this}}class Ni extends Ot{constructor(s,c,f,b,x){super(),this.initialize=Y.transportConnectionInitializer,this.hooks=s,this.name=c,this.priority=f,this.key=b,this.options=x,this.state="new",this.timeline=x.timeline,this.activityTimeout=x.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 Te.defer(()=>{this.onError(c),this.changeState("closed")}),!1}return this.bindListeners(),X.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"?(Te.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 Pe({cid:this.id},s)}}class he{constructor(s){this.hooks=s}isSupported(s){return this.hooks.isSupported(s)}createConnection(s,c,f,b){return new Ni(this.hooks,s,c,f,b)}}var Rn=new he({urls:zi,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!Y.getWebSocketAPI()},isSupported:function(){return!!Y.getWebSocketAPI()},getSocket:function(u){return Y.createWebSocket(u)}}),ds={urls:xr,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},ro=Pe({getSocket:function(u){return Y.HTTPFactory.createStreamingSocket(u)}},ds),Tr=Pe({getSocket:function(u){return Y.HTTPFactory.createPollingSocket(u)}},ds),oo={isSupported:function(){return Y.isXHRSupported()}},ps=new he(Pe({},ro,oo)),Di=new he(Pe({},Tr,oo)),vt={ws:Rn,xhr_streaming:ps,xhr_polling:Di};const yt=vt;var hs=new he({file:"sockjs",urls:Sr,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:S.getPath("sockjs",{useTLS:s.useTLS}),ignore_null_origin:s.ignoreNullOrigin})},beforeOpen:function(u,s){u.send(JSON.stringify({path:s}))}}),so={isSupported:function(u){var s=Y.isXDRSupported(u.useTLS);return s}},io=new he(Pe({},ro,so)),fs=new he(Pe({},Tr,so));yt.xdr_streaming=io,yt.xdr_polling=fs,yt.sockjs=hs;const Nt=yt;class gs extends Ot{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 ms=new gs;class bs{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=Pe({},b,{activityTimeout:this.pingDelay});var x=this.transport.createConnection(s,c,f,b),R=null,D=function(){x.unbind("open",D),x.bind("closed",J),R=Te.now()},J=te=>{if(x.unbind("closed",J),te.code===1002||te.code===1003)this.manager.reportDeath();else if(!te.wasClean&&R){var ie=Te.now()-R;ie<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(ie/2,this.minPingDelay))}};return x.bind("open",D),x}isSupported(s){return this.manager.isAlive()&&this.transport.isSupported(s)}}const ao={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=ao.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}},dn=ao;class Z extends Ot{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),X.debug("Event sent",b),this.send(dn.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=dn.decodeMessage(f)}catch(x){this.emit("error",{type:"MessageParseError",error:x,data:f.data})}if(b!==void 0){switch(X.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=()=>{Ne(s,(f,b)=>{this.transport.unbind(b,f)})};Ne(s,(f,b)=>{this.transport.bind(b,f)})}handleCloseEvent(s){var c=dn.getCloseAction(s),f=dn.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=dn.processHandshake(s)}catch(f){this.finish("error",{error:f}),this.transport.close();return}c.action==="connected"?this.finish("connected",{connection:new Z(c.id,this.transport),activityTimeout:c.activityTimeout}):(this.finish(c.action,{error:c.error}),this.transport.close())},this.onClosed=s=>{this.unbindListeners();var c=dn.getCloseAction(s)||"backoff",f=dn.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(Pe({transport:this.transport,action:s},c))}}class C{constructor(s,c){this.timeline=s,this.options=c||{}}send(s,c){this.timeline.isEmpty()||this.timeline.send(Y.TimelineTransport.getAgent(this,s),c)}}class O extends Ot{constructor(s,c){super(function(f,b){X.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=j.buildLogSuffix("triggeringClientEvents");X.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,X.error(s.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:s.message},s instanceof Se?{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 de extends O{authorize(s,c){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:s},c)}}class Ze{constructor(){this.reset()}get(s){return Object.prototype.hasOwnProperty.call(this.members,s)?{id:s,info:this.members[s]}:null}each(s){Ne(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 Ee=function(u,s,c,f){function b(x){return x instanceof c?x:new c(function(R){R(x)})}return new(c||(c=Promise))(function(x,R){function D(ie){try{te(f.next(ie))}catch($e){R($e)}}function J(ie){try{te(f.throw(ie))}catch($e){R($e)}}function te(ie){ie.done?x(ie.value):b(ie.value).then(D,J)}te((f=f.apply(u,s||[])).next())})};class Je extends de{constructor(s,c){super(s,c),this.members=new Ze}authorize(s,c){super.authorize(s,(f,b)=>Ee(this,void 0,void 0,function*(){if(!f)if(b=b,b.channel_data!=null){var x=JSON.parse(b.channel_data);this.members.setMyID(x.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=j.buildLogSuffix("authorizationEndpoint");X.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 x=this.members.removeMember(f);x&&this.emit("pusher:member_removed",x);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 Dt=l(978),Qt=l(594);class co extends de{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 x=b.shared_secret;if(!x){c(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=(0,Qt.decode)(x),delete b.shared_secret,c(null,b)})}trigger(s,c){throw new je("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){X.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!c.ciphertext||!c.nonce){X.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+c);return}let f=(0,Qt.decode)(c.ciphertext);if(f.length<this.nacl.secretbox.overheadLength){X.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${f.length}`);return}let b=(0,Qt.decode)(c.nonce);if(b.length<this.nacl.secretbox.nonceLength){X.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${b.length}`);return}let x=this.nacl.secretbox.open(f,b,this.key);if(x===null){X.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,D)=>{if(R){X.error(`Failed to make a request to the authEndpoint: ${D}. Unable to fetch new key, so dropping encrypted event`);return}if(x=this.nacl.secretbox.open(f,b,this.key),x===null){X.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(s,this.getDataToEmit(x))});return}this.emit(s,this.getDataToEmit(x))}getDataToEmit(s){let c=(0,Dt.D4)(s);try{return JSON.parse(c)}catch(f){return c}}}class Me extends Ot{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=Y.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 Le(s||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new Le(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Le(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 Le(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(s){return Pe({},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 Pe({},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),X.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 ks{constructor(){this.channels={}}add(s,c){return this.channels[s]||(this.channels[s]=_s(s,c)),this.channels[s]}all(){return bt(this.channels)}find(s){return this.channels[s]}remove(s){var c=this.channels[s];return delete this.channels[s],c}disconnect(){Ne(this.channels,function(s){s.disconnect()})}}function _s(u,s){if(u.indexOf("private-encrypted-")===0){if(s.config.nacl)return pn.createEncryptedChannel(u,s,s.config.nacl);let c="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",f=j.buildLogSuffix("encryptedChannelSupport");throw new je(`${c}. ${f}`)}else{if(u.indexOf("private-")===0)return pn.createPrivateChannel(u,s);if(u.indexOf("presence-")===0)return pn.createPresenceChannel(u,s);if(u.indexOf("#")===0)throw new L('Cannot create a channel with name "'+u+'".');return pn.createChannel(u,s)}}var jk={createChannels(){return new ks},createConnectionManager(u,s){return new Me(u,s)},createChannel(u,s){return new O(u,s)},createPrivateChannel(u,s){return new de(u,s)},createPresenceChannel(u,s){return new Je(u,s)},createEncryptedChannel(u,s,c){return new co(u,s,c)},createTimelineSender(u,s){return new C(u,s)},createHandshake(u,s){return new _(u,s)},createAssistantToTheTransportManager(u,s,c){return new bs(u,s,c)}};const pn=jk;class tu{constructor(s){this.options=s||{},this.livesLeft=this.options.lives||1/0}getAssistant(s){return pn.createAssistantToTheTransportManager(this,s,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Wn{constructor(s,c){this.strategies=s,this.loop=!!c.loop,this.failFast=!!c.failFast,this.timeout=c.timeout,this.timeoutLimit=c.timeoutLimit}isSupported(){return _t(this.strategies,Te.method("isSupported"))}connect(s,c){var f=this.strategies,b=0,x=this.timeout,R=null,D=(J,te)=>{te?c(null,te):(b=b+1,this.loop&&(b=b%f.length),b<f.length?(x&&(x=x*2,this.timeoutLimit&&(x=Math.min(x,this.timeoutLimit))),R=this.tryStrategy(f[b],s,{timeout:x,failFast:this.failFast},D)):c(!0))};return R=this.tryStrategy(f[b],s,{timeout:x,failFast:this.failFast},D),{abort:function(){R.abort()},forceMinPriority:function(J){s=J,R&&R.forceMinPriority(J)}}}tryStrategy(s,c,f,b){var x=null,R=null;return f.timeout>0&&(x=new Le(f.timeout,function(){R.abort(),b(!0)})),R=s.connect(c,function(D,J){D&&x&&x.isRunning()&&!f.failFast||(x&&x.ensureAborted(),b(D,J))}),{abort:function(){x&&x.ensureAborted(),R.abort()},forceMinPriority:function(D){R.forceMinPriority(D)}}}}class Mi{constructor(s){this.strategies=s}isSupported(){return _t(this.strategies,Te.method("isSupported"))}connect(s,c){return Zk(this.strategies,s,function(f,b){return function(x,R){if(b[f].error=x,x){qk(b)&&c(!0);return}kt(b,function(D){D.forceMinPriority(R.transport.priority)}),c(null,R)}})}}function Zk(u,s,c){var f=cn(u,function(b,x,R,D){return b.connect(s,c(x,D))});return{abort:function(){kt(f,Hk)},forceMinPriority:function(b){kt(f,function(x){x.forceMinPriority(b)})}}}function qk(u){return Lt(u,function(s){return!!s.error})}function Hk(u){!u.error&&!u.aborted&&(u.abort(),u.aborted=!0)}class Fk{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=Bk(f),x=b&&b.cacheSkipCount?b.cacheSkipCount:0,R=[this.strategy];if(b&&b.timestamp+this.ttl>=Te.now()){var D=this.transports[b.transport];D&&(["ws","wss"].includes(b.transport)||x>3?(this.timeline.info({cached:!0,transport:b.transport,latency:b.latency}),R.push(new Wn([D],{timeout:b.latency*2+1e3,failFast:!0}))):x++)}var J=Te.now(),te=R.pop().connect(s,function ie($e,xs){$e?(nu(f),R.length>0?(J=Te.now(),te=R.pop().connect(s,ie)):c($e)):(Gk(f,xs.transport.name,Te.now()-J,x),c(null,xs))});return{abort:function(){te.abort()},forceMinPriority:function(ie){s=ie,te&&te.forceMinPriority(ie)}}}}function Ui(u){return"pusherTransport"+(u?"TLS":"NonTLS")}function Bk(u){var s=Y.getLocalStorage();if(s)try{var c=s[Ui(u)];if(c)return JSON.parse(c)}catch(f){nu(u)}return null}function Gk(u,s,c,f){var b=Y.getLocalStorage();if(b)try{b[Ui(u)]=ue({timestamp:Te.now(),transport:s,latency:c,cacheSkipCount:f})}catch(x){}}function nu(u){var s=Y.getLocalStorage();if(s)try{delete s[Ui(u)]}catch(c){}}class vs{constructor(s,{delay:c}){this.strategy=s,this.options={delay:c}}isSupported(){return this.strategy.isSupported()}connect(s,c){var f=this.strategy,b,x=new Le(this.options.delay,function(){b=f.connect(s,c)});return{abort:function(){x.ensureAborted(),b&&b.abort()},forceMinPriority:function(R){s=R,b&&b.forceMinPriority(R)}}}}class lo{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 Wk{constructor(s){this.strategy=s}isSupported(){return this.strategy.isSupported()}connect(s,c){var f=this.strategy.connect(s,function(b,x){x&&f.abort(),c(b,x)});return f}}function uo(u){return function(){return u.isSupported()}}var Jk=function(u,s,c){var f={};function b(gu,B_,G_,W_,J_){var mu=c(u,gu,B_,G_,W_,J_);return f[gu]=mu,mu}var x=Object.assign({},s,{hostNonTLS:u.wsHost+":"+u.wsPort,hostTLS:u.wsHost+":"+u.wssPort,httpPath:u.wsPath}),R=Object.assign({},x,{useTLS:!0}),D=Object.assign({},s,{hostNonTLS:u.httpHost+":"+u.httpPort,hostTLS:u.httpHost+":"+u.httpsPort,httpPath:u.httpPath}),J={loop:!0,timeout:15e3,timeoutLimit:6e4},te=new tu({minPingDelay:1e4,maxPingDelay:u.activityTimeout}),ie=new tu({lives:2,minPingDelay:1e4,maxPingDelay:u.activityTimeout}),$e=b("ws","ws",3,x,te),xs=b("wss","ws",3,R,te),j_=b("sockjs","sockjs",1,D),lu=b("xhr_streaming","xhr_streaming",1,D,ie),Z_=b("xdr_streaming","xdr_streaming",1,D,ie),uu=b("xhr_polling","xhr_polling",1,D),q_=b("xdr_polling","xdr_polling",1,D),du=new Wn([$e],J),H_=new Wn([xs],J),F_=new Wn([j_],J),pu=new Wn([new lo(uo(lu),lu,Z_)],J),hu=new Wn([new lo(uo(uu),uu,q_)],J),fu=new Wn([new lo(uo(pu),new Mi([pu,new vs(hu,{delay:4e3})]),hu)],J),qi=new lo(uo(fu),fu,F_),Hi;return s.useTLS?Hi=new Mi([du,new vs(qi,{delay:2e3})]):Hi=new Mi([du,new vs(H_,{delay:2e3}),new vs(qi,{delay:5e3})]),new Fk(new Wk(new lo(uo($e),Hi,qi)),f,{ttl:18e5,timeline:s.timeline,useTLS:s.useTLS})};const Yk=Jk;function Vk(){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"),S.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 Xk={getRequest:function(u){var s=new window.XDomainRequest;return s.ontimeout=function(){u.emit("error",new q),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 Kk=Xk,Qk=256*1024;class e_ extends Ot{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()},Y.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&&(Y.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(`
|
|
1578
|
-
`);return f!==-1?(this.position+=f+1,c.slice(0,f)):null}isBufferTooLong(s){return this.position===s.length&&s.length>Qk}}var ji;(function(u){u[u.CONNECTING=0]="CONNECTING",u[u.OPEN=1]="OPEN",u[u.CLOSED=3]="CLOSED"})(ji||(ji={}));const Jn=ji;var t_=1;class n_{constructor(s,c){this.hooks=s,this.session=ou(1e3)+"/"+i_(8),this.location=r_(c),this.readyState=Jn.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===Jn.OPEN)try{return Y.createSocketRequest("POST",ru(o_(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=Jn.CLOSED,this.onclose&&this.onclose({code:s,reason:c,wasClean:f})}onChunk(s){if(s.status===200){this.readyState===Jn.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===Jn.CONNECTING?(s&&s.hostname&&(this.location.base=s_(this.location.base,s.hostname)),this.readyState=Jn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(s){this.readyState===Jn.OPEN&&this.onmessage&&this.onmessage({data:s})}onActivity(){this.onactivity&&this.onactivity()}onError(s){this.onerror&&this.onerror(s)}openStream(){this.stream=Y.createSocketRequest("POST",ru(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){Te.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 r_(u){var s=/([^\?]*)\/*(\??.*)/.exec(u);return{base:s[1],queryString:s[2]}}function o_(u,s){return u.base+"/"+s+"/xhr_send"}function ru(u){var s=u.indexOf("?")===-1?"?":"&";return u+s+"t="+ +new Date+"&n="+t_++}function s_(u,s){var c=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(u);return c[1]+s+c[3]}function ou(u){return Y.randomInt(u)}function i_(u){for(var s=[],c=0;c<u;c++)s.push(ou(32).toString(32));return s.join("")}const a_=n_;var c_={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 l_=c_;var u_={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 d_=u_;var p_={getRequest:function(u){var s=Y.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 h_=p_;var f_={createStreamingSocket(u){return this.createSocket(l_,u)},createPollingSocket(u){return this.createSocket(d_,u)},createSocket(u,s){return new a_(u,s)},createXHR(u,s){return this.createRequest(h_,u,s)},createRequest(u,s,c){return new e_(u,s,c)}};const su=f_;su.createXDR=function(u,s){return this.createRequest(Kk,u,s)};var g_={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:h,DependenciesReceivers:y,getDefaultStrategy:Yk,Transports:Nt,transportConnectionInitializer:Vk,HTTPFactory:su,TimelineTransport:Pn,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(u){window.Pusher=u;var s=()=>{this.onDocumentBody(u.ready)};window.JSON?s():S.load("json2",{},s)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:At,jsonp:ot}},onDocumentBody(u){document.body?u():setTimeout(()=>{this.onDocumentBody(u)},0)},createJSONPRequest(u,s){return new ln(u,s)},createScriptRequest(u){return new It(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 ms},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 Y=g_;var Zi;(function(u){u[u.ERROR=3]="ERROR",u[u.INFO=6]="INFO",u[u.DEBUG=7]="DEBUG"})(Zi||(Zi={}));const ys=Zi;class m_{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(Pe({},c,{timestamp:Te.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(s){this.log(ys.ERROR,s)}info(s){this.log(ys.INFO,s)}debug(s){this.log(ys.DEBUG,s)}isEmpty(){return this.events.length===0}send(s,c){var f=Pe({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,x)=>{b||this.sent++,c&&c(b,x)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class b_{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 iu(new H,c)}else return iu(new ee,c);var f=!1,b=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),x=null,R=function(){b.unbind("initialized",R),b.connect()},D=function(){x=pn.createHandshake(b,function($e){f=!0,ie(),c(null,$e)})},J=function($e){ie(),c($e)},te=function(){ie();var $e;$e=ue(b),c(new se($e))},ie=function(){b.unbind("initialized",R),b.unbind("open",D),b.unbind("error",J),b.unbind("closed",te)};return b.bind("initialized",R),b.bind("open",D),b.bind("error",J),b.bind("closed",te),b.initialize(),{abort:()=>{f||(ie(),x?x.close():b.close())},forceMinPriority:$e=>{f||this.priority<$e&&(x?x.close():b.close())}}}}function iu(u,s){return Te.defer(function(){s(u)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:k_}=Y;var __=function(u,s,c,f,b,x){var R=k_[c];if(!R)throw new nt(c);var D=(!u.enabledTransports||An(u.enabledTransports,s)!==-1)&&(!u.disabledTransports||An(u.disabledTransports,s)===-1),J;return D?(b=Object.assign({ignoreNullOrigin:u.ignoreNullOrigin},b),J=new b_(s,f,x?x.getAssistant(R):R,b)):J=v_,J},v_={isSupported:function(){return!1},connect:function(u,s){var c=Te.defer(function(){s(new ee)});return{abort:function(){c.ensureAborted()},forceMinPriority:function(){}}}};function y_(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&&X.warn("The disableStats option is deprecated in favor of enableStats")}const w_=(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},x_=u=>{if(typeof Y.getAuthorizers()[u.transport]=="undefined")throw`'${u.transport}' is not a recognized auth transport`;return(s,c)=>{const f=w_(s,u);Y.getAuthorizers()[u.transport](Y,f,u,A.UserAuthentication,c)}},S_=(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},T_=u=>{if(typeof Y.getAuthorizers()[u.transport]=="undefined")throw`'${u.transport}' is not a recognized auth transport`;return(s,c)=>{const f=S_(s,u);Y.getAuthorizers()[u.transport](Y,f,u,A.ChannelAuthorization,c)}},E_=(u,s,c)=>{const f={authTransport:s.transport,authEndpoint:s.endpoint,auth:{params:s.params,headers:s.headers}};return(b,x)=>{const R=u.channel(b.channelName);c(R,f).authorize(b.socketId,x)}};function au(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:L_(u),httpHost:A_(u),useTLS:R_(u),wsHost:C_(u),userAuthenticator:I_(u),channelAuthorizer:z_(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 A_(u){return u.httpHost?u.httpHost:u.cluster?`sockjs-${u.cluster}.pusher.com`:m.httpHost}function C_(u){return u.wsHost?u.wsHost:P_(u.cluster)}function P_(u){return`ws-${u}.pusher.com`}function R_(u){return Y.getProtocol()==="https:"?!0:u.forceTLS!==!1}function L_(u){return"enableStats"in u?u.enableStats:"disableStats"in u?!u.disableStats:!1}const cu=u=>"customHandler"in u&&u.customHandler!=null;function I_(u){const s=Object.assign(Object.assign({},m.userAuthentication),u.userAuthentication);return cu(s)?s.customHandler:x_(s)}function $_(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:E_(s,c,u.authorizer)};return c}function z_(u,s){const c=$_(u,s);return cu(c)?c.customHandler:T_(c)}class O_ extends Ot{constructor(s){super(function(c,f){X.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 N_(){let u,s;return{promise:new Promise((f,b)=>{u=f,s=b}),resolve:u,reject:s}}const D_=N_;class M_ extends Ot{constructor(s){super(function(c,f){X.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){X.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 O_(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){X.error(`Failed parsing user data after signin: ${s.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){X.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 O(`#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}=D_();s.done=!1;const f=()=>{s.done=!0};s.then(f).catch(f),this.signinDonePromise=s,this._signinDoneResolve=c}}class Be{static ready(){Be.isReady=!0;for(var s=0,c=Be.instances.length;s<c;s++)Be.instances[s].connect()}static getClientFeatures(){return Xt(xe({ws:Y.Transports.ws},function(s){return s.isSupported({})}))}constructor(s,c){U_(s),y_(c),this.key=s,this.options=c,this.config=au(this.options,this),this.channels=pn.createChannels(),this.global_emitter=new Ot,this.sessionID=Y.randomInt(1e9),this.timeline=new m_(this.key,this.sessionID,{cluster:this.config.cluster,features:Be.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:ys.INFO,version:m.VERSION}),this.config.enableStats&&(this.timelineSender=pn.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+Y.TimelineTransport.name}));var f=b=>Y.getDefaultStrategy(this.config,b,__);this.connection=pn.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 x=b.event,R=x.indexOf("pusher_internal:")===0;if(b.channel){var D=this.channel(b.channel);D&&D.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=>{X.warn(b)}),Be.instances.push(this),this.timeline.info({instances:Be.instances.length}),this.user=new M_(this),Be.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=au(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 En(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()}}Be.instances=[],Be.isReady=!1,Be.logToConsole=!1,Be.Runtime=Y,Be.ScriptReceivers=Y.ScriptReceivers,Be.DependenciesReceivers=Y.DependenciesReceivers,Be.auth_callbacks=Y.auth_callbacks;const ws=Be;function U_(u){if(u==null)throw"You must pass your app key when you instantiate Pusher."}Y.setup(Be)}},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})())})(Bs)),Bs.exports}var Jg=Wg();const Yg=Gg(Jg);let wt=null,sr=null;function Vg(e){return z(this,null,function*(){return sr||(sr=z(null,null,function*(){const t=e.backendUrl.replace(/\/+$/,""),n=yield Ro(`${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();wt=new Yg(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)=>{Ro(`${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))}}})}),sr.catch(()=>{sr=null}),sr)})}function Xg(e){if(!e||!wt)return null;let t=!1;const n=({current:r})=>{r==="connected"&&t?(t=!1,e()):r!=="connected"&&(t=!0)};return wt.connection.bind("state_change",n),()=>wt==null?void 0:wt.connection.unbind("state_change",n)}function Kg(e,t,n){return z(this,null,function*(){if(yield Vg(e),!wt)return()=>{};const r=wt.subscribe(`private-task-${t}`);n.onStatusUpdate&&r.bind(_o.TASK_STATUS_UPDATED,n.onStatusUpdate),n.onInteractionCreated&&r.bind(_o.TASK_INTERACTION_CREATED,n.onInteractionCreated),n.onInteractionAnswered&&r.bind(_o.TASK_INTERACTION_ANSWERED,n.onInteractionAnswered),n.onBrowserCommandCreated&&r.bind(_o.TASK_BROWSER_COMMAND_CREATED,n.onBrowserCommandCreated);const o=Xg(n.onReconnect);return()=>{r.unbind_all(),wt==null||wt.unsubscribe(`private-task-${t}`),o==null||o()}})}const Gs="ap-sdk-active-automation";function Qg(){try{const e=sessionStorage.getItem(Gs);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 yc(e){try{sessionStorage.setItem(Gs,JSON.stringify(e))}catch(t){}}function wc(){try{sessionStorage.removeItem(Gs)}catch(e){}}function em(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 tm(),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 tm(){return new Promise(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):setTimeout(e,16)})}const Ws="shared",xc="ap-sdk-panel-size:",Sc=280,Tc=200;function nm(e){try{const t=sessionStorage.getItem(xc+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 rm(e,t){try{sessionStorage.setItem(xc+e,JSON.stringify(t))}catch(n){}}function Io(e,t,n){return Math.min(Math.max(e,t),n)}function Ec(){return window.innerWidth-32}function Ac(){return window.innerHeight-64}function Js(e,t){const n=nm(t);n&&(e.style.width=`${Io(n.width,Sc,Ec())}px`,e.style.height=`${Io(n.height,Tc,Ac())}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=y=>{o&&(p=Io(d+(y.clientX-i),Sc,Ec()),h=Io(l+(y.clientY-a),Tc,Ac()),e.style.width=`${p}px`,e.style.height=`${h}px`)},m=()=>{o&&(o=!1,document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",m),rm(t,{width:p,height:h}))},k=y=>{const S=y.target;if(!(S===r||r.contains(S)))return;y.preventDefault(),y.stopPropagation(),o=!0,i=y.clientX,a=y.clientY;const $=e.getBoundingClientRect();d=$.width,l=$.height,p=d,h=l,document.addEventListener("pointermove",g),document.addEventListener("pointerup",m)};return window.addEventListener("pointerdown",k,{capture:!0}),()=>{window.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",m)}}const Ir="shared",Cc="ap-sdk-panel-pos:";function om(e){try{const t=sessionStorage.getItem(Cc+e);if(!t)return null;const n=JSON.parse(t);return typeof(n==null?void 0:n.left)=="number"&&typeof(n==null?void 0:n.top)=="number"?n:null}catch(t){return null}}function sm(e,t){try{sessionStorage.setItem(Cc+e,JSON.stringify(t))}catch(n){}}function Pc(e,t,n){return Math.min(Math.max(e,t),n)}function $r(e,t){const n=(y,S)=>{const $=Math.max(0,window.innerWidth-e.offsetWidth),E=Math.max(0,window.innerHeight-e.offsetHeight);e.style.left=`${Pc(y,0,$)}px`,e.style.top=`${Pc(S,0,E)}px`,e.style.right="auto",e.style.transform="none"},r=om(t);r&&n(r.left,r.top);let o=!1,i=0,a=0,d=0,l=0,p=0,h=0;const g=y=>{o&&(p=d+(y.clientX-i),h=l+(y.clientY-a),n(p,h))},m=()=>{o&&(o=!1,document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",m),sm(t,{left:p,top:h}))},k=y=>{const S=y.target;if(!(S===e||e.contains(S))||!S.closest(".ap-sdk-panel__header")||S.closest("button, a, input, select, textarea"))return;y.preventDefault(),o=!0,i=y.clientX,a=y.clientY;const $=e.getBoundingClientRect();d=$.left,l=$.top,p=d,h=l,document.addEventListener("pointermove",g),document.addEventListener("pointerup",m)};return window.addEventListener("pointerdown",k,{capture:!0}),()=>{window.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",m)}}function Ys(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $n=Ys();function Rc(e){$n=e}var zn={exec:()=>null};function ir(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 K(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(Ge.caret,"$1"),n=n.replace(o,a),r},getRegex:()=>new RegExp(n,t)};return r}var im=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch(t){return!1}})(),Ge={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:ir(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ir(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:ir(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:ir(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:ir(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:ir(e=>new RegExp(`^ {0,${e}}>`))},am=/^(?:[ \t]*(?:\n|$))+/,cm=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,lm=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,zr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,um=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vs=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Lc=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ic=K(Lc).replace(/bull/g,Vs).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(),dm=K(Lc).replace(/bull/g,Vs).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(),Xs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,pm=/^[^\n]+/,Ks=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hm=K(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ks).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),fm=K(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Vs).getRegex(),$o="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",Qs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gm=K("^ {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",Qs).replace("tag",$o).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$c=e=>K(Xs).replace("hr",zr).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",$o).getRegex(),mm=$c(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),bm=$c(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),km=K(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",bm).getRegex(),ei={blockquote:km,code:cm,def:hm,fences:lm,heading:um,hr:zr,html:gm,lheading:Ic,list:fm,newline:am,paragraph:mm,table:zn,text:pm},zc=K("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",zr).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",$o).getRegex(),_m=M(v({},ei),{lheading:dm,table:zc,paragraph:K(Xs).replace("hr",zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",zc).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",$o).getRegex()}),vm=M(v({},ei),{html:K(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Qs).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:zn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:K(Xs).replace("hr",zr).replace("heading",` *#{1,6} *[^
|
|
1579
|
-
]`).replace("lheading",Ic).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),ym=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wm=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Oc=/^( {2,}|\\)\n(?!\s*$)/,xm=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,en=/[\p{P}\p{S}]/u,ar=/[\s\p{P}\p{S}]/u,Or=/[^\s\p{P}\p{S}]/u,Sm=K(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ar).getRegex(),Tm=/[\p{Pi}\p{Ps}"']/u,Nc=/(?!~)[\p{P}\p{S}]/u,Em=/(?!~)[\s\p{P}\p{S}]/u,Am=/(?:[^\s\p{P}\p{S}]|~)/u,Cm=K(/link|precode-code|html/,"g").replace("link",new RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)")).replace("precode-",im?"(?<!`)()":"(^^|[^`])").replace("code",new RegExp("(?<b>`+)[^`]+\\k<b>(?!`)")).replace("html",/<(?! )[^<>]*?>/).getRegex(),Dc=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Pm=K(Dc,"u").replace(/punct/g,en).getRegex(),Rm=K(Dc,"u").replace(/punct/g,Nc).getRegex(),Lm=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Im=K(Lm,"u").replace(/openQuote/g,Tm).replace(/punct/g,en).getRegex(),Mc="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$m=K(Mc,"gu").replace(/notPunctSpace/g,Or).replace(/punctSpace/g,ar).replace(/punct/g,en).getRegex(),zm=K(Mc,"gu").replace(/notPunctSpace/g,Am).replace(/punctSpace/g,Em).replace(/punct/g,Nc).getRegex(),Om="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Nm=K(Om,"gu").replace(/notPunctSpace/g,Or).replace(/punctSpace/g,ar).replace(/punct/g,en).getRegex(),Dm=K("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Or).replace(/punctSpace/g,ar).replace(/punct/g,en).getRegex(),Mm="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Um=K(Mm,"gu").replace(/notPunctSpace/g,Or).replace(/punctSpace/g,ar).replace(/punct/g,en).getRegex(),jm=K(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,en).getRegex(),Zm="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",qm=K(Zm,"gu").replace(/notPunctSpace/g,Or).replace(/punctSpace/g,ar).replace(/punct/g,en).getRegex(),Hm=K(/\\(punct)/,"gu").replace(/punct/g,en).getRegex(),Fm=K(/^<(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(),Bm=K(Qs).replace("(?:-->|$)","-->").getRegex(),Gm=K("^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",Bm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Wm=K(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",zo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Uc=K(/^!?\[(label)\]\[(ref)\]/).replace("label",zo).replace("ref",Ks).getRegex(),jc=K(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ks).getRegex(),Jm=K("reflink|nolink(?!\\()","g").replace("reflink",Uc).replace("nolink",jc).getRegex(),Zc=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ti={_backpedal:zn,anyPunctuation:Hm,autolink:Fm,blockSkip:Cm,br:Oc,code:wm,del:zn,delLDelim:zn,delRDelim:zn,emStrongLDelim:Pm,emStrongRDelimAst:$m,emStrongRDelimUnd:Dm,escape:ym,link:Wm,nolink:jc,punctuation:Sm,reflink:Uc,reflinkSearch:Jm,tag:Gm,text:xm,url:zn},Ym=M(v({},ti),{emStrongLDelim:Im,emStrongRDelimAst:Nm,emStrongRDelimUnd:Um,link:K(/^!?\[(label)\]\((.*?)\)/).replace("label",zo).getRegex(),reflink:K(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zo).getRegex()}),ni=M(v({},ti),{emStrongRDelimAst:zm,emStrongLDelim:Rm,delLDelim:jm,delRDelim:qm,url:K(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Zc).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:K(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Zc).getRegex()}),Vm=M(v({},ni),{br:K(Oc).replace("{2,}","*").getRegex(),text:K(ni.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Oo={normal:ei,gfm:_m,pedantic:vm},Nr={normal:ti,gfm:ni,breaks:Vm,pedantic:Ym},Xm={"&":"&","<":"<",">":">",'"':""","'":"'"},qc=e=>Xm[e];function qt(e,t){if(t){if(Ge.escapeTest.test(e))return e.replace(Ge.escapeReplace,qc)}else if(Ge.escapeTestNoEncode.test(e))return e.replace(Ge.escapeReplaceNoEncode,qc);return e}function Hc(e){try{e=encodeURI(e).replace(Ge.percentDecode,"%")}catch(t){return null}return e}function Fc(e,t){var i;let n=e.replace(Ge.findPipe,(a,d,l)=>{let p=!1,h=d;for(;--h>=0&&l[h]==="\\";)p=!p;return p?"|":" |"}),r=n.split(Ge.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(Ge.slashPipe,"|");return r}function _n(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 Bc(e){let t=e.split(`
|
|
1580
|
-
`),n=t.length-1;for(;n>=0&&Ge.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
1581
|
-
`)}function Km(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 Qm(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 Gc(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 eb(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let o=r[1];return t.split(`
|
|
1582
|
-
`).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(`
|
|
1583
|
-
`)}var No=class{constructor(e){pe(this,"options");pe(this,"rules");pe(this,"lexer");this.options=e||$n}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]:Bc(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=eb(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=_n(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:_n(t[0],`
|
|
1584
|
-
`),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:_n(t[0],`
|
|
1585
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=_n(t[0],`
|
|
1586
|
-
`).split(`
|
|
1587
|
-
`),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(`
|
|
1588
|
-
`),h=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
1589
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
1590
|
-
${p}`:p,o=o?`${o}
|
|
1591
|
-
${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,y=n.join(`
|
|
1592
|
-
`),S=k.raw+`
|
|
1593
|
-
`+y.replace(this.rules.other.blockquoteSetextReplace2,""),$=this.blockquote(S);i[i.length-1]=$,r=`${r}
|
|
1594
|
-
${y}`,o=o.substring(0,o.length-k.text.length)+$.text;break}else if((m==null?void 0:m.type)==="list"){let k=m,y=k.raw+`
|
|
1595
|
-
`+n.join(`
|
|
1596
|
-
`),S=this.list(y);i[i.length-1]=S,r=r.substring(0,r.length-m.raw.length)+S.raw,o=o.substring(0,o.length-k.raw.length)+S.raw,n=y.substring(i.at(-1).raw.length).split(`
|
|
1597
|
-
`);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=Qm(t[2].split(`
|
|
1598
|
-
`,1)[0],t[1].length),m=e.split(`
|
|
1599
|
-
`,1)[0],k=!g.trim(),y=0;if(this.options.pedantic?(y=2,h=g.trimStart()):k?y=t[1].length+1:(y=g.search(this.rules.other.nonSpaceChar),y=y>4?1:y,h=g.slice(y),y+=t[1].length),k&&this.rules.other.blankLine.test(m)&&(p+=m+`
|
|
1600
|
-
`,e=e.substring(m.length+1),l=!0),!l){let S=this.rules.other.nextBulletRegex(y),$=this.rules.other.hrRegex(y),E=this.rules.other.fencesBeginRegex(y),j=this.rules.other.headingBeginRegex(y),A=this.rules.other.htmlBeginRegex(y),T=this.rules.other.blockquoteBeginRegex(y);for(;e;){let L=e.split(`
|
|
1601
|
-
`,1)[0],q;if(m=L,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),q=m):q=m.replace(this.rules.other.tabCharGlobal," "),E.test(m)||j.test(m)||A.test(m)||T.test(m)||S.test(m)||$.test(m))break;if(q.search(this.rules.other.nonSpaceChar)>=y||!m.trim())h+=`
|
|
1602
|
-
`+q.slice(y);else{if(k||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(g)||j.test(g)||$.test(g))break;h+=`
|
|
1603
|
-
`+m}k=!m.trim(),p+=L+`
|
|
1604
|
-
`,e=e.substring(L.length+1),g=q.slice(y)}}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=Bc(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:_n(t[0],`
|
|
1605
|
-
`),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=Fc(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(`
|
|
1606
|
-
`):[],i={type:"table",raw:_n(t[0],`
|
|
1607
|
-
`),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(Fc(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:_n(t[0],`
|
|
1608
|
-
`),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)===`
|
|
1609
|
-
`?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=_n(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=Km(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)),Gc(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 Gc(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 S=k.slice(1,-1);return{type:"em",raw:k,text:S,tokens:this.lexer.inlineTokens(S)}}let y=k.slice(2,-2);return{type:"strong",raw:k,text:y,tokens:this.lexer.inlineTokens(y)}}}}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}}}},xt=class Bi{constructor(t){pe(this,"tokens");pe(this,"options");pe(this,"state");pe(this,"inlineQueue");pe(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||$n,this.options.tokenizer=this.options.tokenizer||new No,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:Ge,block:Oo.normal,inline:Nr.normal};this.options.pedantic?(n.block=Oo.pedantic,n.inline=Nr.pedantic):this.options.gfm&&(n.block=Oo.gfm,this.options.breaks?n.inline=Nr.breaks:n.inline=Nr.gfm),this.tokenizer.rules=n}static get rules(){return{block:Oo,inline:Nr}}static lex(t,n){return new Bi(n).lex(t)}static lexInline(t,n){return new Bi(n).inlineTokens(t)}lex(t){t=t.replace(Ge.carriageReturn,`
|
|
1610
|
-
`),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(Ge.tabCharGlobal," ").replace(Ge.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+=`
|
|
1611
|
-
`: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(`
|
|
1612
|
-
`)?"":`
|
|
1613
|
-
`)+l.raw,h.text+=`
|
|
1614
|
-
`+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(`
|
|
1615
|
-
`)?"":`
|
|
1616
|
-
`)+l.raw,h.text+=`
|
|
1617
|
-
`+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(`
|
|
1618
|
-
`)?"":`
|
|
1619
|
-
`)+l.raw,h.text+=`
|
|
1620
|
-
`+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(`
|
|
1621
|
-
`)?"":`
|
|
1622
|
-
`)+l.raw,h.text+=`
|
|
1623
|
-
`+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,y=>k.includes(y.slice(y.lastIndexOf("[")+1,-1))?"["+"a".repeat(y.length-2)+"]":y))}r=r.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),r=r.replace(this.tokenizer.rules.inline.blockSkip,(k,y,S)=>{let $=S?S.length:0;return k.slice(0,$)+"["+"a".repeat(k.length-$-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(S=>(k=S.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 S=n.at(-1);k.type==="text"&&(S==null?void 0:S.type)==="text"?(S.raw+=k.raw,S.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 y=t;if((m=this.options.extensions)!=null&&m.startInline){let S=1/0,$=t.slice(1),E;this.options.extensions.startInline.forEach(j=>{E=j.call({lexer:this},$),typeof E=="number"&&E>=0&&(S=Math.min(S,E))}),S<1/0&&S>=0&&(y=t.substring(0,S+1))}if(k=this.tokenizer.inlineText(y)){t=t.substring(k.raw.length),k.raw.slice(-1)!=="_"&&(i=k.raw.slice(-1)),o=!0;let S=n.at(-1);(S==null?void 0:S.type)==="text"?(S.raw+=k.raw,S.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)}},Do=class{constructor(e){pe(this,"options");pe(this,"parser");this.options=e||$n}space(e){return""}code({text:e,lang:t,escaped:n}){var i;let r=(i=(t||"").match(Ge.notSpaceStart))==null?void 0:i[0],o=e.replace(Ge.endingNewline,"")+`
|
|
1624
|
-
`;return r?'<pre><code class="language-'+qt(r)+'">'+(n?o:qt(o,!0))+`</code></pre>
|
|
1625
|
-
`:"<pre><code>"+(n?o:qt(o,!0))+`</code></pre>
|
|
1626
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
1627
|
-
${this.parser.parse(e)}</blockquote>
|
|
1628
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
1629
|
-
`}hr(e){return`<hr>
|
|
1630
|
-
`}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+`>
|
|
1631
|
-
`+r+"</"+o+`>
|
|
1632
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
1633
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
1634
|
-
`}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>
|
|
1635
|
-
<thead>
|
|
1636
|
-
`+t+`</thead>
|
|
1637
|
-
`+r+`</table>
|
|
1638
|
-
`}tablerow({text:e}){return`<tr>
|
|
1639
|
-
${e}</tr>
|
|
1640
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
1641
|
-
`}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>${qt(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=Hc(e);if(o===null)return r;e=o;let i='<a href="'+e+'"';return t&&(i+=' title="'+qt(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=Hc(e);if(o===null)return qt(n);e=o;let i=`<img src="${e}" alt="${qt(n)}"`;return t&&(i+=` title="${qt(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:qt(e.text)}},ri=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}},St=class Gi{constructor(t){pe(this,"options");pe(this,"renderer");pe(this,"textRenderer");this.options=t||$n,this.options.renderer=this.options.renderer||new Do,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ri}static parse(t,n){return new Gi(n).parse(t)}static parseInline(t,n){return new Gi(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}},Dr=(us=class{constructor(e){pe(this,"options");pe(this,"block");this.options=e||$n}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?xt.lex:xt.lexInline}provideParser(e=this.block){return e?St.parse:St.parseInline}},pe(us,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),pe(us,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),us),tb=class{constructor(...e){pe(this,"defaults",Ys());pe(this,"options",this.setOptions);pe(this,"parse",this.parseMarkdown(!0));pe(this,"parseInline",this.parseMarkdown(!1));pe(this,"Parser",St);pe(this,"Renderer",Do);pe(this,"TextRenderer",ri);pe(this,"Lexer",xt);pe(this,"Tokenizer",No);pe(this,"Hooks",Dr);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=v({},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 Do(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 No(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 Dr;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];Dr.passThroughHooks.has(i)?o[a]=p=>{if(this.defaults.async&&Dr.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=v(v({},this.defaults),r)}),this}setOptions(e){return this.defaults=v(v({},this.defaults),e),this}lexer(e,t){return xt.lex(e,t!=null?t:this.defaults)}parser(e,t){return St.parse(e,t!=null?t:this.defaults)}parseMarkdown(e){return(t,n)=>{let r=v({},n),o=v(v({},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?xt.lex:xt.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?St.parse:St.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?xt.lex:xt.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?St.parse:St.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+=`
|
|
1642
|
-
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+qt(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},On=new tb;function ce(e,t){return On.parse(e,t)}ce.options=ce.setOptions=function(e){return On.setOptions(e),ce.defaults=On.defaults,Rc(ce.defaults),ce},ce.getDefaults=Ys,ce.defaults=$n;function nb(...e){return On.use(...e),ce.defaults=On.defaults,Rc(ce.defaults),ce}ce.use=nb,ce.walkTokens=function(e,t){return On.walkTokens(e,t)},ce.parseInline=On.parseInline,ce.Parser=St,ce.parser=St.parse,ce.Renderer=Do,ce.TextRenderer=ri,ce.Lexer=xt,ce.lexer=xt.lex,ce.Tokenizer=No,ce.Hooks=Dr,ce.parse=ce,ce.options,ce.setOptions,ce.walkTokens,ce.parseInline,St.parse,xt.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:Wc,setPrototypeOf:Jc,isFrozen:rb,getPrototypeOf:ob,getOwnPropertyDescriptor:sb}=Object;let{freeze:Ve,seal:ft,create:oi}=Object,{apply:si,construct:ii}=typeof Reflect!="undefined"&&Reflect;Ve||(Ve=function(t){return t}),ft||(ft=function(t){return t}),si||(si=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)}),ii||(ii=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=Ke(Array.prototype.forEach),ib=Ke(Array.prototype.lastIndexOf),Yc=Ke(Array.prototype.pop),Mr=Ke(Array.prototype.push),ab=Ke(Array.prototype.splice),Uo=Ke(String.prototype.toLowerCase),ai=Ke(String.prototype.toString),ci=Ke(String.prototype.match),Ur=Ke(String.prototype.replace),cb=Ke(String.prototype.indexOf),lb=Ke(String.prototype.trim),Tt=Ke(Object.prototype.hasOwnProperty),Xe=Ke(RegExp.prototype.test),jr=ub(TypeError);function Ke(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 si(e,t,r)}}function ub(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ii(e,n)}}function V(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Uo;Jc&&Jc(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(rb(t)||(t[r]=i),o=i)}e[o]=!0}return e}function db(e){for(let t=0;t<e.length;t++)Tt(e,t)||(e[t]=null);return e}function Ht(e){const t=oi(null);for(const[n,r]of Wc(e))Tt(e,n)&&(Array.isArray(r)?t[n]=db(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Ht(r):t[n]=r);return t}function Zr(e,t){for(;e!==null;){const r=sb(e,t);if(r){if(r.get)return Ke(r.get);if(typeof r.value=="function")return Ke(r.value)}e=ob(e)}function n(){return null}return n}const Vc=Ve(["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"]),li=Ve(["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"]),ui=Ve(["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"]),pb=Ve(["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"]),di=Ve(["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"]),hb=Ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Xc=Ve(["#text"]),Kc=Ve(["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"]),pi=Ve(["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"]),Qc=Ve(["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"]),jo=Ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),fb=ft(/\{\{[\w\W]*|[\w\W]*\}\}/gm),gb=ft(/<%[\w\W]*|[\w\W]*%>/gm),mb=ft(/\$\{[\w\W]*/gm),bb=ft(/^data-[\-\w.\u00B7-\uFFFF]+$/),kb=ft(/^aria-[\-\w]+$/),el=ft(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_b=ft(/^(?:\w+script|data):/i),vb=ft(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tl=ft(/^html$/i),yb=ft(/^[a-z][.\w]*(-[.\w]+)+$/i);var nl=Object.freeze({__proto__:null,ARIA_ATTR:kb,ATTR_WHITESPACE:vb,CUSTOM_ELEMENT:yb,DATA_ATTR:bb,DOCTYPE_NAME:tl,ERB_EXPR:gb,IS_ALLOWED_URI:el,IS_SCRIPT_OR_DATA:_b,MUSTACHE_EXPR:fb,TMPLIT_EXPR:mb});const qr={element:1,text:3,progressingInstruction:7,comment:8,document:9},wb=function(){return typeof window=="undefined"?null:window},xb=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}},rl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ol(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wb();const t=Z=>ol(Z);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==qr.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,y=l.prototype,S=Zr(y,"cloneNode"),$=Zr(y,"remove"),E=Zr(y,"nextSibling"),j=Zr(y,"childNodes"),A=Zr(y,"parentNode");if(typeof a=="function"){const Z=n.createElement("template");Z.content&&Z.content.ownerDocument&&(n=Z.content.ownerDocument)}let T,L="";const{implementation:q,createNodeIterator:H,createDocumentFragment:se,getElementsByTagName:je}=n,{importNode:nt}=r;let ee=rl();t.isSupported=typeof Wc=="function"&&typeof A=="function"&&q&&q.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Se,ERB_EXPR:at,TMPLIT_EXPR:At,DATA_ATTR:vr,ARIA_ATTR:Jt,IS_SCRIPT_OR_DATA:Ct,ATTR_WHITESPACE:yr,CUSTOM_ELEMENT:Yt}=nl;let{IS_ALLOWED_URI:an}=nl,ye=null;const Vt=V({},[...Vc,...li,...ui,...di,...Xc]);let ge=null;const Pt=V({},[...Kc,...pi,...Qc,...jo]);let le=Object.seal(oi(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}})),Le=null,En=null;const Rt=Object.seal(oi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Te=!0,Pe=!0,Fn=!1,An=!0,Ne=!1,Xt=!0,bt=!1,kt=!1,cn=!1,F=!1,re=!1,xe=!1,rt=!0,_t=!1;const Lt="user-content-";let Cn=!0,Kt=!1,De={},ue=null;const Ie=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 X=null;const wr=V({},["audio","video","img","source","image","track"]);let ot=null;const It=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ln="http://www.w3.org/1998/Math/MathML",$t="http://www.w3.org/2000/svg",zt="http://www.w3.org/1999/xhtml";let Pn=zt,Bn=!1,Gn=null;const zi=V({},[ln,$t,zt],ai);let xr=V({},["mi","mo","mn","ms","mtext"]),Sr=V({},["annotation-xml"]);const Oi=V({},["title","style","font","a","script"]);let un=null;const Ot=["application/xhtml+xml","text/html"],Ni="text/html";let he=null,Rn=null;const ds=n.createElement("form"),ro=function(_){return _ instanceof RegExp||_ instanceof Function},Tr=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Rn&&Rn===_)){if((!_||typeof _!="object")&&(_={}),_=Ht(_),un=Ot.indexOf(_.PARSER_MEDIA_TYPE)===-1?Ni:_.PARSER_MEDIA_TYPE,he=un==="application/xhtml+xml"?ai:Uo,ye=Tt(_,"ALLOWED_TAGS")?V({},_.ALLOWED_TAGS,he):Vt,ge=Tt(_,"ALLOWED_ATTR")?V({},_.ALLOWED_ATTR,he):Pt,Gn=Tt(_,"ALLOWED_NAMESPACES")?V({},_.ALLOWED_NAMESPACES,ai):zi,ot=Tt(_,"ADD_URI_SAFE_ATTR")?V(Ht(It),_.ADD_URI_SAFE_ATTR,he):It,X=Tt(_,"ADD_DATA_URI_TAGS")?V(Ht(wr),_.ADD_DATA_URI_TAGS,he):wr,ue=Tt(_,"FORBID_CONTENTS")?V({},_.FORBID_CONTENTS,he):Ie,Le=Tt(_,"FORBID_TAGS")?V({},_.FORBID_TAGS,he):Ht({}),En=Tt(_,"FORBID_ATTR")?V({},_.FORBID_ATTR,he):Ht({}),De=Tt(_,"USE_PROFILES")?_.USE_PROFILES:!1,Te=_.ALLOW_ARIA_ATTR!==!1,Pe=_.ALLOW_DATA_ATTR!==!1,Fn=_.ALLOW_UNKNOWN_PROTOCOLS||!1,An=_.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ne=_.SAFE_FOR_TEMPLATES||!1,Xt=_.SAFE_FOR_XML!==!1,bt=_.WHOLE_DOCUMENT||!1,F=_.RETURN_DOM||!1,re=_.RETURN_DOM_FRAGMENT||!1,xe=_.RETURN_TRUSTED_TYPE||!1,cn=_.FORCE_BODY||!1,rt=_.SANITIZE_DOM!==!1,_t=_.SANITIZE_NAMED_PROPS||!1,Cn=_.KEEP_CONTENT!==!1,Kt=_.IN_PLACE||!1,an=_.ALLOWED_URI_REGEXP||el,Pn=_.NAMESPACE||zt,xr=_.MATHML_TEXT_INTEGRATION_POINTS||xr,Sr=_.HTML_INTEGRATION_POINTS||Sr,le=_.CUSTOM_ELEMENT_HANDLING||{},_.CUSTOM_ELEMENT_HANDLING&&ro(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(le.tagNameCheck=_.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_.CUSTOM_ELEMENT_HANDLING&&ro(_.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),Ne&&(Pe=!1),re&&(F=!0),De&&(ye=V({},Xc),ge=[],De.html===!0&&(V(ye,Vc),V(ge,Kc)),De.svg===!0&&(V(ye,li),V(ge,pi),V(ge,jo)),De.svgFilters===!0&&(V(ye,ui),V(ge,pi),V(ge,jo)),De.mathMl===!0&&(V(ye,di),V(ge,Qc),V(ge,jo))),_.ADD_TAGS&&(typeof _.ADD_TAGS=="function"?Rt.tagCheck=_.ADD_TAGS:(ye===Vt&&(ye=Ht(ye)),V(ye,_.ADD_TAGS,he))),_.ADD_ATTR&&(typeof _.ADD_ATTR=="function"?Rt.attributeCheck=_.ADD_ATTR:(ge===Pt&&(ge=Ht(ge)),V(ge,_.ADD_ATTR,he))),_.ADD_URI_SAFE_ATTR&&V(ot,_.ADD_URI_SAFE_ATTR,he),_.FORBID_CONTENTS&&(ue===Ie&&(ue=Ht(ue)),V(ue,_.FORBID_CONTENTS,he)),_.ADD_FORBID_CONTENTS&&(ue===Ie&&(ue=Ht(ue)),V(ue,_.ADD_FORBID_CONTENTS,he)),Cn&&(ye["#text"]=!0),bt&&V(ye,["html","head","body"]),ye.table&&(V(ye,["tbody"]),delete Le.tbody),_.TRUSTED_TYPES_POLICY){if(typeof _.TRUSTED_TYPES_POLICY.createHTML!="function")throw jr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw jr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=_.TRUSTED_TYPES_POLICY,L=T.createHTML("")}else T===void 0&&(T=xb(k,o)),T!==null&&typeof L=="string"&&(L=T.createHTML(""));Ve&&Ve(_),Rn=_}},oo=V({},[...li,...ui,...pb]),ps=V({},[...di,...hb]),Di=function(_){let C=A(_);(!C||!C.tagName)&&(C={namespaceURI:Pn,tagName:"template"});const O=Uo(_.tagName),de=Uo(C.tagName);return Gn[_.namespaceURI]?_.namespaceURI===$t?C.namespaceURI===zt?O==="svg":C.namespaceURI===ln?O==="svg"&&(de==="annotation-xml"||xr[de]):!!oo[O]:_.namespaceURI===ln?C.namespaceURI===zt?O==="math":C.namespaceURI===$t?O==="math"&&Sr[de]:!!ps[O]:_.namespaceURI===zt?C.namespaceURI===$t&&!Sr[de]||C.namespaceURI===ln&&!xr[de]?!1:!ps[O]&&(Oi[O]||!oo[O]):!!(un==="application/xhtml+xml"&&Gn[_.namespaceURI]):!1},vt=function(_){Mr(t.removed,{element:_});try{A(_).removeChild(_)}catch(C){$(_)}},yt=function(_,C){try{Mr(t.removed,{attribute:C.getAttributeNode(_),from:C})}catch(O){Mr(t.removed,{attribute:null,from:C})}if(C.removeAttribute(_),_==="is")if(F||re)try{vt(C)}catch(O){}else try{C.setAttribute(_,"")}catch(O){}},hs=function(_){let C=null,O=null;if(cn)_="<remove></remove>"+_;else{const Ee=ci(_,/^[\r\n\t ]+/);O=Ee&&Ee[0]}un==="application/xhtml+xml"&&Pn===zt&&(_='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+_+"</body></html>");const de=T?T.createHTML(_):_;if(Pn===zt)try{C=new m().parseFromString(de,un)}catch(Ee){}if(!C||!C.documentElement){C=q.createDocument(Pn,"template",null);try{C.documentElement.innerHTML=Bn?L:de}catch(Ee){}}const Ze=C.body||C.documentElement;return _&&O&&Ze.insertBefore(n.createTextNode(O),Ze.childNodes[0]||null),Pn===zt?je.call(C,bt?"html":"body")[0]:bt?C.documentElement:Ze},so=function(_){return H.call(_.ownerDocument||_,_,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},io=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")},fs=function(_){return typeof d=="function"&&_ instanceof d};function Nt(Z,_,C){Mo(Z,O=>{O.call(t,_,C,Rn)})}const gs=function(_){let C=null;if(Nt(ee.beforeSanitizeElements,_,null),io(_))return vt(_),!0;const O=he(_.nodeName);if(Nt(ee.uponSanitizeElement,_,{tagName:O,allowedTags:ye}),Xt&&_.hasChildNodes()&&!fs(_.firstElementChild)&&Xe(/<[/\w!]/g,_.innerHTML)&&Xe(/<[/\w!]/g,_.textContent)||_.nodeType===qr.progressingInstruction||Xt&&_.nodeType===qr.comment&&Xe(/<[/\w]/g,_.data))return vt(_),!0;if(!(Rt.tagCheck instanceof Function&&Rt.tagCheck(O))&&(!ye[O]||Le[O])){if(!Le[O]&&bs(O)&&(le.tagNameCheck instanceof RegExp&&Xe(le.tagNameCheck,O)||le.tagNameCheck instanceof Function&&le.tagNameCheck(O)))return!1;if(Cn&&!ue[O]){const de=A(_)||_.parentNode,Ze=j(_)||_.childNodes;if(Ze&&de){const Ee=Ze.length;for(let Je=Ee-1;Je>=0;--Je){const Dt=S(Ze[Je],!0);Dt.__removalCount=(_.__removalCount||0)+1,de.insertBefore(Dt,E(_))}}}return vt(_),!0}return _ instanceof l&&!Di(_)||(O==="noscript"||O==="noembed"||O==="noframes")&&Xe(/<\/no(script|embed|frames)/i,_.innerHTML)?(vt(_),!0):(Ne&&_.nodeType===qr.text&&(C=_.textContent,Mo([Se,at,At],de=>{C=Ur(C,de," ")}),_.textContent!==C&&(Mr(t.removed,{element:_.cloneNode()}),_.textContent=C)),Nt(ee.afterSanitizeElements,_,null),!1)},ms=function(_,C,O){if(rt&&(C==="id"||C==="name")&&(O in n||O in ds))return!1;if(!(Pe&&!En[C]&&Xe(vr,C))){if(!(Te&&Xe(Jt,C))){if(!(Rt.attributeCheck instanceof Function&&Rt.attributeCheck(C,_))){if(!ge[C]||En[C]){if(!(bs(_)&&(le.tagNameCheck instanceof RegExp&&Xe(le.tagNameCheck,_)||le.tagNameCheck instanceof Function&&le.tagNameCheck(_))&&(le.attributeNameCheck instanceof RegExp&&Xe(le.attributeNameCheck,C)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(C,_))||C==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&Xe(le.tagNameCheck,O)||le.tagNameCheck instanceof Function&&le.tagNameCheck(O))))return!1}else if(!ot[C]){if(!Xe(an,Ur(O,yr,""))){if(!((C==="src"||C==="xlink:href"||C==="href")&&_!=="script"&&cb(O,"data:")===0&&X[_])){if(!(Fn&&!Xe(Ct,Ur(O,yr,"")))){if(O)return!1}}}}}}}return!0},bs=function(_){return _!=="annotation-xml"&&ci(_,Yt)},ao=function(_){Nt(ee.beforeSanitizeAttributes,_,null);const{attributes:C}=_;if(!C||io(_))return;const O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ge,forceKeepAttr:void 0};let de=C.length;for(;de--;){const Ze=C[de],{name:Ee,namespaceURI:Je,value:Dt}=Ze,Qt=he(Ee),co=Dt;let Me=Ee==="value"?co:lb(co);if(O.attrName=Qt,O.attrValue=Me,O.keepAttr=!0,O.forceKeepAttr=void 0,Nt(ee.uponSanitizeAttribute,_,O),Me=O.attrValue,_t&&(Qt==="id"||Qt==="name")&&(yt(Ee,_),Me=Lt+Me),Xt&&Xe(/((--!?|])>)|<\/(style|title|textarea)/i,Me)){yt(Ee,_);continue}if(Qt==="attributename"&&ci(Me,"href")){yt(Ee,_);continue}if(O.forceKeepAttr)continue;if(!O.keepAttr){yt(Ee,_);continue}if(!An&&Xe(/\/>/i,Me)){yt(Ee,_);continue}Ne&&Mo([Se,at,At],_s=>{Me=Ur(Me,_s," ")});const ks=he(_.nodeName);if(!ms(ks,Qt,Me)){yt(Ee,_);continue}if(T&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Je)switch(k.getAttributeType(ks,Qt)){case"TrustedHTML":{Me=T.createHTML(Me);break}case"TrustedScriptURL":{Me=T.createScriptURL(Me);break}}if(Me!==co)try{Je?_.setAttributeNS(Je,Ee,Me):_.setAttribute(Ee,Me),io(_)?vt(_):Yc(t.removed)}catch(_s){yt(Ee,_)}}Nt(ee.afterSanitizeAttributes,_,null)},dn=function Z(_){let C=null;const O=so(_);for(Nt(ee.beforeSanitizeShadowDOM,_,null);C=O.nextNode();)Nt(ee.uponSanitizeShadowNode,C,null),gs(C),ao(C),C.content instanceof i&&Z(C.content);Nt(ee.afterSanitizeShadowDOM,_,null)};return t.sanitize=function(Z){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=null,O=null,de=null,Ze=null;if(Bn=!Z,Bn&&(Z="<!-->"),typeof Z!="string"&&!fs(Z))if(typeof Z.toString=="function"){if(Z=Z.toString(),typeof Z!="string")throw jr("dirty is not a string, aborting")}else throw jr("toString is not a function");if(!t.isSupported)return Z;if(kt||Tr(_),t.removed=[],typeof Z=="string"&&(Kt=!1),Kt){if(Z.nodeName){const Dt=he(Z.nodeName);if(!ye[Dt]||Le[Dt])throw jr("root node is forbidden and cannot be sanitized in-place")}}else if(Z instanceof d)C=hs("<!---->"),O=C.ownerDocument.importNode(Z,!0),O.nodeType===qr.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?C=O:C.appendChild(O);else{if(!F&&!Ne&&!bt&&Z.indexOf("<")===-1)return T&&xe?T.createHTML(Z):Z;if(C=hs(Z),!C)return F?null:xe?L:""}C&&cn&&vt(C.firstChild);const Ee=so(Kt?Z:C);for(;de=Ee.nextNode();)gs(de),ao(de),de.content instanceof i&&dn(de.content);if(Kt)return Z;if(F){if(re)for(Ze=se.call(C.ownerDocument);C.firstChild;)Ze.appendChild(C.firstChild);else Ze=C;return(ge.shadowroot||ge.shadowrootmode)&&(Ze=nt.call(r,Ze,!0)),Ze}let Je=bt?C.outerHTML:C.innerHTML;return bt&&ye["!doctype"]&&C.ownerDocument&&C.ownerDocument.doctype&&C.ownerDocument.doctype.name&&Xe(tl,C.ownerDocument.doctype.name)&&(Je="<!DOCTYPE "+C.ownerDocument.doctype.name+`>
|
|
1643
|
-
`+Je),Ne&&Mo([Se,at,At],Dt=>{Je=Ur(Je,Dt," ")}),T&&xe?T.createHTML(Je):Je},t.setConfig=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tr(Z),kt=!0},t.clearConfig=function(){Rn=null,kt=!1},t.isValidAttribute=function(Z,_,C){Rn||Tr({});const O=he(Z),de=he(_);return ms(O,de,C)},t.addHook=function(Z,_){typeof _=="function"&&Mr(ee[Z],_)},t.removeHook=function(Z,_){if(_!==void 0){const C=ib(ee[Z],_);return C===-1?void 0:ab(ee[Z],C,1)[0]}return Yc(ee[Z])},t.removeHooks=function(Z){ee[Z]=[]},t.removeAllHooks=function(){ee=rl()},t}var Sb=ol();function sl(e){const t=ce.parse(e,{gfm:!0,breaks:!0,async:!1});return Sb.sanitize(t)}const il=1e3,Tb=32,al=15e3,Eb=new Set(["completed","failed","cancelled"]),Ab=4e3;let I=null,Hr=null,Fr=null,Ft=null,Fe=null,hi=null,Zo=null,fi=!1,qo=null,Br=null,G={kind:"connecting"},cr=[],lt=!0,lr=null,ve=null,ur=null,tn=null,Gr=-1,Qe=null,nn=!1,rn=null,Nn=new Set;function gi(){Fo(),wc(),Ft&&clearInterval(Ft),Ft=null,rn==null||rn(),rn=null,Fe==null||Fe.destroy(),Fe=null,I&&Ut(I),I==null||I.remove(),I=null,Hr==null||Hr(),Hr=null,Fr==null||Fr(),Fr=null,hi=null,G={kind:"connecting"},cr=[],lt=!0,lr=null,ve=null,ur=null,tn=null,Zo=null,Gr=-1,Qe=null,nn=!1,Nn=new Set}function mi(e,t,n,r,o){I&&gi(),hi=o!=null?o:null,G={kind:"connecting"},cr=[],lt=!0,lr=null,Gr=-1,Qe=null,nn=!1,Nn=new Set,ve=e,ur=n,tn=t,Zo=r,yc({taskId:e,backendUrl:n,title:r}),I=document.createElement("div"),I.className="ap-sdk-panel",I.setAttribute("data-ap-sdk","1"),I.setAttribute("role","dialog"),I.setAttribute("aria-modal","true"),I.setAttribute("aria-label","Automation in progress");const i=r.length>55?`${r.slice(0,52)}…`:r;I.innerHTML=`
|
|
1644
|
-
<div class="ap-sdk-panel__header">
|
|
1645
|
-
<span class="ap-sdk-panel__title">
|
|
1646
|
-
<span class="ap-sdk-panel__logo">AP</span>
|
|
1647
|
-
Automating page
|
|
1648
|
-
</span>
|
|
1649
|
-
<div class="ap-sdk-panel__header-actions">
|
|
1650
|
-
<button class="ap-sdk-panel__close" aria-label="Close" data-ap-close>×</button>
|
|
1651
|
-
</div>
|
|
1652
|
-
</div>
|
|
1653
|
-
<div class="ap-sdk-runner__meta">
|
|
1654
|
-
<div class="ap-sdk-runner__meta-row">
|
|
1655
|
-
<span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--automate">Automate</span>
|
|
1656
|
-
<span class="ap-sdk-runner__title" title="${Ub(r)}">${ki(i)}</span>
|
|
1657
|
-
</div>
|
|
1658
|
-
<div class="ap-sdk-runner__meta-row ap-sdk-runner__meta-row--controls">
|
|
1659
|
-
<span class="ap-sdk-runner__counter" data-ap-runner-counter>0 actions</span>
|
|
1660
|
-
<span class="ap-sdk-runner__timer" data-ap-runner-timer>00:00</span>
|
|
1661
|
-
<span class="ap-sdk-status-badge ap-sdk-status-badge--in-progress" data-ap-runner-status>running</span>
|
|
1662
|
-
<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>
|
|
1663
|
-
</div>
|
|
1664
|
-
</div>
|
|
1665
|
-
<div class="ap-sdk-runner__log-toolbar">
|
|
1666
|
-
<button type="button" class="ap-sdk-runner__scroll-toggle" data-ap-runner-scroll-toggle>Auto ↓</button>
|
|
1667
|
-
<button type="button" class="ap-sdk-runner__scroll-jump" data-ap-runner-scroll-jump title="Jump to latest output">Jump to latest</button>
|
|
1668
|
-
</div>
|
|
1669
|
-
<div class="ap-sdk-runner__log" data-ap-runner-log></div>
|
|
1670
|
-
<div class="ap-sdk-runner__chat" data-ap-runner-chat>
|
|
1671
|
-
<div class="ap-sdk-runner__question" data-ap-runner-question style="display:none"></div>
|
|
1672
|
-
<form class="ap-sdk-runner__chat-form" data-ap-runner-chat-form>
|
|
1673
|
-
<input
|
|
1674
|
-
type="text"
|
|
1675
|
-
class="ap-sdk-runner__chat-input"
|
|
1676
|
-
data-ap-runner-chat-input
|
|
1677
|
-
placeholder="Send a message to the agent…"
|
|
1678
|
-
autocomplete="off"
|
|
1679
|
-
/>
|
|
1680
|
-
<button type="submit" class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-runner-chat-send>Send</button>
|
|
1681
|
-
</form>
|
|
1682
|
-
<div class="ap-sdk-runner__chat-error" data-ap-runner-chat-error style="display:none"></div>
|
|
1683
|
-
</div>
|
|
1684
|
-
<div class="ap-sdk-runner__hint" data-ap-runner-hint>Closing keeps the task running — resume anytime from My Captures.</div>
|
|
1685
|
-
<div class="ap-sdk-panel__status" data-ap-runner-summary style="display:none"></div>
|
|
1686
|
-
`,I.addEventListener("wheel",a=>{a.stopPropagation()},{passive:!0}),I.addEventListener("touchmove",a=>{a.stopPropagation()},{passive:!0}),document.body.appendChild(I),Fe=Es(),Mt(I),Hr=Js(I,Ws),Fr=$r(I,Ir),I.querySelector("[data-ap-close]").addEventListener("click",()=>{gi(),o==null||o()}),I.querySelector("[data-ap-runner-chat-form]").addEventListener("submit",a=>{a.preventDefault(),Rb(t,e)}),I.querySelector("[data-ap-runner-cancel]").addEventListener("click",a=>{a.stopPropagation();const d=a.currentTarget;if(!fi){fi=!0,d.textContent="Confirm",qo=setTimeout(Fo,Ab),Br=l=>{l.target!==d&&Fo()},document.addEventListener("click",Br,!0);return}Fo(),Cb(t,e)}),I.querySelector("[data-ap-runner-scroll-toggle]").addEventListener("click",()=>{lt=!lt,lt&&cl(),Ho()}),I.querySelector("[data-ap-runner-scroll-jump]").addEventListener("click",()=>{lt=!0,cl(),Ho()}),I.querySelector("[data-ap-runner-log]").addEventListener("scroll",()=>{if(!lt||!I)return;const a=I.querySelector("[data-ap-runner-log]");a.scrollHeight-a.scrollTop-a.clientHeight>Tb&&(lt=!1,Ho())}),bi(),ll(e,t)}function cl(){const e=I==null?void 0:I.querySelector("[data-ap-runner-log]");e&&(e.scrollTop=e.scrollHeight)}function Ho(){if(!I)return;const e=I.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 ll(e,t){const n=d=>z(null,null,function*(){if(ve!==e||!I||G.kind!=="idle"&&G.kind!=="connecting"||Nn.has(d.commandId))return;Nn.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()};Dn({kind:"executing",command:l,actionsRun:G.kind==="idle"?G.actionsRun:0}),yield dl(l,t,e)}),r=d=>{if(!(ve!==e||!I)&&Eb.has(d)){if(G.kind==="executing")Dn({kind:"finishing",status:d,actionsRun:G.actionsRun});else if(G.kind==="connecting"||G.kind==="idle"){const l=G.kind==="idle"?G.actionsRun:0;Dn({kind:"finished",status:d,actionsRun:l})}}},o=d=>{ve!==e||!I||(d.outputChunk&&pl([d.outputChunk]),r(d.status))},i=()=>z(null,null,function*(){var d;if(!(ve!==e||!I))try{const l=yield Lo(t,e);ve===e&&I&&(Qe=(d=l[0])!=null?d:null,Mn())}catch(l){}}),a=()=>z(null,null,function*(){var d;try{const[l,p,h,g]=yield Promise.all([mc(t,e),Zg(t,e),Lo(t,e),Ug(t,e)]);if(ve!==e||!I)return;pl(p),Qe=(d=h[0])!=null?d:null,Mn(),r(l.status),g&&g.status==="pending"&&(G.kind==="idle"||G.kind==="connecting")&&!Nn.has(g.id)?(Nn.add(g.id),Dn({kind:"executing",command:g,actionsRun:G.kind==="idle"?G.actionsRun:0}),yield dl(g,t,e)):G.kind==="connecting"&&Dn({kind:"idle",actionsRun:0})}catch(l){}});a(),Kg(t,e,{onStatusUpdate:o,onInteractionCreated:i,onInteractionAnswered:i,onBrowserCommandCreated:n,onReconnect:()=>{a()}}).then(d=>{if(ve!==e||G.kind==="finished"){d();return}rn=d})}function Dn(e){G=e,G.kind==="idle"&&lr===null&&(lr=Date.now(),Bo(),Ft=setInterval(Bo,il)),G.kind==="finished"&&(Ft&&(clearInterval(Ft),Ft=null),rn==null||rn(),rn=null,Fe==null||Fe.hide(),wc()),bi()}function Fo(){fi=!1,qo&&(clearTimeout(qo),qo=null),Br&&(document.removeEventListener("click",Br,!0),Br=null);const e=I==null?void 0:I.querySelector("[data-ap-runner-cancel]");e&&(e.textContent="Cancel task")}function Cb(e,t){return z(this,null,function*(){if(ve!==t||!I)return;const n=I.querySelector("[data-ap-runner-cancel]");n&&(n.disabled=!0);try{yield Hg(e,t)}catch(r){n&&(n.disabled=!1)}})}function ul(){if(!ve||!tn||!ur||!Zo)return;const e=ve,t=tn;yc({taskId:e,backendUrl:ur,title:Zo}),Ft&&clearInterval(Ft),Bo(),Ft=setInterval(Bo,il);const n=G.kind==="finished"?G.actionsRun:0;Nn=new Set,G={kind:"idle",actionsRun:n},bi(),ll(e,t)}function bi(){if(!I)return;const e=I.querySelector("[data-ap-runner-status]"),t=I.querySelector("[data-ap-runner-counter]"),n=I.querySelector("[data-ap-runner-log]"),r=I.querySelector("[data-ap-runner-hint]");if(!e||!t||!n||!r)return;const o="actionsRun"in G?G.actionsRun:0;t.textContent=`${o} action${o===1?"":"s"}`,Ho(),G.kind==="finished"?(e.textContent=G.status.replace(/_/g," "),e.className=`ap-sdk-status-badge ap-sdk-status-badge--${G.status.replace(/_/g,"-")}`,r.style.display="none",Db(G.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(cr.length===0&&(G.kind==="connecting"||G.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();Mn();const a=I.querySelector("[data-ap-runner-chat-input]"),d=I.querySelector("[data-ap-runner-chat-send]");if(a&&d){const h=G.kind==="finished"&&G.status==="failed";a.disabled=h,d.disabled=h||nn,h&&(a.placeholder="This task failed — start a new automation to continue.")}const l=I.querySelector("[data-ap-runner-cancel]");l&&(l.style.display=G.kind==="finished"?"none":"");const p=I.querySelector("[data-ap-runner-summary]");p&&G.kind!=="finished"&&(p.style.display="none",p.innerHTML="")}function Mn(){var o;if(!I)return;const e=I.querySelector("[data-ap-runner-question]"),t=I.querySelector("[data-ap-runner-chat-input]");if(!e||!t)return;if(!Qe){e.style.display="none",e.innerHTML="",t.placeholder="Send a message to the agent…";return}const n=Qe.questionMetadata,r=(o=n==null?void 0:n.options)!=null?o:[];if(t.placeholder="Type your answer…",e.style.display="block",e.innerHTML=`
|
|
1687
|
-
<div class="ap-sdk-runner__question-label">${ki((n==null?void 0:n.header)||"The agent has a question")}</div>
|
|
1688
|
-
<div class="ap-sdk-runner__question-text ap-sdk-markdown">${sl((n==null?void 0:n.question)||Qe.question)}</div>
|
|
1689
|
-
${r.length>0?'<div class="ap-sdk-runner__question-options" data-ap-runner-question-options></div>':""}
|
|
1690
|
-
`,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 Pb(a.label)),i.appendChild(d)}}}function Pb(e){return z(this,null,function*(){var r;if(!I||!Qe||!ve||nn)return;const t=ve,n=tn;if(n){nn=!0;try{const o={selectedOption:e};yield _c(n,t,Qe.id,o),Qe=null,Mn();const i=yield Lo(n,t);ve===t&&I&&(Qe=(r=i[0])!=null?r:null,Mn())}catch(o){const i=I.querySelector("[data-ap-runner-chat-error]");i&&(i.textContent="Failed to send your answer — try again.",i.style.display="block")}finally{nn=!1}}})}function Bo(){if(!I||lr===null)return;const e=I.querySelector("[data-ap-runner-timer]");if(!e)return;const t=Math.max(0,Math.floor((Date.now()-lr)/1e3)),n=String(Math.floor(t/60)).padStart(2,"0"),r=String(t%60).padStart(2,"0");e.textContent=`${n}:${r}`}function dl(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})`);Fe==null||Fe.update(a),o=Ib(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(Fe==null||Fe.update(a),e.action==="click")yield em(a),o="Clicked";else{if(e.value===void 0)throw new Error("inputText command is missing a value");$b(a,e.value),o="Entered text"}}}catch(a){r="error",o=a instanceof Error?a.message:"Unknown error executing command"}if(ve===n&&I&&zb(r,e,o),yield Lb(t,n,e.id,r,o),ve!==n||!I)return;Fe==null||Fe.hide();const i=(G.kind==="executing"||G.kind==="finishing"?G.actionsRun:0)+1;G.kind==="finishing"?Dn({kind:"finished",status:G.status,actionsRun:i}):G.kind==="executing"&&Dn({kind:"idle",actionsRun:i})})}function Rb(e,t){return z(this,null,function*(){var a;if(!I||nn||G.kind==="finished"&&G.status==="failed")return;const n=I.querySelector("[data-ap-runner-chat-input]"),r=I.querySelector("[data-ap-runner-chat-error]"),o=I.querySelector("[data-ap-runner-chat-send]");if(!n||!r||!o)return;const i=n.value.trim();if(i){nn=!0,o.disabled=!0,r.style.display="none";try{if(Qe){yield _c(e,t,Qe.id,i),Qe=null,Mn();try{const d=yield Lo(e,t);ve===t&&I&&(Qe=(a=d[0])!=null?a:null,Mn())}catch(d){}}else yield qg(e,t,i),G.kind==="finished"&&ul();n.value=""}catch(d){r.textContent=d instanceof Error?d.message:"Failed to send — try again.",r.style.display="block"}finally{nn=!1,o.disabled=!1}}})}function Lb(e,t,n,r,o){return z(this,null,function*(){try{yield jg(e,t,n,r,o)}catch(i){}})}function Ib(e){const t=e.cloneNode(!0);t.querySelectorAll("script, style, noscript").forEach(o=>o.remove()),ra(t),na(t);let n=t.outerHTML,r=!1;return n.length>al&&(n=n.slice(0,al),r=!0),`URL: ${location.href}
|
|
1691
|
-
Title: ${document.title}
|
|
1692
|
-
|
|
1693
|
-
${n}${r?`
|
|
1694
|
-
… (truncated)`:""}`}function $b(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 zb(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(cr.push({status:e,text:`${r} ${i}${d}`}),!I)return;const l=I.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=cr[cr.length-1].text,l.appendChild(p),lt&&(l.scrollTop=l.scrollHeight)}function Ob(e){var t,n;return(n=(t=e.display)==null?void 0:t.variant)!=null?n:e.sdkEventType}function Nb(e){const t=Ob(e);return(e.stream==="stdout"||e.stream==="stderr"||e.stream==="sdk_event"&&(t==="text"||t==="thinking"))&&e.data.trim()||null}function pl(e){var r;const t=e.filter(o=>o.sequence>Gr).sort((o,i)=>o.sequence-i.sequence);if(t.length===0||(Gr=Math.max(Gr,...t.map(o=>o.sequence)),!I))return;const n=I.querySelector("[data-ap-runner-log]");if(n)for(const o of t){const i=Nb(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=sl(i)):a.textContent=i,n.appendChild(a),lt&&(n.scrollTop=n.scrollHeight)}}function Db(e){if(!I||!ve||!ur)return;const t=I.querySelector("[data-ap-runner-summary]");if(!t)return;const n=`${ur.replace(/\/+$/,"")}/tasks/${ve}`,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=`
|
|
1695
|
-
<div class="ap-sdk-success-card">
|
|
1696
|
-
<p class="ap-sdk-success-headline">${ki(r)}</p>
|
|
1697
|
-
${o?`
|
|
1698
|
-
<div class="ap-sdk-runner__approval" data-ap-runner-approval>
|
|
1699
|
-
<div class="ap-sdk-runner__approval-actions">
|
|
1700
|
-
<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>
|
|
1701
|
-
<button class="ap-sdk-runner__text-btn ap-sdk-runner__text-btn--danger" data-ap-runner-reject>Reject</button>
|
|
1702
|
-
</div>
|
|
1703
|
-
<div class="ap-sdk-runner__reject-form" data-ap-runner-reject-form style="display:none">
|
|
1704
|
-
<textarea class="ap-sdk-panel__textarea" rows="2" placeholder="What was wrong? (optional)" data-ap-runner-reject-feedback></textarea>
|
|
1705
|
-
<div class="ap-sdk-runner__reject-hint">Leave blank to reject permanently, or add details so the agent can retry with your feedback.</div>
|
|
1706
|
-
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--danger ap-sdk-panel__btn--block" data-ap-runner-reject-submit>Reject Permanently</button>
|
|
1707
|
-
</div>
|
|
1708
|
-
<div class="ap-sdk-runner__approval-error" data-ap-runner-approval-error style="display:none"></div>
|
|
1709
|
-
</div>
|
|
1710
|
-
<div class="ap-sdk-runner__divider"></div>`:""}
|
|
1711
|
-
<div class="ap-sdk-success-actions ap-sdk-success-actions--stacked">
|
|
1712
|
-
<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>
|
|
1713
|
-
<button class="ap-sdk-runner__text-btn" data-ap-runner-close>Close</button>
|
|
1714
|
-
</div>
|
|
1715
|
-
</div>
|
|
1716
|
-
`,t.querySelector("[data-ap-runner-view]").addEventListener("click",()=>window.open(n,"_blank","noopener,noreferrer")),t.querySelector("[data-ap-runner-close]").addEventListener("click",()=>{const a=hi;gi(),a==null||a()}),o&&Mb(t)}function Mb(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(!ve||!tn)return;const h=ve,g=tn;t.disabled=!0,n.disabled=!0,a.style.display="none";try{yield Fg(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(!ve||!tn)return;const h=ve,g=tn,m=o.value.trim();i.disabled=!0,t.disabled=!0,a.style.display="none",i.textContent="Rejecting…";try{yield Bg(g,h,m),m?ul():(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 Ub(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function ki(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function jb(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 cu(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),b=f.ref;if(f.ref=null,b){n(b);const y=A.seen.get(b),_=y.schema;if(_.$ref&&(A.target==="draft-07"||A.target==="draft-04"||A.target==="openapi-3.0")?(g.allOf=(v=g.allOf)!=null?v:[],g.allOf.push(_)):Object.assign(g,_),Object.assign(g,m),h._zod.parent===b)for(const H in g)H==="$ref"||H==="allOf"||H in m||delete g[H];if(_.$ref)for(const H in g)H==="$ref"||H==="allOf"||H in y.def&&JSON.stringify(g[H])===JSON.stringify(y.def[H])&&delete g[H]}const U=h._zod.parent;if(U&&U!==b){n(U);const y=A.seen.get(U);if(y!=null&&y.schema.$ref&&(g.$ref=y.schema.$ref,y.def))for(const _ in g)_==="$ref"||_==="allOf"||_ in y.def&&JSON.stringify(g[_])===JSON.stringify(y.def[_])&&delete g[_]}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:Js(e,"input",A.processors),output:Js(e,"output",A.processors)}}),enumerable:!1,writable:!1}),h}catch(h){throw new Error("Error converting schema to JSON.")}}function ie(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 ie(n.element,t);if(n.type==="set")return ie(n.valueType,t);if(n.type==="lazy")return ie(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 ie(n.innerType,t);if(n.type==="intersection")return ie(n.left,t)||ie(n.right,t);if(n.type==="record"||n.type==="map")return ie(n.keyType,t)||ie(n.valueType,t);if(n.type==="pipe")return ie(n.in,t)||ie(n.out,t);if(n.type==="object"){for(const r in n.shape)if(ie(n.shape[r],t))return!0;return!1}if(n.type==="union"){for(const r of n.options)if(ie(r,t))return!0;return!1}if(n.type==="tuple"){for(const r of n.items)if(ie(r,t))return!0;return!!(n.rest&&ie(n.rest,t))}return!1}const wm=(A,e={})=>t=>{const n=iu($(k({},t),{processors:e}));return OA(A,n),au(n,A),cu(n,A)},Js=(A,e,t={})=>n=>{const{libraryOptions:r,target:s}=n!=null?n:{},o=iu($(k({},r!=null?r:{}),{target:s,io:e,processors:t}));return OA(A,o),au(o,A),cu(o,A)},mm={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cm=(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=mm[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}))])}},bm=(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)},Qm=(A,e,t,n)=>{t.type="boolean"},ym=(A,e,t,n)=>{t.not={}},Um=(A,e,t,n)=>{},Em=(A,e,t,n)=>{},km=(A,e,t,n)=>{const r=A._zod.def,s=Ul(r.entries);s.every(o=>typeof o=="number")&&(t.type="number"),s.every(o=>typeof o=="string")&&(t.type="string"),t.enum=s},Fm=(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},vm=(A,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_m=(A,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},xm=(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=OA(s.element,e,$(k({},n),{path:[...n.path,"items"]}))},Sm=(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]=OA(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=OA(s.catchall,e,$(k({},n),{path:[...n.path,"additionalProperties"]}))):e.io==="output"&&(r.additionalProperties=!1)},Im=(A,e,t,n)=>{const r=A._zod.def,s=r.inclusive===!1,o=r.options.map((a,i)=>OA(a,e,$(k({},n),{path:[...n.path,s?"oneOf":"anyOf",i]})));s?t.oneOf=o:t.anyOf=o},Tm=(A,e,t,n)=>{const r=A._zod.def,s=OA(r.left,e,$(k({},n),{path:[...n.path,"allOf",0]})),o=OA(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},Hm=(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=OA(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=OA(s.keyType,e,$(k({},n),{path:[...n.path,"propertyNames"]}))),r.additionalProperties=OA(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)}},Lm=(A,e,t,n)=>{const r=A._zod.def,s=OA(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"}]},Dm=(A,e,t,n)=>{const r=A._zod.def;OA(r.innerType,e,n);const s=e.seen.get(A);s.ref=r.innerType},Rm=(A,e,t,n)=>{const r=A._zod.def;OA(r.innerType,e,n);const s=e.seen.get(A);s.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue))},Om=(A,e,t,n)=>{const r=A._zod.def;OA(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)))},Pm=(A,e,t,n)=>{const r=A._zod.def;OA(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},Mm=(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;OA(s,e,n);const o=e.seen.get(A);o.ref=s},Km=(A,e,t,n)=>{const r=A._zod.def;OA(r.innerType,e,n);const s=e.seen.get(A);s.ref=r.innerType,t.readOnly=!0},lu=(A,e,t,n)=>{const r=A._zod.def;OA(r.innerType,e,n);const s=e.seen.get(A);s.ref=r.innerType},Nm=x("ZodISODateTime",(A,e)=>{MB.init(A,e),FA.init(A,e)});function $m(A){return Zw(Nm,A)}const zm=x("ZodISODate",(A,e)=>{KB.init(A,e),FA.init(A,e)});function Vm(A){return Xw(zm,A)}const Gm=x("ZodISOTime",(A,e)=>{NB.init(A,e),FA.init(A,e)});function Zm(A){return Ww(Gm,A)}const Xm=x("ZodISODuration",(A,e)=>{$B.init(A,e),FA.init(A,e)});function Wm(A){return Jw(Xm,A)}const Ue=x("ZodError",(A,e)=>{xl.init(A,e),A.name="ZodError",Object.defineProperties(A,{format:{value:t=>Tg(A,t)},flatten:{value:t=>Ig(A,t)},addIssue:{value:t=>{A.issues.push(t),A.message=JSON.stringify(A.issues,Vi,2)}},addIssues:{value:t=>{A.issues.push(...t),A.message=JSON.stringify(A.issues,Vi,2)}},isEmpty:{get(){return A.issues.length===0}}})},{Parent:Error}),Jm=Wi(Ue),jm=Ji(Ue),Ym=zs(Ue),qm=Vs(Ue),AC=Dg(Ue),eC=Rg(Ue),tC=Og(Ue),nC=Pg(Ue),rC=Mg(Ue),sC=Kg(Ue),oC=Ng(Ue),iC=$g(Ue),yA=x("ZodType",(A,e)=>(bA.init(A,e),Object.assign(A["~standard"],{jsonSchema:{input:Js(A,"input"),output:Js(A,"output")}}),A.toJSONSchema=wm(A,{}),A.def=e,A.type=e.type,Object.defineProperty(A,"_def",{value:e}),A.check=(...t)=>{var n;return A.clone(Dt(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)=>Rt(A,t,n),A.brand=()=>A,A.register=((t,n)=>(t.add(A,n),A)),A.parse=(t,n)=>Jm(A,t,n,{callee:A.parse}),A.safeParse=(t,n)=>Ym(A,t,n),A.parseAsync=(t,n)=>I(null,null,function*(){return jm(A,t,n,{callee:A.parseAsync})}),A.safeParseAsync=(t,n)=>I(null,null,function*(){return qm(A,t,n)}),A.spa=A.safeParseAsync,A.encode=(t,n)=>AC(A,t,n),A.decode=(t,n)=>eC(A,t,n),A.encodeAsync=(t,n)=>I(null,null,function*(){return tC(A,t,n)}),A.decodeAsync=(t,n)=>I(null,null,function*(){return nC(A,t,n)}),A.safeEncode=(t,n)=>rC(A,t,n),A.safeDecode=(t,n)=>sC(A,t,n),A.safeEncodeAsync=(t,n)=>I(null,null,function*(){return oC(A,t,n)}),A.safeDecodeAsync=(t,n)=>I(null,null,function*(){return iC(A,t,n)}),A.refine=(t,n)=>A.check(tb(t,n)),A.superRefine=t=>A.check(nb(t)),A.overwrite=t=>A.check(Vn(t)),A.optional=()=>Cu(A),A.exactOptional=()=>$C(A),A.nullable=()=>bu(A),A.nullish=()=>Cu(bu(A)),A.nonoptional=t=>WC(A,t),A.array=()=>be(A),A.or=t=>HC([A,t]),A.and=t=>RC(A,t),A.transform=t=>yu(A,KC(t)),A.default=t=>GC(A,t),A.prefault=t=>XC(A,t),A.catch=t=>jC(A,t),A.pipe=t=>yu(A,t),A.readonly=()=>Ab(A),A.describe=t=>{const n=A.clone();return xr.add(n,{description:t}),n},Object.defineProperty(A,"description",{get(){var t;return(t=xr.get(A))==null?void 0:t.description},configurable:!0}),A.meta=(...t)=>{if(t.length===0)return xr.get(A);const n=A.clone();return xr.add(n,t[0]),n},A.isOptional=()=>A.safeParse(void 0).success,A.isNullable=()=>A.safeParse(null).success,A.apply=t=>t(A),A)),uu=x("_ZodString",(A,e)=>{var n,r,s;ji.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(o,a,i)=>Cm(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(nm(...o)),A.includes=(...o)=>A.check(om(...o)),A.startsWith=(...o)=>A.check(im(...o)),A.endsWith=(...o)=>A.check(am(...o)),A.min=(...o)=>A.check(Ws(...o)),A.max=(...o)=>A.check(su(...o)),A.length=(...o)=>A.check(ou(...o)),A.nonempty=(...o)=>A.check(Ws(1,...o)),A.lowercase=o=>A.check(rm(o)),A.uppercase=o=>A.check(sm(o)),A.trim=()=>A.check(lm()),A.normalize=(...o)=>A.check(cm(...o)),A.toLowerCase=()=>A.check(um()),A.toUpperCase=()=>A.check(dm()),A.slugify=()=>A.check(pm())}),aC=x("ZodString",(A,e)=>{ji.init(A,e),uu.init(A,e),A.email=t=>A.check(kw(cC,t)),A.url=t=>A.check(Sw(lC,t)),A.jwt=t=>A.check(Gw(EC,t)),A.emoji=t=>A.check(Iw(uC,t)),A.guid=t=>A.check(eu(du,t)),A.uuid=t=>A.check(Fw(js,t)),A.uuidv4=t=>A.check(vw(js,t)),A.uuidv6=t=>A.check(_w(js,t)),A.uuidv7=t=>A.check(xw(js,t)),A.nanoid=t=>A.check(Tw(dC,t)),A.guid=t=>A.check(eu(du,t)),A.cuid=t=>A.check(Hw(pC,t)),A.cuid2=t=>A.check(Lw(hC,t)),A.ulid=t=>A.check(Dw(fC,t)),A.base64=t=>A.check($w(QC,t)),A.base64url=t=>A.check(zw(yC,t)),A.xid=t=>A.check(Rw(gC,t)),A.ksuid=t=>A.check(Ow(BC,t)),A.ipv4=t=>A.check(Pw(wC,t)),A.ipv6=t=>A.check(Mw(mC,t)),A.cidrv4=t=>A.check(Kw(CC,t)),A.cidrv6=t=>A.check(Nw(bC,t)),A.e164=t=>A.check(Vw(UC,t)),A.datetime=t=>A.check($m(t)),A.date=t=>A.check(Vm(t)),A.time=t=>A.check(Zm(t)),A.duration=t=>A.check(Wm(t))});function L(A){return Ew(aC,A)}const FA=x("ZodStringFormat",(A,e)=>{QA.init(A,e),uu.init(A,e)}),cC=x("ZodEmail",(A,e)=>{SB.init(A,e),FA.init(A,e)}),du=x("ZodGUID",(A,e)=>{_B.init(A,e),FA.init(A,e)}),js=x("ZodUUID",(A,e)=>{xB.init(A,e),FA.init(A,e)}),lC=x("ZodURL",(A,e)=>{IB.init(A,e),FA.init(A,e)}),uC=x("ZodEmoji",(A,e)=>{TB.init(A,e),FA.init(A,e)}),dC=x("ZodNanoID",(A,e)=>{HB.init(A,e),FA.init(A,e)}),pC=x("ZodCUID",(A,e)=>{LB.init(A,e),FA.init(A,e)}),hC=x("ZodCUID2",(A,e)=>{DB.init(A,e),FA.init(A,e)}),fC=x("ZodULID",(A,e)=>{RB.init(A,e),FA.init(A,e)}),gC=x("ZodXID",(A,e)=>{OB.init(A,e),FA.init(A,e)}),BC=x("ZodKSUID",(A,e)=>{PB.init(A,e),FA.init(A,e)}),wC=x("ZodIPv4",(A,e)=>{zB.init(A,e),FA.init(A,e)}),mC=x("ZodIPv6",(A,e)=>{VB.init(A,e),FA.init(A,e)}),CC=x("ZodCIDRv4",(A,e)=>{GB.init(A,e),FA.init(A,e)}),bC=x("ZodCIDRv6",(A,e)=>{ZB.init(A,e),FA.init(A,e)}),QC=x("ZodBase64",(A,e)=>{XB.init(A,e),FA.init(A,e)}),yC=x("ZodBase64URL",(A,e)=>{JB.init(A,e),FA.init(A,e)}),UC=x("ZodE164",(A,e)=>{jB.init(A,e),FA.init(A,e)}),EC=x("ZodJWT",(A,e)=>{qB.init(A,e),FA.init(A,e)}),pu=x("ZodNumber",(A,e)=>{var n,r,s,o,a,i,c,u,h;Kl.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(f,g,m)=>bm(A,f,g),A.gt=(f,g)=>A.check(nu(f,g)),A.gte=(f,g)=>A.check(Aa(f,g)),A.min=(f,g)=>A.check(Aa(f,g)),A.lt=(f,g)=>A.check(tu(f,g)),A.lte=(f,g)=>A.check(qi(f,g)),A.max=(f,g)=>A.check(qi(f,g)),A.int=f=>A.check(hu(f)),A.safe=f=>A.check(hu(f)),A.positive=f=>A.check(nu(0,f)),A.nonnegative=f=>A.check(Aa(0,f)),A.negative=f=>A.check(tu(0,f)),A.nonpositive=f=>A.check(qi(0,f)),A.multipleOf=(f,g)=>A.check(ru(f,g)),A.step=(f,g)=>A.check(ru(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 ot(A){return jw(pu,A)}const kC=x("ZodNumberFormat",(A,e)=>{Aw.init(A,e),pu.init(A,e)});function hu(A){return Yw(kC,A)}const FC=x("ZodBoolean",(A,e)=>{ew.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Qm(A,t,n)});function UA(A){return qw(FC,A)}const vC=x("ZodAny",(A,e)=>{tw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Um()});function fu(){return Am(vC)}const _C=x("ZodUnknown",(A,e)=>{nw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Em()});function gu(){return em(_C)}const xC=x("ZodNever",(A,e)=>{rw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>ym(A,t,n)});function SC(A){return tm(xC,A)}const IC=x("ZodArray",(A,e)=>{sw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>xm(A,t,n,r),A.element=e.element,A.min=(t,n)=>A.check(Ws(t,n)),A.nonempty=t=>A.check(Ws(1,t)),A.max=(t,n)=>A.check(su(t,n)),A.length=(t,n)=>A.check(ou(t,n)),A.unwrap=()=>A.element});function be(A,e){return hm(IC,A,e)}const TC=x("ZodObject",(A,e)=>{iw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Sm(A,t,n,r),iA(A,"shape",()=>e.shape),A.keyof=()=>Ee(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:gu()})),A.loose=()=>A.clone($(k({},A._zod.def),{catchall:gu()})),A.strict=()=>A.clone($(k({},A._zod.def),{catchall:SC()})),A.strip=()=>A.clone($(k({},A._zod.def),{catchall:void 0})),A.extend=t=>Fg(A,t),A.safeExtend=t=>vg(A,t),A.merge=t=>_g(A,t),A.pick=t=>Eg(A,t),A.omit=t=>kg(A,t),A.partial=(...t)=>xg(mu,A,t[0]),A.required=(...t)=>Sg(Qu,A,t[0])});function CA(A,e){const t=k({type:"object",shape:A!=null?A:{}},V(e));return new TC(t)}const Bu=x("ZodUnion",(A,e)=>{Gl.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Im(A,t,n,r),A.options=e.options});function HC(A,e){return new Bu(k({type:"union",options:A},V(e)))}const LC=x("ZodDiscriminatedUnion",(A,e)=>{Bu.init(A,e),aw.init(A,e)});function wu(A,e,t){return new LC(k({type:"union",options:e,discriminator:A},V(t)))}const DC=x("ZodIntersection",(A,e)=>{cw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Tm(A,t,n,r)});function RC(A,e){return new DC({type:"intersection",left:A,right:e})}const OC=x("ZodRecord",(A,e)=>{lw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Hm(A,t,n,r),A.keyType=e.keyType,A.valueType=e.valueType});function it(A,e,t){return new OC(k({type:"record",keyType:A,valueType:e},V(t)))}const ea=x("ZodEnum",(A,e)=>{uw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(n,r,s)=>km(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 ea($(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 ea($(k($(k({},e),{checks:[]}),V(r)),{entries:s}))}});function Ee(A,e){const t=Array.isArray(A)?Object.fromEntries(A.map(n=>[n,n])):A;return new ea(k({type:"enum",entries:t},V(e)))}const PC=x("ZodLiteral",(A,e)=>{dw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Fm(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 PC(k({type:"literal",values:Array.isArray(A)?A:[A]},V(e)))}const MC=x("ZodTransform",(A,e)=>{pw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>_m(A,t),A._zod.parse=(t,n)=>{if(n.direction==="backward")throw new Ql(A.constructor.name);t.addIssue=s=>{var o,a,i;if(typeof s=="string")t.issues.push(_r(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(_r(c))}};const r=e.transform(t.value,t);return r instanceof Promise?r.then(s=>(t.value=s,t)):(t.value=r,t)}});function KC(A){return new MC({type:"transform",transform:A})}const mu=x("ZodOptional",(A,e)=>{Wl.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>lu(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function Cu(A){return new mu({type:"optional",innerType:A})}const NC=x("ZodExactOptional",(A,e)=>{hw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>lu(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function $C(A){return new NC({type:"optional",innerType:A})}const zC=x("ZodNullable",(A,e)=>{fw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Lm(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function bu(A){return new zC({type:"nullable",innerType:A})}const VC=x("ZodDefault",(A,e)=>{gw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Rm(A,t,n,r),A.unwrap=()=>A._zod.def.innerType,A.removeDefault=A.unwrap});function GC(A,e){return new VC({type:"default",innerType:A,get defaultValue(){return typeof e=="function"?e():vl(e)}})}const ZC=x("ZodPrefault",(A,e)=>{Bw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Om(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function XC(A,e){return new ZC({type:"prefault",innerType:A,get defaultValue(){return typeof e=="function"?e():vl(e)}})}const Qu=x("ZodNonOptional",(A,e)=>{ww.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Dm(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function WC(A,e){return new Qu(k({type:"nonoptional",innerType:A},V(e)))}const JC=x("ZodCatch",(A,e)=>{mw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Pm(A,t,n,r),A.unwrap=()=>A._zod.def.innerType,A.removeCatch=A.unwrap});function jC(A,e){return new JC({type:"catch",innerType:A,catchValue:typeof e=="function"?e:()=>e})}const YC=x("ZodPipe",(A,e)=>{Cw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Mm(A,t,n,r),A.in=e.in,A.out=e.out});function yu(A,e){return new YC({type:"pipe",in:A,out:e})}const qC=x("ZodReadonly",(A,e)=>{bw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>Km(A,t,n,r),A.unwrap=()=>A._zod.def.innerType});function Ab(A){return new qC({type:"readonly",innerType:A})}const eb=x("ZodCustom",(A,e)=>{Qw.init(A,e),yA.init(A,e),A._zod.processJSONSchema=(t,n,r)=>vm(A,t)});function tb(A,e={}){return fm(eb,A,e)}function nb(A){return gm(A)}const rb=CA({name:L().min(1).max(100).optional(),command:L().min(1).max(500),args:be(L()).optional(),failOnError:UA().default(!0).optional(),timeout:ot().int().min(1e3).max(3e5).default(3e4).optional(),workingDirectory:L().optional(),env:it(L(),L()).optional(),runOnBackground:UA().optional(),agentTags:be(L()).optional()});CA({name:L(),command:L(),success:UA(),exitCode:ot().optional(),stdout:L().optional(),stderr:L().optional(),error:L().optional(),duration:ot(),failOnError:UA()});const rn=CA({path:L(),extraCommands:be(rb).optional(),id:L().uuid().optional(),rotationKey:L().optional(),usageStatus:Ee(["free","in_use"]).optional(),agentTags:be(L()).optional()}),sb=wu("operation",[rn.extend({operation:ke("create"),content:L().optional(),contentPath:L().optional(),encoding:Ee(["utf-8","base64"]).optional()}),rn.extend({operation:ke("merge"),data:it(L(),fu()),mergeStrategy:Ee(["deep","shallow"]).optional(),arrayMergeStrategy:Ee(["concat","replace"]).optional()}),rn.extend({operation:ke("modify"),content:L().optional(),contentPath:L().optional(),createIfMissing:UA().optional()}),rn.extend({operation:ke("delete"),ignoreIfMissing:UA().optional()}),rn.extend({operation:ke("createDirectory"),contentPath:L().optional(),mode:ot().optional(),ignoreIfExists:UA().optional()}),rn.extend({operation:ke("download"),url:L().url(),headers:it(L(),L()).optional(),timeout:ot().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 vA=(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))(vA||{});const ob=CA({type:Ee(["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")}),ib=CA({type:Ee(["issue_update","bulk_issue_update","notification","webhook"]).describe("Hook type"),config:fu().describe("Hook-specific configuration")});CA({command:L().optional().describe("Legacy — unused in SDK mode"),args:be(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:be(sb).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:ob.optional().describe("Schema for extracting result data"),postExecutionHooks:be(ib).optional().describe("Hooks to run after task completion"),executionMode:Ee(["claudeAgentSdk","openaiAgentSdk","opencodeSdk","cursorSdk","codexSdk"]).optional().default("claudeAgentSdk").describe("Execution mode (default: claudeAgentSdk)"),executionPlan:wu("executionMode",[CA({executionMode:ke("claudeAgentSdk"),promptText:L(),sdkOptions:CA({model:L(),permissionMode:Ee(["plan","acceptEdits","bypassPermissions","ask"]),settingSources:be(L()),allowDangerouslySkipPermissions:UA(),persistSession:UA(),streamSdkEvents:UA().optional(),allowedTools:be(L()).optional(),settings:CA({enabledPlugins:it(L(),UA())}),env:it(L(),L()).optional()}),resume:CA({sessionId:L().optional(),continue:UA()}).optional()}),CA({executionMode:ke("opencodeSdk"),promptText:L(),sdkOptions:CA({provider:L(),model:L(),allowedTools:be(L()).optional(),env:it(L(),L()).optional()}),resume:CA({sessionId:L().optional(),continue:UA()}).optional()}),CA({executionMode:ke("openaiAgentSdk"),promptText:L(),sdkOptions:CA({model:L(),env:it(L(),L()).optional()}),resume:CA({sessionId:L().optional(),continue:UA()}).optional()}),CA({executionMode:ke("codexSdk"),promptText:L(),sdkOptions:CA({model:L().optional(),sandboxMode:Ee(["read-only","workspace-write","danger-full-access"]).optional(),approvalPolicy:Ee(["never","on-request","on-failure","untrusted"]).optional(),env:it(L(),L()).optional()}),resume:CA({sessionId:L().optional(),continue:UA()}).optional()}),CA({executionMode:ke("cursorSdk"),promptText:L(),sdkOptions:CA({model:L(),env:it(L(),L()).optional()}),resume:CA({sessionId:L().optional(),continue:UA()}).optional()})]).optional().describe("Backend-built prompt + resolved SDK options for this phase"),planEnabled:UA().optional().default(!1).describe("Enable planning phase (computed at runtime for agent)"),planContent:L().optional().describe("Final approved plan content"),planApproved:UA().optional().describe("Plan approval status"),planApprovedAt:L().optional().describe("ISO timestamp of approval"),planRejected:UA().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:be(CA({feedback:L(),rejectedAt:L()})).optional().describe("All rejection messages in chronological order"),notificationChannelPlanMessageId:ot().optional(),notificationChannelPlanMessageSentAt:L().optional(),notificationChannelCompletedMessageId:ot().optional(),notificationChannelFailedMessageId:ot().optional(),streamSdkEvents:UA().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:UA().optional().describe("True when planApproved was cleared for rePlan=true retry — indicates the plan had been approved before"),planComments:be(CA({id:L(),selectedText:L(),startOffset:ot(),endOffset:ot(),commentText:L(),createdAt:L()})).optional().describe("Inline review comments attached to the plan"),hasAiConfigSecrets:UA().optional().describe("True when AI Config has secret-backed env vars; agent must fetch resolved values via /tasks/:id/resolve-secrets"),hasCredentials:UA().optional().describe("True when the task has credentials attached; agent must fetch resolved values via /tasks/:id/resolve-credentials"),mcpServersMode:Ee(["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:UA().optional().describe("When true, the MCP server registers browser_interact and browser_get_context (browser_automate tasks only)")}),vA.DRAFT+"",vA.CANCELLED,vA.PENDING+"",vA.CANCELLED,vA.ASSIGNED+"",vA.CANCELLED,vA.IN_PROGRESS+"",vA.CANCELLED,vA.FAILED,vA.WAITING_FOR_INPUT+"",vA.CANCELLED,vA.WAITING_FOR_PLAN_APPROVAL+"",vA.CANCELLED,vA.PLAN_APPROVED+"",vA.CANCELLED,vA.PLAN_REJECTED+"",vA.CANCELLED,vA.COMPLETED+"",vA.RESULT_REJECTED+"",vA.CANCELLED,vA.FAILED+"",vA.CANCELLED+"";const Uu="browser_capture",ab="browser_automate";function Eu(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 cb(A,e){const t=Eu(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===Eu(n)}function ku(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:[])cb(t,a)&&a.length>r&&(r=a.length,n=o.id);return n}class Fu extends Error{}function ta(A){return I(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 Fu(t):new Error(t)}return A.json()})}let vu=3e4;function lb(A){Number.isFinite(A)&&A>0&&(vu=A)}function Sr(n){return I(this,arguments,function*(A,e={},t=vu){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 $A(A,e,t,n){return I(this,null,function*(){const s=`${A.backendUrl.replace(/\/+$/,"")}/api${t}`,o=yield Sr(s,{method:e,headers:{"Content-Type":"application/json",Authorization:`Bearer ${A.token}`},body:n!==void 0?JSON.stringify(n):void 0});return ta(o)})}function ub(A,e,t){return I(this,null,function*(){const n=A.backendUrl.replace(/\/+$/,""),r=new FormData;r.append("file",e,t);const s=yield Sr(`${n}/api/files/upload`,{method:"POST",headers:{Authorization:`Bearer ${A.token}`},body:r});return ta(s)})}function db(A,e){return I(this,null,function*(){return $A(A,"GET",`/projects/by-key/${encodeURIComponent(e)}`)})}const pb=["project","note","ctx"];function hb(A){var t,n;const e=pb.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 na(A,e){return I(this,null,function*(){var h,f,g,m,b,U;hb(e);const{project:t,note:n,ctx:r,advancedOpts:s,titleOverride:o,titleInstruction:a,allowSubmit:i,extraFileIds:c,type:u=Uu}=e;return $A(A,"POST","/tasks",$(k(k(k(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}:{}),(b=s==null?void 0:s.selectedSlashCommandIds)!=null&&b.length?{selectedSlashCommandIds:s.selectedSlashCommandIds}:{}),(U=s==null?void 0:s.selectedRemoteContextProviderIds)!=null&&U.length?{selectedRemoteContextProviderIds:s.selectedRemoteContextProviderIds}:{}),s!=null&&s.instructionTemplateId?{instructionTemplateId:s.instructionTemplateId}:{}),s!=null&&s.templateParamValues?{templateParamValues:s.templateParamValues}:{}),s!=null&&s.defaultParamValues?{defaultParamValues:s.defaultParamValues}:{}),{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 _u(A,e){return I(this,null,function*(){return na(A,$(k({},e),{type:ab}))})}function xu(A,e,t,n,r){return I(this,null,function*(){var s;return $A(A,"POST","/planning-sessions",k(k(k(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}:{}),n!=null&&n.instructionTemplateId?{instructionTemplateId:n.instructionTemplateId}:{}),n!=null&&n.templateParamValues?{templateParamValues:n.templateParamValues}:{}),n!=null&&n.defaultParamValues?{defaultParamValues:n.defaultParamValues}:{}),r!=null&&r.length?{fileIds:r}:{}))})}function fb(A,e){return I(this,null,function*(){const t=e?`?projectId=${encodeURIComponent(e)}`:"";return $A(A,"GET",`/claude-templates${t}`)})}function gb(A,e){return I(this,null,function*(){const t=e?`?projectId=${encodeURIComponent(e)}`:"";return $A(A,"GET",`/instruction-composer/context${t}`)})}function Bb(A,e){return I(this,null,function*(){return $A(A,"POST","/instruction-composer/preview",e)})}function Su(A,e){return I(this,null,function*(){return $A(A,"GET",`/tasks/${e}`)})}function wb(A,e){return I(this,null,function*(){return $A(A,"GET",`/planning-sessions/${e}`)})}function Iu(A){return I(this,null,function*(){return $A(A,"GET","/projects")})}function mb(A){return I(this,null,function*(){return(yield $A(A,"GET","/tenants/current")).membership})}function Tu(A,e){if(!A||A.includes("tenant:*")||A.includes(e))return!0;const t=e.split(":")[0];return A.includes(`${t}:*`)}function ra(A,e,t){return I(this,null,function*(){const r=`${A.backendUrl.replace(/\/+$/,"")}/api/auth/tokens/exchange-code`,s=yield Sr(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,origin:t})});return ta(s)})}function Cb(A,e){return I(this,null,function*(){return $A(A,"GET",`/tasks/${e}/browser-commands/pending`)})}function bb(A,e,t,n,r){return I(this,null,function*(){return $A(A,"POST",`/tasks/${e}/browser-commands/${t}/result`,{status:n,message:r})})}function Qb(A,e){return I(this,null,function*(){return $A(A,"GET",`/tasks/${e}/chunks`)})}function yb(A,e,t){return I(this,null,function*(){return $A(A,"POST",`/tasks/${e}/instructions`,{content:t})})}function Ub(A,e){return I(this,null,function*(){return $A(A,"POST",`/tasks/${e}/cancel`)})}function Eb(A,e){return I(this,null,function*(){return $A(A,"POST",`/tasks/${e}/approve-result`)})}function kb(A,e,t){return I(this,null,function*(){return $A(A,"POST",`/tasks/${e}/reject-result`,{feedback:t})})}function Ys(A,e){return I(this,null,function*(){return $A(A,"GET",`/tasks/${e}/interactions?filter=unanswered`)})}function Hu(A,e,t,n){return I(this,null,function*(){return $A(A,"POST",`/tasks/${e}/interactions/${t}/answer`,{answer:n})})}function Fb(A,e,t){const n=!!(e.backendUrl&&e.token),r=document.createElement("div");r.className="ap-sdk-advanced",r.innerHTML=`
|
|
1717
1626
|
<details class="ap-sdk-advanced__details">
|
|
1718
1627
|
<summary class="ap-sdk-advanced__summary">Advanced options</summary>
|
|
1719
1628
|
<div class="ap-sdk-advanced__body">
|
|
@@ -1732,12 +1641,149 @@ ${n}${r?`
|
|
|
1732
1641
|
</div>
|
|
1733
1642
|
</div>
|
|
1734
1643
|
</details>
|
|
1735
|
-
`,
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
`,document.body.appendChild(et),Mt(et),Go=et.querySelector("[data-ap-recorder-counter]");const n=()=>{vi();const l=pr;it==null||it(),e(l)},r=()=>{it==null||it()};et.querySelector("[data-ap-recorder-stop]").addEventListener("click",n),et.querySelector("[data-ap-recorder-discard]").addEventListener("click",r);const o=l=>{if(Cr(l.target))return;const p=l.target;yi({action:"click",cssSelector:fo(p),elementText:go(p),description:Gb(go(p),p.tagName),capturedAt:new Date().toISOString()})},i=l=>{if(Cr(l.target))return;const p=l.target;if(!(p instanceof HTMLInputElement)&&!(p instanceof HTMLTextAreaElement)&&!(p instanceof HTMLSelectElement))return;const h=hl(p),g=Du(p),m=g?"[redacted]":Qb(p);yi(M(v({action:"inputText",cssSelector:fo(p),elementText:h,value:m},g?{redacted:!0}:{}),{description:fl(h,m,g),capturedAt:new Date().toISOString()}))},a=()=>{const l=Math.round(window.scrollX),p=Math.round(window.scrollY);Bt?(Bt.scrollX=l,Bt.scrollY=p,Bt.description=gl(l,p)):Bt={action:"scroll",scrollX:l,scrollY:p,description:gl(l,p),capturedAt:new Date().toISOString()},Gt&&clearTimeout(Gt),Gt=setTimeout(()=>{Gt=null,vi()},Jb)},d=l=>{if(l.key==="Escape"){r();return}if(Cr(l.target))return;const p=Xb(l);if(!p)return;const h=l.target instanceof Element?l.target:document.body,g=Kb(h);yi({action:"keypress",cssSelector:fo(h),elementText:g,key:p,description:Wb(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}),Gt&&(clearTimeout(Gt),Gt=null),Bt=null,et&&Ut(et),et==null||et.remove(),et=null,Go=null,it=null}}function tk(){it==null||it()}function Wo(){return it!==null}const nk="data-ap-sdk",rk="ap-sdk-fab",kl="ap-sdk-fab--dragging",wi="ap-sdk-fab--open",_l="ap-sdk-fab-pos",Jo="ap-sdk-fab--left-edge",ok='<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>',sk='<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>',ik='<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>',ak='<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 N=null,Wt=null,vn=null,yn=null,gt=null,hr=null,fr=null,gr=null,Yo=null,Wr=null,mr=null,Vo=null,Xo=null,Ko=null,vl=0,yl=0,wl=0,xl=0,br=!1,Et=!1,Jr=null,Un=null;function ck(){Jr=e=>{if(!N){Qo();return}if(!br){if(Math.hypot(e.clientX-wl,e.clientY-xl)<5)return;br=!0,Et=!0,N.classList.add(kl)}lk(e.clientX-vl,e.clientY-yl)},Un=()=>{if(!N){Qo();return}br?(br=!1,N.classList.remove(kl),N.style.transition="",uk(N.getBoundingClientRect())):N.style.transition="",Qo()},window.addEventListener("pointermove",Jr),window.addEventListener("pointerup",Un),window.addEventListener("pointercancel",Un)}function Qo(){Jr&&(window.removeEventListener("pointermove",Jr),Jr=null),Un&&(window.removeEventListener("pointerup",Un),window.removeEventListener("pointercancel",Un),Un=null)}function lk(e,t){if(!N)return;const n=N.offsetWidth||52,r=N.offsetHeight||52;N.style.top=`${Math.max(0,Math.min(t,window.innerHeight-r))}px`,N.style.left=`${Math.max(0,Math.min(e,window.innerWidth-n))}px`,N.style.bottom="auto",N.style.right="auto"}function uk(e){if(!N)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";N.style.top="auto",N.style.bottom=`${n}px`,r==="left"?(N.style.right="auto",N.style.left="16px",N.classList.add(Jo)):(N.style.left="auto",N.style.right="16px",N.classList.remove(Jo));try{localStorage.setItem(_l,JSON.stringify({edge:r,bottom:n}))}catch(o){}}function dk(){if(N)try{const e=localStorage.getItem(_l);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));N.style.top="auto",N.style.bottom=`${r}px`,t.edge==="left"?(N.style.right="auto",N.style.left="16px",N.classList.add(Jo)):(N.style.left="auto",N.style.right="16px",N.classList.remove(Jo))}catch(e){}}function kr(){N==null||N.classList.remove(wi),mr&&(window.removeEventListener("pointerdown",mr,{capture:!0}),mr=null)}function pk(){N&&(N.classList.add(wi),mr=e=>{!N||N.contains(e.target)||kr()},requestAnimationFrame(()=>{mr&&window.addEventListener("pointerdown",mr,{capture:!0})}))}function es(e){return new DOMParser().parseFromString(e,"text/html").body.firstElementChild}function Sl(e,t,n){var d;if(Vo=e,Xo=t,Ko=n,N)return;N=document.createElement("div"),N.className=rk,N.setAttribute(nk,"1"),hr=document.createElement("div"),hr.className="ap-sdk-fab__row";const r=document.createElement("span");r.className="ap-sdk-fab__label",r.textContent="View captures",gt=document.createElement("button"),gt.className="ap-sdk-fab__list ap-sdk-fab__sub",gt.setAttribute("aria-label","My captures"),gt.setAttribute("title","View my captures"),gt.appendChild(es(ak));const o=document.createElement("span");o.className="ap-sdk-fab__badge",o.setAttribute("data-ap-badge",""),o.style.display="none",gt.appendChild(o),hr.appendChild(r),hr.appendChild(gt),fr=document.createElement("div"),fr.className="ap-sdk-fab__row";const i=document.createElement("span");i.className="ap-sdk-fab__label",i.textContent="Capture element",vn=document.createElement("button"),vn.className="ap-sdk-fab__capture ap-sdk-fab__sub",vn.setAttribute("aria-label","Capture element"),vn.setAttribute("title","Capture element to Agent Platform"),vn.appendChild(es(sk)),fr.appendChild(i),fr.appendChild(vn),gr=document.createElement("div"),gr.className="ap-sdk-fab__row";const a=document.createElement("span");a.className="ap-sdk-fab__label",a.textContent="Record interaction",yn=document.createElement("button"),yn.className="ap-sdk-fab__record ap-sdk-fab__sub",yn.setAttribute("aria-label","Record interaction"),yn.setAttribute("title","Record a sequence of interactions"),yn.appendChild(es(ik)),gr.appendChild(a),gr.appendChild(yn),Wt=document.createElement("button"),Wt.className="ap-sdk-fab__main",Wt.setAttribute("aria-label","Agent Platform"),Wt.setAttribute("title","Agent Platform"),Wt.appendChild(es(ok)),N.appendChild(hr),N.appendChild(fr),N.appendChild(gr),N.appendChild(Wt),Wt.addEventListener("click",l=>{if(Et){Et=!1;return}l.preventDefault(),l.stopPropagation(),N!=null&&N.classList.contains(wi)?kr():pk()}),vn.addEventListener("click",l=>{if(Et){Et=!1;return}l.preventDefault(),l.stopPropagation(),kr(),!Kn()&&!Wo()&&Vo&&Vo()}),yn.addEventListener("click",l=>{if(Et){Et=!1;return}l.preventDefault(),l.stopPropagation(),kr(),!Kn()&&!Wo()&&Xo&&Xo()}),gt.addEventListener("click",l=>{if(Et){Et=!1;return}l.preventDefault(),l.stopPropagation(),kr(),Ko&&Ko()}),Wr=l=>{if(!N||!(N===l.target||N.contains(l.target)))return;const p=N.getBoundingClientRect();vl=l.clientX-p.left,yl=l.clientY-p.top,wl=l.clientX,xl=l.clientY,br=!1,Et=!1,N.style.transition="none",l.stopPropagation(),ck()},window.addEventListener("pointerdown",Wr,{capture:!0}),((d=document.body)!=null?d:document.documentElement).appendChild(N),Mt(N),dk(),Yo=setInterval(()=>{Wt&&Wt.classList.toggle("ap-sdk-fab__main--active",Kn()||Wo())},200)}function jn(e){const t=gt==null?void 0:gt.querySelector("[data-ap-badge]");t&&(e>0?(t.textContent=String(e),t.style.display=""):t.style.display="none")}function Tl(){br=!1,Et=!1,Qo(),kr(),Yo&&(clearInterval(Yo),Yo=null),Wr&&(window.removeEventListener("pointerdown",Wr,{capture:!0}),Wr=null),N&&Ut(N),N==null||N.remove(),N=null,Wt=null,vn=null,yn=null,gt=null,hr=null,fr=null,gr=null,Vo=null,Xo=null,Ko=null}function El(e,t){return z(this,null,function*(){try{if(e.type==="planning"){const r=yield Dg(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 Al(e){return e.filter(t=>!t.approved).length}function Cl(e){return z(this,null,function*(){const t=dr();if(!e||t.length===0){jn(t.length);return}const n=yield Promise.all(t.map(r=>El(r,e)));jn(Al(n))})}let wn=null;function hk(){const e=new Uint32Array(4);return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16)).join("")}function xi(e){if(wn){const d=wn;d.cleanup(),d.popup.closed||d.popup.close(),wn=null}const t=e.replace(/\/+$/,""),n=new URL(t).origin,r=hk(),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),(wn==null?void 0:wn.popup)===a&&(wn=null)}function g(k){if(k.origin!==n)return;const y=k.data;!y||y.type!=="ap-sdk-oauth"||y.state!==r||!y.code||(p=!0,h(),d({code:y.code}))}window.addEventListener("message",g);const m=window.setInterval(()=>{a.closed&&(h(),p||l(new Error("Connection cancelled.")))},500);wn={popup:a,cleanup:h}}):Promise.reject(new Error("Popup blocked — please allow popups for this site and try again."))}const fk="https://agent-platform.tung.engineering",Si="ap-sdk-config";function gk(){try{const e=sessionStorage.getItem(Si);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()?(Pl(),null):t}catch(e){return null}}function ts(e){sessionStorage.setItem(Si,JSON.stringify(e)),bk({backendUrl:e.backendUrl,projectCode:e.projectCode})}function Pl(){sessionStorage.removeItem(Si)}const Rl="ap-sdk-last-connection";function mk(){try{const e=localStorage.getItem(Rl);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 bk(e){try{localStorage.setItem(Rl,JSON.stringify(e))}catch(t){}}let Q=null,Yr=null;function on(){Q&&Ut(Q),Q==null||Q.remove(),Q=null,Yr==null||Yr(),Yr=null}function Ti(e){Q&&on(),Q=document.createElement("div"),Q.className="ap-sdk-panel",Q.setAttribute("data-ap-sdk","1"),Q.setAttribute("role","dialog"),Q.setAttribute("aria-modal","true"),Q.setAttribute("aria-label","Connect to Agent Platform");const t=mk();t?n(t):r(fk),document.body.appendChild(Q),Mt(Q),Yr=$r(Q,Ir);function n(i){if(!Q)return;Q.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};fb(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="${vb(m.id)}">${_b(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,b,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}:{}),(b=u.selectedPluginSkillIds)!=null&&b.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 vb(A){return A.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function _b(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const xb=400;function Sb(A,e,t){if(!!!(e.backendUrl&&e.token))return{getSelection:()=>({})};const r={backendUrl:e.backendUrl,token:e.token},s=document.createElement("div");s.className="ap-sdk-instruction-composer ap-sdk-instruction-composer--before",s.innerHTML=`
|
|
1645
|
+
<div class="ap-sdk-panel__field" data-ap-instruction-template-field>
|
|
1646
|
+
<label class="ap-sdk-panel__label" for="ap-sdk-instruction-template">Instruction Template</label>
|
|
1647
|
+
<select id="ap-sdk-instruction-template" class="ap-sdk-panel__input" data-ap-instruction-template>
|
|
1648
|
+
<option value="">Loading…</option>
|
|
1649
|
+
</select>
|
|
1650
|
+
</div>
|
|
1651
|
+
<div class="ap-sdk-panel__field" data-ap-template-params></div>
|
|
1652
|
+
<div class="ap-sdk-panel__field" data-ap-default-params></div>
|
|
1653
|
+
`;const o=document.createElement("div");o.className="ap-sdk-instruction-composer ap-sdk-instruction-composer--after",o.innerHTML=`
|
|
1654
|
+
<div class="ap-sdk-panel__field ap-sdk-instruction-preview" data-ap-instruction-preview style="display:none"></div>
|
|
1655
|
+
`;const a=A.parentElement;a.insertBefore(s,A),a.insertBefore(o,A.nextSibling);const i=s.querySelector("[data-ap-instruction-template-field]"),c=s.querySelector("[data-ap-instruction-template]"),u=s.querySelector("[data-ap-template-params]"),h=s.querySelector("[data-ap-default-params]"),f=o.querySelector("[data-ap-instruction-preview]");let g=[],m=[],b=null;const U=y=>y==="GLOBAL"?"Global":y==="PROJECT"?"This project":"My templates",E=()=>g.find(y=>y.id===c.value),v=()=>{b&&clearTimeout(b),b=setTimeout(()=>{const y=c.value||void 0;Bb(r,{projectId:t!=null?t:void 0,instructionTemplateId:y,templateParamValues:y?qs(u):void 0,defaultParamValues:m.length>0?qs(h):void 0,rawText:y?void 0:A.value}).then(_=>{var R;f.style.display="block",f.innerHTML=`
|
|
1656
|
+
<div class="ap-sdk-panel__label">Preview</div>
|
|
1657
|
+
<div class="ap-sdk-instruction-preview__text">${at(_.renderedText)}</div>
|
|
1658
|
+
${(R=_.warnings)!=null&&R.length?`<div class="ap-sdk-instruction-preview__warnings">${_.warnings.map(H=>at(H)).join("<br/>")}</div>`:""}
|
|
1659
|
+
`}).catch(()=>{f.style.display="none",f.innerHTML=""})},xb)},F=()=>{const y=E();u.innerHTML="",y?(Lu(u,y.parameterSchema,v),A.style.display="none"):A.style.display="",v()};return c.addEventListener("change",F),A.addEventListener("input",v),gb(r,t!=null?t:void 0).then(y=>{g=y.templates,m=y.defaultFields,c.innerHTML='<option value="">No template (free text)</option>'+g.map(_=>`<option value="${Ke(_.id)}">${at(_.name)} (${at(U(_.scope))})</option>`).join(""),m.length>0?Lu(h,m,v):h.style.display="none"}).catch(()=>{i.style.display="none",h.style.display="none"}),{getSelection(){const y=c.value||void 0;return{instructionTemplateId:y,templateParamValues:y?qs(u):void 0,defaultParamValues:m.length>0?qs(h):void 0}}}}function Lu(A,e,t){A.innerHTML=e.map(n=>{var a,i;const r=`<label class="ap-sdk-panel__label">${at(n.label)}${n.required?" *":""}</label>`,s=n.helpText?`<span class="ap-sdk-advanced__hint">${at(n.helpText)}</span>`:"";let o;switch(n.type){case"textarea":o=`<textarea class="ap-sdk-panel__textarea" rows="2" data-ap-field-key="${Ke(n.key)}" data-ap-field-type="textarea">${at(typeof n.defaultValue=="string"?n.defaultValue:"")}</textarea>`;break;case"number":o=`<input type="number" class="ap-sdk-panel__input" data-ap-field-key="${Ke(n.key)}" data-ap-field-type="number" value="${Ke(n.defaultValue!=null?String(n.defaultValue):"")}" />`;break;case"boolean":o=`<label class="ap-sdk-advanced__checkbox-label"><input type="checkbox" data-ap-field-key="${Ke(n.key)}" data-ap-field-type="boolean" ${n.defaultValue?"checked":""} /> ${at(n.label)}</label>`;break;case"select":o=`<select class="ap-sdk-panel__input" data-ap-field-key="${Ke(n.key)}" data-ap-field-type="select">${((a=n.options)!=null?a:[]).map(c=>`<option value="${Ke(c.value)}" ${n.defaultValue===c.value?"selected":""}>${at(c.label)}</option>`).join("")}</select>`;break;case"multiselect":{const c=Array.isArray(n.defaultValue)?n.defaultValue:[];o=`<select multiple class="ap-sdk-panel__input" data-ap-field-key="${Ke(n.key)}" data-ap-field-type="multiselect">${((i=n.options)!=null?i:[]).map(u=>`<option value="${Ke(u.value)}" ${c.includes(u.value)?"selected":""}>${at(u.label)}</option>`).join("")}</select>`;break}case"text":default:o=`<input type="text" class="ap-sdk-panel__input" data-ap-field-key="${Ke(n.key)}" data-ap-field-type="text" value="${Ke(typeof n.defaultValue=="string"?n.defaultValue:"")}" />`;break}return n.type==="boolean"?`<div class="ap-sdk-panel__field">${o}${s}</div>`:`<div class="ap-sdk-panel__field">${r}${o}${s}</div>`}).join(""),A.querySelectorAll("[data-ap-field-key]").forEach(n=>{n.addEventListener("change",t),(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&n.addEventListener("input",t)})}function qs(A){const e={};return A.querySelectorAll("[data-ap-field-key]").forEach(t=>{const n=t.getAttribute("data-ap-field-key"),r=t.getAttribute("data-ap-field-type");r==="boolean"?e[n]=t.checked:r==="multiselect"?e[n]=Array.from(t.selectedOptions).map(s=>s.value):r==="number"?e[n]=Number(t.value):e[n]=t.value}),e}function Ke(A){return A.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function at(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const sa="shared",Du="ap-sdk-panel-size:",Ru=280,Ou=200;function Ib(A){try{const e=sessionStorage.getItem(Du+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 Tb(A,e){try{sessionStorage.setItem(Du+A,JSON.stringify(e))}catch(t){}}function Ao(A,e,t){return Math.min(Math.max(A,e),t)}function Pu(){return window.innerWidth-32}function Mu(){return window.innerHeight-64}function oa(A,e){const t=Ib(e);t&&(A.style.width=`${Ao(t.width,Ru,Pu())}px`,A.style.height=`${Ao(t.height,Ou,Mu())}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=Ao(a+(m.clientX-s),Ru,Pu()),u=Ao(i+(m.clientY-o),Ou,Mu()),A.style.width=`${c}px`,A.style.height=`${u}px`)},f=()=>{r&&(r=!1,document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",f),Tb(e,{width:c,height:u}))},g=m=>{const b=m.target;if(!(b===n||n.contains(b)))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 Ir="shared",Ku="ap-sdk-panel-pos:";function Hb(A){try{const e=sessionStorage.getItem(Ku+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 Lb(A,e){try{sessionStorage.setItem(Ku+A,JSON.stringify(e))}catch(t){}}function Nu(A,e,t){return Math.min(Math.max(A,e),t)}function Tr(A,e){const t=(m,b)=>{const U=Math.max(0,window.innerWidth-A.offsetWidth),E=Math.max(0,window.innerHeight-A.offsetHeight);A.style.left=`${Nu(m,0,U)}px`,A.style.top=`${Nu(b,0,E)}px`,A.style.right="auto",A.style.transform="none"},n=Hb(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),Lb(e,{left:c,top:u}))},g=m=>{const b=m.target;if(!(b===A||A.contains(b))||!b.closest(".ap-sdk-panel__header")||b.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 eo="ap-sdk-panel-draft";function $u(){var A,e;try{const t=localStorage.getItem(eo);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 Db(A){try{if(!A.note&&A.completedPicks.length===0&&!A.allowSubmit){localStorage.removeItem(eo);return}localStorage.setItem(eo,JSON.stringify(A))}catch(e){}}function ia(){try{localStorage.removeItem(eo)}catch(A){}}/*!
|
|
1660
|
+
* html2canvas-pro 2.4.3 <https://yorickshan.github.io/html2canvas-pro/>
|
|
1661
|
+
* Copyright (c) 2024-present yorickshan and html2canvas-pro contributors
|
|
1662
|
+
* Released under MIT License
|
|
1663
|
+
*/var Rb=class rl{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 rl(k({window:r},t))}clone(e={}){var t,n;return new rl({window:e.window||this.window,cspNonce:(t=e.cspNonce)!=null?t:this.cspNonce,cache:(n=e.cache)!=null?n:this.cache})}},Ob=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 Pb(A={}){return new Ob(k({allowDataUrls:!0,maxImageTimeout:3e5},A))}var Mb=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 I(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(`
|
|
1664
|
+
📊 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())}},Fe=(je=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 je(this.left+e,this.top+t,this.width+n,this.height+r)}static fromClientRect(e,t){return new je(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 je(r.left+e.windowBounds.left,r.top+e.windowBounds.top,r.width,r.height):je.EMPTY}},je.EMPTY=new je(0,0,0,0),je);const Hr=(A,e)=>Fe.fromClientRect(A,e.getBoundingClientRect()),Kb=A=>{const e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");return new Fe(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)))};for(var to=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},HA=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},zu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nb=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),no=0;no<zu.length;no++)Nb[zu.charCodeAt(no)]=no;for(var Vu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Lr=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),ro=0;ro<Vu.length;ro++)Lr[Vu.charCodeAt(ro)]=ro;for(var $b=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=Lr[A.charCodeAt(n)],o=Lr[A.charCodeAt(n+1)],a=Lr[A.charCodeAt(n+2)],i=Lr[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},zb=function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t},Vb=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},sn=5,aa=11,ca=2,Gb=aa-sn,Gu=65536>>sn,la=(1<<sn)-1,Zb=Gu+(1024>>sn)+32,Xb=65536>>aa,Wb=(1<<Gb)-1,Zu=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},Jb=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},jb=function(A,e){var t=$b(A),n=Array.isArray(t)?Vb(t):new Uint32Array(t),r=Array.isArray(t)?zb(t):new Uint16Array(t),s=24,o=Zu(r,s/2,n[4]/2),a=n[5]===2?Zu(r,(s+n[4])/2):Jb(n,Math.ceil((s+n[4])/4));return new Yb(n[0],n[1],n[2],n[3],o,a)},Yb=(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>>sn],t=(t<<ca)+(e&la),this.data[t];if(e<=65535)return t=this.index[Gu+(e-55296>>sn)],t=(t<<ca)+(e&la),this.data[t];if(e<this.highStart)return t=Zb-Xb+(e>>aa),t=this.index[t],t+=e>>sn&Wb,t=this.index[t],t=(t<<ca)+(e&la),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A})(),Xu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qb=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),so=0;so<Xu.length;so++)qb[Xu.charCodeAt(so)]=so;var AQ="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==",Wu=50,eQ=1,Ju=2,ju=3,tQ=4,nQ=5,Yu=7,qu=8,Ad=9,Pt=10,ua=11,ed=12,da=13,rQ=14,Dr=15,pa=16,oo=17,Rr=18,sQ=19,td=20,ha=21,Or=22,fa=23,Gn=24,Qe=25,Pr=26,Mr=27,Zn=28,oQ=29,on=30,iQ=31,io=32,ao=33,ga=34,Ba=35,wa=36,Kr=37,ma=38,co=39,lo=40,Ca=41,nd=42,aQ=43,cQ=[9001,65288],rd="!",nA="×",uo="÷",ba=jb(AQ),bt=[on,wa],Qa=[eQ,Ju,ju,nQ],sd=[Pt,qu],od=[Mr,Pr],lQ=Qa.concat(sd),id=[ma,co,lo,ga,Ba],uQ=[Dr,da],dQ=function(A,e){e===void 0&&(e="strict");var t=[],n=[],r=[];return A.forEach(function(s,o){var a=ba.get(s);if(a>Wu?(r.push(!0),a-=Wu):r.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return n.push(o),t.push(pa);if(a===tQ||a===ua){if(o===0)return n.push(o),t.push(on);var i=t[o-1];return lQ.indexOf(i)===-1?(n.push(n[o-1]),t.push(i)):(n.push(o),t.push(on))}if(n.push(o),a===iQ)return t.push(e==="strict"?ha:Kr);if(a===nd||a===oQ)return t.push(on);if(a===aQ)return s>=131072&&s<=196605||s>=196608&&s<=262141?t.push(Kr):t.push(on);t.push(a)}),[n,t,r]},ya=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},ad=function(A,e){for(var t=A;t>=0;){var n=e[t];if(n===Pt)t--;else return n}return 0},pQ=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===Ju&&u===ju)return nA;if(Qa.indexOf(i)!==-1)return rd;if(Qa.indexOf(u)!==-1||sd.indexOf(u)!==-1)return nA;if(ad(s,e)===qu)return uo;if(ba.get(A[s])===ua||(i===io||i===ao)&&ba.get(A[a])===ua||i===Yu||u===Yu||i===Ad||[Pt,da,Dr].indexOf(i)===-1&&u===Ad||[oo,Rr,sQ,Gn,Zn].indexOf(u)!==-1||ad(s,e)===Or||ya(fa,Or,s,e)||ya([oo,Rr],ha,s,e)||ya(ed,ed,s,e))return nA;if(i===Pt)return uo;if(i===fa||u===fa)return nA;if(u===pa||i===pa)return uo;if([da,Dr,ha].indexOf(u)!==-1||i===rQ||c===wa&&uQ.indexOf(i)!==-1||i===Zn&&u===wa||u===td||bt.indexOf(u)!==-1&&i===Qe||bt.indexOf(i)!==-1&&u===Qe||i===Mr&&[Kr,io,ao].indexOf(u)!==-1||[Kr,io,ao].indexOf(i)!==-1&&u===Pr||bt.indexOf(i)!==-1&&od.indexOf(u)!==-1||od.indexOf(i)!==-1&&bt.indexOf(u)!==-1||[Mr,Pr].indexOf(i)!==-1&&(u===Qe||[Or,Dr].indexOf(u)!==-1&&e[a+1]===Qe)||[Or,Dr].indexOf(i)!==-1&&u===Qe||i===Qe&&[Qe,Zn,Gn].indexOf(u)!==-1)return nA;if([Qe,Zn,Gn,oo,Rr].indexOf(u)!==-1)for(var h=s;h>=0;){var f=e[h];if(f===Qe)return nA;if([Zn,Gn].indexOf(f)!==-1)h--;else break}if([Mr,Pr].indexOf(u)!==-1)for(var h=[oo,Rr].indexOf(i)!==-1?o:s;h>=0;){var f=e[h];if(f===Qe)return nA;if([Zn,Gn].indexOf(f)!==-1)h--;else break}if(ma===i&&[ma,co,ga,Ba].indexOf(u)!==-1||[co,ga].indexOf(i)!==-1&&[co,lo].indexOf(u)!==-1||[lo,Ba].indexOf(i)!==-1&&u===lo||id.indexOf(i)!==-1&&[td,Pr].indexOf(u)!==-1||id.indexOf(u)!==-1&&i===Mr||bt.indexOf(i)!==-1&&bt.indexOf(u)!==-1||i===Gn&&bt.indexOf(u)!==-1||bt.concat(Qe).indexOf(i)!==-1&&u===Or&&cQ.indexOf(A[a])===-1||bt.concat(Qe).indexOf(u)!==-1&&i===Rr)return nA;if(i===Ca&&u===Ca){for(var g=t[s],m=1;g>0&&(g--,e[g]===Ca);)m++;if(m%2!==0)return nA}return i===io&&u===ao?nA:uo},hQ=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=dQ(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[Qe,on,nd].indexOf(a)!==-1?Kr: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]},fQ=(function(){function A(e,t,n,r){this.codePoints=e,this.required=t===rd,this.start=n,this.end=r}return A.prototype.slice=function(){return HA.apply(void 0,this.codePoints.slice(this.start,this.end))},A})(),gQ=function(A,e){var t=to(A),n=hQ(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=pQ(t,s,r,++c,o))===nA;);if(u!==nA||c===a){var h=new fQ(t,u,i,c);return i=c,{value:h,done:!1}}return{done:!0,value:null}}}};const cd=65533,ne=A=>A>=48&&A<=57,BQ=A=>A>=55296&&A<=57343,Xn=A=>ne(A)||A>=65&&A<=70||A>=97&&A<=102,wQ=A=>A>=97&&A<=122,mQ=A=>A>=65&&A<=90,CQ=A=>wQ(A)||mQ(A),bQ=A=>A>=128,po=A=>A===10||A===9||A===32,ho=A=>CQ(A)||bQ(A)||A===95,ld=A=>ho(A)||ne(A)||A===45,QQ=A=>A>=0&&A<=8||A===11||A>=14&&A<=31||A===127,Mt=(A,e)=>A!==92?!1:e!==10,fo=(A,e,t)=>A===45?ho(e)||Mt(e,t):ho(A)?!0:!!(A===92&&Mt(A,e)),Ua=(A,e,t)=>A===43||A===45?ne(e)?!0:e===46&&ne(t):ne(A===46?e:A),yQ=A=>{let e=0,t=1;(A[e]===43||A[e]===45)&&(A[e]===45&&(t=-1),e++);const n=[];for(;ne(A[e]);)n.push(A[e++]);const r=n.length?parseInt(HA(...n),10):0;A[e]===46&&e++;const s=[];for(;ne(A[e]);)s.push(A[e++]);const o=s.length,a=o?parseInt(HA(...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(;ne(A[e]);)c.push(A[e++]);const u=c.length?parseInt(HA(...c),10):0;return t*(r+a*Math.pow(10,-o))*Math.pow(10,i*u)},UQ={type:2},EQ={type:3},kQ={type:4},FQ={type:13},vQ={type:8},_Q={type:21},xQ={type:9},SQ={type:10},IQ={type:11},TQ={type:12},HQ={type:14},go={type:23},LQ={type:1},DQ={type:25},RQ={type:24},OQ={type:26},PQ={type:27},MQ={type:28},KQ={type:29},NQ={type:31},Ea={type:32};var ka=(Le=class{static get(){return Le._pool.pop()||new Le}static release(e){Le._pool.length<Le.MAX_POOL_SIZE&&(e._reset(),Le._pool.push(e))}constructor(){this._value=[]}_reset(){this._value=[]}write(e){this._value=this._value.concat(to(e))}read(){const e=[];let t=this.consumeToken();for(;t!==Ea;)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(ld(t)||Mt(n,r)){const s=fo(t,n,r)?2:1;return{type:5,value:this.consumeName(),flags:s}}break}case 36:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),FQ;break;case 39:return this.consumeStringToken(39);case 40:return UQ;case 41:return EQ;case 42:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),HQ;break;case 43:if(Ua(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return kQ;case 45:{const t=e,n=this.peekCodePoint(0),r=this.peekCodePoint(1);if(Ua(t,n,r))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(fo(t,n,r))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(n===45&&r===62)return this.consumeCodePoint(),this.consumeCodePoint(),RQ;break}case 46:if(Ua(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 OQ;case 59:return PQ;case 60:if(this.peekCodePoint(0)===33&&this.peekCodePoint(1)===45&&this.peekCodePoint(2)===45)return this.consumeCodePoint(),this.consumeCodePoint(),DQ;break;case 64:if(fo(this.peekCodePoint(0),this.peekCodePoint(1),this.peekCodePoint(2)))return{type:7,value:this.consumeName()};break;case 91:return MQ;case 92:if(Mt(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return KQ;case 61:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),vQ;break;case 123:return IQ;case 125:return TQ;case 117:case 85:{const t=this.peekCodePoint(0),n=this.peekCodePoint(1);return t===43&&(Xn(n)||n===63)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken()}case 124:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),xQ;if(this.peekCodePoint(0)===124)return this.consumeCodePoint(),_Q;break;case 126:if(this.peekCodePoint(0)===61)return this.consumeCodePoint(),SQ;break;case-1:return Ea}return po(e)?(this.consumeWhiteSpace(),NQ):ne(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):ho(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:HA(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(;Xn(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(HA(...e.map(s=>s===63?48:s)),16),end:parseInt(HA(...e.map(s=>s===63?70:s)),16)};const r=parseInt(HA(...e),16);if(this.peekCodePoint(0)===45&&Xn(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();const s=[];for(;Xn(t)&&s.length<6;)s.push(t),t=this.consumeCodePoint();return{type:30,start:r,end:parseInt(HA(...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(),go)}for(;;){const n=this.consumeCodePoint();if(n===-1||n===41)return{type:22,value:HA(...e)};if(po(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===-1||this.peekCodePoint(0)===41?(this.consumeCodePoint(),{type:22,value:HA(...e)}):(this.consumeBadUrlRemnants(),go);if(n===34||n===39||n===40||QQ(n))return this.consumeBadUrlRemnants(),go;if(n===92)if(Mt(n,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),go;else e.push(n)}}consumeWhiteSpace(){for(;po(this.peekCodePoint(0));)this.consumeCodePoint()}consumeBadUrlRemnants(){for(;;){const e=this.consumeCodePoint();if(e===41||e===-1)return;Mt(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}}consumeStringSlice(e){let n="";for(;e>0;){const r=Math.min(5e4,e);n+=HA(...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),LQ;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()):Mt(r,s)&&(t+=this.consumeStringSlice(n),t+=HA(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());ne(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);let r=this.peekCodePoint(1);if(n===46&&ne(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;ne(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)&&ne(s)||ne(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;ne(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[yQ(e),t]}consumeNumericToken(){const[e,t]=this.consumeNumber(),n=this.peekCodePoint(0);return fo(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(Xn(e)){let t=HA(e);for(;Xn(this.peekCodePoint(0))&&t.length<6;)t+=HA(this.consumeCodePoint());po(this.peekCodePoint(0))&&this.consumeCodePoint();const n=parseInt(t,16);return n===0||BQ(n)||n>1114111?cd:n}return e===-1?cd:e}consumeName(){let e="";for(;;){const t=this.consumeCodePoint();if(ld(t))e+=HA(t);else if(Mt(t,this.peekCodePoint(0)))e+=HA(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}}},Le._pool=[],Le.MAX_POOL_SIZE=40,Le),ud=class Di{constructor(e){this._tokens=e}static create(e){const t=new ka;return t.write(e),new Di(t.read())}static parseValue(e){return Di.create(e).parseComponentValue()}static parseValues(e){return Di.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||zQ(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"?Ea:e}reconsumeToken(e){this._tokens.unshift(e)}};const ct=A=>A.type===15,zA=A=>A.type===17,j=A=>A.type===20,$Q=A=>A.type===0,Nr=(A,e)=>j(A)&&A.value===e,$r=A=>A.type!==31,VA=A=>A.type!==31&&A.type!==4,Ne=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},zQ=(A,e)=>e===11&&A.type===12||e===28&&A.type===29?!0:e===2&&A.type===3,VQ=/(\d+(?:\.\d+)?|[+\-*/()])/g,dd=A=>{const e=A.match(VQ);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},xA=(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]],Kt=A=>ge([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],A),Fa=A=>ge([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],A),an=A=>A.map(e=>{const t=e<0?-1:1,n=Math.abs(e);return n>.0031308?t*(1.055*ye(n,1/2.4)-.055):12.92*e}),va=A=>A.map(e=>{const t=e<0?-1:1,n=Math.abs(e);return n<=.04045?e/12.92:t*ye((n+.055)/1.055,2.4)}),GQ=A=>{const[e,t,n]=an(Kt([A[0],A[1],A[2]]));return[e,t,n,A[3]]},ZQ=A=>{const[e,t,n]=Kt([A[0],A[1],A[2]]);return[xA(Math.round(e*255),0,255),xA(Math.round(t*255),0,255),xA(Math.round(n*255),0,255),A[3]]},Nt=A=>A.type===17||A.type===15,aA=A=>A.type===16||Nt(A)||pd(A),pd=A=>A.type===17&&A._calcPercentage!==void 0,XQ=A=>A.type===18&&A.name==="calc",WQ=A=>{const e=fd(A,0);if(!e)return null;const t=fd(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}},hd=A=>XQ(A)?WQ(A):aA(A)?A:null,fd=(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=dd(n);if(typeof r=="number"&&!isNaN(r))return{type:17,number:r,flags:4}}catch(n){return null}return null},gd=A=>A.length>1?[A[0],A[1]]:[A[0]],LA={type:17,number:0,flags:4},Qt={type:16,number:50,flags:4},$e={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(pd(A))return A._calcPercentage/100*e+A._calcPixelOffset;if(A.type===16)return A.number/100*e;if(ct(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Bd="deg",wd="grad",md="rad",Cd="turn",Wn={name:"angle",parse:(A,e)=>{if(e.type===15)switch(e.unit){case Bd:return Math.PI*e.number/180;case wd:return Math.PI/200*e.number;case md:return e.number;case Cd:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},bd=A=>A.type===15&&(A.unit===Bd||A.unit===wd||A.unit===md||A.unit===Cd),Qd=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[LA,LA];case"to top":case"bottom":return ve(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[LA,$e];case"to right":case"left":return ve(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[$e,$e];case"to bottom":case"top":return ve(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[$e,LA];case"to left":case"right":return ve(270)}return 0},ve=A=>Math.PI*A/180,yt=A=>(255&A)===0,EA=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})`},ze=(A,e,t,n)=>(A<<24|e<<16|t<<8|Math.round(n*255)<<0)>>>0,$t=(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},cn=A=>(A[0].type===20?A[0].value:"unknown")==="from",JQ=A=>ze(xA(Math.round(A[0]*255),0,255),xA(Math.round(A[1]*255),0,255),xA(Math.round(A[2]*255),0,255),xA(A[3],0,1)),_a=([A,e,t,n])=>{const r=an([A,e,t]);return ze(xA(Math.round(r[0]*255),0,255),xA(Math.round(r[1]*255),0,255),xA(Math.round(r[2]*255),0,255),n)},Vr=A=>{const e=Kt([A[0],A[1],A[2]]);return _a([e[0],e[1],e[2],A[3]])},jQ=(A,e)=>{if(cn(e.filter(VA)))throw new Error("Relative color not supported for lab()");const[t,n,r,s]=Bo(e),o=an(Kt(Co([t,n,r])));return ze(xA(Math.round(o[0]*255),0,255),xA(Math.round(o[1]*255),0,255),xA(Math.round(o[2]*255),0,255),s)},YQ=(A,e)=>{if(cn(e.filter(VA)))throw new Error("Relative color not supported for oklab()");const[t,n,r,s]=Bo(e),o=an(Kt(mo([t,n,r])));return ze(xA(Math.round(o[0]*255),0,255),xA(Math.round(o[1]*255),0,255),xA(Math.round(o[2]*255),0,255),s)},qQ=(A,e)=>{if(cn(e.filter(VA)))throw new Error("Relative color not supported for oklch()");const[t,n,r,s]=kd(e),o=an(Kt(mo(wo([t,n,r]))));return ze(xA(Math.round(o[0]*255),0,255),xA(Math.round(o[1]*255),0,255),xA(Math.round(o[2]*255),0,255),s)},Ay=(A,e)=>{if(cn(e.filter(VA)))throw new Error("Relative color not supported for lch()");const[t,n,r,s]=Ed(e),o=an(Kt(Co(wo([t,n,r]))));return ze(xA(Math.round(o[0]*255),0,255),xA(Math.round(o[1]*255),0,255),xA(Math.round(o[2]*255),0,255),s)},yd=(A,e)=>{const[t,n,r,s]=e.filter(VA);return[(t.type===17?ve(t.number):Wn.parse(A,t))/(Math.PI*2),aA(n)?n.number/100:0,aA(r)?r.number/100:0,typeof s!="undefined"&&aA(s)?J(s,1):1]},Ud=(A,e)=>{if(cn(e))throw new Error("Relative color not supported for hsl()");const[t,n,r,s]=yd(A,e),o=vd([t,n,r]);return ze(o[0]*255,o[1]*255,o[2]*255,n===0?1:s)},Ed=A=>{const e=A.filter(VA);return[aA(e[0])?e[0].number:0,aA(e[1])?e[1].number:0,zA(e[2])||ct(e[2])?e[2].number:0,typeof e[4]!="undefined"&&aA(e[4])?J(e[4],1):1]},Bo=A=>{const e=A.filter(VA);return[e[0].type===16?e[0].number/100:zA(e[0])?e[0].number:0,e[1].type===16?e[1].number/100:zA(e[1])?e[1].number:0,zA(e[2])||ct(e[2])?e[2].number:0,typeof e[4]!="undefined"&&aA(e[4])?J(e[4],1):1]},kd=A=>{const e=A.filter(VA);return[e[0].type===16?e[0].number/100:zA(e[0])?e[0].number:0,e[1].type===16?e[1].number/100:zA(e[1])?e[1].number:0,zA(e[2])||ct(e[2])?e[2].number:0,typeof e[4]!="undefined"&&aA(e[4])?J(e[4],1):1]},Fd=A=>ge([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],A),xa=A=>ge([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],A),Sa=(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),vd=([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[Sa(r,n,A+1/3),Sa(r,n,A),Sa(r,n,A-1/3)]},wo=([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)]),mo=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=>ye(e,3))),Co=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?ye(t,3):(116*t-16)/r)*.3457/.3585,A[0]>8?ye(e,3):A[0]/r,(n>s?ye(n,3):(116*n-16)/r)*.2958/.3585];return xa([o[0],o[1],o[2]])},ey=(A,e)=>{const t=e.filter(VA);if(t.length===3){const[n,r,s]=t.map($t),o=va([n/255,r/255,s/255]),[a,i,c]=Fa([o[0],o[1],o[2]]);return[a,i,c,1]}if(t.length===4){const[n,r,s,o]=t.map($t),a=va([n/255,r/255,s/255]),[i,c,u]=Fa([a[0],a[1],a[2]]);return[i,c,u,o]}return[0,0,0,1]},ty=(A,e)=>{const[t,n,r,s]=yd(A,e),o=va(vd([t,n,r])),[a,i,c]=Fa([o[0],o[1],o[2]]);return[a,i,c,s]},ny=(A,e)=>{const[t,n,r,s]=Bo(e),[o,a,i]=Co([t,n,r]);return[o,a,i,s]},ry=(A,e)=>{const[t,n,r,s]=Ed(e),[o,a,i]=Co(wo([t,n,r]));return[o,a,i,s]},sy=(A,e)=>{const[t,n,r,s]=kd(e),[o,a,i]=mo(wo([t,n,r]));return[o,a,i,s]},oy=(A,e)=>{const[t,n,r,s]=Bo(e),[o,a,i]=mo([t,n,r]);return[o,a,i,s]},iy=A=>xa([A[0],A[1],A[2]]),_d=A=>A,ay=A=>{const[e,t,n]=Fd([A[0],A[2],A[3]]);return[e,t,n,A[3]]},xd=A=>Vr([A[0],A[1],A[2],A[3]]),cy=A=>{const e=iy([A[0],A[1],A[2]]);return Vr([e[0],e[1],e[2],A[3]])},ly=A=>ge([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],A),uy=A=>ge([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],A),dy=A=>A.map(e=>{const t=e<0?-1:1;return e*t<=.04045?e/12.92:t*ye((e+.055)/1.055,2.4)||0}),py=A=>an(A),hy=A=>{const e=dy([A[0],A[1],A[2]]);return ly([e[0],e[1],e[2]])},fy=A=>{const[e,t,n]=py(uy([A[0],A[1],A[2]]));return[e,t,n,A[3]]},gy=A=>{const e=hy([A[0],A[1],A[2]]);return Vr([e[0],e[1],e[2],A[3]])},By=A=>ge([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],A),wy=A=>ge([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],A),my=A=>{const e=A.map(t=>(t<0?-1:1)*ye(Math.abs(t),2.19921875));return[e[0],e[1],e[2]]},Cy=A=>{const e=A.map(t=>(t<0?-1:1)*ye(Math.abs(t),.4547069271758437));return[e[0],e[1],e[2]]},by=A=>{const[e,t,n]=Cy(By([A[0],A[1],A[2]]));return[e,t,n,A[3]]},Qy=A=>{const e=Kt(wy(my([A[0],A[1],A[2]])));return _a([e[0],e[1],e[2],A[3]])},yy=A=>ge([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],A),Uy=A=>ge([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],A),Ey=A=>A.map(e=>e<16/512?e/16:ye(e,1.8)),ky=A=>A.map(e=>e>1/512?ye(e,1/1.8):e*16),Fy=A=>{const e=Ey([A[0],A[1],A[2]]);return xa(yy([e[0],e[1],e[2]]))},vy=A=>{const[e,t,n]=ky(Uy(Fd([A[0],A[1],A[2]])));return[e,t,n,A[3]]},_y=A=>{const e=Fy([A[0],A[1],A[2]]);return Vr([e[0],e[1],e[2],A[3]])},bo=1.09929682680944,Sd=.018053968510807,xy=A=>A.map(function(e){return e<Sd*4.5?e/4.5:Math.pow((e+bo-1)/bo,1/.45)}),Sy=A=>A.map(function(e){return e>=Sd?bo*Math.pow(e,.45)-(bo-1):4.5*e}),Iy=A=>ge([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],A),Ty=A=>ge([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],A),Hy=A=>{const e=xy([A[0],A[1],A[2]]);return Iy([e[0],e[1],e[2]])},Ly=A=>{const[e,t,n]=Sy(Ty([A[0],A[1],A[2]]));return[e,t,n,A[3]]},Dy=A=>{const e=Hy([A[0],A[1],A[2]]);return Vr([e[0],e[1],e[2],A[3]])},zt={name:"color",parse:(A,e)=>{if(e.type===18){const t=My[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]=Id(e);return ze(t,n,r,s)}if(e.type===20){const t=lt[e.value.toUpperCase()];if(typeof t!="undefined")return t}return lt.TRANSPARENT}},Id=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]},Td=(A,e)=>{const t=e.filter(VA);if(cn(t))throw new Error("Relative color not supported for rgb()");if(t.length===3){const[n,r,s]=t.map($t);return ze(n,r,s,1)}if(t.length===4){const[n,r,s,o]=t.map($t);return ze(n,r,s,o)}return t.length===5&&t[3].type===6&&t[3].value==="/"?ze($t(t[0],0),$t(t[1],1),$t(t[2],2),$t(t[4],3)):0},Ry=(A,e)=>{const t=e.filter(VA),n=t[0].type===20?t[0].value:"unknown";if(cn(t)){const r=(U,E)=>{if(zA(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 _=y.filter(VA);let R="(";for(const H of _)R+=H.type===18&&H.name==="calc"?F(H.values):zA(H)?H.number:H.type===6||j(H)?H.value:"";return R+=")",R};if(E.type===18){const y=E.values.filter(VA);if(E.name==="calc")return dd(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 lt[t[1].value.toUpperCase()]=="undefined")throw new Error("Attempting to use unknown color in relative color 'from'");{const U=Jn(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]=Id(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=Oy[s],c=Py[o],u=Hd[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]),b=t.length>6&&t[6].type===6&&t[6].value==="/"&&zA(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,b])}else{const r=n,s=Hd[r];if(typeof s=="undefined")throw new Error(`Attempting to parse an unsupported color space "${r}" for color() function`);return s([zA(t[1])?t[1].number:0,zA(t[2])?t[2].number:0,zA(t[3])?t[3].number:0,t.length>4&&t[4].type===6&&t[4].value==="/"&&zA(t[5])?t[5].number:1])}},Hd={srgb:JQ,"srgb-linear":_a,"display-p3":gy,"a98-rgb":Qy,"prophoto-rgb":_y,xyz:xd,"xyz-d50":cy,"xyz-d65":xd,rec2020:Dy},Oy={rgb:ey,hsl:ty,lab:ny,lch:ry,oklab:oy,oklch:sy},Py={srgb:GQ,"srgb-linear":ZQ,"display-p3":fy,"a98-rgb":by,"prophoto-rgb":vy,xyz:_d,"xyz-d50":ay,"xyz-d65":_d,rec2020:Ly},My={hsl:Ud,hsla:Ud,rgb:Td,rgba:Td,lch:Ay,oklch:qQ,oklab:YQ,lab:jQ,color:Ry},Jn=(A,e)=>zt.parse(A,ud.create(e).parseComponentValue()),lt={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},ln=A=>A.nodeType===Node.ELEMENT_NODE,Ld=A=>A.nodeType===Node.TEXT_NODE,un=A=>typeof A.className=="object",Gr=A=>ln(A)&&typeof A.style!="undefined"&&!un(A),Ky=A=>A.tagName==="INPUT",Ny=A=>A.tagName==="HTML",Dd=A=>A.tagName==="svg",Ia=A=>A.tagName==="BODY",Rd=A=>A.tagName==="CANVAS",Od=A=>A.tagName==="VIDEO",Ta=A=>A.tagName==="IMG",Pd=A=>A.tagName==="IFRAME",Md=A=>A.tagName==="STYLE",$y=A=>A.tagName==="SCRIPT",Qo=A=>A.tagName==="TEXTAREA",yo=A=>A.tagName==="SELECT",Zr=A=>A.tagName==="SLOT",zy=A=>A.tagName==="LI",Vy=A=>A.tagName==="OL",Kd=A=>!un(A)&&A.tagName.indexOf("-")>0,Gy=new Set(["IMG","VIDEO","AUDIO","CANVAS","IFRAME","INPUT","TEXTAREA","SELECT","BR","HR","META","LINK","BASE","COL","SOURCE","TRACK","WBR","AREA","PARAM","EMBED","OBJECT"]),Zy=A=>!un(A)&&!Gy.has(A.tagName),Ha={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}}},Ae=(A,e)=>(A&e)!==0;var Xy=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 Nd={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"]},$d={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Wy={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Jy={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},jn=(A,e,t,n,r,s)=>A<e||A>t?Xr(A,r,s.length>0):n.integers.reduce((o,a,i)=>{for(;A>=a;)A-=a,o+=n.values[i];return o},"")+s,zd=(A,e,t,n)=>{let r="";do t||A--,r=n(A)+r,A/=e;while(A*e>=e);return r},DA=(A,e,t,n,r)=>{const s=t-e+1;return(A<0?"-":"")+(zd(Math.abs(A),s,n,o=>HA(Math.floor(o%s)+e))+r)},dn=(A,e,t=". ")=>{const n=e.length;return zd(Math.abs(A),n,!1,r=>e[Math.floor(r%n)])+t},jy=1,Yy=2,qy=4,A0=8,Ut=(A,e,t,n,r,s)=>{if(A<-9999||A>9999)return Xr(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&&Ae(s,jy)&&a!==""?a=e[c]+a:c>1||c===1&&i===0||c===1&&i===1&&Ae(s,Yy)||c===1&&i===1&&Ae(s,qy)&&A>100||c===1&&i>1&&Ae(s,A0)?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},Vd="十百千萬",Gd="拾佰仟萬",Zd="マイナス",La="마이너스",Xr=(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=DA(A,48,57,!0,n);return a.length<4?`0${a}`:a;case 4:return dn(A,"〇一二三四五六七八九",r);case 6:return jn(A,1,3999,Nd,3,n).toLowerCase();case 7:return jn(A,1,3999,Nd,3,n);case 8:return DA(A,945,969,!1,n);case 9:return DA(A,97,122,!1,n);case 10:return DA(A,65,90,!1,n);case 11:return DA(A,1632,1641,!0,n);case 12:case 49:return jn(A,1,9999,$d,3,n);case 35:return jn(A,1,9999,$d,3,n).toLowerCase();case 13:return DA(A,2534,2543,!0,n);case 14:case 30:return DA(A,6112,6121,!0,n);case 15:return dn(A,"子丑寅卯辰巳午未申酉戌亥",r);case 16:return dn(A,"甲乙丙丁戊己庚辛壬癸",r);case 17:case 48:return Ut(A,"零一二三四五六七八九",Vd,"負",r,14);case 47:return Ut(A,"零壹貳參肆伍陸柒捌玖",Gd,"負",r,15);case 42:return Ut(A,"零一二三四五六七八九",Vd,"负",r,14);case 41:return Ut(A,"零壹贰叁肆伍陆柒捌玖",Gd,"负",r,15);case 26:return Ut(A,"〇一二三四五六七八九","十百千万",Zd,r,0);case 25:return Ut(A,"零壱弐参四伍六七八九","拾百千万",Zd,r,7);case 31:return Ut(A,"영일이삼사오육칠팔구","십백천만",La,s,7);case 33:return Ut(A,"零一二三四五六七八九","十百千萬",La,s,0);case 32:return Ut(A,"零壹貳參四五六七八九","拾百千",La,s,7);case 18:return DA(A,2406,2415,!0,n);case 20:return jn(A,1,19999,Jy,3,n);case 21:return DA(A,2790,2799,!0,n);case 22:return DA(A,2662,2671,!0,n);case 52:return jn(A,1,10999,Wy,3,n);case 23:return dn(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return dn(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return DA(A,3302,3311,!0,n);case 28:return dn(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",r);case 29:return dn(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",r);case 34:return DA(A,3792,3801,!0,n);case 37:return DA(A,6160,6169,!0,n);case 38:return DA(A,4160,4169,!0,n);case 39:return DA(A,2918,2927,!0,n);case 40:return DA(A,1776,1785,!0,n);case 43:return DA(A,3046,3055,!0,n);case 44:return DA(A,3174,3183,!0,n);case 45:return DA(A,3664,3673,!0,n);case 46:return DA(A,3872,3881,!0,n);default:return DA(A,48,57,!0,n)}},e0={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})},t0={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Uo=(A,e)=>{const t=zt.parse(A,e[0]),n=e[1];return n&&aA(n)?{color:t,stop:n}:{color:t,stop:null}},Da=(A,e)=>{const t=A[0],n=A[A.length-1];t.stop===null&&(t.stop=LA),n.stop===null&&(n.stop=$e);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)}))},n0=(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)},Xd=(A,e,t)=>{const n=typeof A=="number"?A:n0(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]},Ve=(A,e)=>Math.sqrt(A*A+e*e),Wd=(A,e,t,n,r)=>[[0,0],[0,e],[A,0],[A,e]].reduce((s,o)=>{const[a,i]=o,c=Ve(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,r0=(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(Ve(e,t),Ve(e,t-r),Ve(e-n,t),Ve(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]=Wd(n,r,e,t,!0);s=Ve(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(Ve(e,t),Ve(e,t-r),Ve(e-n,t),Ve(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]=Wd(n,r,e,t,!1);s=Ve(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]},Jd=(A,e)=>{let t=ve(180);const n=[];return Ne(e).forEach((r,s)=>{if(s===0){const a=r[0];if(a.type===20&&a.value==="to"){t=Qd(r);return}else if(bd(a)){t=Wn.parse(A,a);return}}const o=Uo(A,r);n.push(o)}),{angle:t,stops:n,type:1}},Eo=(A,e)=>{let t=ve(180);const n=[];return Ne(e).forEach((r,s)=>{if(s===0){const a=r[0];if(a.type===20&&["top","left","right","bottom"].indexOf(a.value)!==-1){t=Qd(r);return}else if(bd(a)){t=(Wn.parse(A,a)+ve(270))%ve(360);return}}const o=Uo(A,r);n.push(o)}),{angle:t,stops:n,type:1}},s0=(A,e)=>{const t=ve(180),n=[];let r=1;const s=0,o=3,a=[];return Ne(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=zt.parse(A,u.values[0]);n.push({stop:LA,color:h})}else if(u.name==="to"){const h=zt.parse(A,u.values[0]);n.push({stop:$e,color:h})}else if(u.name==="color-stop"){const h=u.values.filter(VA);if(h.length===2){const f=zt.parse(A,h[1]),g=h[0];zA(g)&&n.push({stop:{type:16,number:g.number*100,flags:g.flags},color:f})}}}}),r===1?{angle:(t+ve(180))%ve(360),stops:n,type:r}:{size:o,shape:s,stops:n,position:a,type:r}},jd="closest-side",Yd="farthest-side",qd="closest-corner",Ap="farthest-corner",ep="circle",tp="ellipse",np="cover",rp="contain",o0=(A,e)=>{let t=0,n=3;const r=[],s=[];return Ne(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(Qt),u;case"top":case"left":return s.push(LA),u;case"right":case"bottom":return s.push($e),u}else(aA(h)||Nt(h))&&s.push(h);else if(j(h))switch(h.value){case ep:return t=0,!1;case tp:return t=1,!1;case"at":return c=!0,!1;case jd:return n=0,!1;case np:case Yd:return n=1,!1;case rp:case qd:return n=2,!1;case Ap:return n=3,!1}else if(Nt(h)||aA(h))return Array.isArray(n)||(n=[]),n.push(h),!1;return u},i)}if(i){const c=Uo(A,o);r.push(c)}}),{size:n,shape:t,stops:r,position:s,type:2}},ko=(A,e)=>{let t=0,n=3;const r=[],s=[];return Ne(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(Qt),!1;case"top":case"left":return s.push(LA),!1;case"right":case"bottom":return s.push($e),!1}else if(aA(u)||Nt(u))return s.push(u),!1;return c},i):a===1&&(i=o.reduce((c,u)=>{if(j(u))switch(u.value){case ep:return t=0,!1;case tp:return t=1,!1;case rp:case jd:return n=0,!1;case Yd:return n=1,!1;case qd:return n=2,!1;case np:case Ap:return n=3,!1}else if(Nt(u)||aA(u))return Array.isArray(n)||(n=[]),n.push(u),!1;return c},i)),i){const c=Uo(A,o);r.push(c)}}),{size:n,shape:t,stops:r,position:s,type:2}},Wr=(A,e)=>$(k({},Jd(A,e)),{type:3}),i0=A=>A.type===1,a0=A=>A.type===2,c0=A=>A.type===3,Fo={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=op[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 sp(A){return!(A.type===20&&A.value==="none")&&(A.type!==18||!!op[A.name])}const op={"linear-gradient":Jd,"-moz-linear-gradient":Eo,"-ms-linear-gradient":Eo,"-o-linear-gradient":Eo,"-webkit-linear-gradient":Eo,"radial-gradient":o0,"-moz-radial-gradient":ko,"-ms-radial-gradient":ko,"-o-radial-gradient":ko,"-webkit-radial-gradient":ko,"-webkit-gradient":s0,"repeating-linear-gradient":Wr,"-webkit-repeating-linear-gradient":Wr,"-moz-repeating-linear-gradient":Wr,"-ms-repeating-linear-gradient":Wr,"-o-repeating-linear-gradient":Wr},l0={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)&&sp(n)).map(n=>Fo.parse(A,n))}},u0={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})},d0={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:(A,e)=>Ne(e).map(t=>t.map(hd).filter(n=>n!==null)).map(gd)},p0={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:(A,e)=>Ne(e).map(t=>t.filter(j).map(n=>n.value).join(" ")).map(h0)},h0=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}},f0={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:(A,e)=>Ne(e).map(t=>t.map(n=>g0(n)?n:hd(n)).filter(n=>n!==null))},g0=A=>j(A)||aA(A),vo=A=>({name:`border-${A}-color`,initialValue:"transparent",prefix:!1,type:3,format:"color"}),B0=vo("top"),w0=vo("right"),m0=vo("bottom"),C0=vo("left"),_o=A=>({name:`border-${A}-radius`,initialValue:"0 0",prefix:!1,type:1,parse:(e,t)=>gd(t.filter(aA))}),b0=_o("top-left"),Q0=_o("top-right"),y0=_o("bottom-right"),U0=_o("bottom-left"),xo=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}}),E0=xo("top"),k0=xo("right"),F0=xo("bottom"),v0=xo("left"),So=A=>({name:`border-${A}-width`,initialValue:"0",type:0,prefix:!1,parse:(e,t)=>ct(t)?t.number:0}),_0=So("top"),x0=So("right"),S0=So("bottom"),I0=So("left"),Ra={type:0},Oa=A=>{const[e]=A;return e?j(e)?e.value==="farthest-side"?"farthest-side":"closest-side":aA(e)?e:"closest-side":"closest-side"},ip=A=>{let e=null,t=null;for(const n of A)if(j(n))switch(n.value){case"left":e=LA;break;case"right":e=$e;break;case"top":t=LA;break;case"bottom":t=$e;break;case"center":e===null?e=Qt:t===null&&(t=Qt);break}else aA(n)&&(e===null?e=n:t===null&&(t=n));return{cx:e!=null?e:Qt,cy:t!=null?t:Qt}},T0=A=>{var r,s,o,a;const e=[];for(const i of A)if(i.type!==31){if(j(i)&&i.value==="round")break;aA(i)&&e.push(i)}const t=(r=e[0])!=null?r:LA,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}},H0=A=>{const e=A.filter($r),t=e.findIndex(s=>Nr(s,"at")),n=t===-1?e:e.slice(0,t),r=t===-1?[]:e.slice(t+1);return k({type:2,radius:Oa(n)},ip(r))},L0=A=>{const e=A.filter($r),t=e.findIndex(s=>Nr(s,"at")),n=t===-1?e:e.slice(0,t),r=t===-1?[]:e.slice(t+1);return k({type:3,rx:Oa(n.slice(0,1)),ry:Oa(n.slice(1,2))},ip(r))},D0=A=>{const e=Ne(A),t=[];for(const n of e){if(n.length===1&&j(n[0]))continue;const r=n.filter(aA);r.length>=2&&t.push([r[0],r[1]])}return{type:4,points:t}},R0=A=>{const e=A.find(t=>t.type===0);return e?{type:5,d:e.value}:Ra},O0={name:"clip-path",initialValue:"none",prefix:!1,type:0,parse:(A,e)=>{if(j(e)&&e.value==="none")return Ra;if(e.type===18)switch(e.name){case"inset":return T0(e.values);case"circle":return H0(e.values);case"ellipse":return L0(e.values);case"polygon":return D0(e.values);case"path":return R0(e.values)}return Ra}},P0={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},M0={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"rtl":return 1;default:return 0}}},K0={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:(A,e)=>e.filter(j).reduce((t,n)=>t|N0(n.value),0)},N0=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},ap={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}},$0={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},z0={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"strict":return"strict";default:return"normal"}}},V0={name:"line-height",initialValue:"normal",prefix:!1,type:4},Pa=(A,e)=>j(A)&&A.value==="normal"?1.2*e:A.type===17?e*A.number:aA(A)?J(A,e):e,G0={name:"list-style-image",initialValue:"none",type:0,prefix:!1,skipCache:!0,parse:(A,e)=>e.type===20&&e.value==="none"?null:Fo.parse(A,e)},Z0={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"inside":return 0;default:return 1}}},Io=A=>({name:`margin-${A}`,initialValue:"0",prefix:!1,type:4}),X0=Io("top"),W0=Io("right"),J0=Io("bottom"),j0=Io("left"),cp={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}})},Y0={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"break-word":return"break-word";default:return"normal"}}},To=A=>({name:`padding-${A}`,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}),q0=To("top"),AU=To("right"),eU=To("bottom"),tU=To("left"),nU={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}}},rU={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}},sU={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.length===1&&Nr(e[0],"none")?[]:Ne(e).map(t=>{const n={color:lt.TRANSPARENT,offsetX:LA,offsetY:LA,blur:LA};let r=0;for(let s=0;s<t.length;s++){const o=t[s];Nt(o)?(r===0?n.offsetX=o:r===1?n.offsetY=o:n.blur=o,r++):n.color=zt.parse(A,o)}return n})},oU={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}},iU={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=aU[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}},aU={matrix:(A,e)=>{const t=e.filter(n=>n.type===17).map(n=>n.number);return t.length===6?t:null},matrix3d:(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},rotate:(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=Wn.parse(A,t);else return null;const r=Math.cos(n),s=Math.sin(n);return[r,s,-s,r,0,0]}},lp={type:16,number:50,flags:4},cU=[lp,lp],lU={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:(A,e)=>{const t=e.filter(aA);return t.length!==2?cU:[t[0],t[1]]}},uU={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?Wn.parse(A,e)*180/Math.PI:null},dU={name:"visibility",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}},pU={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"}}},hU={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"}}},Ho=A=>A!==0,Ma=A=>A===3||A===4,fU={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}}},gU={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:(A,e)=>{if(e.type===20)return{auto:!0,order:0};if(zA(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},up={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")}},BU={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:(A,e)=>zA(e)?e.number:1},dp={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},pp={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)},wU={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}}},mU={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 ct(e)?e.number:"auto"}},CU={name:"text-underline-offset",initialValue:"auto",prefix:!1,type:0,parse:(A,e)=>j(e)&&e.value==="auto"?"auto":ct(e)?e.number:"auto"},bU={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)}},QU={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},yU={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:(A,e)=>{if(zA(e))return e.number;if(j(e))switch(e.value){case"bold":return 700;default:return 400}return 400}},UU={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.filter(j).map(t=>t.value)},EU={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"}}},kU={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}},hp=(A,e)=>{const t=[],n=A.filter($r);for(let r=0;r<n.length;r++){const s=n[r],o=n[r+1];if(s.type===20){const a=o&&zA(o)?o.number:e;t.push([s.value,a])}}return t},FU={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:hp(e,1).map(([n,r])=>({counter:n,increment:r}))}},vU={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:(A,e)=>e.length===0?[]:hp(e,0).filter(([t])=>t!=="none").map(([t,n])=>({counter:t,reset:n}))},_U={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:(A,e)=>e.filter(ct).map(t=>up.parse(A,t))},xU={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($Q);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}},fp=(A,e,t)=>{if(!A)return"";const n=A[Math.min(e,A.length-1)];return n?t?n.open:n.close:""},SU={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.length===1&&Nr(e[0],"none")?[]:Ne(e).map(t=>{const n={color:255,offsetX:LA,offsetY:LA,blur:LA,spread:LA,inset:!1};let r=0;for(let s=0;s<t.length;s++){const o=t[s];Nr(o,"inset")?n.inset=!0:Nt(o)?(r===0?n.offsetX=o:r===1?n.offsetY=o:r===2?n.blur=o:n.spread=o,r++):n.color=zt.parse(A,o)}return n})},IU={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}},TU={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},HU={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:(A,e)=>ct(e)?e.number:0},LU={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},DU={name:"object-fit",initialValue:"fill",prefix:!1,type:1,parse:(A,e)=>e.filter(j).reduce((t,n)=>t|RU(n.value),0)},RU=A=>{switch(A){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},OU={name:"text-overflow",initialValue:"clip",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"ellipsis":return 1;default:return 0}}},PU={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}}},GA={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"},MU=new Set(Object.values(GA)),KU={name:"mix-blend-mode",initialValue:"normal",type:2,prefix:!1,parse:(A,e)=>MU.has(e)?e:GA.NORMAL},NU={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=$U(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}},$U=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(" ")},zU={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}}},VU={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},GU={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(LA);break;case"center":t.push(Qt);break;case"right":case"bottom":t.push($e);break}else aA(r)&&t.push(r);n++}for(;t.length<2;)t.push(Qt);return[t[0],t[1]]}},ZU=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"})),XU={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)&&ZU.has(r.value)&&t.push(r.value);return t.length>0?t:["normal"]}},WU={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)&&sp(n));return t.length===0?null:Fo.parse(A,t[0])}},JU=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)},jU={name:"border-image-slice",initialValue:"100%",prefix:!1,type:1,parse:(A,e)=>{const t=e.filter($r),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]=JU(n.length>0?n:[100]);return{top:o,right:a,bottom:i,left:c,fill:r,unit:s}}},YU=A=>{switch(A){case"repeat":return 1;case"round":return 2;case"space":return 3;default:return 0}},qU={name:"border-image-repeat",initialValue:"stretch",prefix:!1,type:1,parse:(A,e)=>{var s,o;const t=e.filter($r),n=[];for(const a of t)j(a)&&n.push(YU(a.value));const r=(s=n[0])!=null?s:0;return{horizontal:r,vertical:(o=n[1])!=null?o:r}}},AE={name:"box-decoration-break",initialValue:"slice",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"clone":return 1;default:return 0}}},eE=1e4;var tE=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}},nE=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}},rE=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}},sE=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()}},oE=(Fn=class{get border(){var e;return(e=this._border)!=null?e:this._border=new tE(this)}get background(){var e;return(e=this._background)!=null?e:this._background=new nE(this)}get font(){var e;return(e=this._font)!=null?e:this._font=new rE(this)}get layout(){var e;return(e=this._layout)!=null?e:this._layout=new sE(this)}constructor(e,t){var s,o;const n=Fn.standardProps;if(t.display==="none"){this.display=0;for(const[i,c]of n)i!=="display"&&(this[i]=Be(e,c,void 0));this.float=Be(e,ap,void 0),this.textDecorationColor=Be(e,dp,void 0),this.textDecorationLine=Be(e,pp,void 0);const a=Be(e,cp,void 0);this.overflowX=a[0],this.overflowY=a[a.length>1?1:0];return}for(const[a,i,c]of n)this[a]=Be(e,i,t[c]);this.float=Be(e,ap,t.cssFloat),this.textDecorationColor=Be(e,dp,(s=t.textDecorationColor)!=null?s:t.color),this.textDecorationLine=Be(e,pp,(o=t.textDecorationLine)!=null?o:t.textDecoration);const r=Be(e,cp,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 yt(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 Ae(this.display,4)||Ae(this.display,33554432)||Ae(this.display,268435456)||Ae(this.display,536870912)||Ae(this.display,67108864)||Ae(this.display,134217728)}},Fn.standardProps=[["animationDuration",_U,"animationDuration"],["backgroundClip",e0,"backgroundClip"],["backgroundColor",t0,"backgroundColor"],["backgroundImage",l0,"backgroundImage"],["backgroundOrigin",u0,"backgroundOrigin"],["backgroundPosition",d0,"backgroundPosition"],["backgroundRepeat",p0,"backgroundRepeat"],["backgroundSize",f0,"backgroundSize"],["borderTopColor",B0,"borderTopColor"],["borderRightColor",w0,"borderRightColor"],["borderBottomColor",m0,"borderBottomColor"],["borderLeftColor",C0,"borderLeftColor"],["borderTopLeftRadius",b0,"borderTopLeftRadius"],["borderTopRightRadius",Q0,"borderTopRightRadius"],["borderBottomRightRadius",y0,"borderBottomRightRadius"],["borderBottomLeftRadius",U0,"borderBottomLeftRadius"],["borderTopStyle",E0,"borderTopStyle"],["borderRightStyle",k0,"borderRightStyle"],["borderBottomStyle",F0,"borderBottomStyle"],["borderLeftStyle",v0,"borderLeftStyle"],["borderTopWidth",_0,"borderTopWidth"],["borderRightWidth",x0,"borderRightWidth"],["borderBottomWidth",S0,"borderBottomWidth"],["borderLeftWidth",I0,"borderLeftWidth"],["boxShadow",SU,"boxShadow"],["clipPath",O0,"clipPath"],["color",P0,"color"],["direction",M0,"direction"],["display",K0,"display"],["fontFamily",bU,"fontFamily"],["fontSize",QU,"fontSize"],["fontStyle",EU,"fontStyle"],["fontVariant",UU,"fontVariant"],["fontWeight",yU,"fontWeight"],["letterSpacing",$0,"letterSpacing"],["lineBreak",z0,"lineBreak"],["lineHeight",V0,"lineHeight"],["listStyleImage",G0,"listStyleImage"],["listStylePosition",Z0,"listStylePosition"],["listStyleType",Ha,"listStyleType"],["marginTop",X0,"marginTop"],["marginRight",W0,"marginRight"],["marginBottom",J0,"marginBottom"],["marginLeft",j0,"marginLeft"],["opacity",BU,"opacity"],["overflowWrap",Y0,"overflowWrap"],["paddingTop",q0,"paddingTop"],["paddingRight",AU,"paddingRight"],["paddingBottom",eU,"paddingBottom"],["paddingLeft",tU,"paddingLeft"],["paintOrder",IU,"paintOrder"],["position",rU,"position"],["textAlign",nU,"textAlign"],["textDecorationStyle",wU,"textDecorationStyle"],["textDecorationThickness",mU,"textDecorationThickness"],["textUnderlineOffset",CU,"textUnderlineOffset"],["textShadow",sU,"textShadow"],["textTransform",oU,"textTransform"],["textOverflow",OU,"textOverflow"],["transform",iU,"transform"],["transformOrigin",lU,"transformOrigin"],["rotate",uU,"rotate"],["visibility",dU,"visibility"],["webkitTextStrokeColor",TU,"webkitTextStrokeColor"],["webkitTextStrokeWidth",HU,"webkitTextStrokeWidth"],["webkitLineClamp",LU,"webkitLineClamp"],["wordBreak",pU,"wordBreak"],["whiteSpace",hU,"whiteSpace"],["writingMode",fU,"writingMode"],["zIndex",gU,"zIndex"],["objectFit",DU,"objectFit"],["imageRendering",PU,"imageRendering"],["mixBlendMode",KU,"mixBlendMode"],["filter",NU,"filter"],["fontVariantLigatures",zU,"fontVariantLigatures"],["zoom",VU,"zoom"],["objectPosition",GU,"objectPosition"],["backgroundBlendMode",XU,"backgroundBlendMode"],["borderImageSource",WU,"borderImageSource"],["borderImageSlice",jU,"borderImageSlice"],["borderImageRepeat",qU,"borderImageRepeat"],["boxDecorationBreak",AE,"boxDecorationBreak"]],Fn),iE=class{constructor(A,e){this.content=Be(A,kU,e.content),this.quotes=Be(A,xU,e.quotes)}},gp=class{constructor(A,e){this.counterIncrement=Be(A,FU,e.counterIncrement),this.counterReset=Be(A,vU,e.counterReset)}};const Bp=new Map,Be=(A,e,t)=>{let n=t!==null&&typeof t!="undefined"?t.toString():e.initialValue;n.trim()===""&&(n=e.initialValue);let r=Bp.get(e);if(r){const i=r.get(n);if(i!==void 0)return r.delete(n),r.set(n,i),i}const s=ka.get();s.write(n);const o=new ud(s.read());ka.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 Wn.parse(A,o.parseComponentValue());case"color":return zt.parse(A,o.parseComponentValue());case"image":return Fo.parse(A,o.parseComponentValue());case"length":{const i=o.parseComponentValue();return Nt(i)?i:LA}case"length-percentage":{const i=o.parseComponentValue();return aA(i)?i:LA}case"time":return up.parse(A,o.parseComponentValue())}}})();if(r||(r=new Map,Bp.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},aE="data-html2canvas-debug",cE=A=>{if(typeof A.getAttribute!="function")return 0;switch(A.getAttribute(aE)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Ka=(A,e)=>{const t=cE(A);return t===1||e===t},lE="data-html2canvas-ignore";var uE=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!ln(A)||!$y(A)&&!A.hasAttribute("data-html2canvas-ignore")&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(A))}shouldCloneStyleElement(A){return!this.options.copyStyles||!ln(A)||!Md(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(!Zr(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)ln(n)&&Zr(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(!Zr(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)ln(n)&&Zr(n)?this.cloneSlotElementAsLightDOM(n,e,t):this.appendChildNode(e,n,t)}};const dE=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 Na=class{constructor(A,e,t){var n;if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Xy,this.quoteDepth=0,this.slotCloner=new uE((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=dE(e);r&&(this.options.iframeContainer=r)}this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}toIFrame(A,e){var h,f;const t=pE(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=gE(t).then(()=>I(this,null,function*(){this.scrolledElements.forEach(CE),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 fE(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=wE(document.doctype)+"<html></html>";try{const g=(h=this.referenceElement.ownerDocument)==null?void 0:h.defaultView,m=g&&g.trustedTypes;let b=(f=m==null?void 0:m.getPolicy)==null?void 0:f.call(m,"html2canvas-pro");!b&&m&&(b=m.createPolicy("html2canvas-pro",{createHTML:E=>E}));const U=b?b.createHTML(c):c;o.write(U)}catch(g){o.write(c)}mE(this.referenceElement.ownerDocument,n,r),o.close();const u=o.adoptNode(this.documentElement);return EE(u,i),o.replaceChild(u,o.documentElement),a}createElementClone(A){if(Ka(A,2))debugger;if(Rd(A))return this.createCanvasClone(A);if(Od(A))return this.createVideoClone(A);if(Md(A))return this.createStyleClone(A);const e=A.cloneNode(!1);return Ta(e)&&(Ta(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager")),Kd(e)&&!un(e)?this.createCustomElementClone(A,e):e}createCustomElementClone(A,e){const t=document.createElement("div");t.className=e.className,$a(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(Ld(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);const t=A.ownerDocument.defaultView;if(t&&ln(A)&&(Gr(A)||un(A))){const n=this.createElementClone(A);n.style.transitionProperty="none";const r=t.getComputedStyle(A),s=Zy(A);this.referenceElement===A&&Gr(n)&&(this.clonedReferenceElement=n),Ia(n)&&yE(n,this.options.cspNonce);const o=this.counters.parse(new gp(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 Kd(A)&&(e=!0),Od(A)||this.cloneChildNodes(A,n,e),this.counters.pop(o),(r&&(this.options.copyStyles||un(A))&&!Pd(A)||e)&&$a(r,n),(A.scrollTop!==0||A.scrollLeft!==0)&&this.scrolledElements.push([n,A.scrollLeft,A.scrollTop]),(Qo(A)||yo(A))&&(Qo(n)||yo(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 gp(this.context,t));const o=new iE(this.context,t),a=s.createElement("html2canvaspseudoelement");$a(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)?Ha.parse(this.context,h.value):3;a.appendChild(s.createTextNode(Xr(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)?Ha.parse(this.context,f.value):3,b=h&&h.type===0?h.value:"",U=g.map(E=>Xr(E,m,!1)).join(b);a.appendChild(s.createTextNode(U))}}}else if(c.type===20)switch(c.value){case"open-quote":a.appendChild(s.createTextNode(fp(o.quotes,this.quoteDepth++,!0)));break;case"close-quote":a.appendChild(s.createTextNode(fp(o.quotes,--this.quoteDepth,!1)));break;default:a.appendChild(s.createTextNode(c.value))}}),a.className=`${za} ${Va}`;const i=n===0?` ${za}`:` ${Va}`;return un(e)?e.className.baseValue+=i:e.className+=i,a}static destroy(A){return A.parentNode?(A.parentNode.removeChild(A),!0):!1}};const pE=(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(lE,"true"),(t||A.body).appendChild(n),n},hE=A=>new Promise(e=>{if(A.complete){e();return}if(!A.src){e();return}A.onload=e,A.onerror=e}),fE=A=>Promise.all([].slice.call(A.images,0).map(hE)),gE=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)}}),BE=["all","d","content"],$a=(A,e)=>{const t=[];for(let n=A.length-1;n>=0;n--){const r=A.item(n);if(BE.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},wE=A=>{let e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=" "+A.internalSubset.replace(/"/g,""").replace(/>/g,">")),A.publicId?(e+=' PUBLIC "'+A.publicId.replace(/"/g,""")+'"',A.systemId&&(e+=' "'+A.systemId.replace(/"/g,""")+'"')):A.systemId&&(e+=' SYSTEM "'+A.systemId.replace(/"/g,""")+'"'),e+=">"),e},mE=(A,e,t)=>{A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},CE=([A,e,t])=>{A.scrollLeft=e,A.scrollTop=t},bE=":before",QE=":after",za="___html2canvas___pseudoelement_before",Va="___html2canvas___pseudoelement_after",wp=`{
|
|
1665
|
+
content: "" !important;
|
|
1666
|
+
display: none !important;
|
|
1667
|
+
}`,yE=(A,e)=>{UE(A,`.${za}${bE}${wp}
|
|
1668
|
+
.${Va}${QE}${wp}`,e)},UE=(A,e,t)=>{const n=A.ownerDocument;if(n){const r=n.createElement("style");r.textContent=e,t&&(r.nonce=t),A.appendChild(r)}},EE=(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)};for(var mp=class{static normalizeElement(A,e){const t={};return Gr(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){Gr(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))}},ut=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,Ka(e,3))debugger;if(this.styles=new oE(A,A.config.window.getComputedStyle(e,null)),t.normalizeDom!==!1&&Gr(e)&&(this.originalStyles=mp.normalizeElement(e,this.styles),this.originalElement=e),this.bounds=Hr(this.context,e),e.tagName==="FIELDSET"){const n=e.querySelector(":scope > legend");if(n){const r=Hr(this.context,n);this.legendBounds=r;const s=r.top+r.height/2-this.styles.borderTopWidth/2;this.bounds=new Fe(this.bounds.left,s,this.bounds.width,this.bounds.height-(s-this.bounds.top))}}Ka(e,4)&&(this.debugRender=!0)}restore(){this.originalStyles&&this.originalElement&&(mp.restoreElement(this.originalElement,this.originalStyles),this.originalStyles=void 0,this.originalElement=void 0)}restoreTree(){this.restore();for(const A of this.elements)A.restoreTree()}},kE="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Cp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jr=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),Lo=0;Lo<Cp.length;Lo++)Jr[Cp.charCodeAt(Lo)]=Lo;for(var FE=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=Jr[A.charCodeAt(n)],o=Jr[A.charCodeAt(n+1)],a=Jr[A.charCodeAt(n+2)],i=Jr[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},vE=function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t},_E=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},pn=5,Ga=11,Za=2,xE=Ga-pn,bp=65536>>pn,Xa=(1<<pn)-1,SE=bp+(1024>>pn)+32,IE=65536>>Ga,TE=(1<<xE)-1,Qp=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},HE=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},LE=function(A,e){var t=FE(A),n=Array.isArray(t)?_E(t):new Uint32Array(t),r=Array.isArray(t)?vE(t):new Uint16Array(t),s=24,o=Qp(r,s/2,n[4]/2),a=n[5]===2?Qp(r,(s+n[4])/2):HE(n,Math.ceil((s+n[4])/4));return new DE(n[0],n[1],n[2],n[3],o,a)},DE=(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>>pn],t=(t<<Za)+(e&Xa),this.data[t];if(e<=65535)return t=this.index[bp+(e-55296>>pn)],t=(t<<Za)+(e&Xa),this.data[t];if(e<this.highStart)return t=SE-IE+(e>>Ga),t=this.index[t],t+=e>>pn&TE,t=this.index[t],t=(t<<Za)+(e&Xa),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A})(),yp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",RE=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),Do=0;Do<yp.length;Do++)RE[yp.charCodeAt(Do)]=Do;var OE=1,Wa=2,Ja=3,Up=4,Ep=5,PE=7,kp=8,ja=9,Ya=10,Fp=11,vp=12,_p=13,xp=14,qa=15,ME=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},KE=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},NE=LE(kE),_e="×",Ac="÷",$E=function(A){return NE.get(A)},zE=function(A,e,t){var n=t-2,r=e[n],s=e[t-1],o=e[t];if(s===Wa&&o===Ja)return _e;if(s===Wa||s===Ja||s===Up||o===Wa||o===Ja||o===Up)return Ac;if(s===kp&&[kp,ja,Fp,vp].indexOf(o)!==-1||(s===Fp||s===ja)&&(o===ja||o===Ya)||(s===vp||s===Ya)&&o===Ya||o===_p||o===Ep||o===PE||s===OE)return _e;if(s===_p&&o===xp){for(;r===Ep;)r=e[--n];if(r===xp)return _e}if(s===qa&&o===qa){for(var a=0;r===qa;)a++,r=e[--n];if(a%2===0)return _e}return Ac},VE=function(A){var e=ME(A),t=e.length,n=0,r=0,s=e.map($E);return{next:function(){if(n>=t)return{done:!0,value:null};for(var o=_e;n<t&&(o=zE(e,s,++n))===_e;);if(o!==_e||n===t){var a=KE.apply(null,e.slice(r,n));return r=n,{value:a,done:!1}}return{done:!0,value:null}}}},GE=function(A){for(var e=VE(A),t=[],n;!(n=e.next()).done;)n.value&&t.push(n.value.slice());return t};const ZE=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},XE=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"?"👨".repeat(10):"";const n=e.firstChild,r=to(n.data).map(i=>HA(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},WE=()=>typeof new Image().crossOrigin!="undefined",JE=()=>typeof new XMLHttpRequest().responseType=="string",jE=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},Sp=A=>A[0]===0&&A[1]===255&&A[2]===0&&A[3]===255,YE=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=ec(t,t,0,0,r);return n.fillStyle="red",n.fillRect(0,0,t,t),tc(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`,Sp(i)?tc(ec(t,t,0,0,c)):Promise.reject(new Error("ForeignObject rendering not supported"))}).then(a=>(n.drawImage(a,0,0),Sp(n.getImageData(0,0,t,t).data))).catch(()=>!1)},ec=(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},tc=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))}`}),ee={get SUPPORT_RANGE_BOUNDS(){const A=ZE(document);return Object.defineProperty(ee,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){const A=ee.SUPPORT_RANGE_BOUNDS&&XE(document);return Object.defineProperty(ee,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){const A=jE(document);return Object.defineProperty(ee,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){const A=typeof Array.from=="function"&&typeof window.fetch=="function"?YE(document):Promise.resolve(!1);return Object.defineProperty(ee,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){const A=WE();return Object.defineProperty(ee,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){const A=JE();return Object.defineProperty(ee,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){const A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(ee,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){const A=!!(typeof Intl!="undefined"&&Intl.Segmenter);return Object.defineProperty(ee,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}};var hn=class{constructor(A,e){this.text=A,this.bounds=e}};const qE=(A,e,t,n)=>{const r=tk(e,t),s=[];let o=0;return r.forEach(a=>{if(t.textDecorationLine.length||a.trim().length>0)if(ee.SUPPORT_RANGE_BOUNDS){const i=Ip(n,o,a.length).getClientRects();if(i.length>1){const c=fn(a);let u=0;c.forEach(h=>{s.push(new hn(h,Fe.fromDOMRectList(A,Ip(n,u+o,h.length).getClientRects()))),u+=h.length})}else s.push(new hn(a,Fe.fromDOMRectList(A,i)))}else{const i=n.splitText(a.length);s.push(new hn(a,Ak(A,n))),n=i}else ee.SUPPORT_RANGE_BOUNDS||(n=n.splitText(a.length));o+=a.length}),s},Ak=(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=Hr(A,n);return n.firstChild&&r.replaceChild(n.firstChild,n),s}}return Fe.EMPTY},Ip=(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},fn=A=>{if(ee.SUPPORT_NATIVE_TEXT_SEGMENTATION){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map(t=>t.segment)}return GE(A)},ek=(A,e)=>{if(ee.SUPPORT_NATIVE_TEXT_SEGMENTATION){const t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map(n=>n.segment)}return rk(A,e)},tk=(A,e)=>Ho(e.writingMode)||e.letterSpacing!==0?fn(A):ek(A,e),nk=[32,160,4961,65792,65793,4153,4241],rk=(A,e)=>{const t=gQ(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=to(r.value.slice());let o="";s.forEach(a=>{nk.indexOf(a)===-1?o+=HA(a):(o.length&&n.push(o),n.push(HA(a)),o="")}),o.length&&n.push(o)}return n};var sk=class{constructor(A,e,t){this.text=ok(e.data,t.textTransform),this.text.length!==e.data.length&&(e.data=this.text),this.textBounds=qE(A,this.text,t,e)}};const ok=(A,e)=>{switch(e){case 1:return A.toLowerCase();case 3:return A.replace(ik,ak);case 2:return A.toUpperCase();default:return A}},ik=/(^|\s|:|-|\(|\))([a-z])/g,ak=(A,e,t)=>A.length>0?e+t.toUpperCase():A;var Tp=class extends ut{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)}},Hp=class extends ut{constructor(A,e){super(A,e),this.canvas=e,this.intrinsicWidth=e.width,this.intrinsicHeight=e.height}};const ck=["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"],lk=(A,e)=>{const t=e.getAttribute("style");ck.forEach(r=>e.style.removeProperty(r));const n=A.serializeToString(e);return t===null?e.removeAttribute("style"):e.setAttribute("style",t),n};var Lp=class extends ut{constructor(A,e){super(A,e);const t=new XMLSerializer,n=Hr(A,e);e.setAttribute("width",`${n.width}px`),e.setAttribute("height",`${n.height}px`),this.svg=`data:image/svg+xml,${encodeURIComponent(lk(t,e))}`,this.intrinsicWidth=e.width.baseVal.value,this.intrinsicHeight=e.height.baseVal.value,this.context.cache.addImage(this.svg)}},Dp=class extends ut{constructor(A,e){super(A,e),this.value=e.value}},nc=class extends ut{constructor(A,e){super(A,e),this.start=e.start,this.reversed=typeof e.reversed=="boolean"&&e.reversed===!0}};const uk=[{type:15,flags:0,unit:"px",number:3}],dk=[{type:16,flags:0,number:50}],pk=A=>A.width>A.height?new Fe(A.left+(A.width-A.height)/2,A.top,A.height,A.height):A.width<A.height?new Fe(A.left,A.top+(A.height-A.width)/2,A.width,A.width):A,hk=A=>{const e=A.type==="password"?new Array(A.value.length+1).join("•"):A.value;return e.length===0?A.placeholder||"":e},fk=A=>A.value.length===0&&!!A.placeholder,gk="checkbox",Bk="radio",Rp=707406591,wk=1970632191;var Yn=class extends ut{constructor(A,e){switch(super(A,e),this.type=e.type.toLowerCase(),this.checked=e.checked,this.value=hk(e),this.isPlaceholder=fk(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=pk(this.bounds)),this.type){case gk:this.styles.borderTopRightRadius=this.styles.borderTopLeftRadius=this.styles.borderBottomRightRadius=this.styles.borderBottomLeftRadius=uk;break;case Bk:this.styles.borderTopRightRadius=this.styles.borderTopLeftRadius=this.styles.borderBottomRightRadius=this.styles.borderBottomLeftRadius=dk;break}}},Op=class extends ut{constructor(A,e){super(A,e);const t=e.options[e.selectedIndex||0];this.value=t&&t.text||""}},Pp=class extends ut{constructor(A,e){super(A,e),this.value=e.value}},Mp=class extends ut{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?Jn(A,getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):lt.TRANSPARENT,r=e.contentWindow.document.body?Jn(A,getComputedStyle(e.contentWindow.document.body).backgroundColor):lt.TRANSPARENT;this.backgroundColor=yt(n)?yt(r)?this.styles.backgroundColor:r:n}}catch(n){}}};const mk=["OL","UL","MENU"],rc=(A,e,t,n)=>{for(let r=e.firstChild,s;r;r=s)s=r.nextSibling,Kp(A,r,t,n)},Kp=(A,e,t,n)=>{if(Ld(e)&&e.data.length>0)t.textNodes.push(new sk(A,e,t.styles));else if(ln(e))if(Zr(e)&&e.assignedNodes)e.assignedNodes().forEach(r=>Kp(A,r,t,n));else{const r=Np(A,e);r.styles.isVisible()&&(Ck(e,r,n)?r.createsRealStackingContext=!0:bk(r.styles)&&(r.createsStackingContext=!0),mk.indexOf(e.tagName)!==-1&&(r.isListOwner=!0),t.elements.push(r),e.shadowRoot?rc(A,e.shadowRoot,r,n):!Qo(e)&&!Dd(e)&&!yo(e)&&rc(A,e,r,n))}},Np=(A,e)=>Ta(e)?new Tp(A,e):Rd(e)?new Hp(A,e):Dd(e)?new Lp(A,e):zy(e)?new Dp(A,e):Vy(e)?new nc(A,e):Ky(e)?new Yn(A,e):yo(e)?new Op(A,e):Qo(e)?new Pp(A,e):Pd(e)?new Mp(A,e,$p):new ut(A,e),$p=(A,e)=>{const t=Np(A,e);return t.createsRealStackingContext=!0,rc(A,e,t,t),t},Ck=(A,e,t)=>e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Ia(A)&&t.styles.isTransparent(),bk=A=>A.isPositioned()||A.isFloating()?!0:Ae(A.display,268435456)||Ae(A.display,33554432)||Ae(A.display,536870912)||Ae(A.display,134217728),zp=(A,e)=>A.length===e.length?A.some((t,n)=>t===e[n]):!1,Qk=(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 Yf{constructor(e,t){this.type=0,this.x=e,this.y=t}add(e,t){return new Yf(this.x+e,this.y+t)}};const qn=(A,e,t)=>new O(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t);var Ro=class Is{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=qn(this.start,this.startControl,e),r=qn(this.startControl,this.endControl,e),s=qn(this.endControl,this.end,e),o=qn(n,r,e),a=qn(r,s,e),i=qn(o,a,e);return t?new Is(this.start,n,o,i):new Is(i,a,s,this.end)}add(e,t){return new Is(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))}reverse(){return new Is(this.end,this.endControl,this.startControl,this.start)}};const xe=A=>A.type===1;var yk=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,b=t.width-a,U=t.height-u,E=e.borderTopWidth,v=e.borderRightWidth,F=e.borderBottomWidth,y=e.borderLeftWidth,_=J(e.paddingTop,A.bounds.width),R=J(e.paddingRight,A.bounds.width),H=J(e.paddingBottom,A.bounds.width),z=J(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||r>0?kA(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?kA(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?kA(t.left+b,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?kA(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?kA(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?kA(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?kA(t.left+b,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?kA(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?kA(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?kA(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?kA(t.left+b,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?kA(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?kA(t.left,t.top,n,r,0):new O(t.left,t.top),this.topRightBorderBox=s>0||o>0?kA(t.left+g,t.top,s,o,1):new O(t.left+t.width,t.top),this.bottomRightBorderBox=a>0||i>0?kA(t.left+b,t.top+m,a,i,2):new O(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=c>0||u>0?kA(t.left,t.top+U,c,u,3):new O(t.left,t.top+t.height),this.topLeftPaddingBox=n>0||r>0?kA(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?kA(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?kA(t.left+Math.min(b,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?kA(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?kA(t.left+y+z,t.top+E+_,Math.max(0,n-(y+z)),Math.max(0,r-(E+_)),0):new O(t.left+y+z,t.top+E+_),this.topRightContentBox=s>0||o>0?kA(t.left+Math.min(g,t.width+y+z),t.top+E+_,g>t.width+y+z?0:s-y+z,o-(E+_),1):new O(t.left+t.width-(v+R),t.top+E+_),this.bottomRightContentBox=a>0||i>0?kA(t.left+Math.min(b,t.width-(y+z)),t.top+Math.min(m,t.height+E+_),Math.max(0,a-(v+R)),i-(F+H),2):new O(t.left+t.width-(v+R),t.top+t.height-(F+H)),this.bottomLeftContentBox=c>0||u>0?kA(t.left+y+z,t.top+U,Math.max(0,c-(y+z)),u-(F+H),3):new O(t.left+y+z,t.top+t.height-(F+H))}};const kA=(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 Ro(new O(A,c),new O(A,c-a),new O(i-o,e),new O(i,e));case 1:return new Ro(new O(A,e),new O(A+o,e),new O(i,c-a),new O(i,c));case 2:return new Ro(new O(i,e),new O(i,e+a),new O(A+o,c),new O(A,c));default:return new Ro(new O(i,c),new O(i-o,c),new O(A,e+a),new O(A,e))}},Oo=A=>[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox],Uk=A=>[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox],Po=A=>[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox];var sc=class{constructor(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6}},Mo=class{constructor(A,e){this.path=A,this.target=e,this.type=1}},Ek=class{constructor(A){this.opacity=A,this.type=2,this.target=6}},jr=class{constructor(A){this.applyClip=A,this.type=3,this.target=6}};const kk={[GA.NORMAL]:"source-over",[GA.MULTIPLY]:"multiply",[GA.SCREEN]:"screen",[GA.OVERLAY]:"overlay",[GA.DARKEN]:"darken",[GA.LIGHTEN]:"lighten",[GA.COLOR_DODGE]:"color-dodge",[GA.COLOR_BURN]:"color-burn",[GA.HARD_LIGHT]:"hard-light",[GA.SOFT_LIGHT]:"soft-light",[GA.DIFFERENCE]:"difference",[GA.EXCLUSION]:"exclusion",[GA.HUE]:"hue",[GA.SATURATION]:"saturation",[GA.COLOR]:"color",[GA.LUMINOSITY]:"luminosity"};var Fk=class{constructor(A){this.mixBlendMode=A,this.type=4,this.target=6,this.compositeOperation=kk[A]}},vk=class Ur{constructor(e){this.type=5,this.target=6;const t=Ur.parseDropShadow(e);this.shadow=t.shadow,this.safeFilterString=t.safeFilterString}static parseDropShadow(e){if(!e)return{safeFilterString:""};const t=Ur.findDropShadows(e);if(t.length===0)return{safeFilterString:e};const n=Ur.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=Ur.tokenizeFilterArgs(e.trim()),n=[];let r;for(const o of t)Ur.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 Vp=A=>A.type===0,oc=A=>A.type===1,_k=A=>A.type===2,Gp=A=>A.type===3,xk=A=>A.type===4,Sk=A=>A.type===5;var Zp=class{constructor(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}},Xp=class{constructor(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new yk(this.container),this.container.styles.opacity<1&&this.effects.push(new Ek(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 sc(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 sc(n,r,s))}if(Wp(this.container.styles)){const t=Oo(this.curves),n=Po(this.curves);zp(t,n)?this.effects.push(new Mo(t,6)):(this.effects.push(new Mo(t,2)),this.effects.push(new Mo(n,4)))}if(this.container.styles.clipPath.type!==0){const t=Ik(this.container.styles.clipPath,this.container.bounds);t&&this.effects.push(t)}if(this.container.styles.mixBlendMode!==GA.NORMAL&&this.effects.push(new Fk(this.container.styles.mixBlendMode)),this.container.styles.filter!==null&&this.effects.push(new vk(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 sc(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=>!oc(s));if(e||t.container.styles.position!==0||!t.parent){if(e=[2,3].indexOf(t.container.styles.position)===-1,Wp(t.container.styles)){const s=Oo(t.curves),o=Po(t.curves);zp(s,o)||n.unshift(new Mo(o,6))}n.unshift(...r)}else n.unshift(...r);t=t.parent}return n.filter(r=>Ae(r.target,A))}};const Wp=A=>A.overflowX!==0||A.overflowY!==0,Jp=(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),Ik=(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 jr(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 jr(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=Jp(A.rx,o,t,t+r,r),c=Jp(A.ry,a,n,n+s,s);return new jr(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 jr(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 jr(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}},ic=(A,e,t,n)=>{A.container.elements.forEach(r=>{const s=r.createsRealStackingContext,o=r.createsStackingContext,a=new Xp(r,A);Ae(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 Zp(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);ic(a,u,s?u:t,i)}else r.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),ic(a,e,t,i);r.isListOwner&&jp(r,i)})},jp=(A,e)=>{let t=A instanceof nc?A.start:1;const n=A instanceof nc?A.reversed:!1;for(let r=0;r<e.length;r++){const s=e[r];s.container instanceof Dp&&typeof s.container.value=="number"&&s.container.value!==0&&(t=s.container.value),s.listValue=Xr(t,s.container.styles.listStyleType,!0),t+=n?-1:1}},Tk=A=>{const e=new Xp(A,null),t=new Zp(e),n=[];return ic(e,t,t,n),jp(e.container,n),t},ac=A=>{const e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},Yr=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))},Hk=(A,e)=>A===0?e.bounds:A===2?Yr(e):ac(e),Lk=(A,e)=>A===0?e.bounds:A===2?Yr(e):ac(e),Ko=(A,e,t)=>{const n=Hk(gn(A.styles.backgroundOrigin,e),A),r=Lk(gn(A.styles.backgroundClip,e),A),s=Dk(gn(A.styles.backgroundSize,e),t,n);let[o,a]=s;const i=zr(gn(A.styles.backgroundPosition,e),n.width-o,n.height-a),c=Rk(gn(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]},Ar=A=>j(A)&&A.value==="auto",No=A=>typeof A=="number",Dk=(A,[e,t,n],r)=>{const[s,o]=A;if(!s)return[0,0];if(aA(s)&&o&&aA(o))return[J(s,r.width),J(o,r.height)];const a=No(n);if(j(s)&&(s.value==="contain"||s.value==="cover"))return No(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=No(e),c=No(t),u=i||c;if(Ar(s)&&(!o||Ar(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 aA(s)?g=J(s,r.width):aA(o)&&(m=J(o,r.height)),Ar(s)?g=m*n:(!o||Ar(o))&&(m=g/n),[g,m]}let h=null,f=null;if(aA(s)?h=J(s,r.width):o&&aA(o)&&(f=J(o,r.height)),h!==null&&(!o||Ar(o))&&(f=i&&c?h/e*t:r.height),f!==null&&Ar(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")},gn=(A,e)=>{const t=A[e];return typeof t=="undefined"?A[0]:t},Rk=(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 Ok=class{constructor(A){this.ctx=A}render(A,e){this.ctx.fillStyle=EA(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 Pk="Mg",er=A=>A!==void 0&&!Number.isNaN(A),Yp=(A,e)=>{const t=A.measureText(Pk),n=t;return{baseline:er(n.fontBoundingBoxAscent)?n.fontBoundingBoxAscent:er(t.actualBoundingBoxAscent)?t.actualBoundingBoxAscent:e,height:er(n.fontBoundingBoxAscent)&&er(n.fontBoundingBoxDescent)?n.fontBoundingBoxAscent+n.fontBoundingBoxDescent:er(t.actualBoundingBoxAscent)&&er(t.actualBoundingBoxDescent)?t.actualBoundingBoxAscent+t.actualBoundingBoxDescent:e}},qp=(A,e)=>Yp(A,e).baseline,Mk=["-apple-system","system-ui"],Kk=1,Nk=/[\u2E80-\u2FFF\u3000-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF01-\uFFEF]/,qr=A=>Nk.test(A),$k=()=>{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},zk=A=>{const e=$k();return e!==null&&e>=15&&e<17?A.map(t=>Mk.indexOf(t)!==-1?'-apple-system, "Helvetica Neue", Arial, sans-serif':t):A},Vk=()=>{var A;return(A=typeof window!="undefined"?window:void 0)!=null&&A.chrome?"miter":"round"};var Gk=class{constructor(A){this.glyphWidthCache=null,this.ctx=A.ctx,this.options=A.options,this.decorationRenderer=new Ok(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(Ho(n)){this.iterateVerticalGlyphs(A,e,t,n,r);return}const s=fn(A.text),o=A.bounds.top+t,a=this.ctx.font;let i=A.bounds.left;for(const c of s){if(qr(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=fn(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(!(Ma(n)||!qr(u)&&u.trim().length>0)){const g=this.ctx.textBaseline;qr(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(!Ma(n)&&!qr(g)&&g.trim().length===0)break;if(Ma(n)||!qr(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&&!Ho(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=EA(e.webkitTextStrokeColor),this.ctx.lineWidth=e.webkitTextStrokeWidth,this.ctx.lineJoin=Vk(),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=EA(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=EA(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=EA(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=fn(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=zk(A.fontFamily).join(", "),n=ct(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(b=>b.text).join(""),f=u[0],g=r.width-(f.bounds.left-r.left),m=new hn(this.truncateTextWithEllipsis(h,g,e.letterSpacing),f.bounds);for(const b of t)b===0?(this.ctx.fillStyle=EA(e.color),this.renderTextWithLetterSpacing(m,e.letterSpacing,n,e.writingMode)):b===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+Kk)return!1;const i=new hn(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 I(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=qp(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 Ah=(A,e)=>{e.forEach((t,n)=>{const r=xe(t)?t.start:t;n===0?A.moveTo(r.x,r.y):A.lineTo(r.x,r.y),xe(t)&&A.bezierCurveTo(t.startControl.x,t.startControl.y,t.endControl.x,t.endControl.y,t.end.x,t.end.y)})},eh=(A,e)=>{A.beginPath(),Ah(A,e),A.closePath()};var Zk=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()}},th=class{constructor(A){this.patternCache=new Zk(50),this.ctx=A.ctx,this.context=A.context,this.canvas=A.canvas}renderBackgroundImage(A){return I(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):i0(i)?this.renderLinearGradient(A,i,e):c0(i)?this.renderRepeatingLinearGradient(A,i,e):a0(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 I(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]=Ko(A,t,[a,i,a/i]),m=gn(A.styles.backgroundRepeat,t),b=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}|${b}`;let E=this.patternCache.get(U);if(!E){const v=this.resizeImage(n,f,g,A.styles.imageRendering);E=this.ctx.createPattern(v,b),this.patternCache.set(U,E)}this.renderRepeat(c,E,u,h)}})}renderRepeatingLinearGradient(A,e,t){var W;const[n,r,s,o,a]=Ko(A,t,[null,null,null]),[i,c,u,h,f]=Xd(e.angle,o,a),g=Da(e.stops,i||1),m=g[g.length-1],b=g[0],U=m.stop-b.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,_=h,R=c+E*F,H=h+v*F,z=(W=this.canvas.ownerDocument)!=null?W:document,K=`rlg|${e.angle}|${Math.round(U)}|${JSON.stringify(e.stops)}`;let G=this.patternCache.get(K);if(!G){const sA=z.createElement("canvas"),lA=Math.max(1,Math.ceil(U));sA.width=lA,sA.height=lA;const _A=sA.getContext("2d");if(!_A)return;const Ce=_A.createLinearGradient(y-r,_-s,R-r,H-s);g.forEach(pe=>{Ce.addColorStop((pe.stop-b.stop)/U,EA(pe.color))}),_A.fillStyle=Ce,_A.fillRect(0,0,lA,lA),lA>0&&(G=this.ctx.createPattern(sA,"repeat"),this.patternCache.set(K,G))}G&&this.renderRepeat(n,G,r,s)}renderLinearGradient(A,e,t){var b;const[n,r,s,o,a]=Ko(A,t,[null,null,null]),[i,c,u,h,f]=Xd(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=((b=this.canvas.ownerDocument)!=null?b: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);Da(e.stops,i||1).forEach(F=>v.addColorStop(F.stop,EA(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]=Ko(A,t,[null,null,null]),i=e.position.length===0?[Qt]:e.position,c=J(i[0],o),u=J(i[i.length-1],a);let[h,f]=r0(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)}`,b=Da(e.stops,h*2),U=b[b.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);b.forEach(_=>y.addColorStop(_.stop,EA(_.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=EA(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){eh(this.ctx,A)}};const nh=(A,e)=>{switch(e){case 0:return Se(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return Se(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return Se(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return Se(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},Xk=(A,e)=>{switch(e){case 0:return Se(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return Se(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return Se(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return Se(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},Wk=(A,e)=>{switch(e){case 0:return Se(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return Se(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return Se(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return Se(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},Jk=(A,e)=>{switch(e){case 0:return $o(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return $o(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return $o(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return $o(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},$o=(A,e)=>{const t=[];return xe(A)?t.push(A.subdivide(.5,!1)):t.push(A),xe(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},Se=(A,e,t,n)=>{const r=[];return xe(A)?r.push(A.subdivide(.5,!1)):r.push(A),xe(t)?r.push(t.subdivide(.5,!0)):r.push(t),xe(n)?r.push(n.subdivide(.5,!0).reverse()):r.push(n),xe(e)?r.push(e.subdivide(.5,!1).reverse()):r.push(e),r};var jk=class{constructor(A,e){this.ctx=A.ctx,this.pathCallbacks=e}renderSolidBorder(A,e,t){return I(this,null,function*(){this.pathCallbacks.path(nh(t,e)),this.ctx.fillStyle=EA(A),this.ctx.fill()})}renderDoubleBorder(A,e,t,n){return I(this,null,function*(){if(e<3){yield this.renderSolidBorder(A,t,n);return}const r=Xk(n,t);this.pathCallbacks.path(r),this.ctx.fillStyle=EA(A),this.ctx.fill();const s=Wk(n,t);this.pathCallbacks.path(s),this.ctx.fill()})}renderDashedDottedBorder(A,e,t,n,r){return I(this,null,function*(){this.ctx.save();const s=Jk(n,t),o=nh(n,t);r===2&&(this.pathCallbacks.path(o),this.ctx.clip());let a,i,c,u;xe(o[0])?(a=o[0].start.x,i=o[0].start.y):(a=o[0].x,i=o[0].y),xe(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 b=h/(2*f+g);f*=b,g*=b}else{const b=Math.floor((h+g)/(f+g)),U=(h-b*f)/(b-1),E=(h-(b+1)*f)/b;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=EA(A),this.ctx.stroke(),this.ctx.setLineDash([]),r===2){if(xe(o[0])){const b=o[3],U=o[0];this.ctx.beginPath(),this.pathCallbacks.formatPath([new O(b.end.x,b.end.y),new O(U.start.x,U.start.y)]),this.ctx.stroke()}if(xe(o[1])){const b=o[1],U=o[2];this.ctx.beginPath(),this.pathCallbacks.formatPath([new O(b.end.x,b.end.y),new O(U.start.x,U.start.y)]),this.ctx.stroke()}}this.ctx.restore()})}},Yk=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:b,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),_=Math.min(a,U-F);this.drawRegion(e,0,0,g,u,m,b,_,v),this.drawRegion(e,i-h,0,h,u,m+U-F,b,F,v),this.drawRegion(e,i-h,c-f,h,f,m+U-F,b+E-y,F,y),this.drawRegion(e,0,c-f,g,f,m,b+E-y,_,y);const R=[{sx:g,sy:0,sw:i-g-h,sh:u,dx:m+_,dy:b,dw:U-_-F,dh:v,repeat:n.horizontal},{sx:i-h,sy:u,sw:h,sh:c-u-f,dx:m+U-F,dy:b+v,dw:F,dh:E-v-y,repeat:n.vertical},{sx:g,sy:c-f,sw:i-g-h,sh:f,dx:m+_,dy:b+E-y,dw:U-_-F,dh:y,repeat:n.horizontal},{sx:0,sy:u,sw:g,sh:c-u-f,dx:m,dy:b+v,dw:_,dh:E-v-y,repeat:n.vertical}];for(const H of R){if(H.sw<=0||H.sh<=0||H.dw<=0||H.dh<=0)continue;const z=H.dw>=H.dh;H.repeat===0?this.ctx.drawImage(e,H.sx,H.sy,H.sw,H.sh,H.dx,H.dy,H.dw,H.dh):(H.repeat===1||H.repeat===2)&&this.drawRepeatedEdge(e,H,z,H.repeat===2)}if(t.fill){const H=g,z=u,K=i-g-h,G=c-u-f,W=m+_,sA=b+v,lA=U-_-F,_A=E-v-y;this.drawRegion(e,H,z,K,G,W,sA,lA,_A)}}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()}},qk=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=>Vp(n)||oc(n)||Gp(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){Vp(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)):oc(A)?(this.pathCallback.path(A.path),this.ctx.clip()):Gp(A)?A.applyClip(this.ctx):_k(A)?this.ctx.globalAlpha*=A.opacity:xk(A)?this.ctx.globalCompositeOperation=A.compositeOperation:Sk(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 AF=(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,b=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)*b):n===4?m>g?(a=i*g,s+=(A-a)*b):(i=a/g,o+=(e-i)*U):n===8?(a>h?(s+=(a-h)*b,a=h):(c+=(h-a)*b,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)*b):(a>h?(s+=(a-h)*b,a=h):(c+=(h-a)*b,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 eF(A,e,t,n,r,s,o,a){return I(this,null,function*(){var i,c;if(r instanceof Tp)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 Hp&&a(r,s,r.canvas),r instanceof Lp)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 Mp&&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 tF(A,e,t,n,r){if(n instanceof Yn){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=EA(Rp),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=EA(Rp),A.fill(),A.restore())}if(oF(n)&&n.value.length){const[s]=e.createFontStyle(r);A.font=s;const o=J(r.fontSize,0),{baseline:a,height:i}=Yp(A,o);A.fillStyle=n instanceof Yn&&n.isPlaceholder?EA(wk):EA(r.color),A.textBaseline="alphabetic",A.textAlign=iF(n.styles.textAlign);const c=Yr(n),u=n instanceof Yn?nF(c,ac(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 Yn&&(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=rF(A,n.value,c.width,r.whiteSpace==="pre"||r.whiteSpace==="nowrap"),b=Pa(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 Fe(v,g.top+E*b,0,0);e.renderTextWithLetterSpacing(new hn(U,y),r.letterSpacing,a,r.writingMode)}),A.restore(),A.textBaseline="alphabetic",A.textAlign="left"}}const nF=(A,e,t)=>A.height<t?new Fe(A.left,e.top,A.width,e.height):A,rF=(A,e,t,n)=>{const r=[],s=e.split(`
|
|
1669
|
+
`);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 sF(A,e,t,n,r,s){return I(this,null,function*(){var o;if(Ae(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=EA(s.color),A.textBaseline="middle",A.textAlign="right";const i=new Fe(r.bounds.left,r.bounds.top+J(r.styles.paddingTop,r.bounds.width),r.bounds.width,Pa(s.lineHeight,s.fontSize.number)/2+1);t.renderTextWithLetterSpacing(new hn(n.listValue,i),s.letterSpacing,Pa(s.lineHeight,s.fontSize.number)/2+2,s.writingMode),A.textBaseline="bottom",A.textAlign="left"}}})}const oF=A=>A instanceof Pp||A instanceof Op?!0:A instanceof Yn&&A.type!=="radio"&&A.type!=="checkbox",iF=A=>{switch(A){case 1:return"center";case 2:return"right";default:return"left"}};var aF=class qf{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 th({ctx:this.ctx,context:this.context,canvas:this.canvas,options:{width:t.width,height:t.height,scale:t.scale}}),this.borderRenderer=new jk({ctx:this.ctx},{path:r=>this.path(r),formatPath:r=>this.formatPath(r)}),this.borderImageRenderer=new Yk(this.ctx),this.effectsRenderer=new qk({ctx:this.ctx},{path:r=>this.path(r)}),this.textRenderer=new Gk({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 I(this,null,function*(){e.element.container.styles.isVisible()&&(yield this.renderStackContent(e))})}renderNode(e){return I(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=Yr(e),a=Po(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:b}=AF(r,s,o,e.styles.objectFit,e.styles.objectPosition);this.ctx.drawImage(n,i,c,u,h,f,g,m,b),this.ctx.restore()}}renderNodeContent(e){return I(this,null,function*(){this.effectsRenderer.applyEffects(e.getEffects(4));const t=e.container,n=e.curves,r=t.styles,s=Yr(t);for(const o of t.textNodes)yield this.textRenderer.renderTextNode(o,r,s);yield eF(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 qf(o,a),t,n,r,(o,a,i)=>this.renderReplacedElement(o,a,i)),tF(this.ctx,this.textRenderer,this.path.bind(this),t,r),yield sF(this.ctx,this.context,this.textRenderer,e,t,r)})}renderStackContent(e){return I(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){eh(this.ctx,e)}formatPath(e){Ah(this.ctx,e)}renderNodeBackgroundAndBorders(e){return I(this,null,function*(){this.effectsRenderer.applyEffects(e.getEffects(2));const t=e.container.styles,n=!yt(t.backgroundColor)||t.backgroundImage.length,r=lF(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=gn(t.backgroundClip,0),a=cF(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(),yt(t.backgroundColor)||(this.ctx.fillStyle=EA(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=Oo(e.curves),h=c.inset?0:eE,f=Qk(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=EA(c.color),this.ctx.shadowBlur=c.blur.number,this.ctx.fillStyle=c.inset?EA(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&&!yt(c.color)&&c.width>0){const u=()=>I(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 b=f.left+m,U=f.width-m;U>0&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(b,f.top,U,f.height),this.ctx.clip(),yield u(),this.ctx.restore())}else yield u()}i++}})}render(e){return I(this,null,function*(){this.options.backgroundColor&&(this.ctx.fillStyle=EA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height));const t=Tk(e);return yield this.renderStack(t),this.effectsRenderer.applyEffects([]),this.canvas})}renderTextClippedBackground(e){return I(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=qp(i,n.fontSize.number),h=new th({ctx:i,context:this.context,canvas:s,options:{width:o,height:a,scale:1}});yt(n.backgroundColor)||(i.fillStyle=EA(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 b of t.textNodes)for(const U of b.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=fn(t.text);let i=r;for(const c of a){if(Ho(o)){e.fillText(t.text,r,s);return}e.fillText(c,i,s),i+=e.measureText(c).width+n}}};const cF=(A,e)=>{switch(A){case 0:return Oo(e);case 2:return Uk(e);default:return Po(e)}},lF=A=>A.backgroundClip.some(e=>e===3);var uF=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 I(this,null,function*(){var t;if((t=this.options.signal)!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");const e=yield tc(ec(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=EA(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})}},dF=(hr=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))}},hr.instances={},hr),pF=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 I(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)&&(As(A)||rh(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 As(A)||rh(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 I(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 I(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&&!zo(A)&&!As(A)&&typeof this._options.proxy!="string",s=!zo(A)&&(this._options.useCORS===!0||r)&&ee.SUPPORT_CORS_IMAGES&&!n,o=!zo(A)&&!n&&!As(A)&&typeof this._options.proxy=="string"&&ee.SUPPORT_CORS_XHR&&!s;if(!n&&this._options.allowTaint===!1&&!zo(A)&&!As(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,(BF(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=ee.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 hF=/^data:image\/svg\+xml/i,fF=/^data:image\/.*;base64,/i,gF=/^data:image\/.*/i,rh=A=>ee.SUPPORT_SVG_DRAWING||!wF(A),zo=A=>gF.test(A),BF=A=>fF.test(A),As=A=>A.substring(0,4)==="blob",wF=A=>A.slice(-3).toLowerCase()==="svg"||hF.test(A);var mF=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}},CF=(vn=class{constructor(e,t,n){var r,s;this.windowBounds=t,this.instanceName=`#${vn.instanceCount++}`,this.config=n,this.logger=new dF({id:this.instanceName,enabled:e.logging}),this.originChecker=new mF(n.window),this.cache=(s=(r=e.cache)!=null?r:n.cache)!=null?s:new pF(this,e),this.onError=e.onError}},vn.instanceCount=1,vn);const Vo=A=>{if(A!=null&&A.aborted)throw new DOMException("The operation was aborted.","AbortError")},bF=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)}})},QF=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}},yF=(A,e,t)=>{var n,r;return k({logging:(n=A.logging)!=null?n:!0,cache:(r=A.cache)!=null?r:e.cache},t)},UF=800,EF=600,sh=0,kF=(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:UF,windowHeight:(o=(s=A.windowHeight)!=null?s:t.innerHeight)!=null?o:EF,scrollX:(i=(a=A.scrollX)!=null?a:t.pageXOffset)!=null?i:sh,scrollY:(u=(c=A.scrollY)!=null?c:t.pageYOffset)!=null?u:sh}},FF=(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}},vF=(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}},_F=(A,e,t)=>{const n=e.ownerDocument,r=n.documentElement?Jn(A,getComputedStyle(n.documentElement).backgroundColor):lt.TRANSPARENT,s=n.body?Jn(A,getComputedStyle(n.body).backgroundColor):lt.TRANSPARENT,o=typeof t=="string"?Jn(A,t):t===null?lt.TRANSPARENT:4294967295;return e===n.documentElement?yt(r)?yt(s)?o:s:r:o},xF=(A,e,t)=>I(null,null,function*(){var K,G,W,sA,lA,_A;if(bF(e),!e.skipValidation){const Ce=e.validator||Pb(),pe=Ce.validateElement(A);if(!pe.valid)throw new Error(pe.error);const De=Ce.validateOptions(e);if(!De.valid)throw new Error(`Invalid options: ${De.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=yF(e,t,QF(e)),o=kF(e,r),a=new Fe(o.scrollX,o.scrollY,o.windowWidth,o.windowHeight),i=new CF(s,a,t),c=(G=(K=e.enablePerformanceMonitoring)!=null?K:e.logging)!=null?G:!1,u=new Mb(i,c);u.start("total",{width:o.windowWidth,height:o.windowHeight});const h=e.signal;Vo(h);const f=(W=e.foreignObjectRendering)!=null?W:!1,g=FF(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 Na(i,A,g),b=m.clonedReferenceElement;if(!b)throw new Error("Unable to find element in cloned iframe");const U=yield m.toIFrame(n,a);u.end("clone"),h!=null&&h.aborted&&(((sA=e.removeContainer)==null||sA)&&Na.destroy(U),Vo(h));const{width:E,height:v,left:F,top:y}=Ia(b)||Ny(b)?Kb(b.ownerDocument):Hr(i,b),_=_F(i,b,e.backgroundColor),R=vF(e,_,F,y,E,v,(lA=r.devicePixelRatio)!=null?lA:1);let H,z;try{return f?(i.logger.debug("Document cloned, using foreign object rendering"),u.start("render-foreignobject"),H=yield new uF(i,R).render(b),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"),Vo(h),i.cache.startDefer(),z=$p(i,b),u.end("parse"),u.start("preload"),yield i.cache.preloadAll(),u.end("preload"),_===z.styles.backgroundColor&&(z.styles.backgroundColor=lt.TRANSPARENT),i.logger.debug(`Starting renderer for element at ${R.x},${R.y} with size ${R.width}x${R.height}`),u.start("render"),Vo(h),H=yield new aF(i,R).render(z),u.end("render")),u.start("cleanup"),((_A=e.removeContainer)==null||_A)&&(Na.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(),H}finally{z&&z.restoreTree()}}),SF=(A,e={},t)=>xF(A,e,Rb.fromElement(A,{cspNonce:e.cspNonce,cache:e.cache}));function IF(A){return I(this,null,function*(){if(!(A instanceof HTMLElement))return{blob:null,error:null};try{const e=yield SF(A,{backgroundColor:"#ffffff",logging:!1,useCORS:!0,scale:1,ignoreElements:n=>n instanceof Element&&n.hasAttribute("data-ap-sdk"),onclone:(n,r)=>{try{Ni(r)}catch(s){}}}),t=yield TF(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 TF(A){return new Promise(e=>{A.toBlob(t=>e(t),"image/png")})}const HF={click:"🖱",inputText:"⌨",scroll:"↕",keypress:"⌤"};function LF(A,e){const{needsCredentials:t,canCreateTask:n,canCreatePlanning:r,captureType:s,hasOnReselect:o,hasOnAddAnother:a}=e;return`
|
|
1670
|
+
<div class="ap-sdk-panel__header">
|
|
1671
|
+
<span class="ap-sdk-panel__title">
|
|
1672
|
+
<span class="ap-sdk-panel__logo">AP</span>
|
|
1673
|
+
Capture to Agent Platform
|
|
1674
|
+
</span>
|
|
1675
|
+
<div class="ap-sdk-panel__header-actions">
|
|
1676
|
+
<button class="ap-sdk-panel__clear" aria-label="Clear selections" title="Clear selections" data-ap-clear-selections type="button">⟲</button>
|
|
1677
|
+
<button class="ap-sdk-panel__config" aria-label="Configure" data-ap-reconfigure>⚙</button>
|
|
1678
|
+
<button class="ap-sdk-panel__close" aria-label="Close" data-ap-close>×</button>
|
|
1679
|
+
</div>
|
|
1680
|
+
</div>
|
|
1681
|
+
<div class="ap-sdk-pick-list" data-ap-pick-list style="display:none"></div>
|
|
1682
|
+
<div class="ap-sdk-panel__context" data-ap-context>
|
|
1683
|
+
${oh(A)}
|
|
1684
|
+
</div>
|
|
1685
|
+
<div class="ap-sdk-panel__screenshot" data-ap-screenshot style="display:none"></div>
|
|
1686
|
+
<div class="ap-sdk-panel__pick-actions" data-ap-pick-actions>
|
|
1687
|
+
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-panel__btn--select-parent" data-ap-select-parent type="button">
|
|
1688
|
+
⬆ Select parent
|
|
1689
|
+
</button>
|
|
1690
|
+
${o?`
|
|
1691
|
+
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-panel__btn--reselect" data-ap-reselect type="button">
|
|
1692
|
+
↻ Re-select
|
|
1693
|
+
</button>`:""}
|
|
1694
|
+
</div>
|
|
1695
|
+
${t?`
|
|
1696
|
+
<div class="ap-sdk-credentials-section" data-ap-credentials>
|
|
1697
|
+
<p class="ap-sdk-credentials-heading">Connect to Agent Platform to continue</p>
|
|
1698
|
+
<p class="ap-sdk-config-hint">You'll be asked to approve this connection on Agent Platform's own sign-in page.</p>
|
|
1699
|
+
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-connect-required type="button">Connect via Agent Platform</button>
|
|
1700
|
+
</div>`:""}
|
|
1701
|
+
<div class="ap-sdk-panel__body">
|
|
1702
|
+
<div class="ap-sdk-panel__field">
|
|
1703
|
+
<label class="ap-sdk-panel__label" for="ap-sdk-note">Instruction</label>
|
|
1704
|
+
<textarea id="ap-sdk-note" class="ap-sdk-panel__textarea" rows="3"
|
|
1705
|
+
placeholder="Describe the task or planning session…" data-ap-note></textarea>
|
|
1706
|
+
</div>
|
|
1707
|
+
${a?`
|
|
1708
|
+
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--add-another" data-ap-add-another disabled>
|
|
1709
|
+
+ Add another
|
|
1710
|
+
</button>`:""}
|
|
1711
|
+
<div class="ap-sdk-panel__field">
|
|
1712
|
+
<div class="ap-sdk-panel__label">Type</div>
|
|
1713
|
+
<div class="ap-sdk-panel__toggle">
|
|
1714
|
+
${r?`<button class="ap-sdk-panel__toggle-btn${s==="planning"?" ap-sdk-active":""}" data-ap-type="planning">Planning Session</button>`:""}
|
|
1715
|
+
${n?`<button class="ap-sdk-panel__toggle-btn${s==="task"?" ap-sdk-active":""}" data-ap-type="task">Task</button>`:""}
|
|
1716
|
+
${n?`<button class="ap-sdk-panel__toggle-btn${s==="automate"?" ap-sdk-active":""}" data-ap-type="automate">Automate</button>`:""}
|
|
1717
|
+
</div>
|
|
1718
|
+
</div>
|
|
1719
|
+
<div class="ap-sdk-panel__field" data-ap-automate-options style="display:none">
|
|
1720
|
+
<label class="ap-sdk-advanced__checkbox-label">
|
|
1721
|
+
<input type="checkbox" data-ap-allow-submit />
|
|
1722
|
+
Allow submit / confirm actions
|
|
1723
|
+
</label>
|
|
1724
|
+
<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>
|
|
1725
|
+
</div>
|
|
1726
|
+
</div>
|
|
1727
|
+
<div class="ap-sdk-panel__status" data-ap-status style="display:none"></div>
|
|
1728
|
+
<div class="ap-sdk-panel__footer">
|
|
1729
|
+
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-submit>Submit</button>
|
|
1730
|
+
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost" data-ap-cancel>Cancel</button>
|
|
1731
|
+
</div>
|
|
1732
|
+
`}function oh(A){var e,t;return(e=A.interactionSteps)!=null&&e.length?`
|
|
1733
|
+
<div class="ap-sdk-panel__context-label">Recorded steps (${A.interactionSteps.length})</div>
|
|
1734
|
+
<div class="ap-sdk-panel__context-steps">
|
|
1735
|
+
${A.interactionSteps.map(n=>`
|
|
1736
|
+
<div class="ap-sdk-panel__context-step">
|
|
1737
|
+
<span class="ap-sdk-panel__context-step-icon">${HF[n.action]}</span>
|
|
1738
|
+
<span class="ap-sdk-panel__context-step-text">${we(n.description)}</span>
|
|
1739
|
+
</div>
|
|
1740
|
+
`).join("")}
|
|
1741
|
+
</div>
|
|
1742
|
+
`:`
|
|
1743
|
+
<div class="ap-sdk-panel__context-label">Captured element</div>
|
|
1744
|
+
<div class="ap-sdk-panel__context-text" title="${we((t=A.elementText)!=null?t:"")}">${we(A.elementText||"(no text)")}</div>
|
|
1745
|
+
${A.cssSelector?`<div class="ap-sdk-panel__context-selector" title="${we(A.cssSelector)}">${we(A.cssSelector)}</div>`:""}
|
|
1746
|
+
`}function Vt(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 DF(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=`
|
|
1747
|
+
<div class="ap-sdk-success-card">
|
|
1748
|
+
<svg class="ap-sdk-success-check" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
|
|
1749
|
+
<circle class="ap-sdk-success-check__circle" cx="24" cy="24" r="22"/>
|
|
1750
|
+
<path class="ap-sdk-success-check__tick" d="M14 24l7 7 13-14"/>
|
|
1751
|
+
</svg>
|
|
1752
|
+
<p class="ap-sdk-success-headline">${we(o)}</p>
|
|
1753
|
+
<div class="ap-sdk-success-meta">
|
|
1754
|
+
<span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--${e}">${we(s)}</span>
|
|
1755
|
+
<span class="ap-sdk-success-title" title="${we(t)}">${we(i)}</span>
|
|
1756
|
+
</div>
|
|
1757
|
+
<div class="ap-sdk-success-actions">
|
|
1758
|
+
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-success-view>${we(a)}</button>
|
|
1759
|
+
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost" data-ap-success-close>Close</button>
|
|
1760
|
+
</div>
|
|
1761
|
+
</div>
|
|
1762
|
+
`,A.querySelector("[data-ap-success-view]").addEventListener("click",()=>window.open(n,"_blank","noopener,noreferrer")),A.querySelector("[data-ap-success-close]").addEventListener("click",r)}function cc(A,e){A.querySelectorAll("button, input, textarea, select").forEach(t=>{t.disabled=e})}function we(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function RF(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=`
|
|
1763
|
+
<div class="ap-sdk-screenshot__status ap-sdk-screenshot__status--muted">Screenshot unavailable for this element.</div>
|
|
1764
|
+
<div class="ap-sdk-screenshot__error">${we(A.screenshotError)}</div>
|
|
1765
|
+
`):(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=`
|
|
1766
|
+
<label class="ap-sdk-screenshot__toggle">
|
|
1767
|
+
<input type="checkbox" data-ap-screenshot-include ${A.screenshotIncluded?"checked":""} />
|
|
1768
|
+
Attach a screenshot of the selected element
|
|
1769
|
+
</label>
|
|
1770
|
+
<img class="ap-sdk-screenshot__thumb" src="${t}" alt="Screenshot of the selected element" />
|
|
1771
|
+
`,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(),IF(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 OF({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:b,allowSubmitCheckbox:U,automateOptionsEl:E,statusEl:v}=e,F=()=>{Db({captureType:A.captureType,note:u.value,completedPicks:A.completedPicks.map(({ctx:K,instruction:G})=>({ctx:K,instruction:G})),allowSubmit:A.allowSubmit,currentCtx:A.currentCtx})},y=K=>{K?(a.innerHTML=oh(K),u.disabled=!1,u.placeholder="Describe the task or planning session…",setTimeout(()=>u.focus(),50)):(a.innerHTML=`
|
|
1772
|
+
<div class="ap-sdk-panel__context-label">Next element</div>
|
|
1773
|
+
<div class="ap-sdk-panel__context-text ap-sdk-awaiting-pick">👆 Hover and click any element on the page</div>
|
|
1774
|
+
`,u.disabled=!0,u.placeholder="Pick an element to continue…")},_=()=>{if(A.completedPicks.length===0){i.style.display="none",i.innerHTML="";return}i.style.display="block",i.innerHTML=A.completedPicks.map((K,G)=>{var W;return`
|
|
1775
|
+
<div class="ap-sdk-pick-entry" data-pick-index="${G}">
|
|
1776
|
+
<div class="ap-sdk-pick-entry__header">
|
|
1777
|
+
<span class="ap-sdk-pick-entry__number">${G+1}</span>
|
|
1778
|
+
<span class="ap-sdk-pick-entry__element" title="${we((W=K.ctx.elementText)!=null?W:"")}">${we(K.ctx.elementText||"(no text)")}</span>
|
|
1779
|
+
<button class="ap-sdk-pick-entry__remove" data-ap-remove="${G}" aria-label="Remove pick ${G+1}">×</button>
|
|
1780
|
+
</div>
|
|
1781
|
+
<div class="ap-sdk-pick-entry__instruction">${we(K.instruction)}</div>
|
|
1782
|
+
</div>
|
|
1783
|
+
`}).join(""),i.querySelectorAll("[data-ap-remove]").forEach(K=>{K.addEventListener("click",()=>{const G=parseInt(K.dataset.apRemove,10);A.completedPicks.splice(G,1),_(),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)},H=()=>{h&&(h.disabled=!u.value.trim()||A.submitting||A.awaitingPick)},z=(K,G)=>{A.currentCtx=K,A.currentPickedEl=G,y(K),r(G),R(),F()};return R(),m.addEventListener("click",()=>{A.completedPicks=[],A.allowSubmit=!1,A.captureType=n,u.value="",U.checked=!1,b.forEach(K=>K.classList.toggle("ap-sdk-active",K.dataset.apType===A.captureType)),E.style.display="none",_(),ia(),Vt(v,null,""),H(),u.focus()}),f.addEventListener("click",()=>{var G;const K=(G=A.currentPickedEl)==null?void 0:G.parentElement;K&&(z(bl(K),K),t.captureScreenshotFor(K))}),g&&s&&g.addEventListener("click",()=>{if(A.awaitingPick)return;const K=A.currentCtx,G=A.currentPickedEl,W=A.currentScreenshotBlob,sA=A.screenshotIncluded,lA=A.screenshotError;A.awaitingPick=!0,R(),H(),y(null),t.invalidateInFlightCapture(),A.screenshotCapturing=!1,A.currentScreenshotBlob=null,A.screenshotError=null,t.renderScreenshotUi(),s((_A,Ce)=>{A.awaitingPick=!1,z(_A,Ce),t.captureScreenshotFor(Ce),H()},()=>{A.awaitingPick=!1,G&&z(K,G),A.currentScreenshotBlob=W,A.screenshotIncluded=sA,A.screenshotError=lA,t.renderScreenshotUi(),H()})}),h&&o&&(u.addEventListener("input",H),h.addEventListener("click",()=>{const K=u.value.trim();!K||A.awaitingPick||(A.completedPicks.push({ctx:A.currentCtx,instruction:K,screenshotBlob:A.screenshotIncluded?A.currentScreenshotBlob:null}),_(),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((G,W)=>{A.awaitingPick=!1,z(G,W),t.captureScreenshotFor(W),H()}))})),{persistDraft:F,renderPickList:_}}function PF(A,e){A.style.display="block",A.className="ap-sdk-panel__status ap-sdk-panel__status--error",A.innerHTML=`
|
|
1784
|
+
<p>Your session expired.</p>
|
|
1785
|
+
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-reconnect type="button">Reconnect</button>
|
|
1786
|
+
`;const t=A.querySelector("[data-ap-reconnect]");t.addEventListener("click",()=>I(null,null,function*(){t.disabled=!0,t.textContent="Connecting…";try{yield e()}catch(n){Vt(A,"error",n instanceof Error?n.message:"Could not reconnect — please try again.")}}))}let Gt=null;function MF(){const A=new Uint32Array(4);return crypto.getRandomValues(A),Array.from(A,e=>e.toString(16)).join("")}function lc(A){if(Gt){const a=Gt;a.cleanup(),a.popup.closed||a.popup.close(),Gt=null}const e=A.replace(/\/+$/,""),t=new URL(e).origin,n=MF(),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),(Gt==null?void 0:Gt.popup)===o&&(Gt=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);Gt={popup:o,cleanup:u}}):Promise.reject(new Error("Popup blocked — please allow popups for this site and try again."))}const KF="https://agent-platform.tung.engineering",uc="ap-sdk-config";function NF(){try{const A=sessionStorage.getItem(uc);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()?(ih(),null):e}catch(A){return null}}function Go(A){sessionStorage.setItem(uc,JSON.stringify(A)),zF({backendUrl:A.backendUrl,projectCode:A.projectCode})}function ih(){sessionStorage.removeItem(uc)}const ah="ap-sdk-last-connection";function $F(){try{const A=localStorage.getItem(ah);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 zF(A){try{localStorage.setItem(ah,JSON.stringify(A))}catch(e){}}let rA=null,es=null;function Et(){rA&&st(rA),rA==null||rA.remove(),rA=null,es==null||es(),es=null}function dc(A){rA&&Et(),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=$F();e?t(e):n(KF),document.body.appendChild(rA),rt(rA),es=Tr(rA,Ir);function t(s){if(!rA)return;rA.innerHTML=`
|
|
1741
1787
|
<div class="ap-sdk-panel__header">
|
|
1742
1788
|
<span class="ap-sdk-panel__title">
|
|
1743
1789
|
<span class="ap-sdk-panel__logo">AP</span>
|
|
@@ -1747,7 +1793,7 @@ ${n}${r?`
|
|
|
1747
1793
|
</div>
|
|
1748
1794
|
<div class="ap-sdk-panel__body">
|
|
1749
1795
|
<p class="ap-sdk-config-hint">
|
|
1750
|
-
Reconnect to <strong>${
|
|
1796
|
+
Reconnect to <strong>${pc(s.backendUrl)}</strong>. You'll be asked to
|
|
1751
1797
|
approve this connection on Agent Platform's own sign-in page.
|
|
1752
1798
|
</p>
|
|
1753
1799
|
</div>
|
|
@@ -1756,7 +1802,7 @@ ${n}${r?`
|
|
|
1756
1802
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-reconnect>Reconnect</button>
|
|
1757
1803
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-use-different>Use a different connection</button>
|
|
1758
1804
|
</div>
|
|
1759
|
-
`;const
|
|
1805
|
+
`;const o=rA.querySelector("[data-ap-cfg-status]"),a=rA.querySelector("[data-ap-reconnect]");rA.querySelector("[data-ap-close]").addEventListener("click",()=>{Et()}),rA.querySelector("[data-ap-use-different]").addEventListener("click",()=>n(s.backendUrl)),a.addEventListener("click",()=>I(null,null,function*(){a.disabled=!0,a.textContent="Connecting…",Zt(o,null,"");try{const{code:i}=yield lc(s.backendUrl),{token:c,expiresAt:u}=yield ra({backendUrl:s.backendUrl},i,window.location.origin),h={backendUrl:s.backendUrl,token:c},f=yield Iu(h);if(f.length===0){Zt(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){Et(),A({backendUrl:s.backendUrl,token:c,projectCode:g.key,expiresAt:u});return}const m=ku(window.location.href,f),b=m?f.find(U=>U.id===m):void 0;b?(Et(),A({backendUrl:s.backendUrl,token:c,projectCode:b.key,expiresAt:u})):r(s.backendUrl,c,u,f)}catch(i){Zt(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=`
|
|
1760
1806
|
<div class="ap-sdk-panel__header">
|
|
1761
1807
|
<span class="ap-sdk-panel__title">
|
|
1762
1808
|
<span class="ap-sdk-panel__logo">AP</span>
|
|
@@ -1769,7 +1815,7 @@ ${n}${r?`
|
|
|
1769
1815
|
<label class="ap-sdk-panel__label" for="ap-sdk-cfg-url">Backend URL</label>
|
|
1770
1816
|
<input id="ap-sdk-cfg-url" class="ap-sdk-panel__input" type="url"
|
|
1771
1817
|
placeholder="https://your-platform.example.com"
|
|
1772
|
-
value="${
|
|
1818
|
+
value="${ch(s)}" autocomplete="off" data-ap-cfg-url />
|
|
1773
1819
|
</div>
|
|
1774
1820
|
<p class="ap-sdk-config-hint">
|
|
1775
1821
|
You'll be asked to approve this connection on Agent Platform's own sign-in page.
|
|
@@ -1780,7 +1826,7 @@ ${n}${r?`
|
|
|
1780
1826
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-connect>Connect via Agent Platform</button>
|
|
1781
1827
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-cancel>Cancel</button>
|
|
1782
1828
|
</div>
|
|
1783
|
-
`;const
|
|
1829
|
+
`;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",()=>{Et()}),rA.querySelector("[data-ap-cancel]").addEventListener("click",()=>{Et()}),i.addEventListener("click",()=>I(null,null,function*(){const c=o.value.trim();if(!c){Zt(a,"error","Backend URL is required.");return}i.disabled=!0,i.textContent="Connecting…",Zt(a,null,"");try{const{code:u}=yield lc(c),{token:h,expiresAt:f}=yield ra({backendUrl:c},u,window.location.origin),m=yield Iu({backendUrl:c,token:h});if(m.length===0){Zt(a,"error","No projects found — check your account permissions."),i.disabled=!1,i.textContent="Connect via Agent Platform";return}const b=ku(window.location.href,m),U=b?m.find(E=>E.id===b):void 0;if(U){Et(),A({backendUrl:c,token:h,projectCode:U.key,expiresAt:f});return}r(c,h,f,m)}catch(u){Zt(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="${ch(f.key)}"${f.key===(e==null?void 0:e.projectCode)?" selected":""}>${pc(f.name)} (${pc(f.key)})</option>`).join("");rA.innerHTML=`
|
|
1784
1830
|
<div class="ap-sdk-panel__header">
|
|
1785
1831
|
<span class="ap-sdk-panel__title">
|
|
1786
1832
|
<span class="ap-sdk-panel__logo">AP</span>
|
|
@@ -1793,7 +1839,7 @@ ${n}${r?`
|
|
|
1793
1839
|
<label class="ap-sdk-panel__label" for="ap-sdk-cfg-project">Project</label>
|
|
1794
1840
|
<select id="ap-sdk-cfg-project" class="ap-sdk-panel__input" data-ap-cfg-project>
|
|
1795
1841
|
<option value="">Select a project…</option>
|
|
1796
|
-
${
|
|
1842
|
+
${c}
|
|
1797
1843
|
</select>
|
|
1798
1844
|
</div>
|
|
1799
1845
|
</div>
|
|
@@ -1802,130 +1848,175 @@ ${n}${r?`
|
|
|
1802
1848
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-save>Save</button>
|
|
1803
1849
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-back>Back</button>
|
|
1804
1850
|
</div>
|
|
1805
|
-
`;const
|
|
1851
|
+
`;const u=rA.querySelector("[data-ap-cfg-project]"),h=rA.querySelector("[data-ap-cfg-status]");rA.querySelector("[data-ap-close]").addEventListener("click",()=>{Et()}),rA.querySelector("[data-ap-back]").addEventListener("click",()=>n(s)),rA.querySelector("[data-ap-save]").addEventListener("click",()=>{const f=u.value;if(!f){Zt(h,"error","Please select a project.");return}Et(),A({backendUrl:s,token:o,projectCode:f,expiresAt:a})})}}function Zt(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 ch(A){return A.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function pc(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const hc="ap-sdk-active-automation";function VF(){try{const A=sessionStorage.getItem(hc);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 lh(A){try{sessionStorage.setItem(hc,JSON.stringify(A))}catch(e){}}function uh(){try{sessionStorage.removeItem(hc)}catch(A){}}function fc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Bn=fc();function dh(A){Bn=A}var wn={exec:()=>null};function tr(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(re.caret,"$1"),t=t.replace(r,o),n},getRegex:()=>new RegExp(t,e)};return n}var GF=((A="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+A)}catch(e){return!1}})(),re={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:tr(A=>new RegExp(`^ {0,${A}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:tr(A=>new RegExp(`^ {0,${A}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:tr(A=>new RegExp(`^ {0,${A}}(?:\`\`\`|~~~)`)),headingBeginRegex:tr(A=>new RegExp(`^ {0,${A}}#`)),htmlBeginRegex:tr(A=>new RegExp(`^ {0,${A}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:tr(A=>new RegExp(`^ {0,${A}}>`))},ZF=/^(?:[ \t]*(?:\n|$))+/,XF=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,WF=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ts=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,JF=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,gc=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ph=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hh=tA(ph).replace(/bull/g,gc).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(),jF=tA(ph).replace(/bull/g,gc).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(),Bc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,YF=/^[^\n]+/,wc=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qF=tA(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",wc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Av=tA(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,gc).getRegex(),Zo="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",mc=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ev=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",mc).replace("tag",Zo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fh=A=>tA(Bc).replace("hr",ts).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",Zo).getRegex(),tv=fh(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),nv=fh(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),rv=tA(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",nv).getRegex(),Cc={blockquote:rv,code:XF,def:qF,fences:WF,heading:JF,hr:ts,html:ev,lheading:hh,list:Av,newline:ZF,paragraph:tv,table:wn,text:YF},gh=tA("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ts).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",Zo).getRegex(),sv=$(k({},Cc),{lheading:jF,table:gh,paragraph:tA(Bc).replace("hr",ts).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gh).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",Zo).getRegex()}),ov=$(k({},Cc),{html:tA(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",mc).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:wn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:tA(Bc).replace("hr",ts).replace("heading",` *#{1,6} *[^
|
|
1852
|
+
]`).replace("lheading",hh).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),iv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,av=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Bh=/^( {2,}|\\)\n(?!\s*$)/,cv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,kt=/[\p{P}\p{S}]/u,nr=/[\s\p{P}\p{S}]/u,ns=/[^\s\p{P}\p{S}]/u,lv=tA(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,nr).getRegex(),uv=/[\p{Pi}\p{Ps}"']/u,wh=/(?!~)[\p{P}\p{S}]/u,dv=/(?!~)[\s\p{P}\p{S}]/u,pv=/(?:[^\s\p{P}\p{S}]|~)/u,hv=tA(/link|precode-code|html/,"g").replace("link",new RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)")).replace("precode-",GF?"(?<!`)()":"(^^|[^`])").replace("code",new RegExp("(?<b>`+)[^`]+\\k<b>(?!`)")).replace("html",/<(?! )[^<>]*?>/).getRegex(),mh=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fv=tA(mh,"u").replace(/punct/g,kt).getRegex(),gv=tA(mh,"u").replace(/punct/g,wh).getRegex(),Bv=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,wv=tA(Bv,"u").replace(/openQuote/g,uv).replace(/punct/g,kt).getRegex(),Ch="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mv=tA(Ch,"gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,nr).replace(/punct/g,kt).getRegex(),Cv=tA(Ch,"gu").replace(/notPunctSpace/g,pv).replace(/punctSpace/g,dv).replace(/punct/g,wh).getRegex(),bv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Qv=tA(bv,"gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,nr).replace(/punct/g,kt).getRegex(),yv=tA("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,nr).replace(/punct/g,kt).getRegex(),Uv="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Ev=tA(Uv,"gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,nr).replace(/punct/g,kt).getRegex(),kv=tA(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,kt).getRegex(),Fv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",vv=tA(Fv,"gu").replace(/notPunctSpace/g,ns).replace(/punctSpace/g,nr).replace(/punct/g,kt).getRegex(),_v=tA(/\\(punct)/,"gu").replace(/punct/g,kt).getRegex(),xv=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(),Sv=tA(mc).replace("(?:-->|$)","-->").getRegex(),Iv=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",Sv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Tv=tA(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Xo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),bh=tA(/^!?\[(label)\]\[(ref)\]/).replace("label",Xo).replace("ref",wc).getRegex(),Qh=tA(/^!?\[(ref)\](?:\[\])?/).replace("ref",wc).getRegex(),Hv=tA("reflink|nolink(?!\\()","g").replace("reflink",bh).replace("nolink",Qh).getRegex(),yh=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,bc={_backpedal:wn,anyPunctuation:_v,autolink:xv,blockSkip:hv,br:Bh,code:av,del:wn,delLDelim:wn,delRDelim:wn,emStrongLDelim:fv,emStrongRDelimAst:mv,emStrongRDelimUnd:yv,escape:iv,link:Tv,nolink:Qh,punctuation:lv,reflink:bh,reflinkSearch:Hv,tag:Iv,text:cv,url:wn},Lv=$(k({},bc),{emStrongLDelim:wv,emStrongRDelimAst:Qv,emStrongRDelimUnd:Ev,link:tA(/^!?\[(label)\]\((.*?)\)/).replace("label",Xo).getRegex(),reflink:tA(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xo).getRegex()}),Qc=$(k({},bc),{emStrongRDelimAst:Cv,emStrongLDelim:gv,delLDelim:kv,delRDelim:vv,url:tA(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",yh).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",yh).getRegex()}),Dv=$(k({},Qc),{br:tA(Bh).replace("{2,}","*").getRegex(),text:tA(Qc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Wo={normal:Cc,gfm:sv,pedantic:ov},rs={normal:bc,gfm:Qc,breaks:Dv,pedantic:Lv},Rv={"&":"&","<":"<",">":">",'"':""","'":"'"},Uh=A=>Rv[A];function dt(A,e){if(e){if(re.escapeTest.test(A))return A.replace(re.escapeReplace,Uh)}else if(re.escapeTestNoEncode.test(A))return A.replace(re.escapeReplaceNoEncode,Uh);return A}function Eh(A){try{A=encodeURI(A).replace(re.percentDecode,"%")}catch(e){return null}return A}function kh(A,e){var s;let t=A.replace(re.findPipe,(o,a,i)=>{let c=!1,u=a;for(;--u>=0&&i[u]==="\\";)c=!c;return c?"|":" |"}),n=t.split(re.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(re.slashPipe,"|");return n}function Xt(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 Fh(A){let e=A.split(`
|
|
1853
|
+
`),t=e.length-1;for(;t>=0&&re.blankLine.test(e[t]);)t--;return e.length-t<=2?A:e.slice(0,t+1).join(`
|
|
1854
|
+
`)}function Ov(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 Pv(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 vh(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 Mv(A,e,t){let n=A.match(t.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(`
|
|
1855
|
+
`).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(`
|
|
1856
|
+
`)}var Jo=class{constructor(A){gA(this,"options");gA(this,"rules");gA(this,"lexer");this.options=A||Bn}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]:Fh(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=Mv(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=Xt(t,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(t=n.trim())}return{type:"heading",raw:Xt(e[0],`
|
|
1857
|
+
`),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:Xt(e[0],`
|
|
1858
|
+
`)}}blockquote(A){let e=this.rules.block.blockquote.exec(A);if(e){let t=Xt(e[0],`
|
|
1859
|
+
`).split(`
|
|
1860
|
+
`),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(`
|
|
1861
|
+
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
1862
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
1863
|
+
${c}`:c,r=r?`${r}
|
|
1864
|
+
${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(`
|
|
1865
|
+
`),b=g.raw+`
|
|
1866
|
+
`+m.replace(this.rules.other.blockquoteSetextReplace2,""),U=this.blockquote(b);s[s.length-1]=U,n=`${n}
|
|
1867
|
+
${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+`
|
|
1868
|
+
`+t.join(`
|
|
1869
|
+
`),b=this.list(m);s[s.length-1]=b,n=n.substring(0,n.length-f.raw.length)+b.raw,r=r.substring(0,r.length-g.raw.length)+b.raw,t=m.substring(s.at(-1).raw.length).split(`
|
|
1870
|
+
`);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=Pv(e[2].split(`
|
|
1871
|
+
`,1)[0],e[1].length),f=A.split(`
|
|
1872
|
+
`,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+`
|
|
1873
|
+
`,A=A.substring(f.length+1),i=!0),!i){let b=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 _=A.split(`
|
|
1874
|
+
`,1)[0],R;if(f=_,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)||b.test(f)||U.test(f))break;if(R.search(this.rules.other.nonSpaceChar)>=m||!f.trim())u+=`
|
|
1875
|
+
`+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+=`
|
|
1876
|
+
`+f}g=!f.trim(),c+=_+`
|
|
1877
|
+
`,A=A.substring(_.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=Fh(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:Xt(e[0],`
|
|
1878
|
+
`),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=kh(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(`
|
|
1879
|
+
`):[],s={type:"table",raw:Xt(e[0],`
|
|
1880
|
+
`),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(kh(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:Xt(e[0],`
|
|
1881
|
+
`),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)===`
|
|
1882
|
+
`?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=Xt(t.slice(0,-1),"\\");if((t.length-s.length)%2===0)return}else{let s=Ov(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)),vh(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 vh(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 b=g.slice(1,-1);return{type:"em",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}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}}}},Ge=class sl{constructor(e){gA(this,"tokens");gA(this,"options");gA(this,"state");gA(this,"inlineQueue");gA(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Bn,this.options.tokenizer=this.options.tokenizer||new Jo,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:re,block:Wo.normal,inline:rs.normal};this.options.pedantic?(t.block=Wo.pedantic,t.inline=rs.pedantic):this.options.gfm&&(t.block=Wo.gfm,this.options.breaks?t.inline=rs.breaks:t.inline=rs.gfm),this.tokenizer.rules=t}static get rules(){return{block:Wo,inline:rs}}static lex(e,t){return new sl(t).lex(e)}static lexInline(e,t){return new sl(t).inlineTokens(e)}lex(e){e=e.replace(re.carriageReturn,`
|
|
1883
|
+
`),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(re.tabCharGlobal," ").replace(re.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+=`
|
|
1884
|
+
`: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(`
|
|
1885
|
+
`)?"":`
|
|
1886
|
+
`)+i.raw,u.text+=`
|
|
1887
|
+
`+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(`
|
|
1888
|
+
`)?"":`
|
|
1889
|
+
`)+i.raw,u.text+=`
|
|
1890
|
+
`+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(`
|
|
1891
|
+
`)?"":`
|
|
1892
|
+
`)+i.raw,u.text+=`
|
|
1893
|
+
`+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(`
|
|
1894
|
+
`)?"":`
|
|
1895
|
+
`)+i.raw,u.text+=`
|
|
1896
|
+
`+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,b)=>{let U=b?b.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(b=>(g=b.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 b=t.at(-1);g.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.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 b=1/0,U=e.slice(1),E;this.options.extensions.startInline.forEach(v=>{E=v.call({lexer:this},U),typeof E=="number"&&E>=0&&(b=Math.min(b,E))}),b<1/0&&b>=0&&(m=e.substring(0,b+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 b=t.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.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)}},jo=class{constructor(A){gA(this,"options");gA(this,"parser");this.options=A||Bn}space(A){return""}code({text:A,lang:e,escaped:t}){var s;let n=(s=(e||"").match(re.notSpaceStart))==null?void 0:s[0],r=A.replace(re.endingNewline,"")+`
|
|
1897
|
+
`;return n?'<pre><code class="language-'+dt(n)+'">'+(t?r:dt(r,!0))+`</code></pre>
|
|
1898
|
+
`:"<pre><code>"+(t?r:dt(r,!0))+`</code></pre>
|
|
1899
|
+
`}blockquote({tokens:A}){return`<blockquote>
|
|
1900
|
+
${this.parser.parse(A)}</blockquote>
|
|
1901
|
+
`}html({text:A}){return A}def(A){return""}heading({tokens:A,depth:e}){return`<h${e}>${this.parser.parseInline(A)}</h${e}>
|
|
1902
|
+
`}hr(A){return`<hr>
|
|
1903
|
+
`}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+`>
|
|
1904
|
+
`+n+"</"+r+`>
|
|
1905
|
+
`}listitem(A){return`<li>${this.parser.parse(A.tokens)}</li>
|
|
1906
|
+
`}checkbox({checked:A}){return"<input "+(A?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:A}){return`<p>${this.parser.parseInline(A)}</p>
|
|
1907
|
+
`}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>
|
|
1908
|
+
<thead>
|
|
1909
|
+
`+e+`</thead>
|
|
1910
|
+
`+n+`</table>
|
|
1911
|
+
`}tablerow({text:A}){return`<tr>
|
|
1912
|
+
${A}</tr>
|
|
1913
|
+
`}tablecell(A){let e=this.parser.parseInline(A.tokens),t=A.header?"th":"td";return(A.align?`<${t} align="${A.align}">`:`<${t}>`)+e+`</${t}>
|
|
1914
|
+
`}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>${dt(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=Eh(A);if(r===null)return n;A=r;let s='<a href="'+A+'"';return e&&(s+=' title="'+dt(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=Eh(A);if(r===null)return dt(t);A=r;let s=`<img src="${A}" alt="${dt(t)}"`;return e&&(s+=` title="${dt(e)}"`),s+=">",s}text(A){return"tokens"in A&&A.tokens?this.parser.parseInline(A.tokens):"escaped"in A&&A.escaped?A.text:dt(A.text)}},yc=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 ol{constructor(e){gA(this,"options");gA(this,"renderer");gA(this,"textRenderer");this.options=e||Bn,this.options.renderer=this.options.renderer||new jo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new yc}static parse(e,t){return new ol(t).parse(e)}static parseInline(e,t){return new ol(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}},ss=(Ci=class{constructor(A){gA(this,"options");gA(this,"block");this.options=A||Bn}preprocess(A){return A}postprocess(A){return A}processAllTokens(A){return A}emStrongMask(A){return A}provideLexer(A=this.block){return A?Ge.lex:Ge.lexInline}provideParser(A=this.block){return A?Ze.parse:Ze.parseInline}},gA(Ci,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),gA(Ci,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ci),Kv=class{constructor(...A){gA(this,"defaults",fc());gA(this,"options",this.setOptions);gA(this,"parse",this.parseMarkdown(!0));gA(this,"parseInline",this.parseMarkdown(!1));gA(this,"Parser",Ze);gA(this,"Renderer",jo);gA(this,"TextRenderer",yc);gA(this,"Lexer",Ge);gA(this,"Tokenizer",Jo);gA(this,"Hooks",ss);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 jo(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 Jo(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 ss;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];ss.passThroughHooks.has(s)?r[o]=c=>{if(this.defaults.async&&ss.passThroughHooksRespectAsync.has(s))return I(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 I(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 Ge.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 I(this,null,function*(){let o=r.hooks?yield r.hooks.preprocess(e):e,a=yield(r.hooks?yield r.hooks.provideLexer(A):A?Ge.lex:Ge.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?Ge.lex:Ge.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+=`
|
|
1915
|
+
Please report this to https://github.com/markedjs/marked.`,A){let n="<p>An error occurred:</p><pre>"+dt(t.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(t);throw t}}},mn=new Kv;function hA(A,e){return mn.parse(A,e)}hA.options=hA.setOptions=function(A){return mn.setOptions(A),hA.defaults=mn.defaults,dh(hA.defaults),hA},hA.getDefaults=fc,hA.defaults=Bn;function Nv(...A){return mn.use(...A),hA.defaults=mn.defaults,dh(hA.defaults),hA}hA.use=Nv,hA.walkTokens=function(A,e){return mn.walkTokens(A,e)},hA.parseInline=mn.parseInline,hA.Parser=Ze,hA.parser=Ze.parse,hA.Renderer=jo,hA.TextRenderer=yc,hA.Lexer=Ge,hA.lexer=Ge.lex,hA.Tokenizer=Jo,hA.Hooks=ss,hA.parse=hA,hA.options,hA.setOptions,hA.walkTokens,hA.parseInline,Ze.parse,Ge.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:_h,setPrototypeOf:xh,isFrozen:$v,getPrototypeOf:zv,getOwnPropertyDescriptor:Vv}=Object;let{freeze:ae,seal:Ie,create:Uc}=Object,{apply:Ec,construct:kc}=typeof Reflect!="undefined"&&Reflect;ae||(ae=function(e){return e}),Ie||(Ie=function(e){return e}),Ec||(Ec=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)}),kc||(kc=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 Yo=le(Array.prototype.forEach),Gv=le(Array.prototype.lastIndexOf),Sh=le(Array.prototype.pop),os=le(Array.prototype.push),Zv=le(Array.prototype.splice),qo=le(String.prototype.toLowerCase),Fc=le(String.prototype.toString),vc=le(String.prototype.match),is=le(String.prototype.replace),Xv=le(String.prototype.indexOf),Wv=le(String.prototype.trim),Xe=le(Object.prototype.hasOwnProperty),ce=le(RegExp.prototype.test),as=Jv(TypeError);function le(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 Ec(A,e,n)}}function Jv(A){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return kc(A,t)}}function eA(A,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qo;xh&&xh(A,null);let n=e.length;for(;n--;){let r=e[n];if(typeof r=="string"){const s=t(r);s!==r&&($v(e)||(e[n]=s),r=s)}A[r]=!0}return A}function jv(A){for(let e=0;e<A.length;e++)Xe(A,e)||(A[e]=null);return A}function pt(A){const e=Uc(null);for(const[t,n]of _h(A))Xe(A,t)&&(Array.isArray(n)?e[t]=jv(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=pt(n):e[t]=n);return e}function cs(A,e){for(;A!==null;){const n=Vv(A,e);if(n){if(n.get)return le(n.get);if(typeof n.value=="function")return le(n.value)}A=zv(A)}function t(){return null}return t}const Ih=ae(["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"]),_c=ae(["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"]),xc=ae(["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"]),Yv=ae(["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"]),Sc=ae(["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"]),qv=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Th=ae(["#text"]),Hh=ae(["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"]),Ic=ae(["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"]),Lh=ae(["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"]),Ai=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),A_=Ie(/\{\{[\w\W]*|[\w\W]*\}\}/gm),e_=Ie(/<%[\w\W]*|[\w\W]*%>/gm),t_=Ie(/\$\{[\w\W]*/gm),n_=Ie(/^data-[\-\w.\u00B7-\uFFFF]+$/),r_=Ie(/^aria-[\-\w]+$/),Dh=Ie(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),s_=Ie(/^(?:\w+script|data):/i),o_=Ie(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rh=Ie(/^html$/i),i_=Ie(/^[a-z][.\w]*(-[.\w]+)+$/i);var Oh=Object.freeze({__proto__:null,ARIA_ATTR:r_,ATTR_WHITESPACE:o_,CUSTOM_ELEMENT:i_,DATA_ATTR:n_,DOCTYPE_NAME:Rh,ERB_EXPR:e_,IS_ALLOWED_URI:Dh,IS_SCRIPT_OR_DATA:s_,MUSTACHE_EXPR:A_,TMPLIT_EXPR:t_});const ls={element:1,text:3,progressingInstruction:7,comment:8,document:9},a_=function(){return typeof window=="undefined"?null:window},c_=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}},Ph=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Mh(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a_();const e=Z=>Mh(Z);if(e.version="3.3.1",e.removed=[],!A||!A.document||A.document.nodeType!==ls.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,b=cs(m,"cloneNode"),U=cs(m,"remove"),E=cs(m,"nextSibling"),v=cs(m,"childNodes"),F=cs(m,"parentNode");if(typeof o=="function"){const Z=t.createElement("template");Z.content&&Z.content.ownerDocument&&(t=Z.content.ownerDocument)}let y,_="";const{implementation:R,createNodeIterator:H,createDocumentFragment:z,getElementsByTagName:K}=t,{importNode:G}=n;let W=Ph();e.isSupported=typeof _h=="function"&&typeof F=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:sA,ERB_EXPR:lA,TMPLIT_EXPR:_A,DATA_ATTR:Ce,ARIA_ATTR:pe,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:fr,CUSTOM_ELEMENT:Cs}=Oh;let{IS_ALLOWED_URI:gr}=Oh,SA=null;const Br=eA({},[...Ih,..._c,...xc,...Sc,...Th]);let BA=null;const vt=eA({},[...Hh,...Ic,...Lh,...Ai]);let uA=Object.seal(Uc(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}})),ZA=null,Yt=null;const Ye=Object.seal(Uc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let IA=!0,PA=!0,_n=!1,qt=!0,XA=!1,Bt=!0,Re=!1,Oe=!1,_t=!1,qe=!1,wt=!1,mt=!1,xn=!0,WA=!1;const wr="user-content-";let bs=!0,Sn=!1,An={},he=null;const Qs=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 wA=null;const bi=eA({},["audio","video","img","source","image","track"]);let ys=null;const Qi=eA({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mr="http://www.w3.org/1998/Math/MathML",Cr="http://www.w3.org/2000/svg",At="http://www.w3.org/1999/xhtml";let en=At,In=!1,Tn=null;const Zc=eA({},[mr,Cr,At],Fc);let br=eA({},["mi","mo","mn","ms","mtext"]),Qr=eA({},["annotation-xml"]);const Xc=eA({},["title","style","font","a","script"]);let xt=null;const et=["application/xhtml+xml","text/html"],Wc="text/html";let mA=null,tn=null;const yi=t.createElement("form"),Us=function(Q){return Q instanceof RegExp||Q instanceof Function},yr=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(tn&&tn===Q)){if((!Q||typeof Q!="object")&&(Q={}),Q=pt(Q),xt=et.indexOf(Q.PARSER_MEDIA_TYPE)===-1?Wc:Q.PARSER_MEDIA_TYPE,mA=xt==="application/xhtml+xml"?Fc:qo,SA=Xe(Q,"ALLOWED_TAGS")?eA({},Q.ALLOWED_TAGS,mA):Br,BA=Xe(Q,"ALLOWED_ATTR")?eA({},Q.ALLOWED_ATTR,mA):vt,Tn=Xe(Q,"ALLOWED_NAMESPACES")?eA({},Q.ALLOWED_NAMESPACES,Fc):Zc,ys=Xe(Q,"ADD_URI_SAFE_ATTR")?eA(pt(Qi),Q.ADD_URI_SAFE_ATTR,mA):Qi,wA=Xe(Q,"ADD_DATA_URI_TAGS")?eA(pt(bi),Q.ADD_DATA_URI_TAGS,mA):bi,he=Xe(Q,"FORBID_CONTENTS")?eA({},Q.FORBID_CONTENTS,mA):Qs,ZA=Xe(Q,"FORBID_TAGS")?eA({},Q.FORBID_TAGS,mA):pt({}),Yt=Xe(Q,"FORBID_ATTR")?eA({},Q.FORBID_ATTR,mA):pt({}),An=Xe(Q,"USE_PROFILES")?Q.USE_PROFILES:!1,IA=Q.ALLOW_ARIA_ATTR!==!1,PA=Q.ALLOW_DATA_ATTR!==!1,_n=Q.ALLOW_UNKNOWN_PROTOCOLS||!1,qt=Q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,XA=Q.SAFE_FOR_TEMPLATES||!1,Bt=Q.SAFE_FOR_XML!==!1,Re=Q.WHOLE_DOCUMENT||!1,qe=Q.RETURN_DOM||!1,wt=Q.RETURN_DOM_FRAGMENT||!1,mt=Q.RETURN_TRUSTED_TYPE||!1,_t=Q.FORCE_BODY||!1,xn=Q.SANITIZE_DOM!==!1,WA=Q.SANITIZE_NAMED_PROPS||!1,bs=Q.KEEP_CONTENT!==!1,Sn=Q.IN_PLACE||!1,gr=Q.ALLOWED_URI_REGEXP||Dh,en=Q.NAMESPACE||At,br=Q.MATHML_TEXT_INTEGRATION_POINTS||br,Qr=Q.HTML_INTEGRATION_POINTS||Qr,uA=Q.CUSTOM_ELEMENT_HANDLING||{},Q.CUSTOM_ELEMENT_HANDLING&&Us(Q.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(uA.tagNameCheck=Q.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Q.CUSTOM_ELEMENT_HANDLING&&Us(Q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(uA.attributeNameCheck=Q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Q.CUSTOM_ELEMENT_HANDLING&&typeof Q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(uA.allowCustomizedBuiltInElements=Q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),XA&&(PA=!1),wt&&(qe=!0),An&&(SA=eA({},Th),BA=[],An.html===!0&&(eA(SA,Ih),eA(BA,Hh)),An.svg===!0&&(eA(SA,_c),eA(BA,Ic),eA(BA,Ai)),An.svgFilters===!0&&(eA(SA,xc),eA(BA,Ic),eA(BA,Ai)),An.mathMl===!0&&(eA(SA,Sc),eA(BA,Lh),eA(BA,Ai))),Q.ADD_TAGS&&(typeof Q.ADD_TAGS=="function"?Ye.tagCheck=Q.ADD_TAGS:(SA===Br&&(SA=pt(SA)),eA(SA,Q.ADD_TAGS,mA))),Q.ADD_ATTR&&(typeof Q.ADD_ATTR=="function"?Ye.attributeCheck=Q.ADD_ATTR:(BA===vt&&(BA=pt(BA)),eA(BA,Q.ADD_ATTR,mA))),Q.ADD_URI_SAFE_ATTR&&eA(ys,Q.ADD_URI_SAFE_ATTR,mA),Q.FORBID_CONTENTS&&(he===Qs&&(he=pt(he)),eA(he,Q.FORBID_CONTENTS,mA)),Q.ADD_FORBID_CONTENTS&&(he===Qs&&(he=pt(he)),eA(he,Q.ADD_FORBID_CONTENTS,mA)),bs&&(SA["#text"]=!0),Re&&eA(SA,["html","head","body"]),SA.table&&(eA(SA,["tbody"]),delete ZA.tbody),Q.TRUSTED_TYPES_POLICY){if(typeof Q.TRUSTED_TYPES_POLICY.createHTML!="function")throw as('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw as('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=Q.TRUSTED_TYPES_POLICY,_=y.createHTML("")}else y===void 0&&(y=c_(g,r)),y!==null&&typeof _=="string"&&(_=y.createHTML(""));ae&&ae(Q),tn=Q}},Es=eA({},[..._c,...xc,...Yv]),Ui=eA({},[...Sc,...qv]),Jc=function(Q){let T=F(Q);(!T||!T.tagName)&&(T={namespaceURI:en,tagName:"template"});const P=qo(Q.tagName),fA=qo(T.tagName);return Tn[Q.namespaceURI]?Q.namespaceURI===Cr?T.namespaceURI===At?P==="svg":T.namespaceURI===mr?P==="svg"&&(fA==="annotation-xml"||br[fA]):!!Es[P]:Q.namespaceURI===mr?T.namespaceURI===At?P==="math":T.namespaceURI===Cr?P==="math"&&Qr[fA]:!!Ui[P]:Q.namespaceURI===At?T.namespaceURI===Cr&&!Qr[fA]||T.namespaceURI===mr&&!br[fA]?!1:!Ui[P]&&(Xc[P]||!Es[P]):!!(xt==="application/xhtml+xml"&&Tn[Q.namespaceURI]):!1},Pe=function(Q){os(e.removed,{element:Q});try{F(Q).removeChild(Q)}catch(T){U(Q)}},Me=function(Q,T){try{os(e.removed,{attribute:T.getAttributeNode(Q),from:T})}catch(P){os(e.removed,{attribute:null,from:T})}if(T.removeAttribute(Q),Q==="is")if(qe||wt)try{Pe(T)}catch(P){}else try{T.setAttribute(Q,"")}catch(P){}},Ei=function(Q){let T=null,P=null;if(_t)Q="<remove></remove>"+Q;else{const TA=vc(Q,/^[\r\n\t ]+/);P=TA&&TA[0]}xt==="application/xhtml+xml"&&en===At&&(Q='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Q+"</body></html>");const fA=y?y.createHTML(Q):Q;if(en===At)try{T=new f().parseFromString(fA,xt)}catch(TA){}if(!T||!T.documentElement){T=R.createDocument(en,"template",null);try{T.documentElement.innerHTML=In?_:fA}catch(TA){}}const YA=T.body||T.documentElement;return Q&&P&&YA.insertBefore(t.createTextNode(P),YA.childNodes[0]||null),en===At?K.call(T,Re?"html":"body")[0]:Re?T.documentElement:YA},ks=function(Q){return H.call(Q.ownerDocument||Q,Q,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Fs=function(Q){return Q instanceof h&&(typeof Q.nodeName!="string"||typeof Q.textContent!="string"||typeof Q.removeChild!="function"||!(Q.attributes instanceof u)||typeof Q.removeAttribute!="function"||typeof Q.setAttribute!="function"||typeof Q.namespaceURI!="string"||typeof Q.insertBefore!="function"||typeof Q.hasChildNodes!="function")},ki=function(Q){return typeof a=="function"&&Q instanceof a};function tt(Z,Q,T){Yo(Z,P=>{P.call(e,Q,T,tn)})}const Fi=function(Q){let T=null;if(tt(W.beforeSanitizeElements,Q,null),Fs(Q))return Pe(Q),!0;const P=mA(Q.nodeName);if(tt(W.uponSanitizeElement,Q,{tagName:P,allowedTags:SA}),Bt&&Q.hasChildNodes()&&!ki(Q.firstElementChild)&&ce(/<[/\w!]/g,Q.innerHTML)&&ce(/<[/\w!]/g,Q.textContent)||Q.nodeType===ls.progressingInstruction||Bt&&Q.nodeType===ls.comment&&ce(/<[/\w]/g,Q.data))return Pe(Q),!0;if(!(Ye.tagCheck instanceof Function&&Ye.tagCheck(P))&&(!SA[P]||ZA[P])){if(!ZA[P]&&_i(P)&&(uA.tagNameCheck instanceof RegExp&&ce(uA.tagNameCheck,P)||uA.tagNameCheck instanceof Function&&uA.tagNameCheck(P)))return!1;if(bs&&!he[P]){const fA=F(Q)||Q.parentNode,YA=v(Q)||Q.childNodes;if(YA&&fA){const TA=YA.length;for(let oe=TA-1;oe>=0;--oe){const nt=b(YA[oe],!0);nt.__removalCount=(Q.__removalCount||0)+1,fA.insertBefore(nt,E(Q))}}}return Pe(Q),!0}return Q instanceof i&&!Jc(Q)||(P==="noscript"||P==="noembed"||P==="noframes")&&ce(/<\/no(script|embed|frames)/i,Q.innerHTML)?(Pe(Q),!0):(XA&&Q.nodeType===ls.text&&(T=Q.textContent,Yo([sA,lA,_A],fA=>{T=is(T,fA," ")}),Q.textContent!==T&&(os(e.removed,{element:Q.cloneNode()}),Q.textContent=T)),tt(W.afterSanitizeElements,Q,null),!1)},vi=function(Q,T,P){if(xn&&(T==="id"||T==="name")&&(P in t||P in yi))return!1;if(!(PA&&!Yt[T]&&ce(Ce,T))){if(!(IA&&ce(pe,T))){if(!(Ye.attributeCheck instanceof Function&&Ye.attributeCheck(T,Q))){if(!BA[T]||Yt[T]){if(!(_i(Q)&&(uA.tagNameCheck instanceof RegExp&&ce(uA.tagNameCheck,Q)||uA.tagNameCheck instanceof Function&&uA.tagNameCheck(Q))&&(uA.attributeNameCheck instanceof RegExp&&ce(uA.attributeNameCheck,T)||uA.attributeNameCheck instanceof Function&&uA.attributeNameCheck(T,Q))||T==="is"&&uA.allowCustomizedBuiltInElements&&(uA.tagNameCheck instanceof RegExp&&ce(uA.tagNameCheck,P)||uA.tagNameCheck instanceof Function&&uA.tagNameCheck(P))))return!1}else if(!ys[T]){if(!ce(gr,is(P,fr,""))){if(!((T==="src"||T==="xlink:href"||T==="href")&&Q!=="script"&&Xv(P,"data:")===0&&wA[Q])){if(!(_n&&!ce(De,is(P,fr,"")))){if(P)return!1}}}}}}}return!0},_i=function(Q){return Q!=="annotation-xml"&&vc(Q,Cs)},vs=function(Q){tt(W.beforeSanitizeAttributes,Q,null);const{attributes:T}=Q;if(!T||Fs(Q))return;const P={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:BA,forceKeepAttr:void 0};let fA=T.length;for(;fA--;){const YA=T[fA],{name:TA,namespaceURI:oe,value:nt}=YA,Ct=mA(TA),_s=nt;let JA=TA==="value"?_s:Wv(_s);if(P.attrName=Ct,P.attrValue=JA,P.keepAttr=!0,P.forceKeepAttr=void 0,tt(W.uponSanitizeAttribute,Q,P),JA=P.attrValue,WA&&(Ct==="id"||Ct==="name")&&(Me(TA,Q),JA=wr+JA),Bt&&ce(/((--!?|])>)|<\/(style|title|textarea)/i,JA)){Me(TA,Q);continue}if(Ct==="attributename"&&vc(JA,"href")){Me(TA,Q);continue}if(P.forceKeepAttr)continue;if(!P.keepAttr){Me(TA,Q);continue}if(!qt&&ce(/\/>/i,JA)){Me(TA,Q);continue}XA&&Yo([sA,lA,_A],Si=>{JA=is(JA,Si," ")});const xi=mA(Q.nodeName);if(!vi(xi,Ct,JA)){Me(TA,Q);continue}if(y&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!oe)switch(g.getAttributeType(xi,Ct)){case"TrustedHTML":{JA=y.createHTML(JA);break}case"TrustedScriptURL":{JA=y.createScriptURL(JA);break}}if(JA!==_s)try{oe?Q.setAttributeNS(oe,TA,JA):Q.setAttribute(TA,JA),Fs(Q)?Pe(Q):Sh(e.removed)}catch(Si){Me(TA,Q)}}tt(W.afterSanitizeAttributes,Q,null)},St=function Z(Q){let T=null;const P=ks(Q);for(tt(W.beforeSanitizeShadowDOM,Q,null);T=P.nextNode();)tt(W.uponSanitizeShadowNode,T,null),Fi(T),vs(T),T.content instanceof s&&Z(T.content);tt(W.afterSanitizeShadowDOM,Q,null)};return e.sanitize=function(Z){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T=null,P=null,fA=null,YA=null;if(In=!Z,In&&(Z="<!-->"),typeof Z!="string"&&!ki(Z))if(typeof Z.toString=="function"){if(Z=Z.toString(),typeof Z!="string")throw as("dirty is not a string, aborting")}else throw as("toString is not a function");if(!e.isSupported)return Z;if(Oe||yr(Q),e.removed=[],typeof Z=="string"&&(Sn=!1),Sn){if(Z.nodeName){const nt=mA(Z.nodeName);if(!SA[nt]||ZA[nt])throw as("root node is forbidden and cannot be sanitized in-place")}}else if(Z instanceof a)T=Ei("<!---->"),P=T.ownerDocument.importNode(Z,!0),P.nodeType===ls.element&&P.nodeName==="BODY"||P.nodeName==="HTML"?T=P:T.appendChild(P);else{if(!qe&&!XA&&!Re&&Z.indexOf("<")===-1)return y&&mt?y.createHTML(Z):Z;if(T=Ei(Z),!T)return qe?null:mt?_:""}T&&_t&&Pe(T.firstChild);const TA=ks(Sn?Z:T);for(;fA=TA.nextNode();)Fi(fA),vs(fA),fA.content instanceof s&&St(fA.content);if(Sn)return Z;if(qe){if(wt)for(YA=z.call(T.ownerDocument);T.firstChild;)YA.appendChild(T.firstChild);else YA=T;return(BA.shadowroot||BA.shadowrootmode)&&(YA=G.call(n,YA,!0)),YA}let oe=Re?T.outerHTML:T.innerHTML;return Re&&SA["!doctype"]&&T.ownerDocument&&T.ownerDocument.doctype&&T.ownerDocument.doctype.name&&ce(Rh,T.ownerDocument.doctype.name)&&(oe="<!DOCTYPE "+T.ownerDocument.doctype.name+`>
|
|
1916
|
+
`+oe),XA&&Yo([sA,lA,_A],nt=>{oe=is(oe,nt," ")}),y&&mt?y.createHTML(oe):oe},e.setConfig=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yr(Z),Oe=!0},e.clearConfig=function(){tn=null,Oe=!1},e.isValidAttribute=function(Z,Q,T){tn||yr({});const P=mA(Z),fA=mA(Q);return vi(P,fA,T)},e.addHook=function(Z,Q){typeof Q=="function"&&os(W[Z],Q)},e.removeHook=function(Z,Q){if(Q!==void 0){const T=Gv(W[Z],Q);return T===-1?void 0:Zv(W[Z],T,1)[0]}return Sh(W[Z])},e.removeHooks=function(Z){W[Z]=[]},e.removeAllHooks=function(){W=Ph()},e}var l_=Mh();function Kh(A){const e=hA.parse(A,{gfm:!0,breaks:!0,async:!1});return l_.sanitize(e)}function u_(A){return I(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 d_(),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 d_(){return new Promise(A=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>A()):setTimeout(A,16)})}function p_(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var Tc={exports:{}};/*!
|
|
1917
|
+
* Pusher JavaScript Library v8.5.0
|
|
1918
|
+
* https://pusher.com/
|
|
1919
|
+
*
|
|
1920
|
+
* Copyright 2020, Pusher
|
|
1921
|
+
* Released under the MIT licence.
|
|
1922
|
+
*/var Nh;function h_(){return Nh||(Nh=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(_,R){_.__proto__=R}||function(_,R){for(var H in R)R.hasOwnProperty(H)&&(_[H]=R[H])},v(F,y)};return function(F,y){v(F,y);function _(){this.constructor=F}F.prototype=y===null?Object.create(y):(_.prototype=y.prototype,new _)}})();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="",_=0;_<F.length-2;_+=3){var R=F[_]<<16|F[_+1]<<8|F[_+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 H=F.length-_;if(H>0){var R=F[_]<<16|(H===2?F[_+1]<<8:0);y+=this._encodeByte(R>>>18&63),y+=this._encodeByte(R>>>12&63),H===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),_=F.length-y,R=new Uint8Array(this.maxDecodedLength(_)),H=0,z=0,K=0,G=0,W=0,sA=0,lA=0;z<_-4;z+=4)G=this._decodeChar(F.charCodeAt(z+0)),W=this._decodeChar(F.charCodeAt(z+1)),sA=this._decodeChar(F.charCodeAt(z+2)),lA=this._decodeChar(F.charCodeAt(z+3)),R[H++]=G<<2|W>>>4,R[H++]=W<<4|sA>>>2,R[H++]=sA<<6|lA,K|=G&c,K|=W&c,K|=sA&c,K|=lA&c;if(z<_-1&&(G=this._decodeChar(F.charCodeAt(z)),W=this._decodeChar(F.charCodeAt(z+1)),R[H++]=G<<2|W>>>4,K|=G&c,K|=W&c),z<_-2&&(sA=this._decodeChar(F.charCodeAt(z+2)),R[H++]=W<<4|sA>>>2,K|=sA&c),z<_-3&&(lA=this._decodeChar(F.charCodeAt(z+3)),R[H++]=sA<<6|lA,K|=lA&c),K!==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 _=F.length-1;_>=0&&F[_]===this._paddingCharacter;_--)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 _=y;return _+=65,_+=25-y>>>8&6,_+=51-y>>>8&-75,_+=61-y>>>8&-13,_+=62-y>>>8&49,String.fromCharCode(_)},F.prototype._decodeChar=function(y){var _=c;return _+=(44-y&y-46)>>>8&-c+y-45+62,_+=(94-y&y-96)>>>8&-c+y-95+63,_+=(47-y&y-58)>>>8&-c+y-48+52,_+=(64-y&y-91)>>>8&-c+y-65+0,_+=(96-y&y-123)>>>8&-c+y-97+26,_},F})(u);a.URLSafeCoder=m;var b=new m;function U(v){return b.encode(v)}a.encodeURLSafe=U;function E(v){return b.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 b=u[++f];if((b&192)!==128)throw new Error(i);g=(g&31)<<6|b&63,m=128}else if(g<240){if(f>=u.length-1)throw new Error(i);var b=u[++f],U=u[++f];if((b&192)!==128||(U&192)!==128)throw new Error(i);g=(g&15)<<12|(b&63)<<6|U&63,m=2048}else if(g<248){if(f>=u.length-2)throw new Error(i);var b=u[++f],U=u[++f],E=u[++f];if((b&192)!==128||(U&192)!==128||(E&192)!==128)throw new Error(i);g=(g&15)<<18|(b&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:()=>Hi});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=AA.createScriptRequest(C.getPath(l,d)),D=C.receivers.create(function(N){if(C.receivers.remove(D),C.loading[l]){var Y=C.loading[l];delete C.loading[l];for(var oA=function(MA){MA||S.cleanup()},dA=0;dA<Y.length;dA++)Y[dA](N,oA)}});S.send(D)}}getRoot(l){var d,B=AA.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"),b=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 _ 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 H 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 K extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class G extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class W extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class sA extends Error{constructor(l,d){super(d),this.status=l,Object.setPrototypeOf(this,new.target.prototype)}}const _A=function(p,l,d,B,C){const S=AA.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 N=d.headersProvider();for(var D in N)S.setRequestHeader(D,N[D])}return S.onreadystatechange=function(){if(S.readyState===4)if(S.status===200){let N,Y=!1;try{N=JSON.parse(S.responseText),Y=!0}catch(oA){C(new sA(200,`JSON returned from ${B.toString()} endpoint was invalid, yet status code was 200. Data was: ${S.responseText}`),null)}Y&&C(null,N)}else{let N="";switch(B){case F.UserAuthentication:N=v.buildLogSuffix("authenticationEndpoint");break;case F.ChannelAuthorization:N=`Clients must be authorized to join private or presence channels. ${v.buildLogSuffix("authorizationEndpoint")}`;break}C(new sA(S.status,`Unable to retrieve auth string from ${B.toString()} endpoint - received status: ${S.status} from ${d.endpoint}. ${N}`),null)}},S.send(l),S};function Ce(p){return SA(Cs(p))}var pe=String.fromCharCode,De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fr=function(p){var l=p.charCodeAt(0);return l<128?p:l<2048?pe(192|l>>>6)+pe(128|l&63):pe(224|l>>>12&15)+pe(128|l>>>6&63)+pe(128|l&63)},Cs=function(p){return p.replace(/[^\x00-\x7F]/g,fr)},gr=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=[De.charAt(d>>>18),De.charAt(d>>>12&63),l>=2?"=":De.charAt(d>>>6&63),l>=1?"=":De.charAt(d&63)];return B.join("")},SA=window.btoa||function(p){return p.replace(/[\s\S]{1,3}/g,gr)};class Br{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 BA=Br;function vt(p){window.clearTimeout(p)}function uA(p){window.clearInterval(p)}class ZA extends BA{constructor(l,d){super(setTimeout,vt,l,function(B){return d(),null})}}class Yt extends BA{constructor(l,d){super(setInterval,uA,l,function(B){return d(),B})}}var Ye={now(){return Date.now?Date.now():new Date().valueOf()},defer(p){return new ZA(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 IA=Ye;function PA(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]=PA(p[C]||{},B[C]):p[C]=B[C]}return p}function _n(){for(var p=["Pusher"],l=0;l<arguments.length;l++)typeof arguments[l]=="string"?p.push(arguments[l]):p.push(he(arguments[l]));return p.join(" : ")}function qt(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 XA(p,l){for(var d in p)Object.prototype.hasOwnProperty.call(p,d)&&l(p[d],d,p)}function Bt(p){var l=[];return XA(p,function(d,B){l.push(B)}),l}function Re(p){var l=[];return XA(p,function(d){l.push(d)}),l}function Oe(p,l,d){for(var B=0;B<p.length;B++)l.call(d||window,p[B],B,p)}function _t(p,l){for(var d=[],B=0;B<p.length;B++)d.push(l(p[B],B,p,d));return d}function qe(p,l){var d={};return XA(p,function(B,C){d[C]=l(B)}),d}function wt(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 mt(p,l){var d={};return XA(p,function(B,C){(l&&l(B,C,p,d)||B)&&(d[C]=B)}),d}function xn(p){var l=[];return XA(p,function(d,B){l.push([B,d])}),l}function WA(p,l){for(var d=0;d<p.length;d++)if(l(p[d],d,p))return!0;return!1}function wr(p,l){for(var d=0;d<p.length;d++)if(!l(p[d],d,p))return!1;return!0}function bs(p){return qe(p,function(l){return typeof l=="object"&&(l=he(l)),encodeURIComponent(Ce(l.toString()))})}function Sn(p){var l=mt(p,function(B){return B!==void 0}),d=_t(xn(bs(l)),IA.method("join","=")).join("&");return d}function An(p){var l=[],d=[];return(function B(C,S){var D,N,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(N in C)Object.prototype.hasOwnProperty.call(C,N)&&(Y[N]=B(C[N],S+"["+JSON.stringify(N)+"]"))}return Y;case"number":case"string":case"boolean":return C}})(p,"$")}function he(p){try{return JSON.stringify(p)}catch(l){return JSON.stringify(An(p))}}class Qs{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=_n.apply(this,arguments);Hi.log?Hi.log(B):Hi.logToConsole&&l.bind(this)(B)}}const wA=new Qs;var bi=function(p,l,d,B,C){(d.headers!==void 0||d.headersProvider!=null)&&wA.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(),N=D.createElement("script");p.auth_callbacks[S]=function(dA){C(null,dA)};var Y="Pusher.auth_callbacks['"+S+"']";N.src=d.endpoint+"?callback="+encodeURIComponent(Y)+"&"+l;var oA=D.getElementsByTagName("head")[0]||D.documentElement;oA.insertBefore(N,oA.firstChild)};const ys=bi;class Qi{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 mr{constructor(l,d){this.url=l,this.data=d}send(l){if(!this.request){var d=Sn(this.data),B=this.url+"/"+l.number+"?"+d;this.request=AA.createScriptRequest(B),this.request.send(l)}}cleanup(){this.request&&this.request.cleanup()}}var Cr=function(p,l){return function(d,B){var C="http"+(l?"s":"")+"://",S=C+(p.host||p.options.host)+p.options.path,D=AA.createJSONPRequest(S,d),N=AA.ScriptReceivers.create(function(Y,oA){u.remove(N),D.cleanup(),oA&&oA.host&&(p.host=oA.host),B&&B(Y,oA)});D.send(N)}},At={name:"jsonp",getAgent:Cr};const en=At;function In(p,l,d){var B=p+(l.useTLS?"s":""),C=l.useTLS?l.hostTLS:l.hostNonTLS;return B+"://"+C+d}function Tn(p,l){var d="/app/"+p,B="?protocol="+f.PROTOCOL+"&client=js&version="+f.VERSION+(l?"&"+l:"");return d+B}var Zc={getInitial:function(p,l){var d=(l.httpPath||"")+Tn(p,"flash=false");return In("ws",l,d)}},br={getInitial:function(p,l){var d=(l.httpPath||"/pusher")+Tn(p);return In("http",l,d)}},Qr={getInitial:function(p,l){return In("http",l,l.httpPath||"/pusher")},getPath:function(p,l){return Tn(p)}};class Xc{constructor(){this._callbacks={}}get(l){return this._callbacks[xt(l)]}add(l,d,B){var C=xt(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?[xt(l)]:Bt(this._callbacks);d||B?this.removeCallback(C,d,B):this.removeAllCallbacks(C)}removeCallback(l,d,B){Oe(l,function(C){this._callbacks[C]=wt(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){Oe(l,function(d){delete this._callbacks[d]},this)}}function xt(p){return"_"+p}class et{constructor(l){this.callbacks=new Xc,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=wt(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 Wc extends et{constructor(l,d,B,C,S){super(),this.initialize=AA.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 IA.defer(()=>{this.onError(d),this.changeState("closed")}),!1}return this.bindListeners(),wA.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"?(IA.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 PA({cid:this.id},l)}}class mA{constructor(l){this.hooks=l}isSupported(l){return this.hooks.isSupported(l)}createConnection(l,d,B,C){return new Wc(this.hooks,l,d,B,C)}}var tn=new mA({urls:Zc,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!AA.getWebSocketAPI()},isSupported:function(){return!!AA.getWebSocketAPI()},getSocket:function(p){return AA.createWebSocket(p)}}),yi={urls:br,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Us=PA({getSocket:function(p){return AA.HTTPFactory.createStreamingSocket(p)}},yi),yr=PA({getSocket:function(p){return AA.HTTPFactory.createPollingSocket(p)}},yi),Es={isSupported:function(){return AA.isXHRSupported()}},Ui=new mA(PA({},Us,Es)),Jc=new mA(PA({},yr,Es)),Pe={ws:tn,xhr_streaming:Ui,xhr_polling:Jc};const Me=Pe;var Ei=new mA({file:"sockjs",urls:Qr,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:b.getPath("sockjs",{useTLS:l.useTLS}),ignore_null_origin:l.ignoreNullOrigin})},beforeOpen:function(p,l){p.send(JSON.stringify({path:l}))}}),ks={isSupported:function(p){var l=AA.isXDRSupported(p.useTLS);return l}},Fs=new mA(PA({},Us,ks)),ki=new mA(PA({},yr,ks));Me.xdr_streaming=Fs,Me.xdr_polling=ki,Me.sockjs=Ei;const tt=Me;class Fi extends et{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 vi=new Fi;class _i{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=PA({},C,{activityTimeout:this.pingDelay});var S=this.transport.createConnection(l,d,B,C),D=null,N=function(){S.unbind("open",N),S.bind("closed",Y),D=IA.now()},Y=oA=>{if(S.unbind("closed",Y),oA.code===1002||oA.code===1003)this.manager.reportDeath();else if(!oA.wasClean&&D){var dA=IA.now()-D;dA<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(dA/2,this.minPingDelay))}};return S.bind("open",N),S}isSupported(l){return this.manager.isAlive()&&this.transport.isSupported(l)}}const vs={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=vs.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}},St=vs;class Z extends et{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),wA.debug("Event sent",C),this.send(St.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=St.decodeMessage(B)}catch(S){this.emit("error",{type:"MessageParseError",error:S,data:B.data})}if(C!==void 0){switch(wA.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=()=>{XA(l,(B,C)=>{this.transport.unbind(C,B)})};XA(l,(B,C)=>{this.transport.bind(C,B)})}handleCloseEvent(l){var d=St.getCloseAction(l),B=St.getCloseError(l);B&&this.emit("error",B),d&&this.emit(d,{action:d,error:B})}}class Q{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=St.processHandshake(l)}catch(B){this.finish("error",{error:B}),this.transport.close();return}d.action==="connected"?this.finish("connected",{connection:new Z(d.id,this.transport),activityTimeout:d.activityTimeout}):(this.finish(d.action,{error:d.error}),this.transport.close())},this.onClosed=l=>{this.unbindListeners();var d=St.getCloseAction(l)||"backoff",B=St.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(PA({transport:this.transport,action:l},d))}}class T{constructor(l,d){this.timeline=l,this.options=d||{}}send(l,d){this.timeline.isEmpty()||this.timeline.send(AA.TimelineTransport.getAgent(this,l),d)}}class P extends et{constructor(l,d){super(function(B,C){wA.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");wA.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,wA.error(l.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:l.message},l instanceof sA?{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 fA extends P{authorize(l,d){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:l},d)}}class YA{constructor(){this.reset()}get(l){return Object.prototype.hasOwnProperty.call(this.members,l)?{id:l,info:this.members[l]}:null}each(l){XA(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 TA=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 N(dA){try{oA(B.next(dA))}catch(MA){D(MA)}}function Y(dA){try{oA(B.throw(dA))}catch(MA){D(MA)}}function oA(dA){dA.done?S(dA.value):C(dA.value).then(N,Y)}oA((B=B.apply(p,l||[])).next())})};class oe extends fA{constructor(l,d){super(l,d),this.members=new YA}authorize(l,d){super.authorize(l,(B,C)=>TA(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");wA.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 nt=i(978),Ct=i(594);class _s extends fA{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,Ct.decode)(S),delete C.shared_secret,d(null,C)})}trigger(l,d){throw new K("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){wA.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!d.ciphertext||!d.nonce){wA.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+d);return}let B=(0,Ct.decode)(d.ciphertext);if(B.length<this.nacl.secretbox.overheadLength){wA.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${B.length}`);return}let C=(0,Ct.decode)(d.nonce);if(C.length<this.nacl.secretbox.nonceLength){wA.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){wA.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,N)=>{if(D){wA.error(`Failed to make a request to the authEndpoint: ${N}. Unable to fetch new key, so dropping encrypted event`);return}if(S=this.nacl.secretbox.open(B,C,this.key),S===null){wA.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,nt.D4)(l);try{return JSON.parse(d)}catch(B){return d}}}class JA extends et{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=AA.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 ZA(l||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new ZA(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new ZA(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 ZA(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(l){return PA({},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 PA({},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),wA.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 xi{constructor(){this.channels={}}add(l,d){return this.channels[l]||(this.channels[l]=Si(l,d)),this.channels[l]}all(){return Re(this.channels)}find(l){return this.channels[l]}remove(l){var d=this.channels[l];return delete this.channels[l],d}disconnect(){XA(this.channels,function(l){l.disconnect()})}}function Si(p,l){if(p.indexOf("private-encrypted-")===0){if(l.config.nacl)return It.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 K(`${d}. ${B}`)}else{if(p.indexOf("private-")===0)return It.createPrivateChannel(p,l);if(p.indexOf("presence-")===0)return It.createPresenceChannel(p,l);if(p.indexOf("#")===0)throw new _('Cannot create a channel with name "'+p+'".');return It.createChannel(p,l)}}var Ex={createChannels(){return new xi},createConnectionManager(p,l){return new JA(p,l)},createChannel(p,l){return new P(p,l)},createPrivateChannel(p,l){return new fA(p,l)},createPresenceChannel(p,l){return new oe(p,l)},createEncryptedChannel(p,l,d){return new _s(p,l,d)},createTimelineSender(p,l){return new T(p,l)},createHandshake(p,l){return new Q(p,l)},createAssistantToTheTransportManager(p,l,d){return new _i(p,l,d)}};const It=Ex;class Lf{constructor(l){this.options=l||{},this.livesLeft=this.options.lives||1/0}getAssistant(l){return It.createAssistantToTheTransportManager(this,l,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Hn{constructor(l,d){this.strategies=l,this.loop=!!d.loop,this.failFast=!!d.failFast,this.timeout=d.timeout,this.timeoutLimit=d.timeoutLimit}isSupported(){return WA(this.strategies,IA.method("isSupported"))}connect(l,d){var B=this.strategies,C=0,S=this.timeout,D=null,N=(Y,oA)=>{oA?d(null,oA):(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},N)):d(!0))};return D=this.tryStrategy(B[C],l,{timeout:S,failFast:this.failFast},N),{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 ZA(B.timeout,function(){D.abort(),C(!0)})),D=l.connect(d,function(N,Y){N&&S&&S.isRunning()&&!B.failFast||(S&&S.ensureAborted(),C(N,Y))}),{abort:function(){S&&S.ensureAborted(),D.abort()},forceMinPriority:function(N){D.forceMinPriority(N)}}}}class jc{constructor(l){this.strategies=l}isSupported(){return WA(this.strategies,IA.method("isSupported"))}connect(l,d){return kx(this.strategies,l,function(B,C){return function(S,D){if(C[B].error=S,S){Fx(C)&&d(!0);return}Oe(C,function(N){N.forceMinPriority(D.transport.priority)}),d(null,D)}})}}function kx(p,l,d){var B=_t(p,function(C,S,D,N){return C.connect(l,d(S,N))});return{abort:function(){Oe(B,vx)},forceMinPriority:function(C){Oe(B,function(S){S.forceMinPriority(C)})}}}function Fx(p){return wr(p,function(l){return!!l.error})}function vx(p){!p.error&&!p.aborted&&(p.abort(),p.aborted=!0)}class _x{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=xx(B),S=C&&C.cacheSkipCount?C.cacheSkipCount:0,D=[this.strategy];if(C&&C.timestamp+this.ttl>=IA.now()){var N=this.transports[C.transport];N&&(["ws","wss"].includes(C.transport)||S>3?(this.timeline.info({cached:!0,transport:C.transport,latency:C.latency}),D.push(new Hn([N],{timeout:C.latency*2+1e3,failFast:!0}))):S++)}var Y=IA.now(),oA=D.pop().connect(l,function dA(MA,Li){MA?(Df(B),D.length>0?(Y=IA.now(),oA=D.pop().connect(l,dA)):d(MA)):(Sx(B,Li.transport.name,IA.now()-Y,S),d(null,Li))});return{abort:function(){oA.abort()},forceMinPriority:function(dA){l=dA,oA&&oA.forceMinPriority(dA)}}}}function Yc(p){return"pusherTransport"+(p?"TLS":"NonTLS")}function xx(p){var l=AA.getLocalStorage();if(l)try{var d=l[Yc(p)];if(d)return JSON.parse(d)}catch(B){Df(p)}return null}function Sx(p,l,d,B){var C=AA.getLocalStorage();if(C)try{C[Yc(p)]=he({timestamp:IA.now(),transport:l,latency:d,cacheSkipCount:B})}catch(S){}}function Df(p){var l=AA.getLocalStorage();if(l)try{delete l[Yc(p)]}catch(d){}}class Ii{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 ZA(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 xs{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 Ix{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 Ss(p){return function(){return p.isSupported()}}var Tx=function(p,l,d){var B={};function C(Wf,xS,SS,IS,TS){var Jf=d(p,Wf,xS,SS,IS,TS);return B[Wf]=Jf,Jf}var S=Object.assign({},l,{hostNonTLS:p.wsHost+":"+p.wsPort,hostTLS:p.wsHost+":"+p.wssPort,httpPath:p.wsPath}),D=Object.assign({},S,{useTLS:!0}),N=Object.assign({},l,{hostNonTLS:p.httpHost+":"+p.httpPort,hostTLS:p.httpHost+":"+p.httpsPort,httpPath:p.httpPath}),Y={loop:!0,timeout:15e3,timeoutLimit:6e4},oA=new Lf({minPingDelay:1e4,maxPingDelay:p.activityTimeout}),dA=new Lf({lives:2,minPingDelay:1e4,maxPingDelay:p.activityTimeout}),MA=C("ws","ws",3,S,oA),Li=C("wss","ws",3,D,oA),ES=C("sockjs","sockjs",1,N),$f=C("xhr_streaming","xhr_streaming",1,N,dA),kS=C("xdr_streaming","xdr_streaming",1,N,dA),zf=C("xhr_polling","xhr_polling",1,N),FS=C("xdr_polling","xdr_polling",1,N),Vf=new Hn([MA],Y),vS=new Hn([Li],Y),_S=new Hn([ES],Y),Gf=new Hn([new xs(Ss($f),$f,kS)],Y),Zf=new Hn([new xs(Ss(zf),zf,FS)],Y),Xf=new Hn([new xs(Ss(Gf),new jc([Gf,new Ii(Zf,{delay:4e3})]),Zf)],Y),el=new xs(Ss(Xf),Xf,_S),tl;return l.useTLS?tl=new jc([Vf,new Ii(el,{delay:2e3})]):tl=new jc([Vf,new Ii(vS,{delay:2e3}),new Ii(el,{delay:5e3})]),new _x(new Ix(new xs(Ss(MA),tl,el)),B,{ttl:18e5,timeline:l.timeline,useTLS:l.useTLS})};const Hx=Tx;function Lx(){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"),b.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 Dx={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 Rx=Dx,Ox=256*1024;class Px extends et{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()},AA.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&&(AA.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(`
|
|
1923
|
+
`);return B!==-1?(this.position+=B+1,d.slice(0,B)):null}isBufferTooLong(l){return this.position===l.length&&l.length>Ox}}var qc;(function(p){p[p.CONNECTING=0]="CONNECTING",p[p.OPEN=1]="OPEN",p[p.CLOSED=3]="CLOSED"})(qc||(qc={}));const Ln=qc;var Mx=1;class Kx{constructor(l,d){this.hooks=l,this.session=Of(1e3)+"/"+Vx(8),this.location=Nx(d),this.readyState=Ln.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===Ln.OPEN)try{return AA.createSocketRequest("POST",Rf($x(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=Ln.CLOSED,this.onclose&&this.onclose({code:l,reason:d,wasClean:B})}onChunk(l){if(l.status===200){this.readyState===Ln.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===Ln.CONNECTING?(l&&l.hostname&&(this.location.base=zx(this.location.base,l.hostname)),this.readyState=Ln.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(l){this.readyState===Ln.OPEN&&this.onmessage&&this.onmessage({data:l})}onActivity(){this.onactivity&&this.onactivity()}onError(l){this.onerror&&this.onerror(l)}openStream(){this.stream=AA.createSocketRequest("POST",Rf(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){IA.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 Nx(p){var l=/([^\?]*)\/*(\??.*)/.exec(p);return{base:l[1],queryString:l[2]}}function $x(p,l){return p.base+"/"+l+"/xhr_send"}function Rf(p){var l=p.indexOf("?")===-1?"?":"&";return p+l+"t="+ +new Date+"&n="+Mx++}function zx(p,l){var d=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(p);return d[1]+l+d[3]}function Of(p){return AA.randomInt(p)}function Vx(p){for(var l=[],d=0;d<p;d++)l.push(Of(32).toString(32));return l.join("")}const Gx=Kx;var Zx={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 Xx=Zx;var Wx={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 Jx=Wx;var jx={getRequest:function(p){var l=AA.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 Yx=jx;var qx={createStreamingSocket(p){return this.createSocket(Xx,p)},createPollingSocket(p){return this.createSocket(Jx,p)},createSocket(p,l){return new Gx(p,l)},createXHR(p,l){return this.createRequest(Yx,p,l)},createRequest(p,l,d){return new Px(p,l,d)}};const Pf=qx;Pf.createXDR=function(p,l){return this.createRequest(Rx,p,l)};var AS={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:u,DependenciesReceivers:m,getDefaultStrategy:Hx,Transports:tt,transportConnectionInitializer:Lx,HTTPFactory:Pf,TimelineTransport:en,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(p){window.Pusher=p;var l=()=>{this.onDocumentBody(p.ready)};window.JSON?l():b.load("json2",{},l)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:_A,jsonp:ys}},onDocumentBody(p){document.body?p():setTimeout(()=>{this.onDocumentBody(p)},0)},createJSONPRequest(p,l){return new mr(p,l)},createScriptRequest(p){return new Qi(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 vi},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 AA=AS;var Al;(function(p){p[p.ERROR=3]="ERROR",p[p.INFO=6]="INFO",p[p.DEBUG=7]="DEBUG"})(Al||(Al={}));const Ti=Al;class eS{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(PA({},d,{timestamp:IA.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(l){this.log(Ti.ERROR,l)}info(l){this.log(Ti.INFO,l)}debug(l){this.log(Ti.DEBUG,l)}isEmpty(){return this.events.length===0}send(l,d){var B=PA({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 tS{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 Mf(new H,d)}else return Mf(new W,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()},N=function(){S=It.createHandshake(C,function(MA){B=!0,dA(),d(null,MA)})},Y=function(MA){dA(),d(MA)},oA=function(){dA();var MA;MA=he(C),d(new z(MA))},dA=function(){C.unbind("initialized",D),C.unbind("open",N),C.unbind("error",Y),C.unbind("closed",oA)};return C.bind("initialized",D),C.bind("open",N),C.bind("error",Y),C.bind("closed",oA),C.initialize(),{abort:()=>{B||(dA(),S?S.close():C.close())},forceMinPriority:MA=>{B||this.priority<MA&&(S?S.close():C.close())}}}}function Mf(p,l){return IA.defer(function(){l(p)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:nS}=AA;var rS=function(p,l,d,B,C,S){var D=nS[d];if(!D)throw new G(d);var N=(!p.enabledTransports||qt(p.enabledTransports,l)!==-1)&&(!p.disabledTransports||qt(p.disabledTransports,l)===-1),Y;return N?(C=Object.assign({ignoreNullOrigin:p.ignoreNullOrigin},C),Y=new tS(l,B,S?S.getAssistant(D):D,C)):Y=sS,Y},sS={isSupported:function(){return!1},connect:function(p,l){var d=IA.defer(function(){l(new W)});return{abort:function(){d.ensureAborted()},forceMinPriority:function(){}}}};function oS(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&&wA.warn("The disableStats option is deprecated in favor of enableStats")}const iS=(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},aS=p=>{if(typeof AA.getAuthorizers()[p.transport]=="undefined")throw`'${p.transport}' is not a recognized auth transport`;return(l,d)=>{const B=iS(l,p);AA.getAuthorizers()[p.transport](AA,B,p,F.UserAuthentication,d)}},cS=(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},lS=p=>{if(typeof AA.getAuthorizers()[p.transport]=="undefined")throw`'${p.transport}' is not a recognized auth transport`;return(l,d)=>{const B=cS(l,p);AA.getAuthorizers()[p.transport](AA,B,p,F.ChannelAuthorization,d)}},uS=(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 Kf(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:gS(p),httpHost:dS(p),useTLS:fS(p),wsHost:pS(p),userAuthenticator:BS(p),channelAuthorizer:mS(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 dS(p){return p.httpHost?p.httpHost:p.cluster?`sockjs-${p.cluster}.pusher.com`:f.httpHost}function pS(p){return p.wsHost?p.wsHost:hS(p.cluster)}function hS(p){return`ws-${p}.pusher.com`}function fS(p){return AA.getProtocol()==="https:"?!0:p.forceTLS!==!1}function gS(p){return"enableStats"in p?p.enableStats:"disableStats"in p?!p.disableStats:!1}const Nf=p=>"customHandler"in p&&p.customHandler!=null;function BS(p){const l=Object.assign(Object.assign({},f.userAuthentication),p.userAuthentication);return Nf(l)?l.customHandler:aS(l)}function wS(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:uS(l,d,p.authorizer)};return d}function mS(p,l){const d=wS(p,l);return Nf(d)?d.customHandler:lS(d)}class CS extends et{constructor(l){super(function(d,B){wA.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 bS(){let p,l;return{promise:new Promise((B,C)=>{p=B,l=C}),resolve:p,reject:l}}const QS=bS;class yS extends et{constructor(l){super(function(d,B){wA.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){wA.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 CS(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){wA.error(`Failed parsing user data after signin: ${l.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){wA.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 P(`#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}=QS();l.done=!1;const B=()=>{l.done=!0};l.then(B).catch(B),this.signinDonePromise=l,this._signinDoneResolve=d}}class te{static ready(){te.isReady=!0;for(var l=0,d=te.instances.length;l<d;l++)te.instances[l].connect()}static getClientFeatures(){return Bt(mt({ws:AA.Transports.ws},function(l){return l.isSupported({})}))}constructor(l,d){US(l),oS(d),this.key=l,this.options=d,this.config=Kf(this.options,this),this.channels=It.createChannels(),this.global_emitter=new et,this.sessionID=AA.randomInt(1e9),this.timeline=new eS(this.key,this.sessionID,{cluster:this.config.cluster,features:te.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Ti.INFO,version:f.VERSION}),this.config.enableStats&&(this.timelineSender=It.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+AA.TimelineTransport.name}));var B=C=>AA.getDefaultStrategy(this.config,C,rS);this.connection=It.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 N=this.channel(C.channel);N&&N.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=>{wA.warn(C)}),te.instances.push(this),this.timeline.info({instances:te.instances.length}),this.user=new yS(this),te.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=Kf(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 Yt(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()}}te.instances=[],te.isReady=!1,te.logToConsole=!1,te.Runtime=AA,te.ScriptReceivers=AA.ScriptReceivers,te.DependenciesReceivers=AA.DependenciesReceivers,te.auth_callbacks=AA.auth_callbacks;const Hi=te;function US(p){if(p==null)throw"You must pass your app key when you instantiate Pusher."}AA.setup(te)}},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})())})(Tc)),Tc.exports}var f_=h_();const g_=p_(f_);let We=null,rr=null;function B_(A){return I(this,null,function*(){return rr||(rr=I(null,null,function*(){const e=A.backendUrl.replace(/\/+$/,""),t=yield Sr(`${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 g_(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)=>{Sr(`${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))}}})}),rr.catch(()=>{rr=null}),rr)})}function w_(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 m_(A,e,t){return I(this,null,function*(){if(yield B_(A),!We)return()=>{};const n=We.subscribe(`private-task-${e}`);t.onStatusUpdate&&n.bind(Ks.TASK_STATUS_UPDATED,t.onStatusUpdate),t.onInteractionCreated&&n.bind(Ks.TASK_INTERACTION_CREATED,t.onInteractionCreated),t.onInteractionAnswered&&n.bind(Ks.TASK_INTERACTION_ANSWERED,t.onInteractionAnswered),t.onBrowserCommandCreated&&n.bind(Ks.TASK_BROWSER_COMMAND_CREATED,t.onBrowserCommandCreated);const r=w_(t.onReconnect);return()=>{n.unbind_all(),We==null||We.unsubscribe(`private-task-${e}`),r==null||r()}})}function $h(A,e){const t=a=>I(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()};bn({kind:"executing",command:i,actionsRun:w.state.kind==="idle"?w.state.actionsRun:0}),yield Vh(i,e,A)}),n=a=>{if(!(w.currentTaskId!==A||!w.runnerEl)&&T_.has(a)){if(w.state.kind==="executing")bn({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;bn({kind:"finished",status:a,actionsRun:i})}}},r=a=>{w.currentTaskId!==A||!w.runnerEl||(a.outputChunk&&Zh([a.outputChunk]),n(a.status))},s=()=>I(null,null,function*(){var a;if(!(w.currentTaskId!==A||!w.runnerEl))try{const i=yield Ys(e,A);w.currentTaskId===A&&w.runnerEl&&(w.currentQuestion=(a=i[0])!=null?a:null,Cn())}catch(i){}}),o=()=>I(null,null,function*(){var a;try{const[i,c,u,h]=yield Promise.all([Su(e,A),Qb(e,A),Ys(e,A),Cb(e,A)]);if(w.currentTaskId!==A||!w.runnerEl)return;Zh(c),w.currentQuestion=(a=u[0])!=null?a:null,Cn(),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),bn({kind:"executing",command:h,actionsRun:w.state.kind==="idle"?w.state.actionsRun:0}),yield Vh(h,e,A)):w.state.kind==="connecting"&&bn({kind:"idle",actionsRun:0})}catch(i){}});o(),m_(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 ei(){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 C_(A,e){return I(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 Ub(A,e)}catch(n){t&&(t.disabled=!1)}})}function zh(){if(!w.currentTaskId||!w.currentApiOpts||!w.currentBackendUrl||!w.currentCaptureTitle)return;const A=w.currentTaskId,e=w.currentApiOpts;lh({taskId:A,backendUrl:w.currentBackendUrl,title:w.currentCaptureTitle}),w.timerHandle&&clearInterval(w.timerHandle),ni(),w.timerHandle=setInterval(ni,Xh);const t=w.state.kind==="finished"?w.state.actionsRun:0;w.handledCommandIds=new Set,w.state={kind:"idle",actionsRun:t},Hc(),$h(A,e)}function Vh(A,e,t){return I(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(wl(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=U_(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(wl(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 u_(c),r="Clicked";else{if(A.value===void 0)throw new Error("inputText command is missing a value");E_(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&&v_(n,A,r),yield y_(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"?bn({kind:"finished",status:w.state.status,actionsRun:s}):w.state.kind==="executing"&&bn({kind:"idle",actionsRun:s})})}function b_(A){return I(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 Hu(t,e,w.currentQuestion.id,r),w.currentQuestion=null,Cn();const s=yield Ys(t,e);w.currentTaskId===e&&w.runnerEl&&(w.currentQuestion=(n=s[0])!=null?n:null,Cn())}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 Q_(A,e){return I(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 Hu(A,e,w.currentQuestion.id,s),w.currentQuestion=null,Cn();try{const a=yield Ys(A,e);w.currentTaskId===e&&w.runnerEl&&(w.currentQuestion=(o=a[0])!=null?o:null,Cn())}catch(a){}}else yield yb(A,e,s),w.state.kind==="finished"&&zh();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 y_(A,e,t,n,r){return I(this,null,function*(){try{yield bb(A,e,t,n,r)}catch(s){}})}function U_(A){const e=A.cloneNode(!0);e.querySelectorAll("script, style, noscript").forEach(r=>r.remove()),ml(e),Ni(e);let t=e.outerHTML,n=!1;return t.length>Wh&&(t=t.slice(0,Wh),n=!0),`URL: ${location.href}
|
|
1924
|
+
Title: ${document.title}
|
|
1925
|
+
|
|
1926
|
+
${t}${n?`
|
|
1927
|
+
… (truncated)`:""}`}function E_(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 k_(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=`
|
|
1928
|
+
<div class="ap-sdk-success-card">
|
|
1929
|
+
<p class="ap-sdk-success-headline">${Lc(n)}</p>
|
|
1930
|
+
${r?`
|
|
1931
|
+
<div class="ap-sdk-runner__approval" data-ap-runner-approval>
|
|
1932
|
+
<div class="ap-sdk-runner__approval-actions">
|
|
1933
|
+
<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>
|
|
1934
|
+
<button class="ap-sdk-runner__text-btn ap-sdk-runner__text-btn--danger" data-ap-runner-reject>Reject</button>
|
|
1935
|
+
</div>
|
|
1936
|
+
<div class="ap-sdk-runner__reject-form" data-ap-runner-reject-form style="display:none">
|
|
1937
|
+
<textarea class="ap-sdk-panel__textarea" rows="2" placeholder="What was wrong? (optional)" data-ap-runner-reject-feedback></textarea>
|
|
1938
|
+
<div class="ap-sdk-runner__reject-hint">Leave blank to reject permanently, or add details so the agent can retry with your feedback.</div>
|
|
1939
|
+
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--danger ap-sdk-panel__btn--block" data-ap-runner-reject-submit>Reject Permanently</button>
|
|
1940
|
+
</div>
|
|
1941
|
+
<div class="ap-sdk-runner__approval-error" data-ap-runner-approval-error style="display:none"></div>
|
|
1942
|
+
</div>
|
|
1943
|
+
<div class="ap-sdk-runner__divider"></div>`:""}
|
|
1944
|
+
<div class="ap-sdk-success-actions ap-sdk-success-actions--stacked">
|
|
1945
|
+
<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>
|
|
1946
|
+
<button class="ap-sdk-runner__text-btn" data-ap-runner-close>Close</button>
|
|
1947
|
+
</div>
|
|
1948
|
+
</div>
|
|
1949
|
+
`,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;Dc(),o==null||o()}),r&&F_(e)}function F_(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",()=>I(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 Eb(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",()=>I(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 kb(h,u,f),f?zh():(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 Gh(){var e;const A=(e=w.runnerEl)==null?void 0:e.querySelector("[data-ap-runner-log]");A&&(A.scrollTop=A.scrollHeight)}function ti(){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 Hc(){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"}`,ti(),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",k_(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();Cn();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 Cn(){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=`
|
|
1950
|
+
<div class="ap-sdk-runner__question-label">${Lc((t==null?void 0:t.header)||"The agent has a question")}</div>
|
|
1951
|
+
<div class="ap-sdk-runner__question-text ap-sdk-markdown">${Kh((t==null?void 0:t.question)||w.currentQuestion.question)}</div>
|
|
1952
|
+
${n.length>0?'<div class="ap-sdk-runner__question-options" data-ap-runner-question-options></div>':""}
|
|
1953
|
+
`,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 b_(o.label)),s.appendChild(a)}}}function ni(){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 v_(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 __(A){var e,t;return(t=(e=A.display)==null?void 0:e.variant)!=null?t:A.sdkEventType}function x_(A){const e=__(A);return(A.stream==="stdout"||A.stream==="stderr"||A.stream==="sdk_event"&&(e==="text"||e==="thinking"))&&A.data.trim()||null}function Zh(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=x_(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=Kh(s)):o.textContent=s,t.appendChild(o),w.autoScrollEnabled&&(t.scrollTop=t.scrollHeight)}}function S_(A){return A.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Lc(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const Xh=1e3,I_=32,Wh=15e3,T_=new Set(["completed","failed","cancelled"]),H_=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 bn(A){var e,t;w.state=A,w.state.kind==="idle"&&w.runStartedAt===null&&(w.runStartedAt=Date.now(),ni(),w.timerHandle=setInterval(ni,Xh)),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(),uh()),Hc()}function Dc(){var A,e,t,n,r;ei(),uh(),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&&st(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 Rc(A,e,t,n,r){w.runnerEl&&Dc(),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,lh({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=`
|
|
1806
1954
|
<div class="ap-sdk-panel__header">
|
|
1807
1955
|
<span class="ap-sdk-panel__title">
|
|
1808
1956
|
<span class="ap-sdk-panel__logo">AP</span>
|
|
1809
|
-
|
|
1957
|
+
Automating page
|
|
1810
1958
|
</span>
|
|
1811
1959
|
<div class="ap-sdk-panel__header-actions">
|
|
1812
|
-
<button class="ap-sdk-panel__clear" aria-label="Clear selections" title="Clear selections" data-ap-clear-selections type="button">⟲</button>
|
|
1813
|
-
<button class="ap-sdk-panel__config" aria-label="Configure" data-ap-reconfigure>⚙</button>
|
|
1814
1960
|
<button class="ap-sdk-panel__close" aria-label="Close" data-ap-close>×</button>
|
|
1815
1961
|
</div>
|
|
1816
1962
|
</div>
|
|
1817
|
-
<div class="ap-sdk-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
<div class="ap-sdk-panel__pick-actions" data-ap-pick-actions>
|
|
1822
|
-
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-panel__btn--select-parent" data-ap-select-parent type="button">
|
|
1823
|
-
⬆ Select parent
|
|
1824
|
-
</button>
|
|
1825
|
-
${l?`
|
|
1826
|
-
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost ap-sdk-panel__btn--reselect" data-ap-reselect type="button">
|
|
1827
|
-
↻ Re-select
|
|
1828
|
-
</button>`:""}
|
|
1829
|
-
</div>
|
|
1830
|
-
${m?`
|
|
1831
|
-
<div class="ap-sdk-credentials-section" data-ap-credentials>
|
|
1832
|
-
<p class="ap-sdk-credentials-heading">Connect to Agent Platform to continue</p>
|
|
1833
|
-
<p class="ap-sdk-config-hint">You'll be asked to approve this connection on Agent Platform's own sign-in page.</p>
|
|
1834
|
-
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-connect-required type="button">Connect via Agent Platform</button>
|
|
1835
|
-
</div>`:""}
|
|
1836
|
-
<div class="ap-sdk-panel__body">
|
|
1837
|
-
<div class="ap-sdk-panel__field">
|
|
1838
|
-
<label class="ap-sdk-panel__label" for="ap-sdk-note">Instruction</label>
|
|
1839
|
-
<textarea id="ap-sdk-note" class="ap-sdk-panel__textarea" rows="3"
|
|
1840
|
-
placeholder="Describe the task or planning session…" data-ap-note></textarea>
|
|
1841
|
-
</div>
|
|
1842
|
-
${d?`
|
|
1843
|
-
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--add-another" data-ap-add-another disabled>
|
|
1844
|
-
+ Add another
|
|
1845
|
-
</button>`:""}
|
|
1846
|
-
<div class="ap-sdk-panel__field">
|
|
1847
|
-
<div class="ap-sdk-panel__label">Type</div>
|
|
1848
|
-
<div class="ap-sdk-panel__toggle">
|
|
1849
|
-
${y?`<button class="ap-sdk-panel__toggle-btn${E.captureType==="planning"?" ap-sdk-active":""}" data-ap-type="planning">Planning Session</button>`:""}
|
|
1850
|
-
${k?`<button class="ap-sdk-panel__toggle-btn${E.captureType==="task"?" ap-sdk-active":""}" data-ap-type="task">Task</button>`:""}
|
|
1851
|
-
${k?`<button class="ap-sdk-panel__toggle-btn${E.captureType==="automate"?" ap-sdk-active":""}" data-ap-type="automate">Automate</button>`:""}
|
|
1852
|
-
</div>
|
|
1963
|
+
<div class="ap-sdk-runner__meta">
|
|
1964
|
+
<div class="ap-sdk-runner__meta-row">
|
|
1965
|
+
<span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--automate">Automate</span>
|
|
1966
|
+
<span class="ap-sdk-runner__title" title="${S_(n)}">${Lc(o)}</span>
|
|
1853
1967
|
</div>
|
|
1854
|
-
<div class="ap-sdk-
|
|
1855
|
-
<
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
</
|
|
1859
|
-
<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>
|
|
1968
|
+
<div class="ap-sdk-runner__meta-row ap-sdk-runner__meta-row--controls">
|
|
1969
|
+
<span class="ap-sdk-runner__counter" data-ap-runner-counter>0 actions</span>
|
|
1970
|
+
<span class="ap-sdk-runner__timer" data-ap-runner-timer>00:00</span>
|
|
1971
|
+
<span class="ap-sdk-status-badge ap-sdk-status-badge--in-progress" data-ap-runner-status>running</span>
|
|
1972
|
+
<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>
|
|
1860
1973
|
</div>
|
|
1861
1974
|
</div>
|
|
1862
|
-
<div class="ap-sdk-
|
|
1863
|
-
|
|
1864
|
-
<button class="ap-sdk-
|
|
1865
|
-
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost" data-ap-cancel>Cancel</button>
|
|
1975
|
+
<div class="ap-sdk-runner__log-toolbar">
|
|
1976
|
+
<button type="button" class="ap-sdk-runner__scroll-toggle" data-ap-runner-scroll-toggle>Auto ↓</button>
|
|
1977
|
+
<button type="button" class="ap-sdk-runner__scroll-jump" data-ap-runner-scroll-jump title="Jump to latest output">Jump to latest</button>
|
|
1866
1978
|
</div>
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1979
|
+
<div class="ap-sdk-runner__log" data-ap-runner-log></div>
|
|
1980
|
+
<div class="ap-sdk-runner__chat" data-ap-runner-chat>
|
|
1981
|
+
<div class="ap-sdk-runner__question" data-ap-runner-question style="display:none"></div>
|
|
1982
|
+
<form class="ap-sdk-runner__chat-form" data-ap-runner-chat-form>
|
|
1983
|
+
<input
|
|
1984
|
+
type="text"
|
|
1985
|
+
class="ap-sdk-runner__chat-input"
|
|
1986
|
+
data-ap-runner-chat-input
|
|
1987
|
+
placeholder="Send a message to the agent…"
|
|
1988
|
+
autocomplete="off"
|
|
1989
|
+
/>
|
|
1990
|
+
<button type="submit" class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-runner-chat-send>Send</button>
|
|
1991
|
+
</form>
|
|
1992
|
+
<div class="ap-sdk-runner__chat-error" data-ap-runner-chat-error style="display:none"></div>
|
|
1993
|
+
</div>
|
|
1994
|
+
<div class="ap-sdk-runner__hint" data-ap-runner-hint>Closing keeps the task running — resume anytime from My Captures.</div>
|
|
1995
|
+
<div class="ap-sdk-panel__status" data-ap-runner-summary style="display:none"></div>
|
|
1996
|
+
`,s.addEventListener("wheel",a=>{a.stopPropagation()},{passive:!0}),s.addEventListener("touchmove",a=>{a.stopPropagation()},{passive:!0}),document.body.appendChild(s),w.highlightOverlay=Pi(),rt(s),w.runnerResizeCleanup=oa(s,sa),w.runnerDragCleanup=Tr(s,Ir),s.querySelector("[data-ap-close]").addEventListener("click",()=>{Dc(),r==null||r()}),s.querySelector("[data-ap-runner-chat-form]").addEventListener("submit",a=>{a.preventDefault(),Q_(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(ei,H_),w.cancelDisarmDocListener=c=>{c.target!==i&&ei()},document.addEventListener("click",w.cancelDisarmDocListener,!0);return}ei(),C_(e,A)}),s.querySelector("[data-ap-runner-scroll-toggle]").addEventListener("click",()=>{w.autoScrollEnabled=!w.autoScrollEnabled,w.autoScrollEnabled&&Gh(),ti()}),s.querySelector("[data-ap-runner-scroll-jump]").addEventListener("click",()=>{w.autoScrollEnabled=!0,Gh(),ti()}),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>I_&&(w.autoScrollEnabled=!1,ti())}),Hc(),$h(A,e)}const Oc="ap-sdk-captures",L_=50;function sr(){try{const A=localStorage.getItem(Oc);return A?JSON.parse(A):[]}catch(A){return[]}}function D_(A){const e=sr(),t=[A,...e].slice(0,L_);try{localStorage.setItem(Oc,JSON.stringify(t))}catch(n){}}function R_(){try{localStorage.removeItem(Oc)}catch(A){}}function Jh(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 O_(A,e){return`Click "${A}" ${e.toLowerCase()}`}function jh(A,e,t){return t?`Typed [redacted] into ${A}`:`Typed "${e}" into ${A}`}function Yh(A,e){return`Scrolled to (${A}, ${e})`}function P_(A,e){return e?`Pressed "${A}" in ${e}`:`Pressed "${A}"`}function qh(A){return A.map((e,t)=>`${t+1}. ${e.description}`).join(`
|
|
1997
|
+
`)}const M_=400,K_=new Set(["Enter","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]),N_=new Set(["Control","Meta","Alt","Shift"]);function $_(A){if(N_.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("+")):K_.has(A.key)?A.key:null}function z_(A){return A instanceof HTMLInputElement||A instanceof HTMLTextAreaElement||A instanceof HTMLSelectElement?Jh(A):Ds(A)||A.tagName.toLowerCase()}let or=[],ue=null,ri=null,me=null,ht=null,ft=null;function Af(){ri&&(ri.textContent=`● Recording — ${or.length} step${or.length===1?"":"s"}`)}function Pc(){ft&&(clearTimeout(ft),ft=null),ht&&(or.push(ht),ht=null,Af())}function Mc(A){Pc(),or.push(A),Af()}function V_(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 G_(A,e){me&&me(),or=[],ht=null,ue=document.createElement("div"),ue.className="ap-sdk-recorder-bar",ue.setAttribute("data-ap-sdk","1"),ue.innerHTML=`
|
|
1998
|
+
<span class="ap-sdk-recorder-bar__counter" data-ap-recorder-counter>● Recording — 0 steps</span>
|
|
1999
|
+
<button class="ap-sdk-recorder-bar__btn ap-sdk-recorder-bar__btn--stop" data-ap-recorder-stop type="button">Stop</button>
|
|
2000
|
+
<button class="ap-sdk-recorder-bar__btn ap-sdk-recorder-bar__btn--discard" data-ap-recorder-discard type="button">Discard</button>
|
|
2001
|
+
`,document.body.appendChild(ue),rt(ue),ri=ue.querySelector("[data-ap-recorder-counter]");const t=()=>{Pc();const i=or;me==null||me(),A(i)},n=()=>{me==null||me()};ue.querySelector("[data-ap-recorder-stop]").addEventListener("click",t),ue.querySelector("[data-ap-recorder-discard]").addEventListener("click",n);const r=i=>{if(Fr(i.target))return;const c=i.target;Mc({action:"click",cssSelector:Ls(c),elementText:Ds(c),description:O_(Ds(c),c.tagName),capturedAt:new Date().toISOString()})},s=i=>{if(Fr(i.target))return;const c=i.target;if(!(c instanceof HTMLInputElement)&&!(c instanceof HTMLTextAreaElement)&&!(c instanceof HTMLSelectElement))return;const u=Jh(c),h=Bl(c),f=h?"[redacted]":V_(c);Mc($(k({action:"inputText",cssSelector:Ls(c),elementText:u,value:f},h?{redacted:!0}:{}),{description:jh(u,f,h),capturedAt:new Date().toISOString()}))},o=()=>{const i=Math.round(window.scrollX),c=Math.round(window.scrollY);ht?(ht.scrollX=i,ht.scrollY=c,ht.description=Yh(i,c)):ht={action:"scroll",scrollX:i,scrollY:c,description:Yh(i,c),capturedAt:new Date().toISOString()},ft&&clearTimeout(ft),ft=setTimeout(()=>{ft=null,Pc()},M_)},a=i=>{if(i.key==="Escape"){n();return}if(Fr(i.target))return;const c=$_(i);if(!c)return;const u=i.target instanceof Element?i.target:document.body,h=z_(u);Mc({action:"keypress",cssSelector:Ls(u),elementText:h,key:c,description:P_(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}),me=()=>{document.removeEventListener("click",r,{capture:!0}),document.removeEventListener("change",s,{capture:!0}),window.removeEventListener("scroll",o,{capture:!0}),document.removeEventListener("keydown",a,{capture:!0}),ft&&(clearTimeout(ft),ft=null),ht=null,ue&&st(ue),ue==null||ue.remove(),ue=null,ri=null,me=null}}function Z_(){me==null||me()}function si(){return me!==null}const X_="data-ap-sdk",W_="ap-sdk-fab",ef="ap-sdk-fab--dragging",Kc="ap-sdk-fab--open",tf="ap-sdk-fab-pos",oi="ap-sdk-fab--left-edge",J_='<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>',j_='<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>',Y_='<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>',q_='<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 M=null,gt=null,Wt=null,Jt=null,Te=null,ir=null,ar=null,cr=null,ii=null,us=null,lr=null,ai=null,ci=null,li=null,nf=0,rf=0,sf=0,of=0,ur=!1,Je=!1,ds=null,Qn=null;function Ax(){ds=A=>{if(!M){ui();return}if(!ur){if(Math.hypot(A.clientX-sf,A.clientY-of)<5)return;ur=!0,Je=!0,M.classList.add(ef)}ex(A.clientX-nf,A.clientY-rf)},Qn=()=>{if(!M){ui();return}ur?(ur=!1,M.classList.remove(ef),M.style.transition="",tx(M.getBoundingClientRect())):M.style.transition="",ui()},window.addEventListener("pointermove",ds),window.addEventListener("pointerup",Qn),window.addEventListener("pointercancel",Qn)}function ui(){ds&&(window.removeEventListener("pointermove",ds),ds=null),Qn&&(window.removeEventListener("pointerup",Qn),window.removeEventListener("pointercancel",Qn),Qn=null)}function ex(A,e){if(!M)return;const t=M.offsetWidth||52,n=M.offsetHeight||52;M.style.top=`${Math.max(0,Math.min(e,window.innerHeight-n))}px`,M.style.left=`${Math.max(0,Math.min(A,window.innerWidth-t))}px`,M.style.bottom="auto",M.style.right="auto"}function tx(A){if(!M)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";M.style.top="auto",M.style.bottom=`${t}px`,n==="left"?(M.style.right="auto",M.style.left="16px",M.classList.add(oi)):(M.style.left="auto",M.style.right="16px",M.classList.remove(oi));try{localStorage.setItem(tf,JSON.stringify({edge:n,bottom:t}))}catch(r){}}function nx(){if(M)try{const A=localStorage.getItem(tf);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));M.style.top="auto",M.style.bottom=`${n}px`,e.edge==="left"?(M.style.right="auto",M.style.left="16px",M.classList.add(oi)):(M.style.left="auto",M.style.right="16px",M.classList.remove(oi))}catch(A){}}function dr(){M==null||M.classList.remove(Kc),lr&&(window.removeEventListener("pointerdown",lr,{capture:!0}),lr=null)}function rx(){M&&(M.classList.add(Kc),lr=A=>{!M||M.contains(A.target)||dr()},requestAnimationFrame(()=>{lr&&window.addEventListener("pointerdown",lr,{capture:!0})}))}function di(A){return new DOMParser().parseFromString(A,"text/html").body.firstElementChild}function af(A,e,t){var a;if(ai=A,ci=e,li=t,M)return;M=document.createElement("div"),M.className=W_,M.setAttribute(X_,"1"),ir=document.createElement("div"),ir.className="ap-sdk-fab__row";const n=document.createElement("span");n.className="ap-sdk-fab__label",n.textContent="View captures",Te=document.createElement("button"),Te.className="ap-sdk-fab__list ap-sdk-fab__sub",Te.setAttribute("aria-label","My captures"),Te.setAttribute("title","View my captures"),Te.appendChild(di(q_));const r=document.createElement("span");r.className="ap-sdk-fab__badge",r.setAttribute("data-ap-badge",""),r.style.display="none",Te.appendChild(r),ir.appendChild(n),ir.appendChild(Te),ar=document.createElement("div"),ar.className="ap-sdk-fab__row";const s=document.createElement("span");s.className="ap-sdk-fab__label",s.textContent="Capture element",Wt=document.createElement("button"),Wt.className="ap-sdk-fab__capture ap-sdk-fab__sub",Wt.setAttribute("aria-label","Capture element"),Wt.setAttribute("title","Capture element to Agent Platform"),Wt.appendChild(di(j_)),ar.appendChild(s),ar.appendChild(Wt),cr=document.createElement("div"),cr.className="ap-sdk-fab__row";const o=document.createElement("span");o.className="ap-sdk-fab__label",o.textContent="Record interaction",Jt=document.createElement("button"),Jt.className="ap-sdk-fab__record ap-sdk-fab__sub",Jt.setAttribute("aria-label","Record interaction"),Jt.setAttribute("title","Record a sequence of interactions"),Jt.appendChild(di(Y_)),cr.appendChild(o),cr.appendChild(Jt),gt=document.createElement("button"),gt.className="ap-sdk-fab__main",gt.setAttribute("aria-label","Agent Platform"),gt.setAttribute("title","Agent Platform"),gt.appendChild(di(J_)),M.appendChild(ir),M.appendChild(ar),M.appendChild(cr),M.appendChild(gt),gt.addEventListener("click",i=>{if(Je){Je=!1;return}i.preventDefault(),i.stopPropagation(),M!=null&&M.classList.contains(Kc)?dr():rx()}),Wt.addEventListener("click",i=>{if(Je){Je=!1;return}i.preventDefault(),i.stopPropagation(),dr(),!Pn()&&!si()&&ai&&ai()}),Jt.addEventListener("click",i=>{if(Je){Je=!1;return}i.preventDefault(),i.stopPropagation(),dr(),!Pn()&&!si()&&ci&&ci()}),Te.addEventListener("click",i=>{if(Je){Je=!1;return}i.preventDefault(),i.stopPropagation(),dr(),li&&li()}),us=i=>{if(!M||!(M===i.target||M.contains(i.target)))return;const c=M.getBoundingClientRect();nf=i.clientX-c.left,rf=i.clientY-c.top,sf=i.clientX,of=i.clientY,ur=!1,Je=!1,M.style.transition="none",i.stopPropagation(),Ax()},window.addEventListener("pointerdown",us,{capture:!0}),((a=document.body)!=null?a:document.documentElement).appendChild(M),rt(M),nx(),ii=setInterval(()=>{gt&>.classList.toggle("ap-sdk-fab__main--active",Pn()||si())},200)}function yn(A){const e=Te==null?void 0:Te.querySelector("[data-ap-badge]");e&&(A>0?(e.textContent=String(A),e.style.display=""):e.style.display="none")}function cf(){ur=!1,Je=!1,ui(),dr(),ii&&(clearInterval(ii),ii=null),us&&(window.removeEventListener("pointerdown",us,{capture:!0}),us=null),M&&st(M),M==null||M.remove(),M=null,gt=null,Wt=null,Jt=null,Te=null,ir=null,ar=null,cr=null,ai=null,ci=null,li=null}function lf(A,e){return I(this,null,function*(){try{if(A.type==="planning"){const n=yield wb(e,A.id);return{capture:A,status:n.status,approved:n.status==="approved"}}const t=yield Su(e,A.id);return{capture:A,status:t.status,approved:t.approved===!0}}catch(t){return{capture:A,status:"unavailable",approved:!1}}})}function uf(A){return A.filter(e=>!e.approved).length}function df(A){return I(this,null,function*(){const e=sr();if(!A||e.length===0){yn(e.length);return}const t=yield Promise.all(e.map(n=>lf(n,A)));yn(uf(t))})}function pf(A){return A.screenshotBlob?`
|
|
1880
2002
|
|
|
2003
|
+
(A screenshot of the selected element is attached.)`:""}function sx(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:",qh(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(`
|
|
1881
2004
|
Element tree:
|
|
1882
|
-
${
|
|
2005
|
+
${e.ctx.innerTree}`),e.screenshotBlob&&n.push(`Screenshot: attached (see screenshot-${t+1}.png)`),n.push("",`Instruction:
|
|
2006
|
+
${e.instruction}`),n.join(`
|
|
2007
|
+
`)}).join(`
|
|
1883
2008
|
|
|
1884
|
-
|
|
1885
|
-
|
|
2009
|
+
---
|
|
2010
|
+
|
|
2011
|
+
`)}function ox(i){return I(this,arguments,function*({opts:A,advancedOpts:e,allPicks:t,captureType:n,note:r,allowSubmit:s,project:o,projectCode:a}){var m,b;const u=t.some(U=>!!U.screenshotBlob)?(yield Promise.all(t.map((U,E)=>U.screenshotBlob?ub(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+pf(t[0]),E=t[0].ctx;if(n==="task")f=(yield na(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=ug(r,$(k({},E),{ancestry:E.outerTree||E.ancestry}));(m=E.innerTree)!=null&&m.trim()&&(v+=`
|
|
1886
2012
|
|
|
1887
|
-
`);E.captureType==="task"?(ue=(yield Hs(rt,{project:De,note:ot,ctx:Lt[0].ctx,advancedOpts:_t,titleOverride:It,type:cc,titleInstruction:ln})).id,Ie="task",X=It):E.captureType==="planning"?(ue=(yield gc(rt,De,ot,_t)).id,Ie="planning",X=It):(ue=(yield fc(rt,{project:De,note:ot,ctx:Lt[0].ctx,advancedOpts:_t,titleOverride:It,titleInstruction:ln,allowSubmit:E.allowSubmit})).id,Ie="automate",X=It)}if(Fb({id:ue,type:Ie,title:X,backendUrl:F,createdAt:new Date().toISOString()}),Ai(),Cl(rt).catch(()=>{}),Ie==="automate"){Le(),mi(ue,rt,F,X,p);return}const wr=Ie==="task"?`${F.replace(/\/+$/,"")}/tasks/${ue}`:`${F.replace(/\/+$/,"")}/planning/${ue}`;wk(se,Ie,X,wr,Le),W.classList.add("ap-sdk-panel--success"),sn==null||sn(),sn=null,tt==null||tt.hide(),E.submitting=!1,Ci(W,!1)}catch(De){De instanceof dc?yk(se,()=>z(null,null,function*(){const{code:ue}=yield xi(F),{token:Ie,expiresAt:X}=yield Fs({backendUrl:F},ue,window.location.origin);ts({backendUrl:F,token:Ie,projectCode:o,expiresAt:X}),n.token=Ie,i({backendUrl:F,token:Ie}),yield Pe()})):Sn(se,"error",De instanceof Error?De.message:"An unexpected error occurred."),E.submitting=!1,Ci(W,!1),q.textContent="Submit"}});q.addEventListener("click",Pe),setTimeout(()=>H.focus(),50)}const _k={click:"🖱",inputText:"⌨",scroll:"↕",keypress:"⌤"};function zl(e){var t,n;return(t=e.interactionSteps)!=null&&t.length?`
|
|
1888
|
-
<div class="ap-sdk-panel__context-label">Recorded steps (${e.interactionSteps.length})</div>
|
|
1889
|
-
<div class="ap-sdk-panel__context-steps">
|
|
1890
|
-
${e.interactionSteps.map(r=>`
|
|
1891
|
-
<div class="ap-sdk-panel__context-step">
|
|
1892
|
-
<span class="ap-sdk-panel__context-step-icon">${_k[r.action]}</span>
|
|
1893
|
-
<span class="ap-sdk-panel__context-step-text">${ut(r.description)}</span>
|
|
1894
|
-
</div>
|
|
1895
|
-
`).join("")}
|
|
1896
|
-
</div>
|
|
1897
|
-
`:`
|
|
1898
|
-
<div class="ap-sdk-panel__context-label">Captured element</div>
|
|
1899
|
-
<div class="ap-sdk-panel__context-text" title="${ut((n=e.elementText)!=null?n:"")}">${ut(e.elementText||"(no text)")}</div>
|
|
1900
|
-
${e.cssSelector?`<div class="ap-sdk-panel__context-selector" title="${ut(e.cssSelector)}">${ut(e.cssSelector)}</div>`:""}
|
|
1901
|
-
`}function vk(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:",ml(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(`
|
|
1902
2013
|
Element tree:
|
|
1903
|
-
${
|
|
1904
|
-
${t.instruction}`),r.join(`
|
|
1905
|
-
`)}).join(`
|
|
2014
|
+
${E.innerTree}`),(b=E.interactionSteps)!=null&&b.length&&(v+=`
|
|
1906
2015
|
|
|
1907
|
-
|
|
2016
|
+
Recorded steps:
|
|
2017
|
+
${qh(E.interactionSteps)}`),v+=pf(t[0]),f=(yield xu(A,h,v,e,u)).id,g=r.slice(0,120)||E.pageTitle||"Planning session"}else f=(yield _u(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=sx(t),E=t[0].instruction.slice(0,120)||t[0].ctx.pageTitle||"Multi-element capture",v=t.map(F=>F.instruction).filter(Boolean).join(`
|
|
1908
2018
|
|
|
1909
|
-
`)}function
|
|
1910
|
-
<p>Your session expired.</p>
|
|
1911
|
-
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-reconnect type="button">Reconnect</button>
|
|
1912
|
-
`;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){Sn(e,"error",r instanceof Error?r.message:"Could not reconnect — please try again.")}}))}function wk(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=`
|
|
1913
|
-
<div class="ap-sdk-success-card">
|
|
1914
|
-
<svg class="ap-sdk-success-check" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
|
|
1915
|
-
<circle class="ap-sdk-success-check__circle" cx="24" cy="24" r="22"/>
|
|
1916
|
-
<path class="ap-sdk-success-check__tick" d="M14 24l7 7 13-14"/>
|
|
1917
|
-
</svg>
|
|
1918
|
-
<p class="ap-sdk-success-headline">${ut(a)}</p>
|
|
1919
|
-
<div class="ap-sdk-success-meta">
|
|
1920
|
-
<span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--${t}">${ut(i)}</span>
|
|
1921
|
-
<span class="ap-sdk-success-title" title="${ut(n)}">${ut(l)}</span>
|
|
1922
|
-
</div>
|
|
1923
|
-
<div class="ap-sdk-success-actions">
|
|
1924
|
-
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-success-view>${ut(d)}</button>
|
|
1925
|
-
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost" data-ap-success-close>Close</button>
|
|
1926
|
-
</div>
|
|
1927
|
-
</div>
|
|
1928
|
-
`,e.querySelector("[data-ap-success-view]").addEventListener("click",()=>window.open(r,"_blank","noopener,noreferrer")),e.querySelector("[data-ap-success-close]").addEventListener("click",o)}function Ci(e,t){e.querySelectorAll("button, input, textarea, select").forEach(n=>{n.disabled=t})}function ut(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}let oe=null,eo=null,to=null;function Ol(){return oe!==null}function Zn(){oe&&Ut(oe),oe==null||oe.remove(),oe=null,eo==null||eo(),eo=null,to==null||to(),to=null}function xk(e){return e==="task"?"Task":e==="planning"?"Planning":"Automate"}function Sk(e){if(oe){Zn();return}oe=document.createElement("div"),oe.className="ap-sdk-panel",oe.setAttribute("data-ap-sdk","1"),oe.setAttribute("role","dialog"),oe.setAttribute("aria-modal","true"),oe.setAttribute("aria-label","My captures"),oe.addEventListener("wheel",t=>{t.stopPropagation()},{passive:!0}),oe.addEventListener("touchmove",t=>{t.stopPropagation()},{passive:!0}),oe.innerHTML=`
|
|
2019
|
+
`);n==="task"?(f=(yield na(A,{project:h,note:U,ctx:t[0].ctx,advancedOpts:e,titleOverride:E,type:Uu,titleInstruction:v,extraFileIds:u})).id,g=E):n==="planning"?(f=(yield xu(A,h,U,e,u)).id,g=E):(f=(yield _u(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 ix(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:b,hideHighlight:U}=A,E=()=>I(null,null,function*(){if(e.submitting)return;if(s){Vt(o,"error","Connect to Agent Platform first.");return}const v=t.backendUrl,F=t.token,y=u.value.trim();if(!y){Vt(o,"error","Please enter an instruction.");return}e.submitting=!0,cc(i,!0),Vt(o,null,""),a.textContent="Submitting…";const _={backendUrl:v,token:F},R=h.getOptions(),H=[...e.completedPicks,{ctx:e.currentCtx,instruction:y,screenshotBlob:e.screenshotIncluded?e.currentScreenshotBlob:null}];try{const{createdId:z,captureType:K,captureTitle:G}=yield ox({opts:_,advancedOpts:R,allPicks:H,captureType:e.captureType,note:y,allowSubmit:e.allowSubmit,project:n,projectCode:r});if(D_({id:z,type:K,title:G,backendUrl:v,createdAt:new Date().toISOString()}),ia(),df(_).catch(()=>{}),K==="automate"){m(),Rc(z,_,v,G,f);return}const W=K==="task"?`${v.replace(/\/+$/,"")}/tasks/${z}`:`${v.replace(/\/+$/,"")}/planning/${z}`;DF(o,K,G,W,m),i.classList.add("ap-sdk-panel--success"),b(),U(),c.style.display="none",e.submitting=!1,cc(i,!1)}catch(z){z instanceof Fu?PF(o,()=>I(null,null,function*(){const{code:K}=yield lc(v),{token:G,expiresAt:W}=yield ra({backendUrl:v},K,window.location.origin);Go({backendUrl:v,token:G,projectCode:r,expiresAt:W}),t.token=G,g({backendUrl:v,token:G}),yield E()})):Vt(o,"error",z instanceof Error?z.message:"An unexpected error occurred."),e.submitting=!1,cc(i,!1),a.textContent="Submit"}});return E}let q=null,de=null,Ft=null,ps=null,hs=null;function fs(){return q!==null}function gs(){q&&st(q),q==null||q.remove(),q=null,Ft==null||Ft(),Ft=null,ps==null||ps(),ps=null,hs==null||hs(),hs=null,de==null||de.destroy(),de=null}function hf(A,e,t,n,r,s,o,a,i,c,u=null,h){var _n,qt,XA,Bt,Re,Oe,_t,qe,wt,mt,xn;q&&gs();const f=!t.backendUrl||!t.token,g=Tu(u,"tasks:write"),m=Tu(u,"planning-sessions:write"),b=!g&&m?"planning":"task",U=h?null:$u(),E={captureType:(qt=(_n=h==null?void 0:h.captureType)!=null?_n:U==null?void 0:U.captureType)!=null?qt:b,submitting:!1,completedPicks:(Bt=(XA=h==null?void 0:h.completedPicks)!=null?XA:U==null?void 0:U.completedPicks)!=null?Bt:[],currentCtx:A,currentPickedEl:e,awaitingPick:!1,allowSubmit:(Oe=(Re=h==null?void 0:h.allowSubmit)!=null?Re:U==null?void 0:U.allowSubmit)!=null?Oe:!1,currentScreenshotBlob:(_t=h==null?void 0:h.currentScreenshotBlob)!=null?_t:null,screenshotCapturing:!1,screenshotIncluded:(qe=h==null?void 0:h.screenshotIncluded)!=null?qe:!1,screenshotError:(wt=h==null?void 0:h.screenshotError)!=null?wt:null};q=document.createElement("div"),q.className="ap-sdk-panel",q.setAttribute("data-ap-sdk","1"),q.setAttribute("role","dialog"),q.setAttribute("aria-modal","true"),q.setAttribute("aria-label","Capture to Agent Platform"),q.innerHTML=LF(A,{needsCredentials:f,canCreateTask:g,canCreatePlanning:m,captureType:E.captureType,hasOnReselect:!!i,hasOnAddAnother:!!a}),q.addEventListener("wheel",WA=>{WA.stopPropagation()},{passive:!0}),q.addEventListener("touchmove",WA=>{WA.stopPropagation()},{passive:!0});const v=q.querySelector(".ap-sdk-panel__body"),F=Fb(v,t,(mt=n==null?void 0:n.id)!=null?mt:null),y=q.querySelector("[data-ap-note]"),_=Sb(y,t,(xn=n==null?void 0:n.id)!=null?xn:null),R={getOptions(){return k(k({},F.getOptions()),_.getSelection())}};document.body.appendChild(q),de=Pi(),E.currentPickedEl&&de.update(E.currentPickedEl),rt(q),ps=oa(q,sa),hs=Tr(q,Ir);const H=q.querySelector("[data-ap-close]"),z=q.querySelector("[data-ap-cancel]"),K=q.querySelector("[data-ap-submit]"),G=q.querySelector("[data-ap-note]"),W=q.querySelector("[data-ap-status]"),sA=q.querySelectorAll("[data-ap-type]"),lA=q.querySelector("[data-ap-automate-options]"),_A=q.querySelector("[data-ap-allow-submit]"),Ce=q.querySelector("[data-ap-pick-list]"),pe=q.querySelector("[data-ap-context]"),De=q.querySelector("[data-ap-screenshot]"),fr=q.querySelector("[data-ap-add-another]"),Cs=q.querySelector("[data-ap-pick-actions]"),gr=q.querySelector("[data-ap-select-parent]"),SA=q.querySelector("[data-ap-reselect]"),Br=q.querySelector("[data-ap-clear-selections]"),BA=RF(E,De),vt=()=>{E.currentPickedEl&&(de==null||de.update(E.currentPickedEl))};window.addEventListener("scroll",vt,{capture:!0,passive:!0}),window.addEventListener("resize",vt),Ft=()=>{window.removeEventListener("scroll",vt,!0),window.removeEventListener("resize",vt),BA.cleanup()};const uA=OF({state:E,els:{contextEl:pe,pickListEl:Ce,pickActionsEl:Cs,noteEl:G,addAnotherBtn:fr,selectParentBtn:gr,reselectBtn:SA,clearSelectionsBtn:Br,typeButtons:sA,allowSubmitCheckbox:_A,automateOptionsEl:lA,statusEl:W},screenshotCtl:BA,defaultCaptureType:b,updateHighlight:WA=>de==null?void 0:de.update(WA),onReselect:i,onAddAnother:a});h?(G.value=h.note,_A.checked=h.allowSubmit,lA.style.display=E.captureType==="automate"?"":"none",uA.renderPickList(),Vt(W,"success","Reconnected — your draft was kept."),BA.renderScreenshotUi()):U?(G.value=U.note,_A.checked=U.allowSubmit,lA.style.display=E.captureType==="automate"?"":"none",uA.renderPickList(),Vt(W,"success","Restored your previous selections."),BA.renderScreenshotUi()):E.currentPickedEl&&BA.captureScreenshotFor(E.currentPickedEl);const ZA=()=>{gs(),c==null||c()},Yt=()=>({captureType:E.captureType,note:G.value,completedPicks:E.completedPicks,currentCtx:E.currentCtx,currentPickedEl:E.currentPickedEl,allowSubmit:E.allowSubmit,currentScreenshotBlob:E.currentScreenshotBlob,screenshotIncluded:E.screenshotIncluded,screenshotError:E.screenshotError});H.addEventListener("click",ZA),z.addEventListener("click",ZA);const Ye=q.querySelector("[data-ap-connect-required]");Ye&&o&&Ye.addEventListener("click",()=>{const WA=Yt();ZA(),o(WA)}),sA.forEach(WA=>{WA.addEventListener("click",()=>{E.captureType=WA.dataset.apType,sA.forEach(wr=>wr.classList.toggle("ap-sdk-active",wr===WA)),lA.style.display=E.captureType==="automate"?"":"none",uA.persistDraft()})}),_A.addEventListener("change",()=>{E.allowSubmit=_A.checked,uA.persistDraft()}),G.addEventListener("input",uA.persistDraft);const IA=q.querySelector("[data-ap-reconfigure]");o?IA.addEventListener("click",()=>{const WA=Yt();ZA(),o(WA)}):IA.style.display="none";const PA=ix({state:E,apiOpts:t,project:n,projectCode:r,needsCredentials:f,statusEl:W,submitBtn:K,panelEl:q,screenshotEl:De,noteEl:G,advancedOptionsRef:R,onClose:c,onCredentialsSaved:s,closeAndCleanup:ZA,clearTrackCleanup:()=>{Ft==null||Ft(),Ft=null},hideHighlight:()=>de==null?void 0:de.hide()});K.addEventListener("click",PA),setTimeout(()=>G.focus(),50)}let cA=null,Bs=null,ws=null;function ff(){return cA!==null}function Un(){cA&&st(cA),cA==null||cA.remove(),cA=null,Bs==null||Bs(),Bs=null,ws==null||ws(),ws=null}function ax(A){return A==="task"?"Task":A==="planning"?"Planning":"Automate"}function cx(A){if(cA){Un();return}cA=document.createElement("div"),cA.className="ap-sdk-panel",cA.setAttribute("data-ap-sdk","1"),cA.setAttribute("role","dialog"),cA.setAttribute("aria-modal","true"),cA.setAttribute("aria-label","My captures"),cA.addEventListener("wheel",e=>{e.stopPropagation()},{passive:!0}),cA.addEventListener("touchmove",e=>{e.stopPropagation()},{passive:!0}),cA.innerHTML=`
|
|
1929
2020
|
<div class="ap-sdk-panel__header">
|
|
1930
2021
|
<span class="ap-sdk-panel__title">
|
|
1931
2022
|
<span class="ap-sdk-panel__logo">AP</span>
|
|
@@ -1938,27 +2029,27 @@ ${t.instruction}`),r.join(`
|
|
|
1938
2029
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-clear-history>Clear history</button>
|
|
1939
2030
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-close-list>Close</button>
|
|
1940
2031
|
</div>
|
|
1941
|
-
`,document.body.appendChild(
|
|
2032
|
+
`,document.body.appendChild(cA),rt(cA),Bs=oa(cA,sa),ws=Tr(cA,Ir),cA.querySelector("[data-ap-close]").addEventListener("click",()=>{Un()}),cA.querySelector("[data-ap-close-list]").addEventListener("click",()=>{Un()}),cA.querySelector("[data-ap-clear-history]").addEventListener("click",()=>{R_(),yn(0),gf(A)}),gf(A)}function gf(A){if(!cA)return;const e=cA.querySelector("[data-ap-list-body]"),t=sr();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=>`
|
|
1942
2033
|
<div class="ap-sdk-list-item">
|
|
1943
2034
|
<div class="ap-sdk-list-item__row">
|
|
1944
|
-
<span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--${
|
|
1945
|
-
<span class="ap-sdk-list-item__title" title="${
|
|
2035
|
+
<span class="ap-sdk-list-item__badge ap-sdk-list-item__badge--${n.type}">${ax(n.type)}</span>
|
|
2036
|
+
<span class="ap-sdk-list-item__title" title="${pi(n.title)}">${dx(n.title)}</span>
|
|
1946
2037
|
</div>
|
|
1947
2038
|
<div class="ap-sdk-list-item__row">
|
|
1948
|
-
<span class="ap-sdk-status-badge" data-ap-status="${
|
|
1949
|
-
${
|
|
2039
|
+
<span class="ap-sdk-status-badge" data-ap-status="${pi(n.id)}">${A?"…":"—"}</span>
|
|
2040
|
+
${n.type==="automate"&&A?`<button class="ap-sdk-list-item__link" data-ap-resume="${pi(n.id)}">Resume →</button>`:`<a class="ap-sdk-list-item__link" href="${pi(ux(n))}" target="_blank" rel="noopener noreferrer">View →</a>`}
|
|
1950
2041
|
</div>
|
|
1951
2042
|
</div>
|
|
1952
|
-
`).join(""),
|
|
2043
|
+
`).join(""),A){const n=A;Promise.all(t.map(r=>lx(r,n))).then(r=>{yn(uf(r))}),e.querySelectorAll("[data-ap-resume]").forEach(r=>{r.addEventListener("click",()=>{const s=r.dataset.apResume,o=t.find(a=>a.id===s);o&&(Un(),Rc(o.id,n,o.backendUrl,o.title,()=>{}))})})}}function lx(A,e){return I(this,null,function*(){const t=yield lf(A,e),n=cA==null?void 0:cA.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 ux(A){const e=A.backendUrl.replace(/\/+$/,"");return A.type==="planning"?`${e}/planning/${A.id}`:`${e}/tasks/${A.id}`}function pi(A){return A.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function dx(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}let He=null,hi=!1;function px(){He==null||He.disconnect(),Array.from(document.body.querySelectorAll(':scope > [data-ap-sdk="1"]')).forEach(A=>document.body.appendChild(A)),He&&He.observe(document.body,{childList:!0}),hi=!1}function Bf(){He||(He=new MutationObserver(A=>{!A.some(t=>Array.from(t.addedNodes).some(n=>n instanceof Element&&n.getAttribute("data-ap-sdk")!=="1"))||hi||(hi=!0,queueMicrotask(px))}),He.observe(document.body,{childList:!0}))}function hx(){He==null||He.disconnect(),He=null,hi=!1}let se=null;function En(){se&&st(se),se==null||se.remove(),se=null}function wf(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 mf(A){if(se)return;const e=$u();e&&(se=document.createElement("div"),se.className="ap-sdk-resume-banner",se.setAttribute("data-ap-sdk","1"),se.setAttribute("role","status"),se.innerHTML=`
|
|
1953
2044
|
<div>
|
|
1954
2045
|
<span class="ap-sdk-resume-banner__title">Resume your draft?</span>
|
|
1955
|
-
<span class="ap-sdk-resume-banner__summary" title="${
|
|
2046
|
+
<span class="ap-sdk-resume-banner__summary" title="${fx(wf(e))}">${Cf(wf(e))}</span>
|
|
1956
2047
|
</div>
|
|
1957
2048
|
<div class="ap-sdk-resume-banner__actions">
|
|
1958
2049
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-resume-draft type="button">Resume</button>
|
|
1959
2050
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--secondary" data-ap-discard-draft type="button">Discard</button>
|
|
1960
2051
|
</div>
|
|
1961
|
-
`,document.body.appendChild(
|
|
2052
|
+
`,document.body.appendChild(se),rt(se),se.querySelector("[data-ap-resume-draft]").addEventListener("click",()=>{En(),A(e)}),se.querySelector("[data-ap-discard-draft]").addEventListener("click",()=>{ia(),En()}))}function Cf(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function fx(A){return Cf(A)}const gx={click:"🖱",inputText:"⌨",scroll:"↕",keypress:"⌤"};let RA=null,jt=[],ms=null;function fi(){RA&&st(RA),RA==null||RA.remove(),RA=null,jt=[],ms==null||ms(),ms=null}function Bx(A,e,t){RA&&fi(),jt=[...A],RA=document.createElement("div"),RA.className="ap-sdk-panel ap-sdk-record-review",RA.setAttribute("data-ap-sdk","1"),RA.setAttribute("role","dialog"),RA.setAttribute("aria-modal","true"),RA.setAttribute("aria-label","Review recorded steps"),RA.innerHTML=`
|
|
1962
2053
|
<div class="ap-sdk-panel__header">
|
|
1963
2054
|
<span class="ap-sdk-panel__title">
|
|
1964
2055
|
<span class="ap-sdk-panel__logo">AP</span>
|
|
@@ -1973,11 +2064,11 @@ ${t.instruction}`),r.join(`
|
|
|
1973
2064
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--primary" data-ap-review-continue>Continue</button>
|
|
1974
2065
|
<button class="ap-sdk-panel__btn ap-sdk-panel__btn--ghost" data-ap-review-cancel>Cancel</button>
|
|
1975
2066
|
</div>
|
|
1976
|
-
`,document.body.appendChild(
|
|
1977
|
-
<div class="ap-sdk-record-step" data-step-index="${
|
|
1978
|
-
<span class="ap-sdk-record-step__icon">${
|
|
1979
|
-
${
|
|
1980
|
-
<button class="ap-sdk-record-step__remove" data-ap-step-remove="${
|
|
2067
|
+
`,document.body.appendChild(RA),rt(RA),ms=Tr(RA,Ir);const n=RA.querySelector("[data-ap-review-list]"),r=RA.querySelector("[data-ap-review-continue]"),s=()=>{if(jt.length===0){n.innerHTML='<p class="ap-sdk-list-empty">No steps recorded.</p>',r.disabled=!0;return}r.disabled=!1,n.innerHTML=jt.map((a,i)=>{var c;return`
|
|
2068
|
+
<div class="ap-sdk-record-step" data-step-index="${i}">
|
|
2069
|
+
<span class="ap-sdk-record-step__icon">${gx[a.action]}</span>
|
|
2070
|
+
${a.action==="inputText"&&!a.redacted?`<input class="ap-sdk-record-step__input" type="text" value="${wx((c=a.value)!=null?c:"")}" data-ap-step-value />`:`<span class="ap-sdk-record-step__description">${bf(a.description)}</span>`}
|
|
2071
|
+
<button class="ap-sdk-record-step__remove" data-ap-step-remove="${i}" aria-label="Remove step ${i+1}">✕</button>
|
|
1981
2072
|
</div>
|
|
1982
|
-
`}).join(""),
|
|
2073
|
+
`}).join(""),n.querySelectorAll("[data-ap-step-remove]").forEach(a=>{a.addEventListener("click",()=>{const i=parseInt(a.dataset.apStepRemove,10);jt.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=jt[c];u.value=a.value,u.description=jh((h=u.elementText)!=null?h:"",a.value,!1)})})};s();const o=()=>{fi()};RA.querySelector("[data-ap-review-close]").addEventListener("click",o),RA.querySelector("[data-ap-review-cancel]").addEventListener("click",o),r.addEventListener("click",()=>{if(jt.length===0)return;const a=jt,i=$(k({},dl()),{pageUrl:window.location.href,pageTitle:document.title,interactionSteps:a});fi(),e(i)})}function bf(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function wx(A){return bf(A)}let X=null,gi=null,Bi=null,wi=null;function Nc(A,e,t){gi=A,Bi=e,wi=t,af(A,e,t)}const Qf="#agent-platform-web-sdk",yf="ap-sdk-fab-unlocked";let kn=null;function Uf(){try{if(localStorage.getItem(yf)==="1")return!0}catch(A){}return window.location.hash===Qf}function Ef(){try{localStorage.setItem(yf,"1")}catch(A){}}function kf(A){return I(this,null,function*(){var t,n,r,s,o;if(Er(),A.requestTimeoutMs!=null&&lb(A.requestTimeoutMs),gg((t=A.exclusionSelector)!=null?t:null),X&&X.projectCode===A.projectCode&&X.backendUrl===((n=A.backendUrl)!=null?n:null)&&X.token===((r=A.token)!=null?r:null))return;X={projectCode:A.projectCode,backendUrl:(s=A.backendUrl)!=null?s:null,token:(o=A.token)!=null?o:null,project:null,resolvingProject:!1,permissions:null},Nc(()=>vf(),()=>Cx(),()=>Gc()),yn(sr().length);let e=!1;if(X.backendUrl&&X.token){const a=X.backendUrl,i=X.token;yield Tf(),df({backendUrl:a,token:i}).catch(()=>{}),If({backendUrl:a,token:i}).catch(()=>{});const c=VF();c&&(Rc(c.taskId,{backendUrl:a,token:i},c.backendUrl,c.title,()=>{}),e=!0)}e||mf(Ff),Bf()})}function $c(A,e){return I(this,null,function*(){if(!X)throw new Error("AgentPlatformSDK: call init() first.");X.backendUrl=A,X.token=e,X.project=null,X.permissions=null,yield Tf(),If({backendUrl:A,token:e}).catch(()=>{})})}function zc(A,e,t){if(!X)throw new Error("AgentPlatformSDK: call init() first.");hf(A,e,{backendUrl:X.backendUrl,token:X.token},X.project,X.projectCode,n=>I(null,null,function*(){yield $c(n.backendUrl,n.token)}),n=>{dc(r=>{Go(r),mi(r).then(()=>zc(n.currentCtx,n.currentPickedEl,n)).catch(console.error)})},n=>{$i((r,s)=>{fs()&&n(r,s)},()=>{_f()})},(n,r)=>{$i((s,o)=>{fs()&&n(s,o)},()=>{fs()&&r()})},()=>{Pn()&&zi()},X.permissions,t)}function Vc(A,e){if(!X)throw new Error("AgentPlatformSDK: call init() first.");hf(A,null,{backendUrl:X.backendUrl,token:X.token},X.project,X.projectCode,t=>I(null,null,function*(){yield $c(t.backendUrl,t.token)}),t=>{dc(n=>{Go(n),mi(n).then(()=>Vc(t.currentCtx,t)).catch(console.error)})},void 0,void 0,()=>{},X.permissions,e)}function Ff(A){var e;if(!X){pr();return}(e=A.currentCtx.interactionSteps)!=null&&e.length?Vc(A.currentCtx,void 0):zc(A.currentCtx,null,void 0)}function vf(){if(!X)throw new Error("AgentPlatformSDK: call init() first.");Pn()||(En(),Er(),$i((A,e)=>I(null,null,function*(){ff()&&Un(),zc(A,e)}),()=>{}))}function mx(){zi()}function Cx(){if(!X)throw new Error("AgentPlatformSDK: call init() first.");si()||(En(),Er(),G_(A=>{Bx(A,e=>Vc(e))}))}function _f(){fs()&&gs()}function bx(){return Pn()}function xf(){hx(),kn&&(window.removeEventListener("hashchange",kn),kn=null),zi(),Z_(),fi(),gs(),Un(),En(),cf(),gi=null,Bi=null,wi=null,X=null}function Sf(){if(typeof window=="undefined"||typeof document=="undefined")return;Er();const A=NF(),e=()=>{A?mi(A).catch(console.error):(Nc(()=>pr(),()=>pr(),()=>Gc()),yn(sr().length),mf(Ff),Bf())};if(Uf()){Ef(),e();return}kn=()=>{window.location.hash===Qf&&(Ef(),window.removeEventListener("hashchange",kn),kn=null,e())},window.addEventListener("hashchange",kn)}function Qx(){gi&&Bi&&wi&&af(gi,Bi,wi)}function yx(){cf()}function pr(){En(),dc(A=>{Go(A),mi(A).catch(console.error)})}function Ux(){ih(),xf(),Er(),Uf()&&(Nc(()=>pr(),()=>pr(),()=>Gc()),yn(sr().length))}function mi(A){return I(this,null,function*(){yield kf({projectCode:A.projectCode,backendUrl:A.backendUrl,token:A.token})})}function Gc(){if(ff()){Un();return}En(),fs()&&gs();const A=X!=null&&X.backendUrl&&(X!=null&&X.token)?{backendUrl:X.backendUrl,token:X.token}:null;cx(A)}function If(A){return I(this,null,function*(){const e=yield mb(A);X&&(X.permissions=e.permissions)})}function Tf(){return I(this,null,function*(){if(!(!X||!X.backendUrl||!X.token||X.project||X.resolvingProject)){X.resolvingProject=!0;try{X.project=yield db({backendUrl:X.backendUrl,token:X.token},X.projectCode)}catch(A){}finally{X&&(X.resolvingProject=!1)}}})}return Sf(),pA.activateElementPicker=vf,pA.autoInit=Sf,pA.clearConfig=Ux,pA.closePanelIfOpen=_f,pA.configure=pr,pA.deactivateElementPicker=mx,pA.destroy=xf,pA.hideFab=yx,pA.init=kf,pA.isPickerRunning=bx,pA.showFab=Qx,pA.updateCredentials=$c,Object.defineProperty(pA,Symbol.toStringTag,{value:"Module"}),pA})({});
|
|
1983
2074
|
//# sourceMappingURL=web-sdk.min.js.map
|