@flarehr/apollo-workplace-policies 0.5.5 → 0.7.7
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.
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var Vt,S,Oo,Ye,Mr,No,Ln,Ro,dt={},Fo=[],ji=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,mn=Array.isArray;function Re(e,t){for(var n in t)e[n]=t[n];return e}function Do(e){var t=e.parentNode;t&&t.removeChild(e)}function b(e,t,n){var r,o,s,i={};for(s in t)s=="key"?r=t[s]:s=="ref"?o=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?Vt.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)i[s]===void 0&&(i[s]=e.defaultProps[s]);return Pt(e,i,r,o,null)}function Pt(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:o??++Oo};return o==null&&S.vnode!=null&&S.vnode(s),s}function Vo(){return{current:null}}function Ie(e){return e.children}function ke(e,t){this.props=e,this.context=t}function rn(e,t){if(t==null)return e.__?rn(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?rn(e):null}function Lo(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Lo(e)}}function Hn(e){(!e.__d&&(e.__d=!0)&&Ye.push(e)&&!on.__r++||Mr!==S.debounceRendering)&&((Mr=S.debounceRendering)||No)(on)}function on(){var e,t,n,r,o,s,i,l,a;for(Ye.sort(Ln);e=Ye.shift();)e.__d&&(t=Ye.length,r=void 0,o=void 0,s=void 0,l=(i=(n=e).__v).__e,(a=n.__P)&&(r=[],o=[],(s=Re({},i)).__v=i.__v+1,nr(a,i,s,n.__n,a.ownerSVGElement!==void 0,i.__h!=null?[l]:null,r,l??rn(i),i.__h,o),Bo(r,i,o),i.__e!=l&&Lo(i)),Ye.length>t&&Ye.sort(Ln));on.__r=0}function Ho(e,t,n,r,o,s,i,l,a,c,f){var u,p,h,d,m,g,w,C,k,q,H=0,te=r&&r.__k||Fo,Ze=te.length,Je=Ze,ne=t.length;for(n.__k=[],u=0;u<ne;u++)(d=n.__k[u]=(d=t[u])==null||typeof d=="boolean"||typeof d=="function"?null:typeof d=="string"||typeof d=="number"||typeof d=="bigint"?Pt(null,d,null,null,d):mn(d)?Pt(Ie,{children:d},null,null,null):d.__b>0?Pt(d.type,d.props,d.key,d.ref?d.ref:null,d.__v):d)!=null&&(d.__=n,d.__b=n.__b+1,(C=Ui(d,te,w=u+H,Je))===-1?h=dt:(h=te[C]||dt,te[C]=void 0,Je--),nr(e,d,h,o,s,i,l,a,c,f),m=d.__e,(p=d.ref)&&h.ref!=p&&(h.ref&&rr(h.ref,null,d),f.push(p,d.__c||m,d)),m!=null&&(g==null&&(g=m),q=!(k=h===dt||h.__v===null)&&C===w,k?C==-1&&H--:C!==w&&(C===w+1?(H++,q=!0):C>w?Je>ne-w?(H+=C-w,q=!0):H--:H=C<w&&C==w-1?C-w:0),w=u+H,q=q||C==u&&!k,typeof d.type!="function"||C===w&&h.__k!==d.__k?typeof d.type=="function"||q?d.__d!==void 0?(a=d.__d,d.__d=void 0):a=m.nextSibling:a=Uo(e,m,a):a=jo(d,a,e),typeof n.type=="function"&&(n.__d=a)));for(n.__e=g,u=Ze;u--;)te[u]!=null&&(typeof n.type=="function"&&te[u].__e!=null&&te[u].__e==n.__d&&(n.__d=te[u].__e.nextSibling),Go(te[u],te[u]))}function jo(e,t,n){for(var r,o=e.__k,s=0;o&&s<o.length;s++)(r=o[s])&&(r.__=e,t=typeof r.type=="function"?jo(r,t,n):Uo(n,r.__e,t));return t}function Fe(e,t){return t=t||[],e==null||typeof e=="boolean"||(mn(e)?e.some(function(n){Fe(n,t)}):t.push(e)),t}function Uo(e,t,n){return n==null||n.parentNode!==e?e.insertBefore(t,null):t==n&&t.parentNode!=null||e.insertBefore(t,n),t.nextSibling}function Ui(e,t,n,r){var o=e.key,s=e.type,i=n-1,l=n+1,a=t[n];if(a===null||a&&o==a.key&&s===a.type)return n;if(r>(a!=null?1:0))for(;i>=0||l<t.length;){if(i>=0){if((a=t[i])&&o==a.key&&s===a.type)return i;i--}if(l<t.length){if((a=t[l])&&o==a.key&&s===a.type)return l;l++}}return-1}function Bi(e,t,n,r,o){var s;for(s in n)s==="children"||s==="key"||s in t||sn(e,s,null,n[s],r);for(s in t)o&&typeof t[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||n[s]===t[s]||sn(e,s,t[s],n[s],r)}function $r(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||ji.test(t)?n:n+"px"}function sn(e,t,n,r,o){var s;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||$r(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||$r(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")s=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r||e.addEventListener(t,s?Pr:Ir,s):e.removeEventListener(t,s?Pr:Ir,s);else if(t!=="dangerouslySetInnerHTML"){if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function Ir(e){return this.l[e.type+!1](S.event?S.event(e):e)}function Pr(e){return this.l[e.type+!0](S.event?S.event(e):e)}function nr(e,t,n,r,o,s,i,l,a,c){var f,u,p,h,d,m,g,w,C,k,q,H,te,Ze,Je,ne=t.type;if(t.constructor!==void 0)return null;n.__h!=null&&(a=n.__h,l=t.__e=n.__e,t.__h=null,s=[l]),(f=S.__b)&&f(t);try{e:if(typeof ne=="function"){if(w=t.props,C=(f=ne.contextType)&&r[f.__c],k=f?C?C.props.value:f.__:r,n.__c?g=(u=t.__c=n.__c).__=u.__E:("prototype"in ne&&ne.prototype.render?t.__c=u=new ne(w,k):(t.__c=u=new ke(w,k),u.constructor=ne,u.render=zi),C&&C.sub(u),u.props=w,u.state||(u.state={}),u.context=k,u.__n=r,p=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),ne.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Re({},u.__s)),Re(u.__s,ne.getDerivedStateFromProps(w,u.__s))),h=u.props,d=u.state,u.__v=t,p)ne.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(ne.getDerivedStateFromProps==null&&w!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(w,k),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(w,u.__s,k)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(u.props=w,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(Jt){Jt&&(Jt.__=t)}),q=0;q<u._sb.length;q++)u.__h.push(u._sb[q]);u._sb=[],u.__h.length&&i.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(w,u.__s,k),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,d,m)})}if(u.context=k,u.props=w,u.__P=e,u.__e=!1,H=S.__r,te=0,"prototype"in ne&&ne.prototype.render){for(u.state=u.__s,u.__d=!1,H&&H(t),f=u.render(u.props,u.state,u.context),Ze=0;Ze<u._sb.length;Ze++)u.__h.push(u._sb[Ze]);u._sb=[]}else do u.__d=!1,H&&H(t),f=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++te<25);u.state=u.__s,u.getChildContext!=null&&(r=Re(Re({},r),u.getChildContext())),p||u.getSnapshotBeforeUpdate==null||(m=u.getSnapshotBeforeUpdate(h,d)),Ho(e,mn(Je=f!=null&&f.type===Ie&&f.key==null?f.props.children:f)?Je:[Je],t,n,r,o,s,i,l,a,c),u.base=t.__e,t.__h=null,u.__h.length&&i.push(u),g&&(u.__E=u.__=null)}else s==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Gi(n.__e,t,n,r,o,s,i,a,c);(f=S.diffed)&&f(t)}catch(Jt){t.__v=null,(a||s!=null)&&(t.__e=l,t.__h=!!a,s[s.indexOf(l)]=null),S.__e(Jt,t,n)}}function Bo(e,t,n){for(var r=0;r<n.length;r++)rr(n[r],n[++r],n[++r]);S.__c&&S.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(s){s.call(o)})}catch(s){S.__e(s,o.__v)}})}function Gi(e,t,n,r,o,s,i,l,a){var c,f,u,p=n.props,h=t.props,d=t.type,m=0;if(d==="svg"&&(o=!0),s!=null){for(;m<s.length;m++)if((c=s[m])&&"setAttribute"in c==!!d&&(d?c.localName===d:c.nodeType===3)){e=c,s[m]=null;break}}if(e==null){if(d===null)return document.createTextNode(h);e=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,h.is&&h),s=null,l=!1}if(d===null)p===h||l&&e.data===h||(e.data=h);else{if(s=s&&Vt.call(e.childNodes),f=(p=n.props||dt).dangerouslySetInnerHTML,u=h.dangerouslySetInnerHTML,!l){if(s!=null)for(p={},m=0;m<e.attributes.length;m++)p[e.attributes[m].name]=e.attributes[m].value;(u||f)&&(u&&(f&&u.__html==f.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(Bi(e,h,p,o,l),u)t.__k=[];else if(Ho(e,mn(m=t.props.children)?m:[m],t,n,r,o&&d!=="foreignObject",s,i,s?s[0]:n.__k&&rn(n,0),l,a),s!=null)for(m=s.length;m--;)s[m]!=null&&Do(s[m]);l||("value"in h&&(m=h.value)!==void 0&&(m!==e.value||d==="progress"&&!m||d==="option"&&m!==p.value)&&sn(e,"value",m,p.value,!1),"checked"in h&&(m=h.checked)!==void 0&&m!==e.checked&&sn(e,"checked",m,p.checked,!1))}return e}function rr(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){S.__e(r,n)}}function Go(e,t,n){var r,o;if(S.unmount&&S.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||rr(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){S.__e(s,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Go(r[o],t,n||typeof e.type!="function");n||e.__e==null||Do(e.__e),e.__=e.__e=e.__d=void 0}function zi(e,t,n){return this.constructor(e,n)}function ze(e,t,n){var r,o,s,i;S.__&&S.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,s=[],i=[],nr(t,e=(!r&&n||t).__k=b(Ie,null,[e]),o||dt,dt,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?Vt.call(t.childNodes):null,s,!r&&n?n:o?o.__e:t.firstChild,r,i),Bo(s,e,i)}function or(e,t){ze(e,t,or)}function sr(e,t,n){var r,o,s,i,l=Re({},e.props);for(s in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)s=="key"?r=t[s]:s=="ref"?o=t[s]:l[s]=t[s]===void 0&&i!==void 0?i[s]:t[s];return arguments.length>2&&(l.children=arguments.length>3?Vt.call(arguments,2):n),Pt(e.type,l,r||e.key,o||e.ref,null)}function zo(e,t){var n={__c:t="__cC"+Ro++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,s;return this.getChildContext||(o=[],(s={})[t]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(i){this.props.value!==i.value&&o.some(function(l){l.__e=!0,Hn(l)})},this.sub=function(i){o.push(i);var l=i.componentWillUnmount;i.componentWillUnmount=function(){o.splice(o.indexOf(i),1),l&&l.call(i)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}Vt=Fo.slice,S={__e:function(e,t,n,r){for(var o,s,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((s=o.constructor)&&s.getDerivedStateFromError!=null&&(o.setState(s.getDerivedStateFromError(e)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(l){e=l}throw e}},Oo=0,ke.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Re({},this.state),typeof e=="function"&&(e=e(Re({},n),this.props)),e&&Re(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Hn(this))},ke.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Hn(this))},ke.prototype.render=Ie,Ye=[],No=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ln=function(e,t){return e.__v.__b-t.__v.__b},on.__r=0,Ro=0;var De,O,$n,Ar,gt=0,Wo=[],Qt=[],Or=S.__b,Nr=S.__r,Rr=S.diffed,Fr=S.__c,Dr=S.unmount;function nt(e,t){S.__h&&S.__h(O,e,gt||t),gt=0;var n=O.__H||(O.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Qt}),n.__[e]}function Lt(e){return gt=1,ir(Qo,e)}function ir(e,t,n){var r=nt(De++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Qo(void 0,t),function(l){var a=r.__N?r.__N[0]:r.__[0],c=r.t(a,l);a!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=O,!O.u)){var o=function(l,a,c){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(p){return p.__c});if(f.every(function(p){return!p.__N}))return!s||s.call(this,l,a,c);var u=!1;return f.forEach(function(p){if(p.__N){var h=p.__[0];p.__=p.__N,p.__N=void 0,h!==p.__[0]&&(u=!0)}}),!(!u&&r.__c.props===l)&&(!s||s.call(this,l,a,c))};O.u=!0;var s=O.shouldComponentUpdate,i=O.componentWillUpdate;O.componentWillUpdate=function(l,a,c){if(this.__e){var f=s;s=void 0,o(l,a,c),s=f}i&&i.call(this,l,a,c)},O.shouldComponentUpdate=o}return r.__N||r.__}function gn(e,t){var n=nt(De++,3);!S.__s&&lr(n.__H,t)&&(n.__=e,n.i=t,O.__H.__h.push(n))}function Ht(e,t){var n=nt(De++,4);!S.__s&&lr(n.__H,t)&&(n.__=e,n.i=t,O.__h.push(n))}function qo(e){return gt=5,wn(function(){return{current:e}},[])}function Zo(e,t,n){gt=6,Ht(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function wn(e,t){var n=nt(De++,7);return lr(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Jo(e,t){return gt=8,wn(function(){return e},t)}function Ko(e){var t=O.context[e.__c],n=nt(De++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(O)),t.props.value):e.__}function Yo(e,t){S.useDebugValue&&S.useDebugValue(t?t(e):e)}function Wi(e){var t=nt(De++,10),n=Lt();return t.__=e,O.componentDidCatch||(O.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Xo(){var e=nt(De++,11);if(!e.__){for(var t=O.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function qi(){for(var e;e=Wo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(en),e.__H.__h.forEach(jn),e.__H.__h=[]}catch(t){e.__H.__h=[],S.__e(t,e.__v)}}S.__b=function(e){O=null,Or&&Or(e)},S.__r=function(e){Nr&&Nr(e),De=0;var t=(O=e.__c).__H;t&&($n===O?(t.__h=[],O.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Qt,n.__N=n.i=void 0})):(t.__h.forEach(en),t.__h.forEach(jn),t.__h=[],De=0)),$n=O},S.diffed=function(e){Rr&&Rr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Wo.push(t)!==1&&Ar===S.requestAnimationFrame||((Ar=S.requestAnimationFrame)||Zi)(qi)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Qt&&(n.__=n.__V),n.i=void 0,n.__V=Qt})),$n=O=null},S.__c=function(e,t){t.some(function(n){try{n.__h.forEach(en),n.__h=n.__h.filter(function(r){return!r.__||jn(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],S.__e(r,n.__v)}}),Fr&&Fr(e,t)},S.unmount=function(e){Dr&&Dr(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{en(r)}catch(o){t=o}}),n.__H=void 0,t&&S.__e(t,n.__v))};var Vr=typeof requestAnimationFrame=="function";function Zi(e){var t,n=function(){clearTimeout(r),Vr&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Vr&&(t=requestAnimationFrame(n))}function en(e){var t=O,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),O=t}function jn(e){var t=O;e.__c=e.__(),O=t}function lr(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Qo(e,t){return typeof t=="function"?t(e):t}function es(e,t){for(var n in t)e[n]=t[n];return e}function Un(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function In(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function ln(e){this.props=e}function ts(e,t){function n(o){var s=this.props.ref,i=s==o.ref;return!i&&s&&(s.call?s(null):s.current=null),t?!t(this.props,o)||!i:Un(this.props,o)}function r(o){return this.shouldComponentUpdate=n,b(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(ln.prototype=new ke).isPureReactComponent=!0,ln.prototype.shouldComponentUpdate=function(e,t){return Un(this.props,e)||Un(this.state,t)};var Lr=S.__b;S.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Lr&&Lr(e)};var Ji=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ns(e){function t(n){var r=es({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=Ji,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Hr=function(e,t){return e==null?null:Fe(Fe(e).map(t))},rs={map:Hr,forEach:Hr,count:function(e){return e?Fe(e).length:0},only:function(e){var t=Fe(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Fe},Ki=S.__e;S.__e=function(e,t,n,r){if(e.then){for(var o,s=t;s=s.__;)if((o=s.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}Ki(e,t,n,r)};var jr=S.unmount;function os(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=es({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return os(r,t,n)})),e}function ss(e,t,n){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return ss(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=n)),e}function At(){this.__u=0,this.t=null,this.__b=null}function is(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ls(e){var t,n,r;function o(s){if(t||(t=e()).then(function(i){n=i.default||i},function(i){r=i}),r)throw r;if(!n)throw t;return b(n,s)}return o.displayName="Lazy",o.__f=!0,o}function ut(){this.u=null,this.o=null}S.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),jr&&jr(e)},(At.prototype=new ke).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=is(r.__v),s=!1,i=function(){s||(s=!0,n.__R=null,o?o(l):l())};n.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=ss(c,c.__c.__P,c.__c.__O)}var f;for(r.setState({__a:r.__b=null});f=r.t.pop();)f.forceUpdate()}},a=t.__h===!0;r.__u++||a||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},At.prototype.componentWillUnmount=function(){this.t=[]},At.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=os(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&b(Ie,null,e.fallback);return o&&(o.__h=null),[b(Ie,null,t.__a?null:e.children),o]};var Ur=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Yi(e){return this.getChildContext=function(){return e.context},e.children}function Xi(e){var t=this,n=e.i;t.componentWillUnmount=function(){ze(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),ze(b(Yi,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function us(e,t){var n=b(Xi,{__v:e,i:t});return n.containerInfo=t,n}(ut.prototype=new ke).__a=function(e){var t=this,n=is(t.__v),r=t.o.get(e);return r[0]++,function(o){var s=function(){t.props.revealOrder?(r.push(o),Ur(t,e,r)):o()};n?n(s):s()}},ut.prototype.render=function(e){this.u=null,this.o=new Map;var t=Fe(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ut.prototype.componentDidUpdate=ut.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Ur(e,n,t)})};var as=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Qi=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,el=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,tl=/[A-Z0-9]/g,nl=typeof document<"u",rl=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function cs(e,t,n){return t.__k==null&&(t.textContent=""),ze(e,t),typeof n=="function"&&n(),e?e.__c:null}function fs(e,t,n){return or(e,t),typeof n=="function"&&n(),e?e.__c:null}ke.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ke.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Br=S.event;function ol(){}function sl(){return this.cancelBubble}function il(){return this.defaultPrevented}S.event=function(e){return Br&&(e=Br(e)),e.persist=ol,e.isPropagationStopped=sl,e.isDefaultPrevented=il,e.nativeEvent=e};var ur,ll={enumerable:!1,configurable:!0,get:function(){return this.class}},Gr=S.vnode;S.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={};for(var s in n){var i=n[s];if(!(s==="value"&&"defaultValue"in n&&i==null||nl&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&i===!0?i="":l==="ondoubleclick"?s="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||rl(n.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":el.test(s)?s=l:r.indexOf("-")===-1&&Qi.test(s)?s=s.replace(tl,"-$&").toLowerCase():i===null&&(i=void 0):l=s="oninput",l==="oninput"&&o[s=l]&&(s="oninputCapture"),o[s]=i}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=Fe(n.children).forEach(function(a){a.props.selected=o.value.indexOf(a.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=Fe(n.children).forEach(function(a){a.props.selected=o.multiple?o.defaultValue.indexOf(a.props.value)!=-1:o.defaultValue==a.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",ll)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=as,Gr&&Gr(e)};var zr=S.__r;S.__r=function(e){zr&&zr(e),ur=e.__c};var Wr=S.diffed;S.diffed=function(e){Wr&&Wr(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),ur=null};var ds={ReactCurrentDispatcher:{current:{readContext:function(e){return ur.__n[e.__c].props.value}}}},ul="17.0.2";function hs(e){return b.bind(null,e)}function ar(e){return!!e&&e.$$typeof===as}function ps(e){return ar(e)?sr.apply(null,arguments):e}function _s(e){return!!e.__k&&(ze(null,e),!0)}function ms(e){return e&&(e.base||e.nodeType===1&&e)||null}var gs=function(e,t){return e(t)},ws=function(e,t){return e(t)},ys=Ie;function cr(e){e()}function bs(e){return e}function vs(){return[!1,cr]}var Ss=Ht;function Cs(e,t){var n=t(),r=Lt({h:{__:n,v:t}}),o=r[0].h,s=r[1];return Ht(function(){o.__=n,o.v=t,In(o.__,t())||s({h:o})},[e,n,t]),gn(function(){return In(o.__,o.v())||s({h:o}),e(function(){In(o.__,o.v())||s({h:o})})},[e]),n}var xs={useState:Lt,useId:Xo,useReducer:ir,useEffect:gn,useLayoutEffect:Ht,useInsertionEffect:Ss,useTransition:vs,useDeferredValue:bs,useSyncExternalStore:Cs,startTransition:cr,useRef:qo,useImperativeHandle:Zo,useMemo:wn,useCallback:Jo,useContext:Ko,useDebugValue:Yo,version:"17.0.2",Children:rs,render:cs,hydrate:fs,unmountComponentAtNode:_s,createPortal:us,createElement:b,createContext:zo,createFactory:hs,cloneElement:ps,createRef:Vo,Fragment:Ie,isValidElement:ar,findDOMNode:ms,Component:ke,PureComponent:ln,memo:ts,forwardRef:ns,flushSync:ws,unstable_batchedUpdates:gs,StrictMode:ys,Suspense:At,SuspenseList:ut,lazy:ls,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ds};const al=Object.freeze(Object.defineProperty({__proto__:null,Children:rs,Component:ke,Fragment:Ie,PureComponent:ln,StrictMode:ys,Suspense:At,SuspenseList:ut,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ds,cloneElement:ps,createContext:zo,createElement:b,createFactory:hs,createPortal:us,createRef:Vo,default:xs,findDOMNode:ms,flushSync:ws,forwardRef:ns,hydrate:fs,isValidElement:ar,lazy:ls,memo:ts,render:cs,startTransition:cr,unmountComponentAtNode:_s,unstable_batchedUpdates:gs,useCallback:Jo,useContext:Ko,useDebugValue:Yo,useDeferredValue:bs,useEffect:gn,useErrorBoundary:Wi,useId:Xo,useImperativeHandle:Zo,useInsertionEffect:Ss,useLayoutEffect:Ht,useMemo:wn,useReducer:ir,useRef:qo,useState:Lt,useSyncExternalStore:Cs,useTransition:vs,version:ul},Symbol.toStringTag,{value:"Module"}));function Pe(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function cl(e){return e!=null&&typeof e.GetEnumerator=="function"}function fl(e){return e!=null&&typeof e.CompareTo=="function"}function dl(e){return e!=null&&typeof e.Equals=="function"}function hl(e){return e!=null&&typeof e.GetHashCode=="function"}function Bn(e){return e!=null&&typeof e.Dispose=="function"}function F(e){Bn(e)&&e.Dispose()}function Te(){return null}function un(e,t){var n,r;return((n=Object.getPrototypeOf(e))==null?void 0:n.constructor)===((r=Object.getPrototypeOf(t))==null?void 0:r.constructor)}class pl{constructor(t){this.iter=t,this.current=Te()}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const t=this.iter.next();return this.current=t.value,!t.done}"System.Collections.IEnumerator.Reset"(){throw new Error("JS iterators cannot be reset")}Dispose(){}}function z(e){return cl(e)?e.GetEnumerator():new pl(e[Symbol.iterator]())}function yn(e){return{next(){const t=e["System.Collections.IEnumerator.MoveNext"](),n=t?e["System.Collections.Generic.IEnumerator`1.get_Current"]():void 0;return{done:!t,value:n}}}}class _l{constructor(t){this.factory=t,this.isValueCreated=!1}get Value(){return this.isValueCreated||(this.createdValue=this.factory(),this.isValueCreated=!0),this.createdValue}get IsValueCreated(){return this.isValueCreated}}function se(e,t){let n=e.toString(10);for(;n.length<t;)n="0"+n;return n}function ml(e,t,n){let r=e.toString(10);for(;r.length<t;)r="0"+r;for(;r.length<n;)r=r+"0";return r}function qr(e){const t=e;return typeof t.offset=="number"?t.offset:e.kind===1?0:e.getTimezoneOffset()*-6e4}function gl(e,t){return e=e<0&&t!=null&&t!==10?65535+e+1:e,e.toString(t)}function et(e,t){return e=e<0&&t!=null&&t!==10?4294967295+e+1:e,e.toString(t)}class Ue{static id(t){return Ue.idMap.has(t)||Ue.idMap.set(t,++Ue.count),Ue.idMap.get(t)}}Ue.idMap=new WeakMap;Ue.count=0;function fr(e){let t=0,n=5381;const r=e.length;for(;t<r;)n=n*33^e.charCodeAt(t++);return n}function Oe(e){return e*2654435761|0}function wl(e){return fr(e.toString(32))}function jt(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const o=e[r];t=(t<<5)+t^o}return t}function yl(e){return e.getTime()}function bl(e){const t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=Ve(e[r]);return jt(n)}function Ve(e){var t;if(e==null)return 0;switch(typeof e){case"boolean":return e?1:0;case"number":return Oe(e);case"bigint":return wl(e);case"string":return fr(e);default:{if(hl(e))return e.GetHashCode();if(Pe(e))return bl(e);if(e instanceof Date)return yl(e);if(((t=Object.getPrototypeOf(e))==null?void 0:t.constructor)===Object){const n=Object.values(e).map(r=>Ve(r));return jt(n)}else return Oe(Ue.id(e))}}}function Gn(e,t,n){if(e==null)return t==null;if(t==null||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Es(e,t){return Gn(e,t,oe)}function vl(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;n.sort(),r.sort();for(let o=0;o<n.length;o++)if(n[o]!==r[o]||!oe(e[n[o]],t[r[o]]))return!1;return!0}function oe(e,t){var n;return e===t?!0:e==null?t==null:t==null?!1:dl(e)?e.Equals(t):Pe(e)?Pe(t)&&Es(e,t):typeof e!="object"?!1:e instanceof Date?t instanceof Date&&ks(e,t)===0:((n=Object.getPrototypeOf(e))==null?void 0:n.constructor)===Object&&vl(e,t)}function ks(e,t){let n,r;return"offset"in e&&"offset"in t?(n=e.getTime(),r=t.getTime()):(n=e.getTime()+qr(e),r=t.getTime()+qr(t)),n===r?0:n<r?-1:1}function bn(e,t){return e===t?0:e<t?-1:1}function Sl(e,t,n){if(e==null)return t==null?0:1;if(t==null)return-1;if(e.length!==t.length)return e.length<t.length?-1:1;for(let r=0,o=0;r<e.length;r++)if(o=n(e[r],t[r]),o!==0)return o;return 0}function Ts(e,t){return Sl(e,t,be)}function Cl(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return n.length<r.length?-1:1;n.sort(),r.sort();for(let o=0,s=0;o<n.length;o++){const i=n[o];if(i!==r[o])return i<r[o]?-1:1;if(s=be(e[i],t[i]),s!==0)return s}return 0}function be(e,t){var n;return e===t?0:e==null?t==null?0:-1:t==null?1:fl(e)?e.CompareTo(t):Pe(e)?Pe(t)?Ts(e,t):-1:typeof e!="object"?e<t?-1:1:e instanceof Date?t instanceof Date?ks(e,t):-1:((n=Object.getPrototypeOf(e))==null?void 0:n.constructor)===Object?Cl(e,t):-1}function K(e){const t={};for(const n of e)t[n[0]]=n[1];return t}function xl(e){Pe(e)?e.splice(0):e.clear()}const vn=new WeakMap;function V(e){if(e==null)return null;const t=(n,r)=>e(n)(r);return vn.set(t,e),t}function Xe(e){return vn.get(e)??(t=>n=>e(t,n))}function zn(e){if(e==null)return null;const t=(n,r,o)=>e(n)(r)(o);return vn.set(t,e),t}function Pn(e){return vn.get(e)??(t=>n=>r=>e(t,n,r))}function El(e){let t=0,n="[";for(const r of e){if(t===0)n+=Me(r);else if(t===100){n+="; ...";break}else n+="; "+Me(r);t++}return n+"]"}function Me(e,t=0){var n;if(e!=null&&typeof e=="object"){if(typeof e.toString=="function")return e.toString();if(Symbol.iterator in e)return El(e);{const r=(n=Object.getPrototypeOf(e))==null?void 0:n.constructor;return r===Object&&t<10?"{ "+Object.entries(e).map(([o,s])=>o+" = "+Me(s,t+1)).join(`
|
|
2
|
-
`)+" }":(
|
|
3
|
-
`)+" }"}function $l(e){const t=Object.values(e).map(n=>Ve(n));return jt(t)}function Il(e,t){if(e===t)return!0;if(un(e,t)){const n=Object.keys(e);for(let r=0;r<n.length;r++)if(!oe(e[n[r]],t[n[r]]))return!1;return!0}else return!1}function Pl(e,t){if(e===t)return 0;if(un(e,t)){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=be(e[n[r]],t[n[r]]);if(o!==0)return o}return 0}else return-1}class ue{toJSON(){return Tl(this)}toString(){return Ml(this)}GetHashCode(){return $l(this)}Equals(t){return Il(this,t)}CompareTo(t){return Pl(this,t)}}class ae{get contents(){return this.getter()}set contents(t){this.setter(t)}constructor(t,n){typeof n=="function"?(this.getter=t,this.setter=n):(this.getter=()=>t,this.setter=r=>{t=r})}}class Al{constructor(t){this.message=t}}function Ol(e){return e instanceof Al||e instanceof Error}function Nl(e){return e instanceof Promise}function an(e){return Ol(e)||Nl(e)?e:new Error(String(e))}const Ct=Symbol("numeric");function Ms(e){return typeof e=="number"||typeof e=="bigint"||(e==null?void 0:e[Ct])}function Rl(e,t){return typeof e=="number"||typeof e=="bigint"?e<t?-1:e>t?1:0:e.CompareTo(t)}function Wn(e,t){return typeof e=="number"?e*t:typeof e=="bigint"?e*BigInt(t):e[Ct]().multiply(t)}function tn(e,t){return typeof e=="number"?e.toFixed(t):typeof e=="bigint"?e:e[Ct]().toFixed(t)}function cn(e,t){return typeof e=="number"?e.toPrecision(t):typeof e=="bigint"?e:e[Ct]().toPrecision(t)}function fn(e,t){return typeof e=="number"?e.toExponential(t):typeof e=="bigint"?e:e[Ct]().toExponential(t)}function dn(e){return typeof e=="number"?(Number(e)>>>0).toString(16):typeof e=="bigint"?BigInt.asUintN(64,e).toString(16):e[Ct]().toHex()}class Fl{constructor(t,n,r,o){this.declaringType=t,this.tag=n,this.name=r,this.fields=o}}class ve{constructor(t,n,r,o,s,i,l){this.fullname=t,this.generics=n,this.construct=r,this.parent=o,this.fields=s,this.cases=i,this.enumCases=l}toString(){return R(this)}GetHashCode(){return $s(this)}Equals(t){return qn(this,t)}}function de(e){return e.generics!=null?e.generics:[]}function $s(e){const t=fr(e.fullname),n=de(e).map($s);return jt([t,...n])}function qn(e,t){return e.fullname===""?t.fullname===""&&Gn(Nt(e),Nt(t),([n,r],[o,s])=>n===o&&qn(r,s)):e.fullname===t.fullname&&Gn(de(e),de(t),qn)}function Dl(e,t,n,r){return new ve(e,t,n,r)}function Ut(e,t,n,r){return new ve(e,t,n,void 0,r)}function Vl(...e){return new ve("",void 0,void 0,void 0,()=>e)}function Is(e,t,n,r){const o=new ve(e,t,n,void 0,void 0,()=>{const s=n.prototype.cases();return r().map((i,l)=>new Fl(o,l,s[l],i))});return o}function Ll(e){return new ve("Microsoft.FSharp.Collections.FSharpList`1",[e])}const Ps=new ve("System.Object"),tt=new ve("System.String"),Hl=new ve("System.Int32");function ht(e){if(Array.isArray(e))return e[0];if(e instanceof ve){const t=Bt(e);if(t!=null)return ht(t)+"[]";{const n=e.fullname.lastIndexOf(".");return n===-1?e.fullname:e.fullname.substr(n+1)}}else return e.name}function R(e){const t=Bt(e);return t!=null?R(t)+"[]":e.generics==null||e.generics.length===0?e.fullname:e.fullname+"["+e.generics.map(n=>R(n)).join(",")+"]"}function As(e){return Bt(e)!=null}function Bt(e){var t;return e.fullname==="[]"&&((t=e.generics)==null?void 0:t.length)===1?e.generics[0]:void 0}function Os(e){return e.generics!=null&&e.generics.length>0}function dr(e){return e.enumCases!=null&&e.enumCases.length>0}function Ns(e){return e.generics==null?e:new ve(e.fullname,e.generics.map(()=>Ps))}function Rs(e){var t;return(t=e.generics)==null?void 0:t[0]}function ot(e){if(dr(e)&&e.enumCases!=null)return e.enumCases.map(t=>t[1]);throw new Error(`${e.fullname} is not an enum type`)}function jl(e,t){if(e.enumCases!=null)if(typeof t=="string"){for(const n of e.enumCases)if(n[0]===t)return n;throw new Error(`'${t}' was not found in ${e.fullname}`)}else{for(const n of e.enumCases)if(n[1]===t)return n;return["",t]}else throw new Error(`${e.fullname} is not an enum type`)}function st(e,t){const n=parseInt(t,10);return jl(e,isNaN(n)?t:n)[1]}function Fs(e){if(e.cases!=null)return e.cases();throw new Error(`${e.fullname} is not an F# union type`)}function Nt(e){if(e.fields!=null)return e.fields();throw new Error(`${e.fullname} is not an F# record type`)}function Ds(e){if(hr(e)&&e.generics!=null)return e.generics;throw new Error(`${e.fullname} is not a tuple type`)}function Vs(e){return e instanceof ve?e.cases!=null:e instanceof W}function Ls(e){return e instanceof ve?e.fields!=null:e instanceof ue}function hr(e){return e.fullname.startsWith("System.Tuple")}function Ul(e,t){const r=Fs(t)[e.tag];if(r==null)throw new Error(`Cannot find case ${e.name} in union type`);return[r,e.fields]}function Hs(e){return e.fields==null?[]:e.fields}function Bl(e,t){return e[t[0]]}function Gl(e,t){const n=(e.fields||[]).length;if(t.length!==n)throw new Error(`Expected an array of length ${n} but got ${t.length}`);const r=e.declaringType.construct;return r==null?{}:(e.declaringType.cases?e.declaringType.cases().length==1:!1)?new r(...t):new r(e.tag,t)}function zl(e,t){const n=Nt(e);if(n.length!==t.length)throw new Error(`Expected an array of length ${n.length} but got ${t.length}`);return e.construct!=null?new e.construct(...t):n.reduce((r,[o,s],i)=>(r[o]=t[i],r),{})}function Wl(e,t){return e}class ql{constructor(t=!1){this._id=0,this._cancelled=t,this._listeners=new Map}get isCancelled(){return this._cancelled}cancel(){if(!this._cancelled){this._cancelled=!0;for(const[,t]of this._listeners)t()}}addListener(t){const n=this._id;return this._listeners.set(this._id++,t),n}removeListener(t){return this._listeners.delete(t)}register(t,n){const r=this,o=this.addListener(n==null?t:()=>t(n));return{Dispose(){r.removeListener(o)}}}Dispose(){}}class pr extends Error{constructor(){super("The operation was canceled"),Object.setPrototypeOf(this,pr.prototype)}}class _r{static get maxTrampolineCallCount(){return 2e3}constructor(){this.callCount=0}incrementAndCheck(){return this.callCount++>_r.maxTrampolineCallCount}hijack(t){this.callCount=0,setTimeout(t,0)}}function Be(e){return t=>{if(t.cancelToken.isCancelled)t.onCancel(new pr);else if(t.trampoline.incrementAndCheck())t.trampoline.hijack(()=>{try{e(t)}catch(n){t.onError(an(n))}});else try{e(t)}catch(n){t.onError(an(n))}}}function Zl(e,t){return Be(n=>{e({onSuccess:r=>{try{t(r)(n)}catch(o){n.onError(an(o))}},onError:n.onError,onCancel:n.onCancel,cancelToken:n.cancelToken,trampoline:n.trampoline})})}function Jl(e){return Be(t=>t.onSuccess(e))}class Kl{Bind(t,n){return Zl(t,n)}Combine(t,n){return this.Bind(t,()=>n)}Delay(t){return Be(n=>t()(n))}For(t,n){const r=t[Symbol.iterator]();let o=r.next();return this.While(()=>!o.done,this.Delay(()=>{const s=n(o.value);return o=r.next(),s}))}Return(t){return Jl(t)}ReturnFrom(t){return t}TryFinally(t,n){return Be(r=>{t({onSuccess:o=>{n(),r.onSuccess(o)},onError:o=>{n(),r.onError(o)},onCancel:o=>{n(),r.onCancel(o)},cancelToken:r.cancelToken,trampoline:r.trampoline})})}TryWith(t,n){return Be(r=>{t({onSuccess:r.onSuccess,onCancel:r.onCancel,cancelToken:r.cancelToken,trampoline:r.trampoline,onError:o=>{try{n(o)(r)}catch(s){r.onError(an(s))}}})})}Using(t,n){return this.TryFinally(n(t),()=>t.Dispose())}While(t,n){return t()?this.Bind(n,()=>this.While(t,n)):this.Return(void 0)}Zero(){return Be(t=>t.onSuccess(void 0))}}const Z=new Kl;class wt{constructor(t){this.value=t}toJSON(){return this.value}toString(){return String(this.value)}GetHashCode(){return Ve(this.value)}Equals(t){return t==null?!1:oe(this.value,t instanceof wt?t.value:t)}CompareTo(t){return t==null?1:be(this.value,t instanceof wt?t.value:t)}}function y(e){if(e==null)throw new Error("Option has no value");return e instanceof wt?e.value:e}function le(e){return e==null||e instanceof wt?new wt(e):e}function Zn(e,t){return e!=null?y(e):t}function Yl(e,t){return e!=null?y(e):t()}function Xl(e,t){return t!=null?le(e(y(t))):void 0}function Ql(e){return new _(0,[e])}function js(e){return new _(1,[e])}class _ extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Ok","Error"]}}function ye(e,t){return t.tag===0?Ql(e(t.fields[0])):js(t.fields[0])}function eu(e,t){return t.tag===0?e(t.fields[0]):js(t.fields[0])}function tu(e){return new Us(0,[e])}function nu(e){return new Us(1,[e])}class Us extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Choice1Of2","Choice2Of2"]}}function ru(e){return tu(e)}function ou(e){return nu(e)}function An(e){}const su=new ql;function iu(e){return Be(t=>{e({onSuccess:n=>t.onSuccess(ru(n)),onError:n=>t.onSuccess(ou(n)),onCancel:t.onCancel,cancelToken:t.cancelToken,trampoline:t.trampoline})})}function lu(e){return Be(t=>e([t.onSuccess,t.onError,t.onCancel]))}function uu(e,t){return cu(e,t)}function au(e,t){return uu(e,t)}function cu(e,t,n,r,o){typeof t!="function"&&(o=t,t=void 0);const s=new _r;e({onSuccess:t||An,onError:n||An,onCancel:r||An,cancelToken:o||su,trampoline:s})}class mr extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]}}class Bs extends W{constructor(t,n){super(),this.tag=0,this.fields=[t,n]}cases(){return["Header"]}}class Gs extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Empty","Text","Binary","Form"]}}class Gt extends ue{constructor(t,n,r,o,s,i,l,a){super(),this.url=t,this.method=n,this.headers=r,this.withCredentials=o,this.overridenMimeType=s,this.overridenResponseType=i,this.timeout=l,this.content=a}}class lt extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Text","Blob","ArrayBuffer","Unknown"]}}class zs extends ue{constructor(t,n,r,o,s,i){super(),this.statusCode=t|0,this.responseText=n,this.responseType=r,this.responseUrl=o,this.responseHeaders=s,this.content=i}}function gr(e){const t=e<0;e=Math.abs(e);const n=~~(e/36e5),r=e%36e5/6e4;return(t?"-":"+")+se(n,2)+":"+se(r,2)}function hn(e,t){const n=e.toISOString();return t==="first"?n.substring(0,n.indexOf("T")):n.substring(n.indexOf("T")+1,n.length-1)}function fu(e,t){if(t)return e.toISOString();{const n=e.kind==null?!0:e.kind===2;return se(e.getFullYear(),4)+"-"+se(e.getMonth()+1,2)+"-"+se(e.getDate(),2)+"T"+se(e.getHours(),2)+":"+se(e.getMinutes(),2)+":"+se(e.getSeconds(),2)+"."+se(e.getMilliseconds(),3)+(n?gr(e.getTimezoneOffset()*-6e4):"")}}function du(e,t){const n=e.toISOString();return n.substring(0,n.length-1)+gr(t)}function Ws(e,t,n){return t.replace(/(\w)\1*/g,r=>{let o=Number.NaN;switch(r.substring(0,1)){case"y":const s=n?e.getUTCFullYear():e.getFullYear();o=r.length<4?s%100:s;break;case"M":o=(n?e.getUTCMonth():e.getMonth())+1;break;case"d":o=n?e.getUTCDate():e.getDate();break;case"H":o=n?e.getUTCHours():e.getHours();break;case"h":const i=n?e.getUTCHours():e.getHours();o=i>12?i%12:i;break;case"m":o=n?e.getUTCMinutes():e.getMinutes();break;case"s":o=n?e.getUTCSeconds():e.getSeconds();break;case"f":o=n?e.getUTCMilliseconds():e.getMilliseconds();break}return Number.isNaN(o)?r:se(o,r.length)})}function hu(e,t){const n=new Date(e.getTime()+(e.offset??0));if(typeof t!="string")return n.toISOString().replace(/\.\d+/,"").replace(/[A-Z]|\.\d+/g," ")+gr(e.offset??0);if(t.length===1)switch(t){case"D":case"d":return hn(n,"first");case"T":case"t":return hn(n,"second");case"O":case"o":return du(n,e.offset??0);default:throw new Error("Unrecognized Date print format")}else return Ws(n,t,!0)}function pu(e,t){const n=e.kind===1;if(typeof t!="string")return n?e.toUTCString():e.toLocaleString();if(t.length===1)switch(t){case"D":case"d":return n?hn(e,"first"):e.toLocaleDateString();case"T":case"t":return n?hn(e,"second"):e.toLocaleTimeString();case"O":case"o":return fu(e,n);default:throw new Error("Unrecognized Date print format")}else return Ws(e,t,n)}function Sn(e,t,n){return e.offset!=null?hu(e,t):pu(e,t)}function wr(e,t){const n=new Date(e);return n.kind=(t??0)|0,n}function _u(){return wr(-621355968e5,0)}function qs(e){function t(){throw new Error(`The string is not a valid Date: ${e}`)}(e==null||e.trim()==="")&&t(),e.length===10&&e[4]==="-"&&e[7]==="-"&&(e+="T00:00:00");let n=new Date(e),r=null;if(isNaN(n.getTime())){const o=/^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*(Z|[+-]([01]?\d):?([0-5]?\d)?)?\s*$/.exec(e);if(o!=null){let s,i=0;if(o[2]!=null){const l=o[2].split(":");i=parseInt(l[0],10)*3600+parseInt(l[1]||"0",10)*60+parseFloat(l[2]||"0"),o[3]!=null&&o[3].toUpperCase()==="PM"&&(i+=720)}if(o[4]!=null){if(o[1]!=null)s=new Date(o[1]+" UTC");else{const l=new Date;s=new Date(l.getUTCFullYear()+"/"+(l.getUTCMonth()+1)+"/"+l.getUTCDate())}if(o[4]==="Z")r="Z";else{let l=parseInt(o[5],10)*60+parseInt(o[6]||"0",10);o[4][0]==="-"&&(l*=-1),r=l,i-=l*60}}else if(o[1]!=null)s=new Date(o[1]);else{const l=new Date;s=new Date(l.getFullYear()+"/"+(l.getMonth()+1)+"/"+l.getDate())}n=new Date(s.getTime()+i*1e3),n=new Date(n.getTime()+(n.getTimezoneOffset()-s.getTimezoneOffset())*6e4)}else t();isNaN(n.getTime())&&t()}return[n,r]}function mu(e,t=!1){const[n,r]=qs(e),o=r!=null?t&&r==="Z"?1:2:0;return wr(n.getTime(),o)}function gu(e,t){try{return t.contents=mu(e),!0}catch{return!1}}function wu(e){return e.kind===1?e:wr(e.getTime(),1)}function yu(e,t=0){if(t&-284)throw new Error("RegexOptions only supports: IgnoreCase, Multiline, Compiled, Singleline and ECMAScript");let n="gu";return n+=t&1?"i":"",n+=t&2?"m":"",n+=t&16?"s":"",new RegExp(e,n)}function Zs(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function Zr(e,t,n=0){if(t==null)throw new Error("Input cannot ve null");if(!e.global)throw new Error("Non-global RegExp");e.lastIndex=n;const r=[];let o,s=-1;for(;(o=e.exec(t))!=null;)o.index===s?e.lastIndex++:(s=o.index,r.push(o));return r}function bu(e,t,n,r,o=0){function s(){let i=arguments[0];if(r){r--;const l=[],a=arguments.length,c=typeof arguments[a-1]!="string";let f=c?a-3:a-2;for(let u=0;u<f;u++)l.push(arguments[u]);l.index=arguments[f++],l.input=arguments[f++],c&&(l.groups=arguments[f]),i=n(l)}return i}if(typeof e=="string"){const i=e;e=yu(t,r??0),t=i,r=void 0}if(typeof n=="function")return r=r??-1,t.substring(0,o)+t.substring(o).replace(e,s);if(n=n.replace(/\$0/g,i=>"$&").replace(/\${([^}]+)}/g,"$<$1>"),r!=null){let i;const l=t.substring(o),a=Zr(e,l),c=Zr.length>r?(i=a[r-1],l.substring(0,i.index+i[0].length)):l;return t.substring(0,o)+c.replace(e,n)+t.substring(o+c.length)}else return t.replace(e,n)}const Tt=/(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g,vu=/\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g;function Js(e,t){return Rl(e,t)<0}function We(e){return{input:e,cont:Cu(e)}}function Ks(e,t){return typeof t=="string"?e(t):t.cont(e)}function yt(e){return Ks(t=>t,e)}function Ys(e){return Ks(t=>{throw new Error(t)},e)}function Su(e,t,n,r,o){let s="";if(t=t||"",o=o||"",Ms(e))switch(o.toLowerCase()!=="x"&&(Js(e,0)?(e=Wn(e,-1),s="-"):t.indexOf(" ")>=0?s=" ":t.indexOf("+")>=0&&(s="+")),r=r==null?null:parseInt(r,10),o){case"f":case"F":r=r??6,e=tn(e,r);break;case"g":case"G":e=r!=null?cn(e,r):cn(e);break;case"e":case"E":e=r!=null?fn(e,r):fn(e);break;case"x":e=dn(e);break;case"X":e=dn(e).toUpperCase();break;default:e=String(e);break}else e instanceof Date?e=Sn(e):e=Me(e);if(n=typeof n=="number"?n:parseInt(n,10),isNaN(n))e=s+e;else{const i=t.indexOf("0")>=0,l=t.indexOf("-")>=0,a=l||!i?" ":"0";a==="0"?(e=Rt(e,n-s.length,a,l),e=s+e):e=Rt(s+e,n,a,l)}return e}function Xs(e,t,n,r="",o=-1){return(...s)=>{let i=r;const l=t.slice(),a=n.slice();for(const c of s){const[,,f,u,p,h]=a[0];let d=u;if(o>=0)d=o,o=-1;else if(d==="*"){if(c<0)throw new Error("Non-negative number required");o=c;continue}i+=l[0],i+=Su(c,f,d,p,h),l.splice(0,1),a.splice(0,1)}return a.length===0?(i+=l[0],e(i)):Xs(e,l,a,i,o)}}function Cu(e){return t=>{Tt.lastIndex=0;const n=[],r=[];let o=0,s=Tt.exec(e);for(;s;){const i=s.index+(s[1]||"").length;n.push(e.substring(o,i).replace(/%%/g,"%")),r.push(s),o=Tt.lastIndex,Tt.lastIndex-=1,s=Tt.exec(e)}return n.length===0?t(e.replace(/%%/g,"%")):(n.push(e.substring(o).replace(/%%/g,"%")),Xs(t,n,r))}}function xu(e,...t){let n;return typeof e=="object"?(n=String(t[0]),t.shift()):n=e,n.replace(vu,(r,o,s,i,l,a)=>{if(o<0||o>=t.length)throw new Error("Index must be greater or equal to zero and less than the arguments' length.");let c=t[o];if(Ms(c))switch(l=l==null?null:parseInt(l,10),i){case"f":case"F":l=l??2,c=tn(c,l);break;case"g":case"G":c=l!=null?cn(c,l):cn(c);break;case"e":case"E":c=l!=null?fn(c,l):fn(c);break;case"p":case"P":l=l??2,c=tn(Wn(c,100),l)+" %";break;case"d":case"D":c=l!=null?On(String(c),l,"0"):String(c);break;case"x":case"X":c=l!=null?On(dn(c),l,"0"):dn(c),i==="X"&&(c=c.toUpperCase());break;default:if(a){let f="";c=a.replace(/([0#,]+)(\.[0#]+)?/,(u,p,h)=>{Js(c,0)&&(c=Wn(c,-1),f="-"),h=h==null?"":h.substring(1),c=tn(c,Math.max(h.length,0));let[d,m]=c.split(".");m||(m="");const g=p.replace(/,/g,"").replace(/^#+/,"").length;d=On(d,g,"0");const w=h.replace(/#+$/,"").length;if(w>m.length?m=ku(m,w,"0"):w<m.length&&(m=m.substring(0,w)+m.substring(w).replace(/0+$/,"")),p.indexOf(",")>0){const C=d.length%3,k=Math.floor(d.length/3);let q=C>0?d.substr(0,C)+(k>0?",":""):"";for(let H=0;H<k;H++)q+=d.substr(C+H*3,3)+(H<k-1?",":"");d=q}return m.length>0?d+"."+m:d}),c=f+c}}else c instanceof Date?c=Sn(c,a||i):c=Me(c);return s=parseInt((s||" ").substring(1),10),isNaN(s)||(c=Rt(String(c),Math.abs(s)," ",s<0)),c})}function Eu(e){return typeof e!="string"||e.length===0}function Le(e,t){return Array.isArray(t)?t.join(e):Array.from(t).join(e)}function Rt(e,t,n,r){n=n||" ",t=t-e.length;for(let o=0;o<t;o++)e=r?e+n:n+e;return e}function On(e,t,n){return Rt(e,t,n)}function ku(e,t,n){return Rt(e,t,n,!0)}function Tu(e,t,n,r){if(n=typeof n=="number"?n:void 0,r=typeof r=="number"?r:0,n&&n<0)throw new Error("Count cannot be less than zero");if(n===0)return[];const o=(r&1)===1,s=(r&2)===2;t=t||[],t=t.filter(f=>f).map(Zs),t=t.length>0?t:["\\s"];const i=[],l=new RegExp(t.join("|"),"g");let a=!0,c=0;do{const f=l.exec(e);if(f===null){const u=s?e.substring(c).trim():e.substring(c);(!o||u.length>0)&&i.push(u),a=!1}else{const u=s?e.substring(c,f.index).trim():e.substring(c,f.index);(!o||u.length>0)&&(n!=null&&i.length+1===n?(i.push(s?e.substring(c).trim():e.substring(c)),a=!1):i.push(u)),c=l.lastIndex}}while(a);return i}function Mu(e,...t){if(t.length===0)return e.trim();const n="["+Zs(t.join(""))+"]+";return e.replace(new RegExp("^"+n),"").replace(new RegExp(n+"$"),"")}const Qs="Collection was empty.";function ei(e,t){return typeof e=="function"?new e(t):new Array(t)}function Jr(e,t){return e>t?e:t}function Cn(e,t,n,r){const o=t|0;return e.fill(r,o,o+n)}function xt(e,t,n){const r=t.length|0,o=ei(n,r);for(let s=0;s<=r-1;s++)o[s]=e(t[s]);return o}function $u(e,t){const n=ei(t,1);return n[0]=e,n}function Iu(e){return e.slice().reverse()}function Pu(e,t){return t.find(e)}function Au(e,t,n){const r=[];for(let o=0;o<=t.length-1;o++){const s=e(t[o]);if(s!=null){const i=y(s);r.push(i)}}return oe(n,Te())?r:xt(o=>o,r,n)}function xn(e,t,n){return n.reduce(e,t)}function ti(e,t,n){return t.reduceRight((r,o)=>e(o,r),n)}class he extends ue{constructor(t,n){super(),this.head=t,this.tail=n}toString(){return"["+Le("; ",this)+"]"}Equals(t){const n=this;return n===t?!0:((o,s)=>{e:for(;;){const i=o,l=s,a=i.tail,c=l.tail;if(a!=null)if(c!=null){const f=y(a),u=y(c);if(oe(i.head,l.head)){o=f,s=u;continue e}else return!1}else return!1;else return c==null}})(n,t)}GetHashCode(){return((r,o,s)=>{e:for(;;){const i=r,l=o,a=s,c=a.tail;if(c!=null){const f=y(c);if(i>18)return l|0;r=i+1,o=(l<<1)+Ve(a.head)+631*i,s=f;continue e}else return l|0}})(0,0,this)|0}toJSON(){const t=this;return Array.from(t)}CompareTo(t){return((o,s)=>{e:for(;;){const i=o,l=s,a=i.tail,c=l.tail;if(a!=null)if(c!=null){const f=y(a),u=y(c),p=be(i.head,l.head)|0;if(p===0){o=f,s=u;continue e}else return p|0}else return 1;else return c!=null?-1:0}})(this,t)|0}GetEnumerator(){return Nu(this)}[Symbol.iterator](){return yn(z(this))}"System.Collections.IEnumerable.GetEnumerator"(){return z(this)}}class Ou{constructor(t){this.xs=t,this.it=this.xs,this.current=Te()}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const t=this,n=t.it.tail;if(n!=null){const r=y(n);return t.current=t.it.head,t.it=r,!0}else return!1}"System.Collections.IEnumerator.Reset"(){const t=this;t.it=t.xs,t.current=Te()}Dispose(){}}function Nu(e){return new Ou(e)}function ee(){return new he(Te(),void 0)}function zt(e,t){return new he(e,t)}function yr(e){return e.tail==null}function Ru(e){return((n,r)=>{e:for(;;){const o=n,i=r.tail;if(i!=null){n=o+1,r=y(i);continue e}else return o|0}})(0,e)|0}function ni(e){if(e.tail!=null)return e.head;throw new Error(Qs+"\\nParameter name: list")}function He(e){const t=e.tail;if(t!=null)return y(t);throw new Error(Qs+"\\nParameter name: list")}function J(){return ee()}function me(e,t){return zt(e,t)}function Y(e){return zt(e,ee())}function I(e){return yr(e)}function x(e){return ni(e)}function M(e){return He(e)}function Wt(e){const t=Ru(e)|0,n=Cn(new Array(t),0,t,null);return((o,s)=>{e:for(;;){const i=o,l=s;if(!yr(l)){n[i]=ni(l),o=i+1,s=He(l);continue e}break}})(0,e),n}function Ae(e,t,n){let r=t,o=n;for(;!yr(o);)r=e(r,x(o)),o=He(o);return r}function br(e){return Ae((t,n)=>zt(n,t),ee(),e)}function Fu(e,t,n){return ti(e,Wt(t),n)}function pn(e,t){Ae((n,r)=>{e(r)},void 0,t)}function D(e,t){let n=t;for(let r=e.length-1;r>=0;r--)n=zt(e[r],n);return n}function U(e){return D(e,ee())}function Du(e){let t,n;if(Pe(e))return U(e);if(e instanceof he)return e;{const r=ee();let o=r;const s=z(e);try{for(;s["System.Collections.IEnumerator.MoveNext"]();){const a=s["System.Collections.Generic.IEnumerator`1.get_Current"]();o=(t=o,n=new he(a,void 0),t.tail=n,n)}}finally{F(s)}const i=o,l=ee();return i.tail=l,He(r)}}function vr(e,t){return Ae((n,r)=>zt(r,n),t,br(e))}function at(e,t){const n=ee(),r=Ae((s,i)=>{const l=new he(e(i),void 0);return s.tail=l,l},n,t),o=ee();return r.tail=o,He(n)}function Vu(e,t){const n=ee(),r=Ae((s,i)=>{if(e(i)){const l=new he(i,void 0);return s.tail=l,l}else return s},n,t),o=ee();return r.tail=o,He(n)}function Lu(e,t){const n=ee(),r=ee(),o=n,s=Ae((a,c)=>{let f,u;const p=a[0],h=a[1];return e(c)?[(f=new he(c,void 0),p.tail=f,f),h]:[p,(u=new he(c,void 0),h.tail=u,u)]},[o,r],t),i=ee();s[0].tail=i;const l=ee();return s[1].tail=l,[He(o),He(r)]}function Hu(e,t){const n=ee(),r=Ae((s,i)=>{const l=e(i);if(l==null)return s;{const a=new he(y(l),void 0);return s.tail=a,a}},n,t),o=ee();return r.tail=o,He(n)}function ju(e,t){return Ae((n,r)=>n&&e(r),!0,t)}function Uu(e){throw new Error(e)}const Bu="Enumeration already finished.",Gu="Enumeration has not started. Call MoveNext.",ri="The input sequence has an insufficient number of elements.",zu="Reset is not supported on this enumerator.";function Wu(){throw new Error(zu)}function Sr(){throw new Error(Gu)}function Jn(){throw new Error(Bu)}class qu{constructor(t){this.f=t}toString(){const t=this;let n=0,r="seq [";const o=z(t);try{for(;n<4&&o["System.Collections.IEnumerator.MoveNext"]();)n>0&&(r=r+"; "),r=r+Me(o["System.Collections.Generic.IEnumerator`1.get_Current"]()),n=n+1|0;return n===4&&(r=r+"; ..."),r+"]"}finally{F(o)}}GetEnumerator(){return this.f()}[Symbol.iterator](){return yn(z(this))}"System.Collections.IEnumerable.GetEnumerator"(){return this.f()}}function Zu(e){return new qu(e)}class Ju{constructor(t,n,r){this.current=t,this.next=n,this.dispose=r}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current()}"System.Collections.IEnumerator.get_Current"(){return this.current()}"System.Collections.IEnumerator.MoveNext"(){return this.next()}"System.Collections.IEnumerator.Reset"(){Wu()}Dispose(){this.dispose()}}function En(e,t,n){return new Ju(e,t,n)}function Ku(e){let t,n,r=!1,o=!1,s;const i=()=>{if(o=!0,n!=null){const l=y(n);try{F(l)}finally{n=void 0}}if(t!=null){const l=y(t);try{F(l)}finally{t=void 0}}};return En(()=>(r?o&&Jn():Sr(),s!=null?y(s):Jn()),()=>{let l;if(r||(r=!0),o)return!1;{let a;for(;a==null;){const c=t,f=n;if(c!=null)if(f!=null){const u=y(f);if(u["System.Collections.IEnumerator.MoveNext"]())s=le(u["System.Collections.Generic.IEnumerator`1.get_Current"]()),a=!0;else try{F(u)}finally{n=void 0}}else{const u=y(c);u["System.Collections.IEnumerator.MoveNext"]()?n=(l=u["System.Collections.Generic.IEnumerator`1.get_Current"](),z(l)):(i(),a=!1)}else t=z(e)}return y(a)}},()=>{o||i()})}function Yu(e,t){return En(()=>t["System.Collections.Generic.IEnumerator`1.get_Current"](),()=>t["System.Collections.IEnumerator.MoveNext"](),()=>{try{F(t)}finally{e()}})}function oi(e,t,n){let r=!1,o,s=le(e());const i=()=>{if(s!=null){const a=y(s);try{n(a)}finally{s=void 0}}},l=()=>{try{i()}finally{o=void 0}};return En(()=>(r||Sr(),o!=null?y(o):Jn()),()=>{if(r||(r=!0),s!=null){const a=y(s);let c;try{c=t(a)}catch(f){throw l(),f}return c!=null?(o=c,!0):(l(),!1)}else return!1},i)}function Xu(e,t){let n,r=t;return En(()=>{if(n!=null){const o=y(n)[0];return y(n)[1],o}else return Sr()},()=>(n=e(r),n!=null?(y(n)[0],r=y(n)[1],!0):!1),()=>{})}function Qu(e,t){t==null&&Uu(e)}function Et(e){return Zu(e)}function qe(e){return Qu("source",e),z(e)}function $(e){return Et(()=>z(e()))}function si(e){return Et(()=>Ku(e))}function ea(e,t){return Et(()=>Xu(e,t))}function Kn(){return $(()=>new Array(0))}function T(e){return $(()=>$u(e))}function ta(e){return e instanceof he?Wt(e):Array.from(e)}function ge(e){return Pe(e)?U(e):e instanceof he?e:Du(e)}function na(e,t,n){return Et(()=>oi(e,t,n))}function ii(e,t,n){return Et(()=>{let r=-1;return oi(e,o=>(r=r+1|0,t(r,o)),n)})}function ie(e,t){return si([e,t])}function ra(e,t,n){const r=qe(t);try{const o=qe(n);try{let s=0,i=r["System.Collections.IEnumerator.MoveNext"](),l=o["System.Collections.IEnumerator.MoveNext"]();for(;s===0&&i&&l;)s=e(r["System.Collections.Generic.IEnumerator`1.get_Current"](),o["System.Collections.Generic.IEnumerator`1.get_Current"]())|0,s===0&&(i=r["System.Collections.IEnumerator.MoveNext"](),l=o["System.Collections.IEnumerator.MoveNext"]());return(s!==0?s:i?1:l?-1:0)|0}finally{F(o)}}finally{F(r)}}function it(e,t,n){const r=qe(t);try{let o=!1;for(;!o&&r["System.Collections.IEnumerator.MoveNext"]();)o=n.Equals(e,r["System.Collections.Generic.IEnumerator`1.get_Current"]());return o}finally{F(r)}}function kn(e,t,n){const r=qe(n);try{let o=t;for(;r["System.Collections.IEnumerator.MoveNext"]();)o=e(o,r["System.Collections.Generic.IEnumerator`1.get_Current"]());return o}finally{F(r)}}function li(e,t){kn((n,r)=>{e(r)},void 0,t)}function we(e,t){return na(()=>qe(t),n=>n["System.Collections.IEnumerator.MoveNext"]()?le(e(n["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,n=>{F(n)})}function oa(e,t){return ii(()=>qe(t),(n,r)=>r["System.Collections.IEnumerator.MoveNext"]()?le(e(n,r["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,n=>{F(n)})}function sa(e){return $(()=>Iu(ta(e)))}function ia(e,t){return Et(()=>{const n=qe(t);try{for(let r=1;r<=e;r++)if(!n["System.Collections.IEnumerator.MoveNext"]())throw new Error(ri+"\\nParameter name: source");return Yu(()=>{},n)}catch(r){throw F(n),r}})}function la(e,t){return ii(()=>qe(t),(n,r)=>{if(n<e){if(r["System.Collections.IEnumerator.MoveNext"]())return le(r["System.Collections.Generic.IEnumerator`1.get_Current"]());throw new Error(ri+"\\nParameter name: source")}else return},n=>{F(n)})}function ua(e,t){return $(()=>si(we(e,t)))}class ui{constructor(t,n){this.k=t,this.v=n}}function Ft(e,t){return new ui(e,t)}function G(e){return e.k}function re(e){return e.v}class B extends ui{constructor(t,n,r,o,s){super(t,n),this.left=r,this.right=o,this.h=s|0}}function Ot(e,t,n,r,o){return new B(e,t,n,r,o)}function X(e){return e.left}function Q(e){return e.right}function Ge(e){return e.h}function ai(e,t){e:for(;;){const n=e,r=t;if(r!=null){const o=y(r);if(o instanceof B){const s=o;e=ai(n+1,X(s)),t=Q(s);continue e}else return n+1|0}else return n|0}}function aa(e){return ai(0,e)}function Se(e,t,n,r){let o,s,i;const l=e;if(l!=null){const u=y(l);i=u instanceof B?(o=u,Ge(o)):1}else i=0;let a;const c=r;if(c!=null){const u=y(c);a=u instanceof B?(s=u,Ge(s)):1}else a=0;const f=(i<a?a:i)|0;return f===0?Ft(t,n):Ot(t,n,e,r,f+1)}function Kr(e,t,n,r){let o,s,i,l,a,c,f,u,p;const h=e;if(h!=null){const g=y(h);p=g instanceof B?(o=g,Ge(o)):1}else p=0;let d;const m=r;if(m!=null){const g=y(m);d=g instanceof B?(s=g,Ge(s)):1}else d=0;if(d>p+2){const g=y(r);if(g instanceof B){const w=g;if(i=X(w),(i!=null?(l=y(i),l instanceof B?(a=l,Ge(a)):1):0)>p+1){const C=y(X(w));if(C instanceof B){const k=C;return Se(Se(e,t,n,X(k)),G(k),re(k),Se(Q(k),G(w),re(w),Q(w)))}else throw new Error("internal error: Map.rebalance")}else return Se(Se(e,t,n,X(w)),G(w),re(w),Q(w))}else throw new Error("internal error: Map.rebalance")}else if(p>d+2){const g=y(e);if(g instanceof B){const w=g;if(c=Q(w),(c!=null?(f=y(c),f instanceof B?(u=f,Ge(u)):1):0)>d+1){const C=y(Q(w));if(C instanceof B){const k=C;return Se(Se(X(w),G(w),re(w),X(k)),G(k),re(k),Se(Q(k),t,n,r))}else throw new Error("internal error: Map.rebalance")}else return Se(X(w),G(w),re(w),Se(Q(w),t,n,r))}else throw new Error("internal error: Map.rebalance")}else return Se(e,t,n,r)}function bt(e,t,n,r){if(r!=null){const o=y(r),s=e.Compare(t,G(o))|0;if(o instanceof B){const i=o;return s<0?Kr(bt(e,t,n,X(i)),G(i),re(i),Q(i)):s===0?Ot(t,n,X(i),Q(i),Ge(i)):Kr(X(i),G(i),re(i),bt(e,t,n,Q(i)))}else return s<0?Ot(t,n,void 0,r,2):s===0?Ft(t,n):Ot(t,n,r,void 0,2)}else return Ft(t,n)}function ci(e,t,n){e:for(;;){const r=e,o=t,s=n;if(s!=null){const i=y(s),l=r.Compare(o,G(i))|0;if(l===0)return le(re(i));if(i instanceof B){const a=i;e=r,t=o,n=l<0?X(a):Q(a);continue e}else return}else return}}function ca(e,t,n){const r=ci(e,t,n);if(r==null)throw new Error;return y(r)}function fa(e,t,n){e:for(;;){const r=e,o=t,s=n;if(s!=null){const i=y(s),l=r.Compare(o,G(i))|0;if(i instanceof B){const a=i;if(l<0){e=r,t=o,n=X(a);continue e}else{if(l===0)return!0;e=r,t=o,n=Q(a);continue e}}else return l===0}else return!1}}function fi(e,t){e:for(;;){const n=e,r=t;if(r!=null){const o=y(r);if(o instanceof B){const s=o;fi(n,X(s)),n(G(s),re(s)),e=n,t=Q(s);continue e}else n(G(o),re(o))}break}}function da(e,t){fi(e,t)}function Yn(e,t){if(t!=null){const n=y(t);if(n instanceof B){const r=n,o=Yn(e,X(r)),s=e(G(r),re(r)),i=Yn(e,Q(r));return Ot(G(r),s,o,i,Ge(r))}else return Ft(G(n),e(G(n),re(n)))}else return void 0}function ha(e,t){return Yn(e,t)}function pa(e,t,n){let r=n;da((o,s)=>{t[r]=[o,s],r=r+1|0},e)}function _a(e,t){return Ae((n,r)=>bt(e,r[0],r[1],n),void 0,t)}function ma(e,t,n){e:for(;;){const r=e,o=t,s=n;if(s["System.Collections.IEnumerator.MoveNext"]()){const i=s["System.Collections.Generic.IEnumerator`1.get_Current"]();e=r,t=bt(r,i[0],i[1],o),n=s;continue e}else return o}}function ga(e,t){let n=void 0;for(let r=0;r<=t.length-1;r++){const o=t[r];n=bt(e,o[0],o[1],n)}return n}function di(e,t){if(Pe(t))return ga(e,t);if(t instanceof he)return _a(e,t);{const n=z(t);try{return ma(e,void 0,n)}finally{F(n)}}}class wa extends ue{constructor(t,n){super(),this.stack=t,this.started=n}}function hi(e){e:for(;;){const t=e;if(I(t))return J();{const n=M(t),r=x(t);if(r!=null){const o=y(r);if(o instanceof B){const s=o;e=D([X(s),Ft(G(s),re(s)),Q(s)],n);continue e}else return t}else{e=n;continue e}}}}function Yr(e){return new wa(hi(Y(e)),!1)}function ya(){throw new Error("enumeration not started")}function ba(){throw new Error("enumeration already finished")}function Xr(e){if(e.started){const t=e.stack;if(I(t))return ba();if(x(t)!=null){const n=y(x(t));if(n instanceof B)throw new Error("Please report error: Map iterator, unexpected stack for current");return[G(n),re(n)]}else throw new Error("Please report error: Map iterator, unexpected stack for current")}else return ya()}function va(e){if(e.started){const t=e.stack;if(I(t))return!1;if(x(t)!=null){if(y(x(t))instanceof B)throw new Error("Please report error: Map iterator, unexpected stack for moveNext");return e.stack=hi(M(t)),!I(e.stack)}else throw new Error("Please report error: Map iterator, unexpected stack for moveNext")}else return e.started=!0,!I(e.stack)}function Qr(e){let t=Yr(e);return{"System.Collections.Generic.IEnumerator`1.get_Current"(){return Xr(t)},"System.Collections.IEnumerator.get_Current"(){return Xr(t)},"System.Collections.IEnumerator.MoveNext"(){return va(t)},"System.Collections.IEnumerator.Reset"(){t=Yr(e)},Dispose(){}}}class _n{constructor(t,n){this.comparer=t,this.tree=n}GetHashCode(){return ka(this)|0}Equals(t){const n=this;if(t instanceof _n){const r=t,o=z(n);try{const s=z(r);try{const i=()=>{const l=o["System.Collections.IEnumerator.MoveNext"]();if(l===s["System.Collections.IEnumerator.MoveNext"]())if(l){const a=o["System.Collections.Generic.IEnumerator`1.get_Current"](),c=s["System.Collections.Generic.IEnumerator`1.get_Current"]();return oe(a[0],c[0])&&oe(a[1],c[1])?i():!1}else return!0;else return!1};return i()}finally{F(s)}}finally{F(o)}}else return!1}toString(){return"map ["+Le("; ",we(n=>xu("({0}, {1})",n[0],n[1]),this))+"]"}get[Symbol.toStringTag](){return"FSharpMap"}toJSON(){const t=this;return Array.from(t)}GetEnumerator(){return Qr(this.tree)}[Symbol.iterator](){return yn(z(this))}"System.Collections.IEnumerable.GetEnumerator"(){return Qr(this.tree)}CompareTo(t){const n=this;if(t instanceof _n)return ra((o,s)=>{const i=n.comparer.Compare(o[0],s[0])|0;return(i!==0?i:be(o[1],s[1]))|0},n,t)|0;throw new Error("not comparable\\nParameter name: obj")}"System.Collections.Generic.ICollection`1.Add2B595"(t){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Remove2B595"(t){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Contains2B595"(t){const n=this;return to(n,t[0])&&oe(eo(n,t[0]),t[1])}"System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(t,n){pa(this.tree,t,n)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return Nn(this)|0}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return Nn(this)|0}get size(){return Nn(this)|0}clear(){throw new Error("Map cannot be mutated")}delete(t){throw new Error("Map cannot be mutated")}entries(){return we(n=>[n[0],n[1]],this)}get(t){return eo(this,t)}has(t){return to(this,t)}keys(){return we(n=>n[0],this)}set(t,n){throw new Error("Map cannot be mutated")}values(){return we(n=>n[1],this)}forEach(t,n){const r=this;li(o=>{t(o[1],o[0],r)},r)}}function qt(e,t){return new _n(e,t)}function Sa(e){return qt(e,void 0)}function Ca(e,t,n){return qt(e.comparer,bt(e.comparer,t,n,e.tree))}function eo(e,t){return ca(e.comparer,t,e.tree)}function xa(e,t){return qt(e.comparer,ha(t,e.tree))}function Nn(e){return aa(e.tree)}function to(e,t){return fa(e.comparer,t,e.tree)}function Ea(e,t){return ci(e.comparer,t,e.tree)}function ka(e){const t=(o,s)=>(o<<1)+s+631;let n=0;const r=z(e);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const o=r["System.Collections.Generic.IEnumerator`1.get_Current"]();n=t(n,Ve(o[0]))|0,n=t(n,Ve(o[1]))|0}}finally{F(r)}return n|0}function pi(e,t,n){return Ca(n,e,t)}function _i(e,t){return Ea(t,e)}function mi(e,t){return xa(t,e)}function Ta(e,t){return qt(t,di(t,e))}function Ma(e,t){return qt(t,di(t,e))}function Cr(e){return Sa(e)}function $a(e){return new Bs("Content-Type",e)}function gi(e){return new Bs("Authorization",e)}const Ke=new Gt("",new mr(0,[]),J(),!1,void 0,void 0,void 0,new Gs(0,[]));new zs(0,"","","",Cr({Compare:bn}),new lt(0,[""]));function no(e,t){return Eu(t)?[t]:Tu(t,[e],void 0,0)}function Ia(e){switch(e.tag){case 1:return"POST";case 3:return"PATCH";case 2:return"PUT";case 4:return"DELETE";case 6:return"OPTIONS";case 5:return"HEAD";default:return"GET"}}function wi(e){return new Gt(e,Ke.method,Ke.headers,Ke.withCredentials,Ke.overridenMimeType,Ke.overridenResponseType,Ke.timeout,Ke.content)}function yi(e,t){return new Gt(t.url,e,t.headers,t.withCredentials,t.overridenMimeType,t.overridenResponseType,t.timeout,t.content)}function Xn(e,t){return new Gt(t.url,t.method,vr(t.headers,Y(e)),t.withCredentials,t.overridenMimeType,t.overridenResponseType,t.timeout,t.content)}function Pa(e,t){return new Gt(t.url,t.method,t.headers,t.withCredentials,t.overridenMimeType,t.overridenResponseType,t.timeout,e)}function bi(e){return lu(t=>{const n=new XMLHttpRequest;n.open(Ia(e.method),e.url),n.onreadystatechange=()=>{let a,c,f,u,p,h,d;n.readyState===4&&t[0]((a=(c=n.responseType,c===""||c==="text"?n.responseText:""),f=n.status|0,u=n.responseType,p=(h=n.responseType,h===""?new lt(0,[n.responseText]):h==="text"?new lt(0,[n.responseText]):h==="arraybuffer"?new lt(2,[n.response]):h==="blob"?new lt(1,[n.response]):new lt(3,[n.response])),d=Ma(Au(m=>{const g=U(no(":",m));if(!I(g))return[x(g).toLocaleLowerCase(),Le(":",M(g)).trim()]},no(`\r
|
|
4
|
-
`,n.getAllResponseHeaders())),{Compare:bn}),new zs(f,a,u,n.responseURL,d,p)))};const r=z(e.headers);try{for(;r["System.Collections.IEnumerator.MoveNext"]();){const a=r["System.Collections.Generic.IEnumerator`1.get_Current"]();n.setRequestHeader(a.fields[0],a.fields[1])}}finally{F(r)}n.withCredentials=e.withCredentials;const o=e.overridenMimeType;if(o!=null){const a=o;n.overrideMimeType(a)}const s=e.overridenResponseType;if(s!=null)switch(s.tag){case 1:{n.responseType="blob";break}case 2:{n.responseType="arraybuffer";break}default:n.responseType="text"}const i=e.timeout;if(i!=null){const a=i|0;n.timeout=a|0}const l=e.content;switch(l.tag){case 1:{n.send(le(l.fields[0]));break}case 3:{n.send(le(l.fields[0]));break}case 2:{n.send(le(l.fields[0]));break}default:n.send()}})}const Qe={None:0,LowerFirst:1,SnakeCase:2,SnakeCaseAllCaps:3,KebabCase:4};function Rn(e,t){return e.replace(/[a-z]?[A-Z]/g,n=>n.length===1?n.toLowerCase():n.charAt(0)+t+n.charAt(1).toLowerCase())}function Aa(e,t){switch(t){case Qe.LowerFirst:return e.charAt(0).toLowerCase()+e.slice(1);case Qe.SnakeCase:return Rn(e,"_");case Qe.SnakeCaseAllCaps:return Rn(e,"_").toUpperCase();case Qe.KebabCase:return Rn(e,"-");case Qe.None:default:return e}}function Oa(e,t=Qe.None){const n={},r=t;function o(i){throw new Error("Cannot infer key and value of "+String(i))}function s(i,l,a){i=Aa(i,l),n[i]=a}for(let i of e){let l=Qe.None;if(i==null&&o(i),i instanceof W){const a=i.cases()[i.tag];i=i.fields.length===0?a:[a].concat(i.fields),l=r}if(Array.isArray(i))switch(i.length){case 0:o(i);break;case 1:s(i[0],l,!0);break;case 2:const a=i[1];s(i[0],l,a);break;default:s(i[0],l,i.slice(1))}else typeof i=="string"?s(i,l,!0):o(i)}return n}class v extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["BadPrimitive","BadPrimitiveExtra","BadType","BadField","BadPath","TooSmallArray","FailMessage","BadOneOf"]}}class Tn extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["PascalCase","CamelCase","SnakeCase"]}}function ro(e){return e.slice(void 0,0+1).toLowerCase()+e.slice(1,e.length)}function vi(e,t){switch(e.tag){case 2:return bu(ro(t),"[A-Z]","_$0").toLowerCase();case 0:return t;default:return ro(t)}}const Na=/^[\(\{]{0,2}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\)\}]{0,2}$/,oo=/^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/,Ra=/^\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\}\}$/;function Fa(e){function t(r){return r.replace(oo,"$1-$2-$3-$4-$5")}const n=e.trim().toLowerCase();if(Na.test(n))return Mu(n,"{","}","(",")");if(oo.test(n))return t(n);if(Ra.test(n))return t(n.replace(/[\{\},]|0x/g,""));throw new Error("Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")}function Da(e,t){try{return t.contents=Fa(e),!0}catch{return!1}}var Qn;(function(e){e[e.AllowHexSpecifier=512]="AllowHexSpecifier"})(Qn||(Qn={}));function Va(e,t){const[,n,r,o]=e;return{sign:n||"",prefix:r||"",digits:o,radix:t}}function so(e,t){switch(t){case 8:return e?[0,255]:[-128,127];case 16:return e?[0,65535]:[-32768,32767];case 32:return e?[0,4294967295]:[-2147483648,2147483647];default:throw new Error("Invalid bit size.")}}function La(e){switch(e){case 2:return/[^0-1]/;case 8:return/[^0-7]/;case 10:return/[^0-9]/;case 16:return/[^0-9a-fA-F]/;default:throw new Error("Invalid Base.")}}function Ha(e,t){if(t&Qn.AllowHexSpecifier)return 16;switch(e){case"0b":case"0B":return 2;case"0o":case"0O":return 8;case"0x":case"0X":return 16;default:return 10}}function ja(e,t,n){const o=/^\s*([\+\-])?(0[xXoObB])?([0-9a-fA-F]+)\s*$/.exec(e.replace(/_/g,""));if(o!=null){const[,,s,i]=o;if(n=n||Ha(s,t),!La(n).test(i))return Va(o,n)}return null}function Ua(e,t,n,r,o){const s=ja(e,t,o);if(s!=null){let i=Number.parseInt(s.sign+s.digits,s.radix);if(!Number.isNaN(i)){const[l,a]=so(!0,r);!n&&s.radix!==10&&i>=l&&i<=a&&(i=i<<32-r>>32-r);const[c,f]=so(n,r);if(i>=c&&i<=f)return i}}throw new Error("Input string was not in a correct format.")}function kt(e,t,n,r,o){try{return o.contents=Ua(e,t,n,r),!0}catch{return!1}}function Si(e,t){Ba(t);const n=new Date(e);return n.offset=t??new Date().getTimezoneOffset()*-6e4,n}function Ba(e){if(e!=null&&e!==0){if(e%6e4!==0)throw new Error("Offset must be specified in whole minutes.");if(Math.abs(e/36e5)>14)throw new Error("Offset must be within plus or minus 14 hours.")}}function Ga(){return Si(-621355968e5,0)}function za(e){const[t,n]=qs(e),r=n==null?t.getTimezoneOffset()*-6e4:n==="Z"?0:n*6e4;return Si(t.getTime(),r)}function Wa(e,t){try{return t.contents=za(e),!0}catch{return!1}}function Zt(e){return e<0?Math.ceil(e):Math.floor(e)}function io(e=0,t=0,n=0,r=0,o=0){switch(arguments.length){case 1:return qa(arguments[0]);case 3:e=0,t=arguments[0],n=arguments[1],r=arguments[2],o=0;break}return e*864e5+t*36e5+n*6e4+r*1e3+o}function qa(e){return Number(BigInt(e)/10000n)}function Za(e){return Zt(e/864e5)}function Ja(e){return Zt(e%864e5/36e5)}function Ka(e){return Zt(e%36e5/6e4)}function Ya(e){return Zt(e%6e4/1e3)}function Xa(e){return Zt(e%1e3)}function Qa(e,t="c",n){if(["c","g","G"].indexOf(t)===-1)throw new Error("Custom formats are not supported");const r=Math.abs(Za(e)),o=Math.abs(Ja(e)),s=Math.abs(Ka(e)),i=Math.abs(Ya(e)),l=Math.abs(Xa(e));return`${e<0?"-":""}${r===0&&(t==="c"||t==="g")?"":t==="c"?r+".":r+":"}${t==="g"?o:se(o,2)}:${se(s,2)}:${se(i,2)}${l===0&&(t==="c"||t==="g")?"":t==="g"?"."+se(l,3):"."+ml(l,3,7)}`}function ec(e){const t=e.search("\\."),n=e.search("\\:");if(t===-1&&n===-1){const r=parseInt(e,0);if(isNaN(r))throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`);return io(r,0,0,0,0)}if(n>0){const r=/^(-?)((\d+)\.)?(?:0*)([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:0*)([0-5][0-9]|[0-9])(:(?:0*)([0-5][0-9]|[0-9]))?\.?(\d+)?$/.exec(e);if(r!=null&&r[4]!=null&&r[5]!=null){let o=0,s=0,i=0;const l=r[1]!=null&&r[1]==="-"?-1:1,a=+r[4],c=+r[5];if(r[3]!=null&&(o=+r[3]),r[7]!=null&&(i=+r[7]),r[8]!=null)switch(r[8].length){case 1:s=+r[8]*100;break;case 2:s=+r[8]*10;break;case 3:s=+r[8];break;case 4:s=+r[8]/10;break;case 5:s=+r[8]/100;break;case 6:s=+r[8]/1e3;break;case 7:s=+r[8]/1e4;break;default:throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`)}return l*io(o,a,c,i,s)}}throw new Error(`String '${e}' was not recognized as a valid TimeSpan.`)}function tc(e,t){try{return t.contents=ec(e),!0}catch{return!1}}class Ci{constructor(t){this.k=t}}function ce(e){return new Ci(e)}function E(e){return e.k}class P extends Ci{constructor(t,n,r,o){super(t),this.left=n,this.right=r,this.h=o|0}}function fe(e,t,n,r){return new P(e,t,n,r)}function N(e){return e.left}function A(e){return e.right}function ct(e){return e.h}function xi(e,t){e:for(;;){const n=e,r=t;if(n!=null){const o=y(n);if(o instanceof P){const s=o;e=N(s),t=xi(A(s),r+1);continue e}else return r+1|0}else return r|0}}function nc(e){return xi(e,0)}function Ce(e,t,n){let r,o,s;const i=e;if(i!=null){const f=y(i);s=f instanceof P?(r=f,ct(r)):1}else s=0;let l;const a=n;if(a!=null){const f=y(a);l=f instanceof P?(o=f,ct(o)):1}else l=0;const c=(s<l?l:s)|0;return c===0?ce(t):fe(t,e,n,c+1)}function lo(e,t,n){let r,o,s,i,l,a,c,f,u;const p=e;if(p!=null){const m=y(p);u=m instanceof P?(r=m,ct(r)):1}else u=0;let h;const d=n;if(d!=null){const m=y(d);h=m instanceof P?(o=m,ct(o)):1}else h=0;if(h>u+2){const m=y(n);if(m instanceof P){const g=m;if(s=N(g),(s!=null?(i=y(s),i instanceof P?(l=i,ct(l)):1):0)>u+1){const w=y(N(g));if(w instanceof P){const C=w;return Ce(Ce(e,t,N(C)),E(C),Ce(A(C),E(g),A(g)))}else throw new Error("internal error: Set.rebalance")}else return Ce(Ce(e,t,N(g)),E(g),A(g))}else throw new Error("internal error: Set.rebalance")}else if(u>h+2){const m=y(e);if(m instanceof P){const g=m;if(a=A(g),(a!=null?(c=y(a),c instanceof P?(f=c,ct(f)):1):0)>h+1){const w=y(A(g));if(w instanceof P){const C=w;return Ce(Ce(N(g),E(g),N(C)),E(C),Ce(A(C),t,n))}else throw new Error("internal error: Set.rebalance")}else return Ce(N(g),E(g),Ce(A(g),t,n))}else throw new Error("internal error: Set.rebalance")}else return Ce(e,t,n)}function vt(e,t,n){if(n!=null){const r=y(n),o=e.Compare(t,E(r))|0;if(r instanceof P){const s=r;return o<0?lo(vt(e,t,N(s)),E(s),A(s)):o===0?n:lo(N(s),E(s),vt(e,t,A(s)))}else{const s=e.Compare(t,E(r))|0;return s<0?fe(t,void 0,n,2):s===0?n:fe(t,n,void 0,2)}}else return ce(t)}function Ei(e,t,n){e:for(;;){const r=e,o=t,s=n;if(s!=null){const i=y(s),l=r.Compare(o,E(i))|0;if(i instanceof P){const a=i;if(l<0){e=r,t=o,n=N(a);continue e}else{if(l===0)return!0;e=r,t=o,n=A(a);continue e}}else return l===0}else return!1}}function ki(e,t){e:for(;;){const n=e,r=t;if(r!=null){const o=y(r);if(o instanceof P){const s=o;ki(n,N(s)),n(E(s)),e=n,t=A(s);continue e}else n(E(o))}break}}class rc extends ue{constructor(t,n){super(),this.stack=t,this.started=n}}function Ti(e){e:for(;;){const t=e;if(I(t))return J();{const n=x(t),r=M(t);if(n!=null){const o=y(n);if(o instanceof P){const s=o;e=D([N(s),ce(E(s)),A(s)],r);continue e}else return t}else{e=r;continue e}}}}function uo(e){return new rc(Ti(Y(e)),!1)}function oc(){throw new Error("Enumeration not started")}function sc(){throw new Error("Enumeration already started")}function ao(e){if(e.started){const t=e.stack;if(I(t))return sc();if(x(t)!=null){const n=y(x(t));return E(n)}else throw new Error("Please report error: Set iterator, unexpected stack for current")}else return oc()}function ic(e){if(e.started){const t=e.stack;if(I(t))return!1;if(x(t)!=null){if(y(x(t))instanceof P)throw new Error("Please report error: Set iterator, unexpected stack for moveNext");return e.stack=Ti(M(t)),!I(e.stack)}else throw new Error("Please report error: Set iterator, unexpected stack for moveNext")}else return e.started=!0,!I(e.stack)}function co(e){let t=uo(e);return{"System.Collections.Generic.IEnumerator`1.get_Current"(){return ao(t)},"System.Collections.IEnumerator.get_Current"(){return ao(t)},"System.Collections.IEnumerator.MoveNext"(){return ic(t)},"System.Collections.IEnumerator.Reset"(){t=uo(e)},Dispose(){}}}function lc(e,t,n){e:for(;;){const r=e,o=t,s=n;if(I(o))return I(s)?0:-1;if(I(s))return 1;if(x(s)!=null)if(x(o)!=null){const i=y(x(o)),l=y(x(s));if(i instanceof P){const a=i;if(N(a)==null)if(l instanceof P){const c=l;if(N(c)==null){const f=r.Compare(E(a),E(c))|0;if(f!==0)return f|0;e=r,t=me(A(a),M(o)),n=me(A(c),M(s));continue e}else{let f,u,p,h,d;switch(I(o)?I(s)?f=2:x(s)!=null?(f=1,h=M(s),d=y(x(s))):f=2:x(o)!=null?(f=0,u=M(o),p=y(x(o))):I(s)?f=2:x(s)!=null?(f=1,h=M(s),d=y(x(s))):f=2,f){case 0:if(p instanceof P){const m=p;e=r,t=D([N(m),fe(E(m),void 0,A(m),0)],u),n=s;continue e}else{e=r,t=D([void 0,ce(E(p))],u),n=s;continue e}case 1:if(d instanceof P){const m=d;e=r,t=o,n=D([N(m),fe(E(m),void 0,A(m),0)],h);continue e}else{e=r,t=o,n=D([void 0,ce(E(d))],h);continue e}default:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const c=r.Compare(E(a),E(l))|0;if(c!==0)return c|0;e=r,t=me(A(a),M(o)),n=me(void 0,M(s));continue e}else{let c,f,u,p,h;switch(I(o)?I(s)?c=2:x(s)!=null?(c=1,p=M(s),h=y(x(s))):c=2:x(o)!=null?(c=0,f=M(o),u=y(x(o))):I(s)?c=2:x(s)!=null?(c=1,p=M(s),h=y(x(s))):c=2,c){case 0:if(u instanceof P){const d=u;e=r,t=D([N(d),fe(E(d),void 0,A(d),0)],f),n=s;continue e}else{e=r,t=D([void 0,ce(E(u))],f),n=s;continue e}case 1:if(h instanceof P){const d=h;e=r,t=o,n=D([N(d),fe(E(d),void 0,A(d),0)],p);continue e}else{e=r,t=o,n=D([void 0,ce(E(h))],p);continue e}default:throw new Error("unexpected state in SetTree.compareStacks")}}}else if(l instanceof P){const a=l;if(N(a)==null){const c=r.Compare(E(i),E(a))|0;if(c!==0)return c|0;e=r,t=me(void 0,M(o)),n=me(A(a),M(s));continue e}else{let c,f,u,p,h;switch(I(o)?I(s)?c=2:x(s)!=null?(c=1,p=M(s),h=y(x(s))):c=2:x(o)!=null?(c=0,f=M(o),u=y(x(o))):I(s)?c=2:x(s)!=null?(c=1,p=M(s),h=y(x(s))):c=2,c){case 0:if(u instanceof P){const d=u;e=r,t=D([N(d),fe(E(d),void 0,A(d),0)],f),n=s;continue e}else{e=r,t=D([void 0,ce(E(u))],f),n=s;continue e}case 1:if(h instanceof P){const d=h;e=r,t=o,n=D([N(d),fe(E(d),void 0,A(d),0)],p);continue e}else{e=r,t=o,n=D([void 0,ce(E(h))],p);continue e}default:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const a=r.Compare(E(i),E(l))|0;if(a!==0)return a|0;e=r,t=M(o),n=M(s);continue e}}else{y(x(s));let i,l,a,c,f;switch(I(o)?I(s)?i=2:x(s)!=null?(i=1,c=M(s),f=y(x(s))):i=2:x(o)!=null?(i=0,l=M(o),a=y(x(o))):I(s)?i=2:x(s)!=null?(i=1,c=M(s),f=y(x(s))):i=2,i){case 0:if(a instanceof P){const u=a;e=r,t=D([N(u),fe(E(u),void 0,A(u),0)],l),n=s;continue e}else{e=r,t=D([void 0,ce(E(a))],l),n=s;continue e}case 1:if(f instanceof P){const u=f;e=r,t=o,n=D([N(u),fe(E(u),void 0,A(u),0)],c);continue e}else{e=r,t=o,n=D([void 0,ce(E(f))],c);continue e}default:throw new Error("unexpected state in SetTree.compareStacks")}}else if(x(o)!=null){y(x(o));let i,l,a,c,f;switch(I(o)?I(s)?i=2:x(s)!=null?(i=1,c=M(s),f=y(x(s))):i=2:x(o)!=null?(i=0,l=M(o),a=y(x(o))):I(s)?i=2:x(s)!=null?(i=1,c=M(s),f=y(x(s))):i=2,i){case 0:if(a instanceof P){const u=a;e=r,t=D([N(u),fe(E(u),void 0,A(u),0)],l),n=s;continue e}else{e=r,t=D([void 0,ce(E(a))],l),n=s;continue e}case 1:if(f instanceof P){const u=f;e=r,t=o,n=D([N(u),fe(E(u),void 0,A(u),0)],c);continue e}else{e=r,t=o,n=D([void 0,ce(E(f))],c);continue e}default:throw new Error("unexpected state in SetTree.compareStacks")}}else{e=r,t=M(o),n=M(s);continue e}}}function fo(e,t,n){return t==null?n==null?0:-1:n==null?1:lc(e,Y(t),Y(n))|0}function uc(e,t,n){let r=n;ki(o=>{t[r]=o,r=r+1|0},e)}function ac(e,t,n){e:for(;;){const r=e,o=t,s=n;if(s["System.Collections.IEnumerator.MoveNext"]()){e=r,t=vt(r,s["System.Collections.Generic.IEnumerator`1.get_Current"](),o),n=s;continue e}else return o}}function cc(e,t){return xn((n,r)=>vt(e,r,n),void 0,t)}function fc(e,t){return Ae((n,r)=>vt(e,r,n),void 0,t)}function Mi(e,t){if(Pe(t))return cc(e,t);if(t instanceof he)return fc(e,t);{const n=z(t);try{return ac(e,void 0,n)}finally{F(n)}}}class xr{constructor(t,n){this.comparer=t,this.tree=n}GetHashCode(){return pc(this)|0}Equals(t){let n;const r=this;return t instanceof xr&&(n=t,fo(pt(r),xe(r),xe(n))===0)}toString(){return"set ["+Le("; ",we(n=>Me(n),this))+"]"}get[Symbol.toStringTag](){return"FSharpSet"}toJSON(){const t=this;return Array.from(t)}CompareTo(t){const n=this;return fo(pt(n),xe(n),xe(t))|0}"System.Collections.Generic.ICollection`1.Add2B595"(t){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Remove2B595"(t){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Contains2B595"(t){const n=this;return Ei(pt(n),t,xe(n))}"System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(t,n){uc(xe(this),t,n)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return Fn(this)|0}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return Fn(this)|0}GetEnumerator(){return co(xe(this))}[Symbol.iterator](){return yn(z(this))}"System.Collections.IEnumerable.GetEnumerator"(){return co(xe(this))}get size(){return Fn(this)|0}add(t){throw new Error("Set cannot be mutated")}clear(){throw new Error("Set cannot be mutated")}delete(t){throw new Error("Set cannot be mutated")}has(t){return $i(this,t)}keys(){return we(n=>n,this)}values(){return we(n=>n,this)}entries(){return we(n=>[n,n],this)}forEach(t,n){const r=this;li(o=>{t(o,o,r)},r)}}function Mn(e,t){return new xr(e,t)}function pt(e){return e.comparer}function xe(e){return e.tree}function dc(e){return Mn(e,void 0)}function hc(e,t){return Mn(pt(e),vt(pt(e),t,xe(e)))}function Fn(e){return nc(xe(e))}function $i(e,t){return Ei(pt(e),t,xe(e))}function pc(e){let t=0;const n=z(e);try{for(;n["System.Collections.IEnumerator.MoveNext"]();){const r=n["System.Collections.Generic.IEnumerator`1.get_Current"]();t=(t<<1)+Ve(r)+631|0}}finally{F(n)}return Math.abs(t)|0}function er(e,t){return $i(t,e)}function _c(e,t){return hc(t,e)}function mc(e){return dc(e)}function gc(e,t){return Mn(t,Mi(t,e))}function wc(e,t){return Mn(t,Mi(t,e))}function Mt(e,t,n){try{return"Expecting "+e+" but instead got:"+(n?`
|
|
5
|
-
`:" ")+(JSON.stringify(
|
|
6
|
-
`:" ")}}function
|
|
7
|
-
Reason: `+
|
|
8
|
-
`+(JSON.stringify(
|
|
1
|
+
var xr=Object.defineProperty;var Pr=(te,ee,ne)=>ee in te?xr(te,ee,{enumerable:!0,configurable:!0,writable:!0,value:ne}):te[ee]=ne;var Lt=(te,ee,ne)=>(Pr(te,typeof ee!="symbol"?ee+"":ee,ne),ne),Ln=(te,ee,ne)=>{if(!ee.has(te))throw TypeError("Cannot "+ne)};var Re=(te,ee,ne)=>(Ln(te,ee,"read from private field"),ne?ne.call(te):ee.get(te)),Je=(te,ee,ne)=>{if(ee.has(te))throw TypeError("Cannot add the same private member more than once");ee instanceof WeakSet?ee.add(te):ee.set(te,ne)},_t=(te,ee,ne,re)=>(Ln(te,ee,"write to private field"),re?re.call(te,ne):ee.set(te,ne),ne);var xn=(te,ee,ne,re)=>({set _(se){_t(te,ee,se,ne)},get _(){return Re(te,ee,re)}}),rt=(te,ee,ne)=>(Ln(te,ee,"access private method"),ne);function _mergeNamespaces(te,ee){for(var ne=0;ne<ee.length;ne++){const re=ee[ne];if(typeof re!="string"&&!Array.isArray(re)){for(const se in re)if(se!=="default"&&!(se in te)){const ie=Object.getOwnPropertyDescriptor(re,se);ie&&Object.defineProperty(te,se,ie.get?ie:{enumerable:!0,get:()=>re[se]})}}}return Object.freeze(Object.defineProperty(te,Symbol.toStringTag,{value:"Module"}))}(function(){const ee=document.createElement("link").relList;if(ee&&ee.supports&&ee.supports("modulepreload"))return;for(const se of document.querySelectorAll('link[rel="modulepreload"]'))re(se);new MutationObserver(se=>{for(const ie of se)if(ie.type==="childList")for(const oe of ie.addedNodes)oe.tagName==="LINK"&&oe.rel==="modulepreload"&&re(oe)}).observe(document,{childList:!0,subtree:!0});function ne(se){const ie={};return se.integrity&&(ie.integrity=se.integrity),se.referrerPolicy&&(ie.referrerPolicy=se.referrerPolicy),se.crossOrigin==="use-credentials"?ie.credentials="include":se.crossOrigin==="anonymous"?ie.credentials="omit":ie.credentials="same-origin",ie}function re(se){if(se.ep)return;se.ep=!0;const ie=ne(se);fetch(se.href,ie)}})();var n$1,l$3,u$3,i$2,o$1,r$4,f$1,e$2,c$2={},s$2=[],a$2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,h$2=Array.isArray;function v$1(te,ee){for(var ne in ee)te[ne]=ee[ne];return te}function p$2(te){var ee=te.parentNode;ee&&ee.removeChild(te)}function y$1(te,ee,ne){var re,se,ie,oe={};for(ie in ee)ie=="key"?re=ee[ie]:ie=="ref"?se=ee[ie]:oe[ie]=ee[ie];if(arguments.length>2&&(oe.children=arguments.length>3?n$1.call(arguments,2):ne),typeof te=="function"&&te.defaultProps!=null)for(ie in te.defaultProps)oe[ie]===void 0&&(oe[ie]=te.defaultProps[ie]);return d$1(te,oe,re,se,null)}function d$1(te,ee,ne,re,se){var ie={type:te,props:ee,key:ne,ref:re,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:se??++u$3};return se==null&&l$3.vnode!=null&&l$3.vnode(ie),ie}function _$1(){return{current:null}}function k$3(te){return te.children}function b$1(te,ee){this.props=te,this.context=ee}function g$2(te,ee){if(ee==null)return te.__?g$2(te.__,te.__.__k.indexOf(te)+1):null;for(var ne;ee<te.__k.length;ee++)if((ne=te.__k[ee])!=null&&ne.__e!=null)return ne.__e;return typeof te.type=="function"?g$2(te):null}function m$2(te){var ee,ne;if((te=te.__)!=null&&te.__c!=null){for(te.__e=te.__c.base=null,ee=0;ee<te.__k.length;ee++)if((ne=te.__k[ee])!=null&&ne.__e!=null){te.__e=te.__c.base=ne.__e;break}return m$2(te)}}function w$2(te){(!te.__d&&(te.__d=!0)&&i$2.push(te)&&!x$2.__r++||o$1!==l$3.debounceRendering)&&((o$1=l$3.debounceRendering)||r$4)(x$2)}function x$2(){var te,ee,ne,re,se,ie,oe,me,pe;for(i$2.sort(f$1);te=i$2.shift();)te.__d&&(ee=i$2.length,re=void 0,se=void 0,ie=void 0,me=(oe=(ne=te).__v).__e,(pe=ne.__P)&&(re=[],se=[],(ie=v$1({},oe)).__v=oe.__v+1,L$1(pe,oe,ie,ne.__n,pe.ownerSVGElement!==void 0,oe.__h!=null?[me]:null,re,me??g$2(oe),oe.__h,se),M$1(re,oe,se),oe.__e!=me&&m$2(oe)),i$2.length>ee&&i$2.sort(f$1));x$2.__r=0}function P$2(te,ee,ne,re,se,ie,oe,me,pe,he,ue){var de,Ae,Se,ce,fe,ye,ve,Pe,we,Te,Le=0,Ne=re&&re.__k||s$2,Me=Ne.length,ae=Me,ge=ee.length;for(ne.__k=[],de=0;de<ge;de++)(ce=ne.__k[de]=(ce=ee[de])==null||typeof ce=="boolean"||typeof ce=="function"?null:typeof ce=="string"||typeof ce=="number"||typeof ce=="bigint"?d$1(null,ce,null,null,ce):h$2(ce)?d$1(k$3,{children:ce},null,null,null):ce.__b>0?d$1(ce.type,ce.props,ce.key,ce.ref?ce.ref:null,ce.__v):ce)!=null&&(ce.__=ne,ce.__b=ne.__b+1,(Pe=A$2(ce,Ne,ve=de+Le,ae))===-1?Se=c$2:(Se=Ne[Pe]||c$2,Ne[Pe]=void 0,ae--),L$1(te,ce,Se,se,ie,oe,me,pe,he,ue),fe=ce.__e,(Ae=ce.ref)&&Se.ref!=Ae&&(Se.ref&&O$1(Se.ref,null,ce),ue.push(Ae,ce.__c||fe,ce)),fe!=null&&(ye==null&&(ye=fe),Te=!(we=Se===c$2||Se.__v===null)&&Pe===ve,we?Pe==-1&&Le--:Pe!==ve&&(Pe===ve+1?(Le++,Te=!0):Pe>ve?ae>ge-ve?(Le+=Pe-ve,Te=!0):Le--:Le=Pe<ve&&Pe==ve-1?Pe-ve:0),ve=de+Le,Te=Te||Pe==de&&!we,typeof ce.type!="function"||Pe===ve&&Se.__k!==ce.__k?typeof ce.type=="function"||Te?ce.__d!==void 0?(pe=ce.__d,ce.__d=void 0):pe=fe.nextSibling:pe=$$1(te,fe,pe):pe=C$1(ce,pe,te),typeof ne.type=="function"&&(ne.__d=pe)));for(ne.__e=ye,de=Me;de--;)Ne[de]!=null&&(typeof ne.type=="function"&&Ne[de].__e!=null&&Ne[de].__e==ne.__d&&(ne.__d=Ne[de].__e.nextSibling),q$3(Ne[de],Ne[de]))}function C$1(te,ee,ne){for(var re,se=te.__k,ie=0;se&&ie<se.length;ie++)(re=se[ie])&&(re.__=te,ee=typeof re.type=="function"?C$1(re,ee,ne):$$1(ne,re.__e,ee));return ee}function S(te,ee){return ee=ee||[],te==null||typeof te=="boolean"||(h$2(te)?te.some(function(ne){S(ne,ee)}):ee.push(te)),ee}function $$1(te,ee,ne){return ne==null||ne.parentNode!==te?te.insertBefore(ee,null):ee==ne&&ee.parentNode!=null||te.insertBefore(ee,ne),ee.nextSibling}function A$2(te,ee,ne,re){var se=te.key,ie=te.type,oe=ne-1,me=ne+1,pe=ee[ne];if(pe===null||pe&&se==pe.key&&ie===pe.type)return ne;if(re>(pe!=null?1:0))for(;oe>=0||me<ee.length;){if(oe>=0){if((pe=ee[oe])&&se==pe.key&&ie===pe.type)return oe;oe--}if(me<ee.length){if((pe=ee[me])&&se==pe.key&&ie===pe.type)return me;me++}}return-1}function H$1(te,ee,ne,re,se){var ie;for(ie in ne)ie==="children"||ie==="key"||ie in ee||T$2(te,ie,null,ne[ie],re);for(ie in ee)se&&typeof ee[ie]!="function"||ie==="children"||ie==="key"||ie==="value"||ie==="checked"||ne[ie]===ee[ie]||T$2(te,ie,ee[ie],ne[ie],re)}function I$1(te,ee,ne){ee[0]==="-"?te.setProperty(ee,ne??""):te[ee]=ne==null?"":typeof ne!="number"||a$2.test(ee)?ne:ne+"px"}function T$2(te,ee,ne,re,se){var ie;e:if(ee==="style")if(typeof ne=="string")te.style.cssText=ne;else{if(typeof re=="string"&&(te.style.cssText=re=""),re)for(ee in re)ne&&ee in ne||I$1(te.style,ee,"");if(ne)for(ee in ne)re&&ne[ee]===re[ee]||I$1(te.style,ee,ne[ee])}else if(ee[0]==="o"&&ee[1]==="n")ie=ee!==(ee=ee.replace(/Capture$/,"")),ee=ee.toLowerCase()in te?ee.toLowerCase().slice(2):ee.slice(2),te.l||(te.l={}),te.l[ee+ie]=ne,ne?re||te.addEventListener(ee,ie?z$2:j$2,ie):te.removeEventListener(ee,ie?z$2:j$2,ie);else if(ee!=="dangerouslySetInnerHTML"){if(se)ee=ee.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(ee!=="width"&&ee!=="height"&&ee!=="href"&&ee!=="list"&&ee!=="form"&&ee!=="tabIndex"&&ee!=="download"&&ee!=="rowSpan"&&ee!=="colSpan"&&ee in te)try{te[ee]=ne??"";break e}catch{}typeof ne=="function"||(ne==null||ne===!1&&ee[4]!=="-"?te.removeAttribute(ee):te.setAttribute(ee,ne))}}function j$2(te){return this.l[te.type+!1](l$3.event?l$3.event(te):te)}function z$2(te){return this.l[te.type+!0](l$3.event?l$3.event(te):te)}function L$1(te,ee,ne,re,se,ie,oe,me,pe,he){var ue,de,Ae,Se,ce,fe,ye,ve,Pe,we,Te,Le,Ne,Me,ae,ge=ee.type;if(ee.constructor!==void 0)return null;ne.__h!=null&&(pe=ne.__h,me=ee.__e=ne.__e,ee.__h=null,ie=[me]),(ue=l$3.__b)&&ue(ee);try{e:if(typeof ge=="function"){if(ve=ee.props,Pe=(ue=ge.contextType)&&re[ue.__c],we=ue?Pe?Pe.props.value:ue.__:re,ne.__c?ye=(de=ee.__c=ne.__c).__=de.__E:("prototype"in ge&&ge.prototype.render?ee.__c=de=new ge(ve,we):(ee.__c=de=new b$1(ve,we),de.constructor=ge,de.render=B$2),Pe&&Pe.sub(de),de.props=ve,de.state||(de.state={}),de.context=we,de.__n=re,Ae=de.__d=!0,de.__h=[],de._sb=[]),de.__s==null&&(de.__s=de.state),ge.getDerivedStateFromProps!=null&&(de.__s==de.state&&(de.__s=v$1({},de.__s)),v$1(de.__s,ge.getDerivedStateFromProps(ve,de.__s))),Se=de.props,ce=de.state,de.__v=ee,Ae)ge.getDerivedStateFromProps==null&&de.componentWillMount!=null&&de.componentWillMount(),de.componentDidMount!=null&&de.__h.push(de.componentDidMount);else{if(ge.getDerivedStateFromProps==null&&ve!==Se&&de.componentWillReceiveProps!=null&&de.componentWillReceiveProps(ve,we),!de.__e&&(de.shouldComponentUpdate!=null&&de.shouldComponentUpdate(ve,de.__s,we)===!1||ee.__v===ne.__v)){for(ee.__v!==ne.__v&&(de.props=ve,de.state=de.__s,de.__d=!1),ee.__e=ne.__e,ee.__k=ne.__k,ee.__k.forEach(function($e){$e&&($e.__=ee)}),Te=0;Te<de._sb.length;Te++)de.__h.push(de._sb[Te]);de._sb=[],de.__h.length&&oe.push(de);break e}de.componentWillUpdate!=null&&de.componentWillUpdate(ve,de.__s,we),de.componentDidUpdate!=null&&de.__h.push(function(){de.componentDidUpdate(Se,ce,fe)})}if(de.context=we,de.props=ve,de.__P=te,de.__e=!1,Le=l$3.__r,Ne=0,"prototype"in ge&&ge.prototype.render){for(de.state=de.__s,de.__d=!1,Le&&Le(ee),ue=de.render(de.props,de.state,de.context),Me=0;Me<de._sb.length;Me++)de.__h.push(de._sb[Me]);de._sb=[]}else do de.__d=!1,Le&&Le(ee),ue=de.render(de.props,de.state,de.context),de.state=de.__s;while(de.__d&&++Ne<25);de.state=de.__s,de.getChildContext!=null&&(re=v$1(v$1({},re),de.getChildContext())),Ae||de.getSnapshotBeforeUpdate==null||(fe=de.getSnapshotBeforeUpdate(Se,ce)),P$2(te,h$2(ae=ue!=null&&ue.type===k$3&&ue.key==null?ue.props.children:ue)?ae:[ae],ee,ne,re,se,ie,oe,me,pe,he),de.base=ee.__e,ee.__h=null,de.__h.length&&oe.push(de),ye&&(de.__E=de.__=null)}else ie==null&&ee.__v===ne.__v?(ee.__k=ne.__k,ee.__e=ne.__e):ee.__e=N$1(ne.__e,ee,ne,re,se,ie,oe,pe,he);(ue=l$3.diffed)&&ue(ee)}catch($e){ee.__v=null,(pe||ie!=null)&&(ee.__e=me,ee.__h=!!pe,ie[ie.indexOf(me)]=null),l$3.__e($e,ee,ne)}}function M$1(te,ee,ne){for(var re=0;re<ne.length;re++)O$1(ne[re],ne[++re],ne[++re]);l$3.__c&&l$3.__c(ee,te),te.some(function(se){try{te=se.__h,se.__h=[],te.some(function(ie){ie.call(se)})}catch(ie){l$3.__e(ie,se.__v)}})}function N$1(te,ee,ne,re,se,ie,oe,me,pe){var he,ue,de,Ae=ne.props,Se=ee.props,ce=ee.type,fe=0;if(ce==="svg"&&(se=!0),ie!=null){for(;fe<ie.length;fe++)if((he=ie[fe])&&"setAttribute"in he==!!ce&&(ce?he.localName===ce:he.nodeType===3)){te=he,ie[fe]=null;break}}if(te==null){if(ce===null)return document.createTextNode(Se);te=se?document.createElementNS("http://www.w3.org/2000/svg",ce):document.createElement(ce,Se.is&&Se),ie=null,me=!1}if(ce===null)Ae===Se||me&&te.data===Se||(te.data=Se);else{if(ie=ie&&n$1.call(te.childNodes),ue=(Ae=ne.props||c$2).dangerouslySetInnerHTML,de=Se.dangerouslySetInnerHTML,!me){if(ie!=null)for(Ae={},fe=0;fe<te.attributes.length;fe++)Ae[te.attributes[fe].name]=te.attributes[fe].value;(de||ue)&&(de&&(ue&&de.__html==ue.__html||de.__html===te.innerHTML)||(te.innerHTML=de&&de.__html||""))}if(H$1(te,Se,Ae,se,me),de)ee.__k=[];else if(P$2(te,h$2(fe=ee.props.children)?fe:[fe],ee,ne,re,se&&ce!=="foreignObject",ie,oe,ie?ie[0]:ne.__k&&g$2(ne,0),me,pe),ie!=null)for(fe=ie.length;fe--;)ie[fe]!=null&&p$2(ie[fe]);me||("value"in Se&&(fe=Se.value)!==void 0&&(fe!==te.value||ce==="progress"&&!fe||ce==="option"&&fe!==Ae.value)&&T$2(te,"value",fe,Ae.value,!1),"checked"in Se&&(fe=Se.checked)!==void 0&&fe!==te.checked&&T$2(te,"checked",fe,Ae.checked,!1))}return te}function O$1(te,ee,ne){try{typeof te=="function"?te(ee):te.current=ee}catch(re){l$3.__e(re,ne)}}function q$3(te,ee,ne){var re,se;if(l$3.unmount&&l$3.unmount(te),(re=te.ref)&&(re.current&&re.current!==te.__e||O$1(re,null,ee)),(re=te.__c)!=null){if(re.componentWillUnmount)try{re.componentWillUnmount()}catch(ie){l$3.__e(ie,ee)}re.base=re.__P=null,te.__c=void 0}if(re=te.__k)for(se=0;se<re.length;se++)re[se]&&q$3(re[se],ee,ne||typeof te.type!="function");ne||te.__e==null||p$2(te.__e),te.__=te.__e=te.__d=void 0}function B$2(te,ee,ne){return this.constructor(te,ne)}function D$1(te,ee,ne){var re,se,ie,oe;l$3.__&&l$3.__(te,ee),se=(re=typeof ne=="function")?null:ne&&ne.__k||ee.__k,ie=[],oe=[],L$1(ee,te=(!re&&ne||ee).__k=y$1(k$3,null,[te]),se||c$2,c$2,ee.ownerSVGElement!==void 0,!re&&ne?[ne]:se?null:ee.firstChild?n$1.call(ee.childNodes):null,ie,!re&&ne?ne:se?se.__e:ee.firstChild,re,oe),M$1(ie,te,oe)}function E$1(te,ee){D$1(te,ee,E$1)}function F$2(te,ee,ne){var re,se,ie,oe,me=v$1({},te.props);for(ie in te.type&&te.type.defaultProps&&(oe=te.type.defaultProps),ee)ie=="key"?re=ee[ie]:ie=="ref"?se=ee[ie]:me[ie]=ee[ie]===void 0&&oe!==void 0?oe[ie]:ee[ie];return arguments.length>2&&(me.children=arguments.length>3?n$1.call(arguments,2):ne),d$1(te.type,me,re||te.key,se||te.ref,null)}function G$1(te,ee){var ne={__c:ee="__cC"+e$2++,__:te,Consumer:function(re,se){return re.children(se)},Provider:function(re){var se,ie;return this.getChildContext||(se=[],(ie={})[ee]=this,this.getChildContext=function(){return ie},this.shouldComponentUpdate=function(oe){this.props.value!==oe.value&&se.some(function(me){me.__e=!0,w$2(me)})},this.sub=function(oe){se.push(oe);var me=oe.componentWillUnmount;oe.componentWillUnmount=function(){se.splice(se.indexOf(oe),1),me&&me.call(oe)}}),re.children}};return ne.Provider.__=ne.Consumer.contextType=ne}n$1=s$2.slice,l$3={__e:function(te,ee,ne,re){for(var se,ie,oe;ee=ee.__;)if((se=ee.__c)&&!se.__)try{if((ie=se.constructor)&&ie.getDerivedStateFromError!=null&&(se.setState(ie.getDerivedStateFromError(te)),oe=se.__d),se.componentDidCatch!=null&&(se.componentDidCatch(te,re||{}),oe=se.__d),oe)return se.__E=se}catch(me){te=me}throw te}},u$3=0,b$1.prototype.setState=function(te,ee){var ne;ne=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=v$1({},this.state),typeof te=="function"&&(te=te(v$1({},ne),this.props)),te&&v$1(ne,te),te!=null&&this.__v&&(ee&&this._sb.push(ee),w$2(this))},b$1.prototype.forceUpdate=function(te){this.__v&&(this.__e=!0,te&&this.__h.push(te),w$2(this))},b$1.prototype.render=k$3,i$2=[],r$4=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$1=function(te,ee){return te.__v.__b-ee.__v.__b},x$2.__r=0,e$2=0;var t$1,r$3,u$2,i$1,o=0,f=[],c$1=[],e$1=l$3.__b,a$1=l$3.__r,v=l$3.diffed,l$2=l$3.__c,m$1=l$3.unmount;function d(te,ee){l$3.__h&&l$3.__h(r$3,te,o||ee),o=0;var ne=r$3.__H||(r$3.__H={__:[],__h:[]});return te>=ne.__.length&&ne.__.push({__V:c$1}),ne.__[te]}function h$1(te){return o=1,s$1(B$1,te)}function s$1(te,ee,ne){var re=d(t$1++,2);if(re.t=te,!re.__c&&(re.__=[ne?ne(ee):B$1(void 0,ee),function(me){var pe=re.__N?re.__N[0]:re.__[0],he=re.t(pe,me);pe!==he&&(re.__N=[he,re.__[1]],re.__c.setState({}))}],re.__c=r$3,!r$3.u)){var se=function(me,pe,he){if(!re.__c.__H)return!0;var ue=re.__c.__H.__.filter(function(Ae){return Ae.__c});if(ue.every(function(Ae){return!Ae.__N}))return!ie||ie.call(this,me,pe,he);var de=!1;return ue.forEach(function(Ae){if(Ae.__N){var Se=Ae.__[0];Ae.__=Ae.__N,Ae.__N=void 0,Se!==Ae.__[0]&&(de=!0)}}),!(!de&&re.__c.props===me)&&(!ie||ie.call(this,me,pe,he))};r$3.u=!0;var ie=r$3.shouldComponentUpdate,oe=r$3.componentWillUpdate;r$3.componentWillUpdate=function(me,pe,he){if(this.__e){var ue=ie;ie=void 0,se(me,pe,he),ie=ue}oe&&oe.call(this,me,pe,he)},r$3.shouldComponentUpdate=se}return re.__N||re.__}function p$1(te,ee){var ne=d(t$1++,3);!l$3.__s&&z$1(ne.__H,ee)&&(ne.__=te,ne.i=ee,r$3.__H.__h.push(ne))}function y(te,ee){var ne=d(t$1++,4);!l$3.__s&&z$1(ne.__H,ee)&&(ne.__=te,ne.i=ee,r$3.__h.push(ne))}function _(te){return o=5,F$1(function(){return{current:te}},[])}function A$1(te,ee,ne){o=6,y(function(){return typeof te=="function"?(te(ee()),function(){return te(null)}):te?(te.current=ee(),function(){return te.current=null}):void 0},ne==null?ne:ne.concat(te))}function F$1(te,ee){var ne=d(t$1++,7);return z$1(ne.__H,ee)?(ne.__V=te(),ne.i=ee,ne.__h=te,ne.__V):ne.__}function T$1(te,ee){return o=8,F$1(function(){return te},ee)}function q$2(te){var ee=r$3.context[te.__c],ne=d(t$1++,9);return ne.c=te,ee?(ne.__==null&&(ne.__=!0,ee.sub(r$3)),ee.props.value):te.__}function x$1(te,ee){l$3.useDebugValue&&l$3.useDebugValue(ee?ee(te):te)}function P$1(te){var ee=d(t$1++,10),ne=h$1();return ee.__=te,r$3.componentDidCatch||(r$3.componentDidCatch=function(re,se){ee.__&&ee.__(re,se),ne[1](re)}),[ne[0],function(){ne[1](void 0)}]}function V$1(){var te=d(t$1++,11);if(!te.__){for(var ee=r$3.__v;ee!==null&&!ee.__m&&ee.__!==null;)ee=ee.__;var ne=ee.__m||(ee.__m=[0,0]);te.__="P"+ne[0]+"-"+ne[1]++}return te.__}function b(){for(var te;te=f.shift();)if(te.__P&&te.__H)try{te.__H.__h.forEach(k$2),te.__H.__h.forEach(w$1),te.__H.__h=[]}catch(ee){te.__H.__h=[],l$3.__e(ee,te.__v)}}l$3.__b=function(te){r$3=null,e$1&&e$1(te)},l$3.__r=function(te){a$1&&a$1(te),t$1=0;var ee=(r$3=te.__c).__H;ee&&(u$2===r$3?(ee.__h=[],r$3.__h=[],ee.__.forEach(function(ne){ne.__N&&(ne.__=ne.__N),ne.__V=c$1,ne.__N=ne.i=void 0})):(ee.__h.forEach(k$2),ee.__h.forEach(w$1),ee.__h=[],t$1=0)),u$2=r$3},l$3.diffed=function(te){v&&v(te);var ee=te.__c;ee&&ee.__H&&(ee.__H.__h.length&&(f.push(ee)!==1&&i$1===l$3.requestAnimationFrame||((i$1=l$3.requestAnimationFrame)||j$1)(b)),ee.__H.__.forEach(function(ne){ne.i&&(ne.__H=ne.i),ne.__V!==c$1&&(ne.__=ne.__V),ne.i=void 0,ne.__V=c$1})),u$2=r$3=null},l$3.__c=function(te,ee){ee.some(function(ne){try{ne.__h.forEach(k$2),ne.__h=ne.__h.filter(function(re){return!re.__||w$1(re)})}catch(re){ee.some(function(se){se.__h&&(se.__h=[])}),ee=[],l$3.__e(re,ne.__v)}}),l$2&&l$2(te,ee)},l$3.unmount=function(te){m$1&&m$1(te);var ee,ne=te.__c;ne&&ne.__H&&(ne.__H.__.forEach(function(re){try{k$2(re)}catch(se){ee=se}}),ne.__H=void 0,ee&&l$3.__e(ee,ne.__v))};var g$1=typeof requestAnimationFrame=="function";function j$1(te){var ee,ne=function(){clearTimeout(re),g$1&&cancelAnimationFrame(ee),setTimeout(te)},re=setTimeout(ne,100);g$1&&(ee=requestAnimationFrame(ne))}function k$2(te){var ee=r$3,ne=te.__c;typeof ne=="function"&&(te.__c=void 0,ne()),r$3=ee}function w$1(te){var ee=r$3;te.__c=te.__(),r$3=ee}function z$1(te,ee){return!te||te.length!==ee.length||ee.some(function(ne,re){return ne!==te[re]})}function B$1(te,ee){return typeof ee=="function"?ee(te):ee}function g(te,ee){for(var ne in ee)te[ne]=ee[ne];return te}function C(te,ee){for(var ne in te)if(ne!=="__source"&&!(ne in ee))return!0;for(var re in ee)if(re!=="__source"&&te[re]!==ee[re])return!0;return!1}function E(te,ee){return te===ee&&(te!==0||1/te==1/ee)||te!=te&&ee!=ee}function w(te){this.props=te}function x(te,ee){function ne(se){var ie=this.props.ref,oe=ie==se.ref;return!oe&&ie&&(ie.call?ie(null):ie.current=null),ee?!ee(this.props,se)||!oe:C(this.props,se)}function re(se){return this.shouldComponentUpdate=ne,y$1(te,se)}return re.displayName="Memo("+(te.displayName||te.name)+")",re.prototype.isReactComponent=!0,re.__f=!0,re}(w.prototype=new b$1).isPureReactComponent=!0,w.prototype.shouldComponentUpdate=function(te,ee){return C(this.props,te)||C(this.state,ee)};var R=l$3.__b;l$3.__b=function(te){te.type&&te.type.__f&&te.ref&&(te.props.ref=te.ref,te.ref=null),R&&R(te)};var N=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function k$1(te){function ee(ne){var re=g({},ne);return delete re.ref,te(re,ne.ref||null)}return ee.$$typeof=N,ee.render=ee,ee.prototype.isReactComponent=ee.__f=!0,ee.displayName="ForwardRef("+(te.displayName||te.name)+")",ee}var A=function(te,ee){return te==null?null:S(S(te).map(ee))},O={map:A,forEach:A,count:function(te){return te?S(te).length:0},only:function(te){var ee=S(te);if(ee.length!==1)throw"Children.only";return ee[0]},toArray:S},T=l$3.__e;l$3.__e=function(te,ee,ne,re){if(te.then){for(var se,ie=ee;ie=ie.__;)if((se=ie.__c)&&se.__c)return ee.__e==null&&(ee.__e=ne.__e,ee.__k=ne.__k),se.__c(te,ee)}T(te,ee,ne,re)};var I=l$3.unmount;function L(te,ee,ne){return te&&(te.__c&&te.__c.__H&&(te.__c.__H.__.forEach(function(re){typeof re.__c=="function"&&re.__c()}),te.__c.__H=null),(te=g({},te)).__c!=null&&(te.__c.__P===ne&&(te.__c.__P=ee),te.__c=null),te.__k=te.__k&&te.__k.map(function(re){return L(re,ee,ne)})),te}function U(te,ee,ne){return te&&(te.__v=null,te.__k=te.__k&&te.__k.map(function(re){return U(re,ee,ne)}),te.__c&&te.__c.__P===ee&&(te.__e&&ne.insertBefore(te.__e,te.__d),te.__c.__e=!0,te.__c.__P=ne)),te}function D(){this.__u=0,this.t=null,this.__b=null}function F(te){var ee=te.__.__c;return ee&&ee.__a&&ee.__a(te)}function M(te){var ee,ne,re;function se(ie){if(ee||(ee=te()).then(function(oe){ne=oe.default||oe},function(oe){re=oe}),re)throw re;if(!ne)throw ee;return y$1(ne,ie)}return se.displayName="Lazy",se.__f=!0,se}function V(){this.u=null,this.o=null}l$3.unmount=function(te){var ee=te.__c;ee&&ee.__R&&ee.__R(),ee&&te.__h===!0&&(te.type=null),I&&I(te)},(D.prototype=new b$1).__c=function(te,ee){var ne=ee.__c,re=this;re.t==null&&(re.t=[]),re.t.push(ne);var se=F(re.__v),ie=!1,oe=function(){ie||(ie=!0,ne.__R=null,se?se(me):me())};ne.__R=oe;var me=function(){if(!--re.__u){if(re.state.__a){var he=re.state.__a;re.__v.__k[0]=U(he,he.__c.__P,he.__c.__O)}var ue;for(re.setState({__a:re.__b=null});ue=re.t.pop();)ue.forceUpdate()}},pe=ee.__h===!0;re.__u++||pe||re.setState({__a:re.__b=re.__v.__k[0]}),te.then(oe,oe)},D.prototype.componentWillUnmount=function(){this.t=[]},D.prototype.render=function(te,ee){if(this.__b){if(this.__v.__k){var ne=document.createElement("div"),re=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,ne,re.__O=re.__P)}this.__b=null}var se=ee.__a&&y$1(k$3,null,te.fallback);return se&&(se.__h=null),[y$1(k$3,null,ee.__a?null:te.children),se]};var W=function(te,ee,ne){if(++ne[1]===ne[0]&&te.o.delete(ee),te.props.revealOrder&&(te.props.revealOrder[0]!=="t"||!te.o.size))for(ne=te.u;ne;){for(;ne.length>3;)ne.pop()();if(ne[1]<ne[0])break;te.u=ne=ne[2]}};function P(te){return this.getChildContext=function(){return te.context},te.children}function j(te){var ee=this,ne=te.i;ee.componentWillUnmount=function(){D$1(null,ee.l),ee.l=null,ee.i=null},ee.i&&ee.i!==ne&&ee.componentWillUnmount(),te.__v?(ee.l||(ee.i=ne,ee.l={nodeType:1,parentNode:ne,childNodes:[],appendChild:function(re){this.childNodes.push(re),ee.i.appendChild(re)},insertBefore:function(re,se){this.childNodes.push(re),ee.i.appendChild(re)},removeChild:function(re){this.childNodes.splice(this.childNodes.indexOf(re)>>>1,1),ee.i.removeChild(re)}}),D$1(y$1(P,{context:ee.context},te.__v),ee.l)):ee.l&&ee.componentWillUnmount()}function z(te,ee){var ne=y$1(j,{__v:te,i:ee});return ne.containerInfo=ee,ne}(V.prototype=new b$1).__a=function(te){var ee=this,ne=F(ee.__v),re=ee.o.get(te);return re[0]++,function(se){var ie=function(){ee.props.revealOrder?(re.push(se),W(ee,te,re)):se()};ne?ne(ie):ie()}},V.prototype.render=function(te){this.u=null,this.o=new Map;var ee=S(te.children);te.revealOrder&&te.revealOrder[0]==="b"&&ee.reverse();for(var ne=ee.length;ne--;)this.o.set(ee[ne],this.u=[1,0,this.u]);return te.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var te=this;this.o.forEach(function(ee,ne){W(te,ne,ee)})};var B=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,H=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Z=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Y=/[A-Z0-9]/g,$=typeof document<"u",q$1=function(te){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(te)};function G(te,ee,ne){return ee.__k==null&&(ee.textContent=""),D$1(te,ee),typeof ne=="function"&&ne(),te?te.__c:null}function J(te,ee,ne){return E$1(te,ee),typeof ne=="function"&&ne(),te?te.__c:null}b$1.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(te){Object.defineProperty(b$1.prototype,te,{configurable:!0,get:function(){return this["UNSAFE_"+te]},set:function(ee){Object.defineProperty(this,te,{configurable:!0,writable:!0,value:ee})}})});var K=l$3.event;function Q(){}function X(){return this.cancelBubble}function nn(){return this.defaultPrevented}l$3.event=function(te){return K&&(te=K(te)),te.persist=Q,te.isPropagationStopped=X,te.isDefaultPrevented=nn,te.nativeEvent=te};var tn,en={enumerable:!1,configurable:!0,get:function(){return this.class}},rn=l$3.vnode;l$3.vnode=function(te){typeof te.type=="string"&&function(ee){var ne=ee.props,re=ee.type,se={};for(var ie in ne){var oe=ne[ie];if(!(ie==="value"&&"defaultValue"in ne&&oe==null||$&&ie==="children"&&re==="noscript"||ie==="class"||ie==="className")){var me=ie.toLowerCase();ie==="defaultValue"&&"value"in ne&&ne.value==null?ie="value":ie==="download"&&oe===!0?oe="":me==="ondoubleclick"?ie="ondblclick":me!=="onchange"||re!=="input"&&re!=="textarea"||q$1(ne.type)?me==="onfocus"?ie="onfocusin":me==="onblur"?ie="onfocusout":Z.test(ie)?ie=me:re.indexOf("-")===-1&&H.test(ie)?ie=ie.replace(Y,"-$&").toLowerCase():oe===null&&(oe=void 0):me=ie="oninput",me==="oninput"&&se[ie=me]&&(ie="oninputCapture"),se[ie]=oe}}re=="select"&&se.multiple&&Array.isArray(se.value)&&(se.value=S(ne.children).forEach(function(pe){pe.props.selected=se.value.indexOf(pe.props.value)!=-1})),re=="select"&&se.defaultValue!=null&&(se.value=S(ne.children).forEach(function(pe){pe.props.selected=se.multiple?se.defaultValue.indexOf(pe.props.value)!=-1:se.defaultValue==pe.props.value})),ne.class&&!ne.className?(se.class=ne.class,Object.defineProperty(se,"className",en)):(ne.className&&!ne.class||ne.class&&ne.className)&&(se.class=se.className=ne.className),ee.props=se}(te),te.$$typeof=B,rn&&rn(te)};var un=l$3.__r;l$3.__r=function(te){un&&un(te),tn=te.__c};var on=l$3.diffed;l$3.diffed=function(te){on&&on(te);var ee=te.props,ne=te.__e;ne!=null&&te.type==="textarea"&&"value"in ee&&ee.value!==ne.value&&(ne.value=ee.value==null?"":ee.value),tn=null};var ln={ReactCurrentDispatcher:{current:{readContext:function(te){return tn.__n[te.__c].props.value}}}},cn="17.0.2";function fn(te){return y$1.bind(null,te)}function an(te){return!!te&&te.$$typeof===B}function sn(te){return an(te)?F$2.apply(null,arguments):te}function hn(te){return!!te.__k&&(D$1(null,te),!0)}function vn(te){return te&&(te.base||te.nodeType===1&&te)||null}var dn=function(te,ee){return te(ee)},pn=function(te,ee){return te(ee)},mn=k$3;function yn(te){te()}function _n(te){return te}function bn(){return[!1,yn]}var Sn=y;function gn(te,ee){var ne=ee(),re=h$1({h:{__:ne,v:ee}}),se=re[0].h,ie=re[1];return y(function(){se.__=ne,se.v=ee,E(se.__,ee())||ie({h:se})},[te,ne,ee]),p$1(function(){return E(se.__,se.v())||ie({h:se}),te(function(){E(se.__,se.v())||ie({h:se})})},[te]),ne}var Cn={useState:h$1,useId:V$1,useReducer:s$1,useEffect:p$1,useLayoutEffect:y,useInsertionEffect:Sn,useTransition:bn,useDeferredValue:_n,useSyncExternalStore:gn,startTransition:yn,useRef:_,useImperativeHandle:A$1,useMemo:F$1,useCallback:T$1,useContext:q$2,useDebugValue:x$1,version:"17.0.2",Children:O,render:G,hydrate:J,unmountComponentAtNode:hn,createPortal:z,createElement:y$1,createContext:G$1,createFactory:fn,cloneElement:sn,createRef:_$1,Fragment:k$3,isValidElement:an,findDOMNode:vn,Component:b$1,PureComponent:w,memo:x,forwardRef:k$1,flushSync:pn,unstable_batchedUpdates:dn,StrictMode:mn,Suspense:D,SuspenseList:V,lazy:M,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ln};const compat_module=Object.freeze(Object.defineProperty({__proto__:null,Children:O,Component:b$1,Fragment:k$3,PureComponent:w,StrictMode:mn,Suspense:D,SuspenseList:V,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ln,cloneElement:sn,createContext:G$1,createElement:y$1,createFactory:fn,createPortal:z,createRef:_$1,default:Cn,findDOMNode:vn,flushSync:pn,forwardRef:k$1,hydrate:J,isValidElement:an,lazy:M,memo:x,render:G,startTransition:yn,unmountComponentAtNode:hn,unstable_batchedUpdates:dn,useCallback:T$1,useContext:q$2,useDebugValue:x$1,useDeferredValue:_n,useEffect:p$1,useErrorBoundary:P$1,useId:V$1,useImperativeHandle:A$1,useInsertionEffect:Sn,useLayoutEffect:y,useMemo:F$1,useReducer:s$1,useRef:_,useState:h$1,useSyncExternalStore:gn,useTransition:bn,version:cn},Symbol.toStringTag,{value:"Module"}));function isArrayLike(te){return Array.isArray(te)||ArrayBuffer.isView(te)}function isEnumerable(te){return te!=null&&typeof te.GetEnumerator=="function"}function isComparable(te){return te!=null&&typeof te.CompareTo=="function"}function isEquatable(te){return te!=null&&typeof te.Equals=="function"}function isHashable(te){return te!=null&&typeof te.GetHashCode=="function"}function isDisposable(te){return te!=null&&typeof te.Dispose=="function"}function disposeSafe(te){isDisposable(te)&&te.Dispose()}function defaultOf(){return null}function sameConstructor(te,ee){var ne,re;return((ne=Object.getPrototypeOf(te))==null?void 0:ne.constructor)===((re=Object.getPrototypeOf(ee))==null?void 0:re.constructor)}class Enumerator{constructor(ee){this.iter=ee,this.current=defaultOf()}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const ee=this.iter.next();return this.current=ee.value,!ee.done}"System.Collections.IEnumerator.Reset"(){throw new Error("JS iterators cannot be reset")}Dispose(){}}function getEnumerator(te){return isEnumerable(te)?te.GetEnumerator():new Enumerator(te[Symbol.iterator]())}function toIterator(te){return{next(){const ee=te["System.Collections.IEnumerator.MoveNext"](),ne=ee?te["System.Collections.Generic.IEnumerator`1.get_Current"]():void 0;return{done:!ee,value:ne}}}}class Lazy{constructor(ee){this.factory=ee,this.isValueCreated=!1}get Value(){return this.isValueCreated||(this.createdValue=this.factory(),this.isValueCreated=!0),this.createdValue}get IsValueCreated(){return this.isValueCreated}}function padWithZeros(te,ee){let ne=te.toString(10);for(;ne.length<ee;)ne="0"+ne;return ne}function padLeftAndRightWithZeros(te,ee,ne){let re=te.toString(10);for(;re.length<ee;)re="0"+re;for(;re.length<ne;)re=re+"0";return re}function dateOffset(te){const ee=te;return typeof ee.offset=="number"?ee.offset:te.kind===1?0:te.getTimezoneOffset()*-6e4}function int16ToString(te,ee){return te=te<0&&ee!=null&&ee!==10?65535+te+1:te,te.toString(ee)}function int32ToString(te,ee){return te=te<0&&ee!=null&&ee!==10?4294967295+te+1:te,te.toString(ee)}class ObjectRef{static id(ee){return ObjectRef.idMap.has(ee)||ObjectRef.idMap.set(ee,++ObjectRef.count),ObjectRef.idMap.get(ee)}}ObjectRef.idMap=new WeakMap;ObjectRef.count=0;function stringHash(te){let ee=0,ne=5381;const re=te.length;for(;ee<re;)ne=ne*33^te.charCodeAt(ee++);return ne}function numberHash(te){return te*2654435761|0}function bigintHash(te){return stringHash(te.toString(32))}function combineHashCodes(te){let ee=0;const ne=te.length;for(let re=0;re<ne;re++){const se=te[re];ee=(ee<<5)+ee^se}return ee}function dateHash(te){return te.getTime()}function arrayHash(te){const ee=te.length,ne=new Array(ee);for(let re=0;re<ee;re++)ne[re]=structuralHash(te[re]);return combineHashCodes(ne)}function structuralHash(te){var ee;if(te==null)return 0;switch(typeof te){case"boolean":return te?1:0;case"number":return numberHash(te);case"bigint":return bigintHash(te);case"string":return stringHash(te);default:{if(isHashable(te))return te.GetHashCode();if(isArrayLike(te))return arrayHash(te);if(te instanceof Date)return dateHash(te);if(((ee=Object.getPrototypeOf(te))==null?void 0:ee.constructor)===Object){const ne=Object.values(te).map(re=>structuralHash(re));return combineHashCodes(ne)}else return numberHash(ObjectRef.id(te))}}}function equalArraysWith(te,ee,ne){if(te==null)return ee==null;if(ee==null||te.length!==ee.length)return!1;for(let re=0;re<te.length;re++)if(!ne(te[re],ee[re]))return!1;return!0}function equalArrays(te,ee){return equalArraysWith(te,ee,equals$1)}function equalObjects(te,ee){const ne=Object.keys(te),re=Object.keys(ee);if(ne.length!==re.length)return!1;ne.sort(),re.sort();for(let se=0;se<ne.length;se++)if(ne[se]!==re[se]||!equals$1(te[ne[se]],ee[re[se]]))return!1;return!0}function equals$1(te,ee){var ne;return te===ee?!0:te==null?ee==null:ee==null?!1:isEquatable(te)?te.Equals(ee):isArrayLike(te)?isArrayLike(ee)&&equalArrays(te,ee):typeof te!="object"?!1:te instanceof Date?ee instanceof Date&&compareDates(te,ee)===0:((ne=Object.getPrototypeOf(te))==null?void 0:ne.constructor)===Object&&equalObjects(te,ee)}function compareDates(te,ee){let ne,re;return"offset"in te&&"offset"in ee?(ne=te.getTime(),re=ee.getTime()):(ne=te.getTime()+dateOffset(te),re=ee.getTime()+dateOffset(ee)),ne===re?0:ne<re?-1:1}function comparePrimitives(te,ee){return te===ee?0:te<ee?-1:1}function compareArraysWith(te,ee,ne){if(te==null)return ee==null?0:1;if(ee==null)return-1;if(te.length!==ee.length)return te.length<ee.length?-1:1;for(let re=0,se=0;re<te.length;re++)if(se=ne(te[re],ee[re]),se!==0)return se;return 0}function compareArrays(te,ee){return compareArraysWith(te,ee,compare$1)}function compareObjects(te,ee){const ne=Object.keys(te),re=Object.keys(ee);if(ne.length!==re.length)return ne.length<re.length?-1:1;ne.sort(),re.sort();for(let se=0,ie=0;se<ne.length;se++){const oe=ne[se];if(oe!==re[se])return oe<re[se]?-1:1;if(ie=compare$1(te[oe],ee[oe]),ie!==0)return ie}return 0}function compare$1(te,ee){var ne;return te===ee?0:te==null?ee==null?0:-1:ee==null?1:isComparable(te)?te.CompareTo(ee):isArrayLike(te)?isArrayLike(ee)?compareArrays(te,ee):-1:typeof te!="object"?te<ee?-1:1:te instanceof Date?ee instanceof Date?compareDates(te,ee):-1:((ne=Object.getPrototypeOf(te))==null?void 0:ne.constructor)===Object?compareObjects(te,ee):-1}function createObj(te){const ee={};for(const ne of te)ee[ne[0]]=ne[1];return ee}function clear(te){isArrayLike(te)?te.splice(0):te.clear()}const curried=new WeakMap;function uncurry2(te){if(te==null)return null;const ee=(ne,re)=>te(ne)(re);return curried.set(ee,te),ee}function curry2(te){return curried.get(te)??(ee=>ne=>te(ee,ne))}function uncurry3(te){if(te==null)return null;const ee=(ne,re,se)=>te(ne)(re)(se);return curried.set(ee,te),ee}function curry3(te){return curried.get(te)??(ee=>ne=>re=>te(ee,ne,re))}function seqToString(te){let ee=0,ne="[";for(const re of te){if(ee===0)ne+=toString$3(re);else if(ee===100){ne+="; ...";break}else ne+="; "+toString$3(re);ee++}return ne+"]"}function toString$3(te,ee=0){var ne;if(te!=null&&typeof te=="object"){if(typeof te.toString=="function")return te.toString();if(Symbol.iterator in te)return seqToString(te);{const re=(ne=Object.getPrototypeOf(te))==null?void 0:ne.constructor;return re===Object&&ee<10?"{ "+Object.entries(te).map(([se,ie])=>se+" = "+toString$3(ie,ee+1)).join(`
|
|
2
|
+
`)+" }":(re==null?void 0:re.name)??""}}return String(te)}function unionToString(te,ee){if(ee.length===0)return te;{let ne,re=!0;return ee.length===1?(ne=toString$3(ee[0]),re=ne.indexOf(" ")>=0):ne=ee.map(se=>toString$3(se)).join(", "),te+(re?" (":" ")+ne+(re?")":"")}}class Union{get name(){return this.cases()[this.tag]}toJSON(){return this.fields.length===0?this.name:[this.name].concat(this.fields)}toString(){return unionToString(this.name,this.fields)}GetHashCode(){const ee=this.fields.map(ne=>structuralHash(ne));return ee.splice(0,0,numberHash(this.tag)),combineHashCodes(ee)}Equals(ee){return this===ee?!0:sameConstructor(this,ee)&&this.tag===ee.tag?equalArrays(this.fields,ee.fields):!1}CompareTo(ee){return this===ee?0:sameConstructor(this,ee)?this.tag===ee.tag?compareArrays(this.fields,ee.fields):this.tag<ee.tag?-1:1:-1}}function recordToJSON(te){const ee={},ne=Object.keys(te);for(let re=0;re<ne.length;re++)ee[ne[re]]=te[ne[re]];return ee}function recordToString(te){return"{ "+Object.entries(te).map(([ee,ne])=>ee+" = "+toString$3(ne)).join(`
|
|
3
|
+
`)+" }"}function recordGetHashCode(te){const ee=Object.values(te).map(ne=>structuralHash(ne));return combineHashCodes(ee)}function recordEquals(te,ee){if(te===ee)return!0;if(sameConstructor(te,ee)){const ne=Object.keys(te);for(let re=0;re<ne.length;re++)if(!equals$1(te[ne[re]],ee[ne[re]]))return!1;return!0}else return!1}function recordCompareTo(te,ee){if(te===ee)return 0;if(sameConstructor(te,ee)){const ne=Object.keys(te);for(let re=0;re<ne.length;re++){const se=compare$1(te[ne[re]],ee[ne[re]]);if(se!==0)return se}return 0}else return-1}class Record{toJSON(){return recordToJSON(this)}toString(){return recordToString(this)}GetHashCode(){return recordGetHashCode(this)}Equals(ee){return recordEquals(this,ee)}CompareTo(ee){return recordCompareTo(this,ee)}}class FSharpRef{get contents(){return this.getter()}set contents(ee){this.setter(ee)}constructor(ee,ne){typeof ne=="function"?(this.getter=ee,this.setter=ne):(this.getter=()=>ee,this.setter=re=>{ee=re})}}class Exception{constructor(ee){this.message=ee}}function isException(te){return te instanceof Exception||te instanceof Error}function isPromise(te){return te instanceof Promise}function ensureErrorOrException(te){return isException(te)||isPromise(te)?te:new Error(String(te))}const symbol=Symbol("numeric");function isNumeric(te){return typeof te=="number"||typeof te=="bigint"||(te==null?void 0:te[symbol])}function compare(te,ee){return typeof te=="number"||typeof te=="bigint"?te<ee?-1:te>ee?1:0:te.CompareTo(ee)}function multiply(te,ee){return typeof te=="number"?te*ee:typeof te=="bigint"?te*BigInt(ee):te[symbol]().multiply(ee)}function toFixed(te,ee){return typeof te=="number"?te.toFixed(ee):typeof te=="bigint"?te:te[symbol]().toFixed(ee)}function toPrecision(te,ee){return typeof te=="number"?te.toPrecision(ee):typeof te=="bigint"?te:te[symbol]().toPrecision(ee)}function toExponential(te,ee){return typeof te=="number"?te.toExponential(ee):typeof te=="bigint"?te:te[symbol]().toExponential(ee)}function toHex(te){return typeof te=="number"?(Number(te)>>>0).toString(16):typeof te=="bigint"?BigInt.asUintN(64,te).toString(16):te[symbol]().toHex()}class CaseInfo{constructor(ee,ne,re,se){this.declaringType=ee,this.tag=ne,this.name=re,this.fields=se}}class TypeInfo{constructor(ee,ne,re,se,ie,oe,me){this.fullname=ee,this.generics=ne,this.construct=re,this.parent=se,this.fields=ie,this.cases=oe,this.enumCases=me}toString(){return fullName(this)}GetHashCode(){return getHashCode(this)}Equals(ee){return equals(this,ee)}}function getGenerics(te){return te.generics!=null?te.generics:[]}function getHashCode(te){const ee=stringHash(te.fullname),ne=getGenerics(te).map(getHashCode);return combineHashCodes([ee,...ne])}function equals(te,ee){return te.fullname===""?ee.fullname===""&&equalArraysWith(getRecordElements(te),getRecordElements(ee),([ne,re],[se,ie])=>ne===se&&equals(re,ie)):te.fullname===ee.fullname&&equalArraysWith(getGenerics(te),getGenerics(ee),equals)}function class_type(te,ee,ne,re){return new TypeInfo(te,ee,ne,re)}function record_type(te,ee,ne,re){return new TypeInfo(te,ee,ne,void 0,re)}function anonRecord_type(...te){return new TypeInfo("",void 0,void 0,void 0,()=>te)}function union_type(te,ee,ne,re){const se=new TypeInfo(te,ee,ne,void 0,void 0,()=>{const ie=ne.prototype.cases();return re().map((oe,me)=>new CaseInfo(se,me,ie[me],oe))});return se}function list_type(te){return new TypeInfo("Microsoft.FSharp.Collections.FSharpList`1",[te])}const obj_type=new TypeInfo("System.Object"),string_type=new TypeInfo("System.String"),int32_type=new TypeInfo("System.Int32");function name(te){if(Array.isArray(te))return te[0];if(te instanceof TypeInfo){const ee=getElementType(te);if(ee!=null)return name(ee)+"[]";{const ne=te.fullname.lastIndexOf(".");return ne===-1?te.fullname:te.fullname.substr(ne+1)}}else return te.name}function fullName(te){const ee=getElementType(te);return ee!=null?fullName(ee)+"[]":te.generics==null||te.generics.length===0?te.fullname:te.fullname+"["+te.generics.map(ne=>fullName(ne)).join(",")+"]"}function isArray(te){return getElementType(te)!=null}function getElementType(te){var ee;return te.fullname==="[]"&&((ee=te.generics)==null?void 0:ee.length)===1?te.generics[0]:void 0}function isGenericType(te){return te.generics!=null&&te.generics.length>0}function isEnum(te){return te.enumCases!=null&&te.enumCases.length>0}function getGenericTypeDefinition(te){return te.generics==null?te:new TypeInfo(te.fullname,te.generics.map(()=>obj_type))}function getEnumUnderlyingType(te){var ee;return(ee=te.generics)==null?void 0:ee[0]}function getEnumValues(te){if(isEnum(te)&&te.enumCases!=null)return te.enumCases.map(ee=>ee[1]);throw new Error(`${te.fullname} is not an enum type`)}function getEnumCase(te,ee){if(te.enumCases!=null)if(typeof ee=="string"){for(const ne of te.enumCases)if(ne[0]===ee)return ne;throw new Error(`'${ee}' was not found in ${te.fullname}`)}else{for(const ne of te.enumCases)if(ne[1]===ee)return ne;return["",ee]}else throw new Error(`${te.fullname} is not an enum type`)}function parseEnum(te,ee){const ne=parseInt(ee,10);return getEnumCase(te,isNaN(ne)?ee:ne)[1]}function getUnionCases(te){if(te.cases!=null)return te.cases();throw new Error(`${te.fullname} is not an F# union type`)}function getRecordElements(te){if(te.fields!=null)return te.fields();throw new Error(`${te.fullname} is not an F# record type`)}function getTupleElements(te){if(isTuple(te)&&te.generics!=null)return te.generics;throw new Error(`${te.fullname} is not a tuple type`)}function isUnion(te){return te instanceof TypeInfo?te.cases!=null:te instanceof Union}function isRecord(te){return te instanceof TypeInfo?te.fields!=null:te instanceof Record}function isTuple(te){return te.fullname.startsWith("System.Tuple")}function getUnionFields(te,ee){const re=getUnionCases(ee)[te.tag];if(re==null)throw new Error(`Cannot find case ${te.name} in union type`);return[re,te.fields]}function getUnionCaseFields(te){return te.fields==null?[]:te.fields}function getRecordField(te,ee){return te[ee[0]]}function getTupleFields(te){return te}function makeUnion$1(te,ee){const ne=(te.fields||[]).length;if(ee.length!==ne)throw new Error(`Expected an array of length ${ne} but got ${ee.length}`);const re=te.declaringType.construct;return re==null?{}:(te.declaringType.cases?te.declaringType.cases().length==1:!1)?new re(...ee):new re(te.tag,ee)}function makeRecord(te,ee){const ne=getRecordElements(te);if(ne.length!==ee.length)throw new Error(`Expected an array of length ${ne.length} but got ${ee.length}`);return te.construct!=null?new te.construct(...ee):ne.reduce((re,[se,ie],oe)=>(re[se]=ee[oe],re),{})}function makeTuple(te,ee){return te}class CancellationToken{constructor(ee=!1){this._id=0,this._cancelled=ee,this._listeners=new Map}get isCancelled(){return this._cancelled}cancel(){if(!this._cancelled){this._cancelled=!0;for(const[,ee]of this._listeners)ee()}}addListener(ee){const ne=this._id;return this._listeners.set(this._id++,ee),ne}removeListener(ee){return this._listeners.delete(ee)}register(ee,ne){const re=this,se=this.addListener(ne==null?ee:()=>ee(ne));return{Dispose(){re.removeListener(se)}}}Dispose(){}}class OperationCanceledError extends Error{constructor(){super("The operation was canceled"),Object.setPrototypeOf(this,OperationCanceledError.prototype)}}class Trampoline{static get maxTrampolineCallCount(){return 2e3}constructor(){this.callCount=0}incrementAndCheck(){return this.callCount++>Trampoline.maxTrampolineCallCount}hijack(ee){this.callCount=0,setTimeout(ee,0)}}function protectedCont(te){return ee=>{if(ee.cancelToken.isCancelled)ee.onCancel(new OperationCanceledError);else if(ee.trampoline.incrementAndCheck())ee.trampoline.hijack(()=>{try{te(ee)}catch(ne){ee.onError(ensureErrorOrException(ne))}});else try{te(ee)}catch(ne){ee.onError(ensureErrorOrException(ne))}}}function protectedBind(te,ee){return protectedCont(ne=>{te({onSuccess:re=>{try{ee(re)(ne)}catch(se){ne.onError(ensureErrorOrException(se))}},onError:ne.onError,onCancel:ne.onCancel,cancelToken:ne.cancelToken,trampoline:ne.trampoline})})}function protectedReturn(te){return protectedCont(ee=>ee.onSuccess(te))}class AsyncBuilder{Bind(ee,ne){return protectedBind(ee,ne)}Combine(ee,ne){return this.Bind(ee,()=>ne)}Delay(ee){return protectedCont(ne=>ee()(ne))}For(ee,ne){const re=ee[Symbol.iterator]();let se=re.next();return this.While(()=>!se.done,this.Delay(()=>{const ie=ne(se.value);return se=re.next(),ie}))}Return(ee){return protectedReturn(ee)}ReturnFrom(ee){return ee}TryFinally(ee,ne){return protectedCont(re=>{ee({onSuccess:se=>{ne(),re.onSuccess(se)},onError:se=>{ne(),re.onError(se)},onCancel:se=>{ne(),re.onCancel(se)},cancelToken:re.cancelToken,trampoline:re.trampoline})})}TryWith(ee,ne){return protectedCont(re=>{ee({onSuccess:re.onSuccess,onCancel:re.onCancel,cancelToken:re.cancelToken,trampoline:re.trampoline,onError:se=>{try{ne(se)(re)}catch(ie){re.onError(ensureErrorOrException(ie))}}})})}Using(ee,ne){return this.TryFinally(ne(ee),()=>ee.Dispose())}While(ee,ne){return ee()?this.Bind(ne,()=>this.While(ee,ne)):this.Return(void 0)}Zero(){return protectedCont(ee=>ee.onSuccess(void 0))}}const singleton$3=new AsyncBuilder;class Some{constructor(ee){this.value=ee}toJSON(){return this.value}toString(){return String(this.value)}GetHashCode(){return structuralHash(this.value)}Equals(ee){return ee==null?!1:equals$1(this.value,ee instanceof Some?ee.value:ee)}CompareTo(ee){return ee==null?1:compare$1(this.value,ee instanceof Some?ee.value:ee)}}function value(te){if(te==null)throw new Error("Option has no value");return te instanceof Some?te.value:te}function some(te){return te==null||te instanceof Some?new Some(te):te}function defaultArg(te,ee){return te!=null?value(te):ee}function defaultArgWith(te,ee){return te!=null?value(te):ee()}function map$5(te,ee){return ee!=null?some(te(value(ee))):void 0}function FSharpResult$2_Ok(te){return new FSharpResult$2(0,[te])}function FSharpResult$2_Error(te){return new FSharpResult$2(1,[te])}class FSharpResult$2 extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["Ok","Error"]}}function Result_Map(te,ee){return ee.tag===0?FSharpResult$2_Ok(te(ee.fields[0])):FSharpResult$2_Error(ee.fields[0])}function Result_Bind(te,ee){return ee.tag===0?te(ee.fields[0]):FSharpResult$2_Error(ee.fields[0])}function FSharpChoice$2_Choice1Of2(te){return new FSharpChoice$2(0,[te])}function FSharpChoice$2_Choice2Of2(te){return new FSharpChoice$2(1,[te])}class FSharpChoice$2 extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["Choice1Of2","Choice2Of2"]}}function Choice_makeChoice1Of2(te){return FSharpChoice$2_Choice1Of2(te)}function Choice_makeChoice2Of2(te){return FSharpChoice$2_Choice2Of2(te)}function emptyContinuation(te){}const defaultCancellationToken=new CancellationToken;function catchAsync(te){return protectedCont(ee=>{te({onSuccess:ne=>ee.onSuccess(Choice_makeChoice1Of2(ne)),onError:ne=>ee.onSuccess(Choice_makeChoice2Of2(ne)),onCancel:ee.onCancel,cancelToken:ee.cancelToken,trampoline:ee.trampoline})})}function fromContinuations(te){return protectedCont(ee=>te([ee.onSuccess,ee.onError,ee.onCancel]))}function start(te,ee){return startWithContinuations(te,ee)}function startImmediate(te,ee){return start(te,ee)}function startWithContinuations(te,ee,ne,re,se){typeof ee!="function"&&(se=ee,ee=void 0);const ie=new Trampoline;te({onSuccess:ee||emptyContinuation,onError:ne||emptyContinuation,onCancel:re||emptyContinuation,cancelToken:se||defaultCancellationToken,trampoline:ie})}class HttpMethod extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]}}class Header extends Union{constructor(ee,ne){super(),this.tag=0,this.fields=[ee,ne]}cases(){return["Header"]}}class BodyContent extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["Empty","Text","Binary","Form"]}}class HttpRequest extends Record{constructor(ee,ne,re,se,ie,oe,me,pe){super(),this.url=ee,this.method=ne,this.headers=re,this.withCredentials=se,this.overridenMimeType=ie,this.overridenResponseType=oe,this.timeout=me,this.content=pe}}class ResponseContent extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["Text","Blob","ArrayBuffer","Unknown"]}}class HttpResponse extends Record{constructor(ee,ne,re,se,ie,oe){super(),this.statusCode=ee|0,this.responseText=ne,this.responseType=re,this.responseUrl=se,this.responseHeaders=ie,this.content=oe}}function dateOffsetToString(te){const ee=te<0;te=Math.abs(te);const ne=~~(te/36e5),re=te%36e5/6e4;return(ee?"-":"+")+padWithZeros(ne,2)+":"+padWithZeros(re,2)}function dateToHalfUTCString(te,ee){const ne=te.toISOString();return ee==="first"?ne.substring(0,ne.indexOf("T")):ne.substring(ne.indexOf("T")+1,ne.length-1)}function dateToISOString(te,ee){if(ee)return te.toISOString();{const ne=te.kind==null?!0:te.kind===2;return padWithZeros(te.getFullYear(),4)+"-"+padWithZeros(te.getMonth()+1,2)+"-"+padWithZeros(te.getDate(),2)+"T"+padWithZeros(te.getHours(),2)+":"+padWithZeros(te.getMinutes(),2)+":"+padWithZeros(te.getSeconds(),2)+"."+padWithZeros(te.getMilliseconds(),3)+(ne?dateOffsetToString(te.getTimezoneOffset()*-6e4):"")}}function dateToISOStringWithOffset(te,ee){const ne=te.toISOString();return ne.substring(0,ne.length-1)+dateOffsetToString(ee)}function dateToStringWithCustomFormat(te,ee,ne){return ee.replace(/(\w)\1*/g,re=>{let se=Number.NaN;switch(re.substring(0,1)){case"y":const ie=ne?te.getUTCFullYear():te.getFullYear();se=re.length<4?ie%100:ie;break;case"M":se=(ne?te.getUTCMonth():te.getMonth())+1;break;case"d":se=ne?te.getUTCDate():te.getDate();break;case"H":se=ne?te.getUTCHours():te.getHours();break;case"h":const oe=ne?te.getUTCHours():te.getHours();se=oe>12?oe%12:oe;break;case"m":se=ne?te.getUTCMinutes():te.getMinutes();break;case"s":se=ne?te.getUTCSeconds():te.getSeconds();break;case"f":se=ne?te.getUTCMilliseconds():te.getMilliseconds();break}return Number.isNaN(se)?re:padWithZeros(se,re.length)})}function dateToStringWithOffset(te,ee){const ne=new Date(te.getTime()+(te.offset??0));if(typeof ee!="string")return ne.toISOString().replace(/\.\d+/,"").replace(/[A-Z]|\.\d+/g," ")+dateOffsetToString(te.offset??0);if(ee.length===1)switch(ee){case"D":case"d":return dateToHalfUTCString(ne,"first");case"T":case"t":return dateToHalfUTCString(ne,"second");case"O":case"o":return dateToISOStringWithOffset(ne,te.offset??0);default:throw new Error("Unrecognized Date print format")}else return dateToStringWithCustomFormat(ne,ee,!0)}function dateToStringWithKind(te,ee){const ne=te.kind===1;if(typeof ee!="string")return ne?te.toUTCString():te.toLocaleString();if(ee.length===1)switch(ee){case"D":case"d":return ne?dateToHalfUTCString(te,"first"):te.toLocaleDateString();case"T":case"t":return ne?dateToHalfUTCString(te,"second"):te.toLocaleTimeString();case"O":case"o":return dateToISOString(te,ne);default:throw new Error("Unrecognized Date print format")}else return dateToStringWithCustomFormat(te,ee,ne)}function toString$2(te,ee,ne){return te.offset!=null?dateToStringWithOffset(te,ee):dateToStringWithKind(te,ee)}function DateTime(te,ee){const ne=new Date(te);return ne.kind=(ee??0)|0,ne}function minValue$1(){return DateTime(-621355968e5,0)}function parseRaw(te){function ee(){throw new Error(`The string is not a valid Date: ${te}`)}(te==null||te.trim()==="")&&ee(),te.length===10&&te[4]==="-"&&te[7]==="-"&&(te+="T00:00:00");let ne=new Date(te),re=null;if(isNaN(ne.getTime())){const se=/^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*(Z|[+-]([01]?\d):?([0-5]?\d)?)?\s*$/.exec(te);if(se!=null){let ie,oe=0;if(se[2]!=null){const me=se[2].split(":");oe=parseInt(me[0],10)*3600+parseInt(me[1]||"0",10)*60+parseFloat(me[2]||"0"),se[3]!=null&&se[3].toUpperCase()==="PM"&&(oe+=720)}if(se[4]!=null){if(se[1]!=null)ie=new Date(se[1]+" UTC");else{const me=new Date;ie=new Date(me.getUTCFullYear()+"/"+(me.getUTCMonth()+1)+"/"+me.getUTCDate())}if(se[4]==="Z")re="Z";else{let me=parseInt(se[5],10)*60+parseInt(se[6]||"0",10);se[4][0]==="-"&&(me*=-1),re=me,oe-=me*60}}else if(se[1]!=null)ie=new Date(se[1]);else{const me=new Date;ie=new Date(me.getFullYear()+"/"+(me.getMonth()+1)+"/"+me.getDate())}ne=new Date(ie.getTime()+oe*1e3),ne=new Date(ne.getTime()+(ne.getTimezoneOffset()-ie.getTimezoneOffset())*6e4)}else ee();isNaN(ne.getTime())&&ee()}return[ne,re]}function parse$4(te,ee=!1){const[ne,re]=parseRaw(te),se=re!=null?ee&&re==="Z"?1:2:0;return DateTime(ne.getTime(),se)}function tryParse$4(te,ee){try{return ee.contents=parse$4(te),!0}catch{return!1}}function toUniversalTime(te){return te.kind===1?te:DateTime(te.getTime(),1)}function create$1(te,ee=0){if(ee&-284)throw new Error("RegexOptions only supports: IgnoreCase, Multiline, Compiled, Singleline and ECMAScript");let ne="gu";return ne+=ee&1?"i":"",ne+=ee&2?"m":"",ne+=ee&16?"s":"",new RegExp(te,ne)}function escape$1(te){return te.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function matches(te,ee,ne=0){if(ee==null)throw new Error("Input cannot ve null");if(!te.global)throw new Error("Non-global RegExp");te.lastIndex=ne;const re=[];let se,ie=-1;for(;(se=te.exec(ee))!=null;)se.index===ie?te.lastIndex++:(ie=se.index,re.push(se));return re}function replace(te,ee,ne,re,se=0){function ie(){let oe=arguments[0];if(re){re--;const me=[],pe=arguments.length,he=typeof arguments[pe-1]!="string";let ue=he?pe-3:pe-2;for(let de=0;de<ue;de++)me.push(arguments[de]);me.index=arguments[ue++],me.input=arguments[ue++],he&&(me.groups=arguments[ue]),oe=ne(me)}return oe}if(typeof te=="string"){const oe=te;te=create$1(ee,re??0),ee=oe,re=void 0}if(typeof ne=="function")return re=re??-1,ee.substring(0,se)+ee.substring(se).replace(te,ie);if(ne=ne.replace(/\$0/g,oe=>"$&").replace(/\${([^}]+)}/g,"$<$1>"),re!=null){let oe;const me=ee.substring(se),pe=matches(te,me),he=matches.length>re?(oe=pe[re-1],me.substring(0,oe.index+oe[0].length)):me;return ee.substring(0,se)+he.replace(te,ne)+ee.substring(se+he.length)}else return ee.replace(te,ne)}const fsFormatRegExp=/(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g,formatRegExp=/\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g;function isLessThan(te,ee){return compare(te,ee)<0}function printf(te){return{input:te,cont:fsFormat(te)}}function continuePrint(te,ee){return typeof ee=="string"?te(ee):ee.cont(te)}function toText(te){return continuePrint(ee=>ee,te)}function toFail(te){return continuePrint(ee=>{throw new Error(ee)},te)}function formatReplacement(te,ee,ne,re,se){let ie="";if(ee=ee||"",se=se||"",isNumeric(te))switch(se.toLowerCase()!=="x"&&(isLessThan(te,0)?(te=multiply(te,-1),ie="-"):ee.indexOf(" ")>=0?ie=" ":ee.indexOf("+")>=0&&(ie="+")),re=re==null?null:parseInt(re,10),se){case"f":case"F":re=re??6,te=toFixed(te,re);break;case"g":case"G":te=re!=null?toPrecision(te,re):toPrecision(te);break;case"e":case"E":te=re!=null?toExponential(te,re):toExponential(te);break;case"x":te=toHex(te);break;case"X":te=toHex(te).toUpperCase();break;default:te=String(te);break}else te instanceof Date?te=toString$2(te):te=toString$3(te);if(ne=typeof ne=="number"?ne:parseInt(ne,10),isNaN(ne))te=ie+te;else{const oe=ee.indexOf("0")>=0,me=ee.indexOf("-")>=0,pe=me||!oe?" ":"0";pe==="0"?(te=pad(te,ne-ie.length,pe,me),te=ie+te):te=pad(ie+te,ne,pe,me)}return te}function createPrinter(te,ee,ne,re="",se=-1){return(...ie)=>{let oe=re;const me=ee.slice(),pe=ne.slice();for(const he of ie){const[,,ue,de,Ae,Se]=pe[0];let ce=de;if(se>=0)ce=se,se=-1;else if(ce==="*"){if(he<0)throw new Error("Non-negative number required");se=he;continue}oe+=me[0],oe+=formatReplacement(he,ue,ce,Ae,Se),me.splice(0,1),pe.splice(0,1)}return pe.length===0?(oe+=me[0],te(oe)):createPrinter(te,me,pe,oe,se)}}function fsFormat(te){return ee=>{fsFormatRegExp.lastIndex=0;const ne=[],re=[];let se=0,ie=fsFormatRegExp.exec(te);for(;ie;){const oe=ie.index+(ie[1]||"").length;ne.push(te.substring(se,oe).replace(/%%/g,"%")),re.push(ie),se=fsFormatRegExp.lastIndex,fsFormatRegExp.lastIndex-=1,ie=fsFormatRegExp.exec(te)}return ne.length===0?ee(te.replace(/%%/g,"%")):(ne.push(te.substring(se).replace(/%%/g,"%")),createPrinter(ee,ne,re))}}function format(te,...ee){let ne;return typeof te=="object"?(ne=String(ee[0]),ee.shift()):ne=te,ne.replace(formatRegExp,(re,se,ie,oe,me,pe)=>{if(se<0||se>=ee.length)throw new Error("Index must be greater or equal to zero and less than the arguments' length.");let he=ee[se];if(isNumeric(he))switch(me=me==null?null:parseInt(me,10),oe){case"f":case"F":me=me??2,he=toFixed(he,me);break;case"g":case"G":he=me!=null?toPrecision(he,me):toPrecision(he);break;case"e":case"E":he=me!=null?toExponential(he,me):toExponential(he);break;case"p":case"P":me=me??2,he=toFixed(multiply(he,100),me)+" %";break;case"d":case"D":he=me!=null?padLeft(String(he),me,"0"):String(he);break;case"x":case"X":he=me!=null?padLeft(toHex(he),me,"0"):toHex(he),oe==="X"&&(he=he.toUpperCase());break;default:if(pe){let ue="";he=pe.replace(/([0#,]+)(\.[0#]+)?/,(de,Ae,Se)=>{isLessThan(he,0)&&(he=multiply(he,-1),ue="-"),Se=Se==null?"":Se.substring(1),he=toFixed(he,Math.max(Se.length,0));let[ce,fe]=he.split(".");fe||(fe="");const ye=Ae.replace(/,/g,"").replace(/^#+/,"").length;ce=padLeft(ce,ye,"0");const ve=Se.replace(/#+$/,"").length;if(ve>fe.length?fe=padRight(fe,ve,"0"):ve<fe.length&&(fe=fe.substring(0,ve)+fe.substring(ve).replace(/0+$/,"")),Ae.indexOf(",")>0){const Pe=ce.length%3,we=Math.floor(ce.length/3);let Te=Pe>0?ce.substr(0,Pe)+(we>0?",":""):"";for(let Le=0;Le<we;Le++)Te+=ce.substr(Pe+Le*3,3)+(Le<we-1?",":"");ce=Te}return fe.length>0?ce+"."+fe:ce}),he=ue+he}}else he instanceof Date?he=toString$2(he,pe||oe):he=toString$3(he);return ie=parseInt((ie||" ").substring(1),10),isNaN(ie)||(he=pad(String(he),Math.abs(ie)," ",ie<0)),he})}function isNullOrEmpty(te){return typeof te!="string"||te.length===0}function join(te,ee){return Array.isArray(ee)?ee.join(te):Array.from(ee).join(te)}function pad(te,ee,ne,re){ne=ne||" ",ee=ee-te.length;for(let se=0;se<ee;se++)te=re?te+ne:ne+te;return te}function padLeft(te,ee,ne){return pad(te,ee,ne)}function padRight(te,ee,ne){return pad(te,ee,ne,!0)}function split(te,ee,ne,re){if(ne=typeof ne=="number"?ne:void 0,re=typeof re=="number"?re:0,ne&&ne<0)throw new Error("Count cannot be less than zero");if(ne===0)return[];const se=(re&1)===1,ie=(re&2)===2;ee=ee||[],ee=ee.filter(ue=>ue).map(escape$1),ee=ee.length>0?ee:["\\s"];const oe=[],me=new RegExp(ee.join("|"),"g");let pe=!0,he=0;do{const ue=me.exec(te);if(ue===null){const de=ie?te.substring(he).trim():te.substring(he);(!se||de.length>0)&&oe.push(de),pe=!1}else{const de=ie?te.substring(he,ue.index).trim():te.substring(he,ue.index);(!se||de.length>0)&&(ne!=null&&oe.length+1===ne?(oe.push(ie?te.substring(he).trim():te.substring(he)),pe=!1):oe.push(de)),he=me.lastIndex}}while(pe);return oe}function trim(te,...ee){if(ee.length===0)return te.trim();const ne="["+escape$1(ee.join(""))+"]+";return te.replace(new RegExp("^"+ne),"").replace(new RegExp(ne+"$"),"")}const SR_inputWasEmpty="Collection was empty.";function Helpers_allocateArrayFromCons(te,ee){return typeof te=="function"?new te(ee):new Array(ee)}function max(te,ee){return te>ee?te:ee}function min(te,ee){return te<ee?te:ee}function fill(te,ee,ne,re){const se=ee|0;return te.fill(re,se,se+ne)}function map$4(te,ee,ne){const re=ee.length|0,se=Helpers_allocateArrayFromCons(ne,re);for(let ie=0;ie<=re-1;ie++)se[ie]=te(ee[ie]);return se}function singleton$2(te,ee){const ne=Helpers_allocateArrayFromCons(ee,1);return ne[0]=te,ne}function reverse$2(te){return te.slice().reverse()}function tryFind$1(te,ee){return ee.find(te)}function choose$1(te,ee,ne){const re=[];for(let se=0;se<=ee.length-1;se++){const ie=te(ee[se]);if(ie!=null){const oe=value(ie);re.push(oe)}}return equals$1(ne,defaultOf())?re:map$4(se=>se,re,ne)}function fold$2(te,ee,ne){return ne.reduce(te,ee)}function foldBack$1(te,ee,ne){return ee.reduceRight((re,se)=>te(se,re),ne)}class FSharpList extends Record{constructor(ee,ne){super(),this.head=ee,this.tail=ne}toString(){return"["+join("; ",this)+"]"}Equals(ee){const ne=this;return ne===ee?!0:((se,ie)=>{e:for(;;){const oe=se,me=ie,pe=oe.tail,he=me.tail;if(pe!=null)if(he!=null){const ue=value(pe),de=value(he);if(equals$1(oe.head,me.head)){se=ue,ie=de;continue e}else return!1}else return!1;else return he==null}})(ne,ee)}GetHashCode(){return((re,se,ie)=>{e:for(;;){const oe=re,me=se,pe=ie,he=pe.tail;if(he!=null){const ue=value(he);if(oe>18)return me|0;re=oe+1,se=(me<<1)+structuralHash(pe.head)+631*oe,ie=ue;continue e}else return me|0}})(0,0,this)|0}toJSON(){const ee=this;return Array.from(ee)}CompareTo(ee){return((se,ie)=>{e:for(;;){const oe=se,me=ie,pe=oe.tail,he=me.tail;if(pe!=null)if(he!=null){const ue=value(pe),de=value(he),Ae=compare$1(oe.head,me.head)|0;if(Ae===0){se=ue,ie=de;continue e}else return Ae|0}else return 1;else return he!=null?-1:0}})(this,ee)|0}GetEnumerator(){return ListEnumerator$1_$ctor_3002E699(this)}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return getEnumerator(this)}}class ListEnumerator$1{constructor(ee){this.xs=ee,this.it=this.xs,this.current=defaultOf()}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const ee=this,ne=ee.it.tail;if(ne!=null){const re=value(ne);return ee.current=ee.it.head,ee.it=re,!0}else return!1}"System.Collections.IEnumerator.Reset"(){const ee=this;ee.it=ee.xs,ee.current=defaultOf()}Dispose(){}}function ListEnumerator$1_$ctor_3002E699(te){return new ListEnumerator$1(te)}function FSharpList_get_Empty(){return new FSharpList(defaultOf(),void 0)}function FSharpList_Cons_305B8EAC(te,ee){return new FSharpList(te,ee)}function FSharpList__get_IsEmpty(te){return te.tail==null}function FSharpList__get_Length(te){return((ne,re)=>{e:for(;;){const se=ne,oe=re.tail;if(oe!=null){ne=se+1,re=value(oe);continue e}else return se|0}})(0,te)|0}function FSharpList__get_Head(te){if(te.tail!=null)return te.head;throw new Error(SR_inputWasEmpty+"\\nParameter name: list")}function FSharpList__get_Tail(te){const ee=te.tail;if(ee!=null)return value(ee);throw new Error(SR_inputWasEmpty+"\\nParameter name: list")}function empty$3(){return FSharpList_get_Empty()}function cons(te,ee){return FSharpList_Cons_305B8EAC(te,ee)}function singleton$1(te){return FSharpList_Cons_305B8EAC(te,FSharpList_get_Empty())}function isEmpty(te){return FSharpList__get_IsEmpty(te)}function head(te){return FSharpList__get_Head(te)}function tail(te){return FSharpList__get_Tail(te)}function toArray$1(te){const ee=FSharpList__get_Length(te)|0,ne=fill(new Array(ee),0,ee,null);return((se,ie)=>{e:for(;;){const oe=se,me=ie;if(!FSharpList__get_IsEmpty(me)){ne[oe]=FSharpList__get_Head(me),se=oe+1,ie=FSharpList__get_Tail(me);continue e}break}})(0,te),ne}function fold$1(te,ee,ne){let re=ee,se=ne;for(;!FSharpList__get_IsEmpty(se);)re=te(re,head(se)),se=FSharpList__get_Tail(se);return re}function reverse$1(te){return fold$1((ee,ne)=>FSharpList_Cons_305B8EAC(ne,ee),FSharpList_get_Empty(),te)}function foldBack(te,ee,ne){return foldBack$1(te,toArray$1(ee),ne)}function iterate$1(te,ee){fold$1((ne,re)=>{te(re)},void 0,ee)}function ofArrayWithTail(te,ee){let ne=ee;for(let re=te.length-1;re>=0;re--)ne=FSharpList_Cons_305B8EAC(te[re],ne);return ne}function ofArray$2(te){return ofArrayWithTail(te,FSharpList_get_Empty())}function ofSeq$3(te){let ee,ne;if(isArrayLike(te))return ofArray$2(te);if(te instanceof FSharpList)return te;{const re=FSharpList_get_Empty();let se=re;const ie=getEnumerator(te);try{for(;ie["System.Collections.IEnumerator.MoveNext"]();){const pe=ie["System.Collections.Generic.IEnumerator`1.get_Current"]();se=(ee=se,ne=new FSharpList(pe,void 0),ee.tail=ne,ne)}}finally{disposeSafe(ie)}const oe=se,me=FSharpList_get_Empty();return oe.tail=me,FSharpList__get_Tail(re)}}function append$1(te,ee){return fold$1((ne,re)=>FSharpList_Cons_305B8EAC(re,ne),ee,reverse$1(te))}function map$3(te,ee){const ne=FSharpList_get_Empty(),re=fold$1((ie,oe)=>{const me=new FSharpList(te(oe),void 0);return ie.tail=me,me},ne,ee),se=FSharpList_get_Empty();return re.tail=se,FSharpList__get_Tail(ne)}function filter(te,ee){const ne=FSharpList_get_Empty(),re=fold$1((ie,oe)=>{if(te(oe)){const me=new FSharpList(oe,void 0);return ie.tail=me,me}else return ie},ne,ee),se=FSharpList_get_Empty();return re.tail=se,FSharpList__get_Tail(ne)}function partition(te,ee){const ne=FSharpList_get_Empty(),re=FSharpList_get_Empty(),se=ne,ie=fold$1((pe,he)=>{let ue,de;const Ae=pe[0],Se=pe[1];return te(he)?[(ue=new FSharpList(he,void 0),Ae.tail=ue,ue),Se]:[Ae,(de=new FSharpList(he,void 0),Se.tail=de,de)]},[se,re],ee),oe=FSharpList_get_Empty();ie[0].tail=oe;const me=FSharpList_get_Empty();return ie[1].tail=me,[FSharpList__get_Tail(se),FSharpList__get_Tail(re)]}function choose(te,ee){const ne=FSharpList_get_Empty(),re=fold$1((ie,oe)=>{const me=te(oe);if(me==null)return ie;{const pe=new FSharpList(value(me),void 0);return ie.tail=pe,pe}},ne,ee),se=FSharpList_get_Empty();return re.tail=se,FSharpList__get_Tail(ne)}function forAll(te,ee){return fold$1((ne,re)=>ne&&te(re),!0,ee)}function Operators_NullArg(te){throw new Error(te)}const SR_enumerationAlreadyFinished="Enumeration already finished.",SR_enumerationNotStarted="Enumeration has not started. Call MoveNext.",SR_notEnoughElements="The input sequence has an insufficient number of elements.",SR_resetNotSupported="Reset is not supported on this enumerator.";function Enumerator_noReset(){throw new Error(SR_resetNotSupported)}function Enumerator_notStarted(){throw new Error(SR_enumerationNotStarted)}function Enumerator_alreadyFinished(){throw new Error(SR_enumerationAlreadyFinished)}class Enumerator_Seq{constructor(ee){this.f=ee}toString(){const ee=this;let ne=0,re="seq [";const se=getEnumerator(ee);try{for(;ne<4&&se["System.Collections.IEnumerator.MoveNext"]();)ne>0&&(re=re+"; "),re=re+toString$3(se["System.Collections.Generic.IEnumerator`1.get_Current"]()),ne=ne+1|0;return ne===4&&(re=re+"; ..."),re+"]"}finally{disposeSafe(se)}}GetEnumerator(){return this.f()}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return this.f()}}function Enumerator_Seq_$ctor_673A07F2(te){return new Enumerator_Seq(te)}class Enumerator_FromFunctions$1{constructor(ee,ne,re){this.current=ee,this.next=ne,this.dispose=re}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current()}"System.Collections.IEnumerator.get_Current"(){return this.current()}"System.Collections.IEnumerator.MoveNext"(){return this.next()}"System.Collections.IEnumerator.Reset"(){Enumerator_noReset()}Dispose(){this.dispose()}}function Enumerator_FromFunctions$1_$ctor_58C54629(te,ee,ne){return new Enumerator_FromFunctions$1(te,ee,ne)}function Enumerator_concat(te){let ee,ne,re=!1,se=!1,ie;const oe=()=>{if(se=!0,ne!=null){const me=value(ne);try{disposeSafe(me)}finally{ne=void 0}}if(ee!=null){const me=value(ee);try{disposeSafe(me)}finally{ee=void 0}}};return Enumerator_FromFunctions$1_$ctor_58C54629(()=>(re?se&&Enumerator_alreadyFinished():Enumerator_notStarted(),ie!=null?value(ie):Enumerator_alreadyFinished()),()=>{let me;if(re||(re=!0),se)return!1;{let pe;for(;pe==null;){const he=ee,ue=ne;if(he!=null)if(ue!=null){const de=value(ue);if(de["System.Collections.IEnumerator.MoveNext"]())ie=some(de["System.Collections.Generic.IEnumerator`1.get_Current"]()),pe=!0;else try{disposeSafe(de)}finally{ne=void 0}}else{const de=value(he);de["System.Collections.IEnumerator.MoveNext"]()?ne=(me=de["System.Collections.Generic.IEnumerator`1.get_Current"](),getEnumerator(me)):(oe(),pe=!1)}else ee=getEnumerator(te)}return value(pe)}},()=>{se||oe()})}function Enumerator_enumerateThenFinally(te,ee){return Enumerator_FromFunctions$1_$ctor_58C54629(()=>ee["System.Collections.Generic.IEnumerator`1.get_Current"](),()=>ee["System.Collections.IEnumerator.MoveNext"](),()=>{try{disposeSafe(ee)}finally{te()}})}function Enumerator_generateWhileSome(te,ee,ne){let re=!1,se,ie=some(te());const oe=()=>{if(ie!=null){const pe=value(ie);try{ne(pe)}finally{ie=void 0}}},me=()=>{try{oe()}finally{se=void 0}};return Enumerator_FromFunctions$1_$ctor_58C54629(()=>(re||Enumerator_notStarted(),se!=null?value(se):Enumerator_alreadyFinished()),()=>{if(re||(re=!0),ie!=null){const pe=value(ie);let he;try{he=ee(pe)}catch(ue){throw me(),ue}return he!=null?(se=he,!0):(me(),!1)}else return!1},oe)}function Enumerator_unfold(te,ee){let ne,re=ee;return Enumerator_FromFunctions$1_$ctor_58C54629(()=>{if(ne!=null){const se=value(ne)[0];return value(ne)[1],se}else return Enumerator_notStarted()},()=>(ne=te(re),ne!=null?(value(ne)[0],re=value(ne)[1],!0):!1),()=>{})}function checkNonNull(te,ee){ee==null&&Operators_NullArg(te)}function mkSeq(te){return Enumerator_Seq_$ctor_673A07F2(te)}function ofSeq$2(te){return checkNonNull("source",te),getEnumerator(te)}function delay(te){return mkSeq(()=>getEnumerator(te()))}function concat(te){return mkSeq(()=>Enumerator_concat(te))}function unfold(te,ee){return mkSeq(()=>Enumerator_unfold(te,ee))}function empty$2(){return delay(()=>new Array(0))}function singleton(te){return delay(()=>singleton$2(te))}function ofArray$1(te){return te}function toArray(te){return te instanceof FSharpList?toArray$1(te):Array.from(te)}function toList(te){return isArrayLike(te)?ofArray$2(te):te instanceof FSharpList?te:ofSeq$3(te)}function generate(te,ee,ne){return mkSeq(()=>Enumerator_generateWhileSome(te,ee,ne))}function generateIndexed(te,ee,ne){return mkSeq(()=>{let re=-1;return Enumerator_generateWhileSome(te,se=>(re=re+1|0,ee(re,se)),ne)})}function append(te,ee){return concat([te,ee])}function compareWith(te,ee,ne){const re=ofSeq$2(ee);try{const se=ofSeq$2(ne);try{let ie=0,oe=re["System.Collections.IEnumerator.MoveNext"](),me=se["System.Collections.IEnumerator.MoveNext"]();for(;ie===0&&oe&&me;)ie=te(re["System.Collections.Generic.IEnumerator`1.get_Current"](),se["System.Collections.Generic.IEnumerator`1.get_Current"]())|0,ie===0&&(oe=re["System.Collections.IEnumerator.MoveNext"](),me=se["System.Collections.IEnumerator.MoveNext"]());return(ie!==0?ie:oe?1:me?-1:0)|0}finally{disposeSafe(se)}}finally{disposeSafe(re)}}function contains$1(te,ee,ne){const re=ofSeq$2(ee);try{let se=!1;for(;!se&&re["System.Collections.IEnumerator.MoveNext"]();)se=ne.Equals(te,re["System.Collections.Generic.IEnumerator`1.get_Current"]());return se}finally{disposeSafe(re)}}function fold(te,ee,ne){const re=ofSeq$2(ne);try{let se=ee;for(;re["System.Collections.IEnumerator.MoveNext"]();)se=te(se,re["System.Collections.Generic.IEnumerator`1.get_Current"]());return se}finally{disposeSafe(re)}}function iterate(te,ee){fold((ne,re)=>{te(re)},void 0,ee)}function map$2(te,ee){return generate(()=>ofSeq$2(ee),ne=>ne["System.Collections.IEnumerator.MoveNext"]()?some(te(ne["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,ne=>{disposeSafe(ne)})}function mapIndexed(te,ee){return generateIndexed(()=>ofSeq$2(ee),(ne,re)=>re["System.Collections.IEnumerator.MoveNext"]()?some(te(ne,re["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,ne=>{disposeSafe(ne)})}function reverse(te){return delay(()=>reverse$2(toArray(te)))}function skip(te,ee){return mkSeq(()=>{const ne=ofSeq$2(ee);try{for(let re=1;re<=te;re++)if(!ne["System.Collections.IEnumerator.MoveNext"]())throw new Error(SR_notEnoughElements+"\\nParameter name: source");return Enumerator_enumerateThenFinally(()=>{},ne)}catch(re){throw disposeSafe(ne),re}})}function take(te,ee){return generateIndexed(()=>ofSeq$2(ee),(ne,re)=>{if(ne<te){if(re["System.Collections.IEnumerator.MoveNext"]())return some(re["System.Collections.Generic.IEnumerator`1.get_Current"]());throw new Error(SR_notEnoughElements+"\\nParameter name: source")}else return},ne=>{disposeSafe(ne)})}function collect(te,ee){return delay(()=>concat(map$2(te,ee)))}class MapTreeLeaf$2{constructor(ee,ne){this.k=ee,this.v=ne}}function MapTreeLeaf$2_$ctor_5BDDA1(te,ee){return new MapTreeLeaf$2(te,ee)}function MapTreeLeaf$2__get_Key(te){return te.k}function MapTreeLeaf$2__get_Value(te){return te.v}class MapTreeNode$2 extends MapTreeLeaf$2{constructor(ee,ne,re,se,ie){super(ee,ne),this.left=re,this.right=se,this.h=ie|0}}function MapTreeNode$2_$ctor_Z39DE9543(te,ee,ne,re,se){return new MapTreeNode$2(te,ee,ne,re,se)}function MapTreeNode$2__get_Left(te){return te.left}function MapTreeNode$2__get_Right(te){return te.right}function MapTreeNode$2__get_Height(te){return te.h}function MapTreeModule_empty(){}function MapTreeModule_sizeAux(te,ee){e:for(;;){const ne=te,re=ee;if(re!=null){const se=value(re);if(se instanceof MapTreeNode$2){const ie=se;te=MapTreeModule_sizeAux(ne+1,MapTreeNode$2__get_Left(ie)),ee=MapTreeNode$2__get_Right(ie);continue e}else return ne+1|0}else return ne|0}}function MapTreeModule_size(te){return MapTreeModule_sizeAux(0,te)}function MapTreeModule_mk(te,ee,ne,re){let se,ie,oe;const me=te;if(me!=null){const de=value(me);oe=de instanceof MapTreeNode$2?(se=de,MapTreeNode$2__get_Height(se)):1}else oe=0;let pe;const he=re;if(he!=null){const de=value(he);pe=de instanceof MapTreeNode$2?(ie=de,MapTreeNode$2__get_Height(ie)):1}else pe=0;const ue=(oe<pe?pe:oe)|0;return ue===0?MapTreeLeaf$2_$ctor_5BDDA1(ee,ne):MapTreeNode$2_$ctor_Z39DE9543(ee,ne,te,re,ue+1)}function MapTreeModule_rebalance(te,ee,ne,re){let se,ie,oe,me,pe,he,ue,de,Ae;const Se=te;if(Se!=null){const ye=value(Se);Ae=ye instanceof MapTreeNode$2?(se=ye,MapTreeNode$2__get_Height(se)):1}else Ae=0;let ce;const fe=re;if(fe!=null){const ye=value(fe);ce=ye instanceof MapTreeNode$2?(ie=ye,MapTreeNode$2__get_Height(ie)):1}else ce=0;if(ce>Ae+2){const ye=value(re);if(ye instanceof MapTreeNode$2){const ve=ye;if(oe=MapTreeNode$2__get_Left(ve),(oe!=null?(me=value(oe),me instanceof MapTreeNode$2?(pe=me,MapTreeNode$2__get_Height(pe)):1):0)>Ae+1){const Pe=value(MapTreeNode$2__get_Left(ve));if(Pe instanceof MapTreeNode$2){const we=Pe;return MapTreeModule_mk(MapTreeModule_mk(te,ee,ne,MapTreeNode$2__get_Left(we)),MapTreeLeaf$2__get_Key(we),MapTreeLeaf$2__get_Value(we),MapTreeModule_mk(MapTreeNode$2__get_Right(we),MapTreeLeaf$2__get_Key(ve),MapTreeLeaf$2__get_Value(ve),MapTreeNode$2__get_Right(ve)))}else throw new Error("internal error: Map.rebalance")}else return MapTreeModule_mk(MapTreeModule_mk(te,ee,ne,MapTreeNode$2__get_Left(ve)),MapTreeLeaf$2__get_Key(ve),MapTreeLeaf$2__get_Value(ve),MapTreeNode$2__get_Right(ve))}else throw new Error("internal error: Map.rebalance")}else if(Ae>ce+2){const ye=value(te);if(ye instanceof MapTreeNode$2){const ve=ye;if(he=MapTreeNode$2__get_Right(ve),(he!=null?(ue=value(he),ue instanceof MapTreeNode$2?(de=ue,MapTreeNode$2__get_Height(de)):1):0)>ce+1){const Pe=value(MapTreeNode$2__get_Right(ve));if(Pe instanceof MapTreeNode$2){const we=Pe;return MapTreeModule_mk(MapTreeModule_mk(MapTreeNode$2__get_Left(ve),MapTreeLeaf$2__get_Key(ve),MapTreeLeaf$2__get_Value(ve),MapTreeNode$2__get_Left(we)),MapTreeLeaf$2__get_Key(we),MapTreeLeaf$2__get_Value(we),MapTreeModule_mk(MapTreeNode$2__get_Right(we),ee,ne,re))}else throw new Error("internal error: Map.rebalance")}else return MapTreeModule_mk(MapTreeNode$2__get_Left(ve),MapTreeLeaf$2__get_Key(ve),MapTreeLeaf$2__get_Value(ve),MapTreeModule_mk(MapTreeNode$2__get_Right(ve),ee,ne,re))}else throw new Error("internal error: Map.rebalance")}else return MapTreeModule_mk(te,ee,ne,re)}function MapTreeModule_add(te,ee,ne,re){if(re!=null){const se=value(re),ie=te.Compare(ee,MapTreeLeaf$2__get_Key(se))|0;if(se instanceof MapTreeNode$2){const oe=se;return ie<0?MapTreeModule_rebalance(MapTreeModule_add(te,ee,ne,MapTreeNode$2__get_Left(oe)),MapTreeLeaf$2__get_Key(oe),MapTreeLeaf$2__get_Value(oe),MapTreeNode$2__get_Right(oe)):ie===0?MapTreeNode$2_$ctor_Z39DE9543(ee,ne,MapTreeNode$2__get_Left(oe),MapTreeNode$2__get_Right(oe),MapTreeNode$2__get_Height(oe)):MapTreeModule_rebalance(MapTreeNode$2__get_Left(oe),MapTreeLeaf$2__get_Key(oe),MapTreeLeaf$2__get_Value(oe),MapTreeModule_add(te,ee,ne,MapTreeNode$2__get_Right(oe)))}else return ie<0?MapTreeNode$2_$ctor_Z39DE9543(ee,ne,void 0,re,2):ie===0?MapTreeLeaf$2_$ctor_5BDDA1(ee,ne):MapTreeNode$2_$ctor_Z39DE9543(ee,ne,re,void 0,2)}else return MapTreeLeaf$2_$ctor_5BDDA1(ee,ne)}function MapTreeModule_tryFind(te,ee,ne){e:for(;;){const re=te,se=ee,ie=ne;if(ie!=null){const oe=value(ie),me=re.Compare(se,MapTreeLeaf$2__get_Key(oe))|0;if(me===0)return some(MapTreeLeaf$2__get_Value(oe));if(oe instanceof MapTreeNode$2){const pe=oe;te=re,ee=se,ne=me<0?MapTreeNode$2__get_Left(pe):MapTreeNode$2__get_Right(pe);continue e}else return}else return}}function MapTreeModule_find(te,ee,ne){const re=MapTreeModule_tryFind(te,ee,ne);if(re==null)throw new Error;return value(re)}function MapTreeModule_mem(te,ee,ne){e:for(;;){const re=te,se=ee,ie=ne;if(ie!=null){const oe=value(ie),me=re.Compare(se,MapTreeLeaf$2__get_Key(oe))|0;if(oe instanceof MapTreeNode$2){const pe=oe;if(me<0){te=re,ee=se,ne=MapTreeNode$2__get_Left(pe);continue e}else{if(me===0)return!0;te=re,ee=se,ne=MapTreeNode$2__get_Right(pe);continue e}}else return me===0}else return!1}}function MapTreeModule_iterOpt(te,ee){e:for(;;){const ne=te,re=ee;if(re!=null){const se=value(re);if(se instanceof MapTreeNode$2){const ie=se;MapTreeModule_iterOpt(ne,MapTreeNode$2__get_Left(ie)),ne(MapTreeLeaf$2__get_Key(ie),MapTreeLeaf$2__get_Value(ie)),te=ne,ee=MapTreeNode$2__get_Right(ie);continue e}else ne(MapTreeLeaf$2__get_Key(se),MapTreeLeaf$2__get_Value(se))}break}}function MapTreeModule_iter(te,ee){MapTreeModule_iterOpt(te,ee)}function MapTreeModule_mapiOpt(te,ee){if(ee!=null){const ne=value(ee);if(ne instanceof MapTreeNode$2){const re=ne,se=MapTreeModule_mapiOpt(te,MapTreeNode$2__get_Left(re)),ie=te(MapTreeLeaf$2__get_Key(re),MapTreeLeaf$2__get_Value(re)),oe=MapTreeModule_mapiOpt(te,MapTreeNode$2__get_Right(re));return MapTreeNode$2_$ctor_Z39DE9543(MapTreeLeaf$2__get_Key(re),ie,se,oe,MapTreeNode$2__get_Height(re))}else return MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(ne),te(MapTreeLeaf$2__get_Key(ne),MapTreeLeaf$2__get_Value(ne)))}else return void 0}function MapTreeModule_mapi(te,ee){return MapTreeModule_mapiOpt(te,ee)}function MapTreeModule_copyToArray(te,ee,ne){let re=ne;MapTreeModule_iter((se,ie)=>{ee[re]=[se,ie],re=re+1|0},te)}function MapTreeModule_ofList(te,ee){return fold$1((ne,re)=>MapTreeModule_add(te,re[0],re[1],ne),void 0,ee)}function MapTreeModule_mkFromEnumerator(te,ee,ne){e:for(;;){const re=te,se=ee,ie=ne;if(ie["System.Collections.IEnumerator.MoveNext"]()){const oe=ie["System.Collections.Generic.IEnumerator`1.get_Current"]();te=re,ee=MapTreeModule_add(re,oe[0],oe[1],se),ne=ie;continue e}else return se}}function MapTreeModule_ofArray(te,ee){let ne=void 0;for(let re=0;re<=ee.length-1;re++){const se=ee[re];ne=MapTreeModule_add(te,se[0],se[1],ne)}return ne}function MapTreeModule_ofSeq(te,ee){if(isArrayLike(ee))return MapTreeModule_ofArray(te,ee);if(ee instanceof FSharpList)return MapTreeModule_ofList(te,ee);{const ne=getEnumerator(ee);try{return MapTreeModule_mkFromEnumerator(te,void 0,ne)}finally{disposeSafe(ne)}}}class MapTreeModule_MapIterator$2 extends Record{constructor(ee,ne){super(),this.stack=ee,this.started=ne}}function MapTreeModule_collapseLHS(te){e:for(;;){const ee=te;if(isEmpty(ee))return empty$3();{const ne=tail(ee),re=head(ee);if(re!=null){const se=value(re);if(se instanceof MapTreeNode$2){const ie=se;te=ofArrayWithTail([MapTreeNode$2__get_Left(ie),MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(ie),MapTreeLeaf$2__get_Value(ie)),MapTreeNode$2__get_Right(ie)],ne);continue e}else return ee}else{te=ne;continue e}}}}function MapTreeModule_mkIterator(te){return new MapTreeModule_MapIterator$2(MapTreeModule_collapseLHS(singleton$1(te)),!1)}function MapTreeModule_notStarted(){throw new Error("enumeration not started")}function MapTreeModule_alreadyFinished(){throw new Error("enumeration already finished")}function MapTreeModule_current(te){if(te.started){const ee=te.stack;if(isEmpty(ee))return MapTreeModule_alreadyFinished();if(head(ee)!=null){const ne=value(head(ee));if(ne instanceof MapTreeNode$2)throw new Error("Please report error: Map iterator, unexpected stack for current");return[MapTreeLeaf$2__get_Key(ne),MapTreeLeaf$2__get_Value(ne)]}else throw new Error("Please report error: Map iterator, unexpected stack for current")}else return MapTreeModule_notStarted()}function MapTreeModule_moveNext(te){if(te.started){const ee=te.stack;if(isEmpty(ee))return!1;if(head(ee)!=null){if(value(head(ee))instanceof MapTreeNode$2)throw new Error("Please report error: Map iterator, unexpected stack for moveNext");return te.stack=MapTreeModule_collapseLHS(tail(ee)),!isEmpty(te.stack)}else throw new Error("Please report error: Map iterator, unexpected stack for moveNext")}else return te.started=!0,!isEmpty(te.stack)}function MapTreeModule_mkIEnumerator(te){let ee=MapTreeModule_mkIterator(te);return{"System.Collections.Generic.IEnumerator`1.get_Current"(){return MapTreeModule_current(ee)},"System.Collections.IEnumerator.get_Current"(){return MapTreeModule_current(ee)},"System.Collections.IEnumerator.MoveNext"(){return MapTreeModule_moveNext(ee)},"System.Collections.IEnumerator.Reset"(){ee=MapTreeModule_mkIterator(te)},Dispose(){}}}class FSharpMap{constructor(ee,ne){this.comparer=ee,this.tree=ne}GetHashCode(){return FSharpMap__ComputeHashCode(this)|0}Equals(ee){const ne=this;if(ee instanceof FSharpMap){const re=ee,se=getEnumerator(ne);try{const ie=getEnumerator(re);try{const oe=()=>{const me=se["System.Collections.IEnumerator.MoveNext"]();if(me===ie["System.Collections.IEnumerator.MoveNext"]())if(me){const pe=se["System.Collections.Generic.IEnumerator`1.get_Current"](),he=ie["System.Collections.Generic.IEnumerator`1.get_Current"]();return equals$1(pe[0],he[0])&&equals$1(pe[1],he[1])?oe():!1}else return!0;else return!1};return oe()}finally{disposeSafe(ie)}}finally{disposeSafe(se)}}else return!1}toString(){return"map ["+join("; ",map$2(ne=>format("({0}, {1})",ne[0],ne[1]),this))+"]"}get[Symbol.toStringTag](){return"FSharpMap"}toJSON(){const ee=this;return Array.from(ee)}GetEnumerator(){return MapTreeModule_mkIEnumerator(this.tree)}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return MapTreeModule_mkIEnumerator(this.tree)}CompareTo(ee){const ne=this;if(ee instanceof FSharpMap)return compareWith((se,ie)=>{const oe=ne.comparer.Compare(se[0],ie[0])|0;return(oe!==0?oe:compare$1(se[1],ie[1]))|0},ne,ee)|0;throw new Error("not comparable\\nParameter name: obj")}"System.Collections.Generic.ICollection`1.Add2B595"(ee){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Remove2B595"(ee){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Contains2B595"(ee){const ne=this;return FSharpMap__ContainsKey(ne,ee[0])&&equals$1(FSharpMap__get_Item(ne,ee[0]),ee[1])}"System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(ee,ne){MapTreeModule_copyToArray(this.tree,ee,ne)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return FSharpMap__get_Count(this)|0}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return FSharpMap__get_Count(this)|0}get size(){return FSharpMap__get_Count(this)|0}clear(){throw new Error("Map cannot be mutated")}delete(ee){throw new Error("Map cannot be mutated")}entries(){return map$2(ne=>[ne[0],ne[1]],this)}get(ee){return FSharpMap__get_Item(this,ee)}has(ee){return FSharpMap__ContainsKey(this,ee)}keys(){return map$2(ne=>ne[0],this)}set(ee,ne){throw new Error("Map cannot be mutated")}values(){return map$2(ne=>ne[1],this)}forEach(ee,ne){const re=this;iterate(se=>{ee(se[1],se[0],re)},re)}}function FSharpMap_$ctor(te,ee){return new FSharpMap(te,ee)}function FSharpMap_Empty(te){return FSharpMap_$ctor(te,void 0)}function FSharpMap__Add(te,ee,ne){return FSharpMap_$ctor(te.comparer,MapTreeModule_add(te.comparer,ee,ne,te.tree))}function FSharpMap__get_Item(te,ee){return MapTreeModule_find(te.comparer,ee,te.tree)}function FSharpMap__Map(te,ee){return FSharpMap_$ctor(te.comparer,MapTreeModule_mapi(ee,te.tree))}function FSharpMap__get_Count(te){return MapTreeModule_size(te.tree)}function FSharpMap__ContainsKey(te,ee){return MapTreeModule_mem(te.comparer,ee,te.tree)}function FSharpMap__TryFind(te,ee){return MapTreeModule_tryFind(te.comparer,ee,te.tree)}function FSharpMap__ComputeHashCode(te){const ee=(se,ie)=>(se<<1)+ie+631;let ne=0;const re=getEnumerator(te);try{for(;re["System.Collections.IEnumerator.MoveNext"]();){const se=re["System.Collections.Generic.IEnumerator`1.get_Current"]();ne=ee(ne,structuralHash(se[0]))|0,ne=ee(ne,structuralHash(se[1]))|0}}finally{disposeSafe(re)}return ne|0}function add$2(te,ee,ne){return FSharpMap__Add(ne,te,ee)}function tryFind(te,ee){return FSharpMap__TryFind(ee,te)}function map$1(te,ee){return FSharpMap__Map(ee,te)}function ofSeq$1(te,ee){return FSharpMap_$ctor(ee,MapTreeModule_ofSeq(ee,te))}function ofArray(te,ee){return FSharpMap_$ctor(ee,MapTreeModule_ofSeq(ee,te))}function empty$1(te){return FSharpMap_Empty(te)}function Headers_contentType(te){return new Header("Content-Type",te)}function Headers_authorization(te){return new Header("Authorization",te)}const Http_defaultRequest=new HttpRequest("",new HttpMethod(0,[]),empty$3(),!1,void 0,void 0,void 0,new BodyContent(0,[]));new HttpResponse(0,"","","",empty$1({Compare:comparePrimitives}),new ResponseContent(0,[""]));function Http_splitAt(te,ee){return isNullOrEmpty(ee)?[ee]:split(ee,[te],void 0,0)}function Http_serializeMethod(te){switch(te.tag){case 1:return"POST";case 3:return"PATCH";case 2:return"PUT";case 4:return"DELETE";case 6:return"OPTIONS";case 5:return"HEAD";default:return"GET"}}function Http_request(te){return new HttpRequest(te,Http_defaultRequest.method,Http_defaultRequest.headers,Http_defaultRequest.withCredentials,Http_defaultRequest.overridenMimeType,Http_defaultRequest.overridenResponseType,Http_defaultRequest.timeout,Http_defaultRequest.content)}function Http_method(te,ee){return new HttpRequest(ee.url,te,ee.headers,ee.withCredentials,ee.overridenMimeType,ee.overridenResponseType,ee.timeout,ee.content)}function Http_header(te,ee){return new HttpRequest(ee.url,ee.method,append$1(ee.headers,singleton$1(te)),ee.withCredentials,ee.overridenMimeType,ee.overridenResponseType,ee.timeout,ee.content)}function Http_content(te,ee){return new HttpRequest(ee.url,ee.method,ee.headers,ee.withCredentials,ee.overridenMimeType,ee.overridenResponseType,ee.timeout,te)}function Http_send(te){return fromContinuations(ee=>{const ne=new XMLHttpRequest;ne.open(Http_serializeMethod(te.method),te.url),ne.onreadystatechange=()=>{let pe,he,ue,de,Ae,Se,ce;ne.readyState===4&&ee[0]((pe=(he=ne.responseType,he===""||he==="text"?ne.responseText:""),ue=ne.status|0,de=ne.responseType,Ae=(Se=ne.responseType,Se===""?new ResponseContent(0,[ne.responseText]):Se==="text"?new ResponseContent(0,[ne.responseText]):Se==="arraybuffer"?new ResponseContent(2,[ne.response]):Se==="blob"?new ResponseContent(1,[ne.response]):new ResponseContent(3,[ne.response])),ce=ofArray(choose$1(fe=>{const ye=ofArray$2(Http_splitAt(":",fe));if(!isEmpty(ye))return[head(ye).toLocaleLowerCase(),join(":",tail(ye)).trim()]},Http_splitAt(`\r
|
|
4
|
+
`,ne.getAllResponseHeaders())),{Compare:comparePrimitives}),new HttpResponse(ue,pe,de,ne.responseURL,ce,Ae)))};const re=getEnumerator(te.headers);try{for(;re["System.Collections.IEnumerator.MoveNext"]();){const pe=re["System.Collections.Generic.IEnumerator`1.get_Current"]();ne.setRequestHeader(pe.fields[0],pe.fields[1])}}finally{disposeSafe(re)}ne.withCredentials=te.withCredentials;const se=te.overridenMimeType;if(se!=null){const pe=se;ne.overrideMimeType(pe)}const ie=te.overridenResponseType;if(ie!=null)switch(ie.tag){case 1:{ne.responseType="blob";break}case 2:{ne.responseType="arraybuffer";break}default:ne.responseType="text"}const oe=te.timeout;if(oe!=null){const pe=oe|0;ne.timeout=pe|0}const me=te.content;switch(me.tag){case 1:{ne.send(some(me.fields[0]));break}case 3:{ne.send(some(me.fields[0]));break}case 2:{ne.send(some(me.fields[0]));break}default:ne.send()}})}const CaseRules={None:0,LowerFirst:1,SnakeCase:2,SnakeCaseAllCaps:3,KebabCase:4};function dashify(te,ee){return te.replace(/[a-z]?[A-Z]/g,ne=>ne.length===1?ne.toLowerCase():ne.charAt(0)+ee+ne.charAt(1).toLowerCase())}function changeCase(te,ee){switch(ee){case CaseRules.LowerFirst:return te.charAt(0).toLowerCase()+te.slice(1);case CaseRules.SnakeCase:return dashify(te,"_");case CaseRules.SnakeCaseAllCaps:return dashify(te,"_").toUpperCase();case CaseRules.KebabCase:return dashify(te,"-");case CaseRules.None:default:return te}}function keyValueList(te,ee=CaseRules.None){const ne={},re=ee;function se(oe){throw new Error("Cannot infer key and value of "+String(oe))}function ie(oe,me,pe){oe=changeCase(oe,me),ne[oe]=pe}for(let oe of te){let me=CaseRules.None;if(oe==null&&se(oe),oe instanceof Union){const pe=oe.cases()[oe.tag];oe=oe.fields.length===0?pe:[pe].concat(oe.fields),me=re}if(Array.isArray(oe))switch(oe.length){case 0:se(oe);break;case 1:ie(oe[0],me,!0);break;case 2:const pe=oe[1];ie(oe[0],me,pe);break;default:ie(oe[0],me,oe.slice(1))}else typeof oe=="string"?ie(oe,me,!0):se(oe)}return ne}class ErrorReason extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["BadPrimitive","BadPrimitiveExtra","BadType","BadField","BadPath","TooSmallArray","FailMessage","BadOneOf"]}}class CaseStrategy extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["PascalCase","CamelCase","SnakeCase"]}}function Util_Casing_lowerFirst(te){return te.slice(void 0,0+1).toLowerCase()+te.slice(1,te.length)}function Util_Casing_convert(te,ee){switch(te.tag){case 2:return replace(Util_Casing_lowerFirst(ee),"[A-Z]","_$0").toLowerCase();case 0:return ee;default:return Util_Casing_lowerFirst(ee)}}const guidRegex=/^[\(\{]{0,2}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\)\}]{0,2}$/,guidRegexNoHyphen=/^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/,guidRegexHex=/^\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\}\}$/;function parse$3(te){function ee(re){return re.replace(guidRegexNoHyphen,"$1-$2-$3-$4-$5")}const ne=te.trim().toLowerCase();if(guidRegex.test(ne))return trim(ne,"{","}","(",")");if(guidRegexNoHyphen.test(ne))return ee(ne);if(guidRegexHex.test(ne))return ee(ne.replace(/[\{\},]|0x/g,""));throw new Error("Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")}function tryParse$3(te,ee){try{return ee.contents=parse$3(te),!0}catch{return!1}}var NumberStyles;(function(te){te[te.AllowHexSpecifier=512]="AllowHexSpecifier"})(NumberStyles||(NumberStyles={}));function validResponse(te,ee){const[,ne,re,se]=te;return{sign:ne||"",prefix:re||"",digits:se,radix:ee}}function getRange(te,ee){switch(ee){case 8:return te?[0,255]:[-128,127];case 16:return te?[0,65535]:[-32768,32767];case 32:return te?[0,4294967295]:[-2147483648,2147483647];default:throw new Error("Invalid bit size.")}}function getInvalidDigits(te){switch(te){case 2:return/[^0-1]/;case 8:return/[^0-7]/;case 10:return/[^0-9]/;case 16:return/[^0-9a-fA-F]/;default:throw new Error("Invalid Base.")}}function getRadix(te,ee){if(ee&NumberStyles.AllowHexSpecifier)return 16;switch(te){case"0b":case"0B":return 2;case"0o":case"0O":return 8;case"0x":case"0X":return 16;default:return 10}}function isValid(te,ee,ne){const se=/^\s*([\+\-])?(0[xXoObB])?([0-9a-fA-F]+)\s*$/.exec(te.replace(/_/g,""));if(se!=null){const[,,ie,oe]=se;if(ne=ne||getRadix(ie,ee),!getInvalidDigits(ne).test(oe))return validResponse(se,ne)}return null}function parse$2(te,ee,ne,re,se){const ie=isValid(te,ee,se);if(ie!=null){let oe=Number.parseInt(ie.sign+ie.digits,ie.radix);if(!Number.isNaN(oe)){const[me,pe]=getRange(!0,re);!ne&&ie.radix!==10&&oe>=me&&oe<=pe&&(oe=oe<<32-re>>32-re);const[he,ue]=getRange(ne,re);if(oe>=he&&oe<=ue)return oe}}throw new Error("Input string was not in a correct format.")}function tryParse$2(te,ee,ne,re,se){try{return se.contents=parse$2(te,ee,ne,re),!0}catch{return!1}}function DateTimeOffset(te,ee){checkOffsetInRange(ee);const ne=new Date(te);return ne.offset=ee??new Date().getTimezoneOffset()*-6e4,ne}function checkOffsetInRange(te){if(te!=null&&te!==0){if(te%6e4!==0)throw new Error("Offset must be specified in whole minutes.");if(Math.abs(te/36e5)>14)throw new Error("Offset must be within plus or minus 14 hours.")}}function minValue(){return DateTimeOffset(-621355968e5,0)}function parse$1(te){const[ee,ne]=parseRaw(te),re=ne==null?ee.getTimezoneOffset()*-6e4:ne==="Z"?0:ne*6e4;return DateTimeOffset(ee.getTime(),re)}function tryParse$1(te,ee){try{return ee.contents=parse$1(te),!0}catch{return!1}}function signedRound(te){return te<0?Math.ceil(te):Math.floor(te)}function create(te=0,ee=0,ne=0,re=0,se=0){switch(arguments.length){case 1:return fromTicks(arguments[0]);case 3:te=0,ee=arguments[0],ne=arguments[1],re=arguments[2],se=0;break}return te*864e5+ee*36e5+ne*6e4+re*1e3+se}function fromTicks(te){return Number(BigInt(te)/10000n)}function days(te){return signedRound(te/864e5)}function hours(te){return signedRound(te%864e5/36e5)}function minutes(te){return signedRound(te%36e5/6e4)}function seconds(te){return signedRound(te%6e4/1e3)}function milliseconds(te){return signedRound(te%1e3)}function toString$1(te,ee="c",ne){if(["c","g","G"].indexOf(ee)===-1)throw new Error("Custom formats are not supported");const re=Math.abs(days(te)),se=Math.abs(hours(te)),ie=Math.abs(minutes(te)),oe=Math.abs(seconds(te)),me=Math.abs(milliseconds(te));return`${te<0?"-":""}${re===0&&(ee==="c"||ee==="g")?"":ee==="c"?re+".":re+":"}${ee==="g"?se:padWithZeros(se,2)}:${padWithZeros(ie,2)}:${padWithZeros(oe,2)}${me===0&&(ee==="c"||ee==="g")?"":ee==="g"?"."+padWithZeros(me,3):"."+padLeftAndRightWithZeros(me,3,7)}`}function parse(te){const ee=te.search("\\."),ne=te.search("\\:");if(ee===-1&&ne===-1){const re=parseInt(te,0);if(isNaN(re))throw new Error(`String '${te}' was not recognized as a valid TimeSpan.`);return create(re,0,0,0,0)}if(ne>0){const re=/^(-?)((\d+)\.)?(?:0*)([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:0*)([0-5][0-9]|[0-9])(:(?:0*)([0-5][0-9]|[0-9]))?\.?(\d+)?$/.exec(te);if(re!=null&&re[4]!=null&&re[5]!=null){let se=0,ie=0,oe=0;const me=re[1]!=null&&re[1]==="-"?-1:1,pe=+re[4],he=+re[5];if(re[3]!=null&&(se=+re[3]),re[7]!=null&&(oe=+re[7]),re[8]!=null)switch(re[8].length){case 1:ie=+re[8]*100;break;case 2:ie=+re[8]*10;break;case 3:ie=+re[8];break;case 4:ie=+re[8]/10;break;case 5:ie=+re[8]/100;break;case 6:ie=+re[8]/1e3;break;case 7:ie=+re[8]/1e4;break;default:throw new Error(`String '${te}' was not recognized as a valid TimeSpan.`)}return me*create(se,pe,he,oe,ie)}}throw new Error(`String '${te}' was not recognized as a valid TimeSpan.`)}function tryParse(te,ee){try{return ee.contents=parse(te),!0}catch{return!1}}class SetTreeLeaf$1{constructor(ee){this.k=ee}}function SetTreeLeaf$1_$ctor_2B595(te){return new SetTreeLeaf$1(te)}function SetTreeLeaf$1__get_Key(te){return te.k}class SetTreeNode$1 extends SetTreeLeaf$1{constructor(ee,ne,re,se){super(ee),this.left=ne,this.right=re,this.h=se|0}}function SetTreeNode$1_$ctor_5F465FC9(te,ee,ne,re){return new SetTreeNode$1(te,ee,ne,re)}function SetTreeNode$1__get_Left(te){return te.left}function SetTreeNode$1__get_Right(te){return te.right}function SetTreeNode$1__get_Height(te){return te.h}function SetTreeModule_empty(){}function SetTreeModule_countAux(te,ee){e:for(;;){const ne=te,re=ee;if(ne!=null){const se=value(ne);if(se instanceof SetTreeNode$1){const ie=se;te=SetTreeNode$1__get_Left(ie),ee=SetTreeModule_countAux(SetTreeNode$1__get_Right(ie),re+1);continue e}else return re+1|0}else return re|0}}function SetTreeModule_count(te){return SetTreeModule_countAux(te,0)}function SetTreeModule_mk(te,ee,ne){let re,se,ie;const oe=te;if(oe!=null){const ue=value(oe);ie=ue instanceof SetTreeNode$1?(re=ue,SetTreeNode$1__get_Height(re)):1}else ie=0;let me;const pe=ne;if(pe!=null){const ue=value(pe);me=ue instanceof SetTreeNode$1?(se=ue,SetTreeNode$1__get_Height(se)):1}else me=0;const he=(ie<me?me:ie)|0;return he===0?SetTreeLeaf$1_$ctor_2B595(ee):SetTreeNode$1_$ctor_5F465FC9(ee,te,ne,he+1)}function SetTreeModule_rebalance(te,ee,ne){let re,se,ie,oe,me,pe,he,ue,de;const Ae=te;if(Ae!=null){const fe=value(Ae);de=fe instanceof SetTreeNode$1?(re=fe,SetTreeNode$1__get_Height(re)):1}else de=0;let Se;const ce=ne;if(ce!=null){const fe=value(ce);Se=fe instanceof SetTreeNode$1?(se=fe,SetTreeNode$1__get_Height(se)):1}else Se=0;if(Se>de+2){const fe=value(ne);if(fe instanceof SetTreeNode$1){const ye=fe;if(ie=SetTreeNode$1__get_Left(ye),(ie!=null?(oe=value(ie),oe instanceof SetTreeNode$1?(me=oe,SetTreeNode$1__get_Height(me)):1):0)>de+1){const ve=value(SetTreeNode$1__get_Left(ye));if(ve instanceof SetTreeNode$1){const Pe=ve;return SetTreeModule_mk(SetTreeModule_mk(te,ee,SetTreeNode$1__get_Left(Pe)),SetTreeLeaf$1__get_Key(Pe),SetTreeModule_mk(SetTreeNode$1__get_Right(Pe),SetTreeLeaf$1__get_Key(ye),SetTreeNode$1__get_Right(ye)))}else throw new Error("internal error: Set.rebalance")}else return SetTreeModule_mk(SetTreeModule_mk(te,ee,SetTreeNode$1__get_Left(ye)),SetTreeLeaf$1__get_Key(ye),SetTreeNode$1__get_Right(ye))}else throw new Error("internal error: Set.rebalance")}else if(de>Se+2){const fe=value(te);if(fe instanceof SetTreeNode$1){const ye=fe;if(pe=SetTreeNode$1__get_Right(ye),(pe!=null?(he=value(pe),he instanceof SetTreeNode$1?(ue=he,SetTreeNode$1__get_Height(ue)):1):0)>Se+1){const ve=value(SetTreeNode$1__get_Right(ye));if(ve instanceof SetTreeNode$1){const Pe=ve;return SetTreeModule_mk(SetTreeModule_mk(SetTreeNode$1__get_Left(ye),SetTreeLeaf$1__get_Key(ye),SetTreeNode$1__get_Left(Pe)),SetTreeLeaf$1__get_Key(Pe),SetTreeModule_mk(SetTreeNode$1__get_Right(Pe),ee,ne))}else throw new Error("internal error: Set.rebalance")}else return SetTreeModule_mk(SetTreeNode$1__get_Left(ye),SetTreeLeaf$1__get_Key(ye),SetTreeModule_mk(SetTreeNode$1__get_Right(ye),ee,ne))}else throw new Error("internal error: Set.rebalance")}else return SetTreeModule_mk(te,ee,ne)}function SetTreeModule_add(te,ee,ne){if(ne!=null){const re=value(ne),se=te.Compare(ee,SetTreeLeaf$1__get_Key(re))|0;if(re instanceof SetTreeNode$1){const ie=re;return se<0?SetTreeModule_rebalance(SetTreeModule_add(te,ee,SetTreeNode$1__get_Left(ie)),SetTreeLeaf$1__get_Key(ie),SetTreeNode$1__get_Right(ie)):se===0?ne:SetTreeModule_rebalance(SetTreeNode$1__get_Left(ie),SetTreeLeaf$1__get_Key(ie),SetTreeModule_add(te,ee,SetTreeNode$1__get_Right(ie)))}else{const ie=te.Compare(ee,SetTreeLeaf$1__get_Key(re))|0;return ie<0?SetTreeNode$1_$ctor_5F465FC9(ee,void 0,ne,2):ie===0?ne:SetTreeNode$1_$ctor_5F465FC9(ee,ne,void 0,2)}}else return SetTreeLeaf$1_$ctor_2B595(ee)}function SetTreeModule_mem(te,ee,ne){e:for(;;){const re=te,se=ee,ie=ne;if(ie!=null){const oe=value(ie),me=re.Compare(se,SetTreeLeaf$1__get_Key(oe))|0;if(oe instanceof SetTreeNode$1){const pe=oe;if(me<0){te=re,ee=se,ne=SetTreeNode$1__get_Left(pe);continue e}else{if(me===0)return!0;te=re,ee=se,ne=SetTreeNode$1__get_Right(pe);continue e}}else return me===0}else return!1}}function SetTreeModule_iter(te,ee){e:for(;;){const ne=te,re=ee;if(re!=null){const se=value(re);if(se instanceof SetTreeNode$1){const ie=se;SetTreeModule_iter(ne,SetTreeNode$1__get_Left(ie)),ne(SetTreeLeaf$1__get_Key(ie)),te=ne,ee=SetTreeNode$1__get_Right(ie);continue e}else ne(SetTreeLeaf$1__get_Key(se))}break}}class SetTreeModule_SetIterator$1 extends Record{constructor(ee,ne){super(),this.stack=ee,this.started=ne}}function SetTreeModule_collapseLHS(te){e:for(;;){const ee=te;if(isEmpty(ee))return empty$3();{const ne=head(ee),re=tail(ee);if(ne!=null){const se=value(ne);if(se instanceof SetTreeNode$1){const ie=se;te=ofArrayWithTail([SetTreeNode$1__get_Left(ie),SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ie)),SetTreeNode$1__get_Right(ie)],re);continue e}else return ee}else{te=re;continue e}}}}function SetTreeModule_mkIterator(te){return new SetTreeModule_SetIterator$1(SetTreeModule_collapseLHS(singleton$1(te)),!1)}function SetTreeModule_notStarted(){throw new Error("Enumeration not started")}function SetTreeModule_alreadyFinished(){throw new Error("Enumeration already started")}function SetTreeModule_current(te){if(te.started){const ee=te.stack;if(isEmpty(ee))return SetTreeModule_alreadyFinished();if(head(ee)!=null){const ne=value(head(ee));return SetTreeLeaf$1__get_Key(ne)}else throw new Error("Please report error: Set iterator, unexpected stack for current")}else return SetTreeModule_notStarted()}function SetTreeModule_moveNext(te){if(te.started){const ee=te.stack;if(isEmpty(ee))return!1;if(head(ee)!=null){if(value(head(ee))instanceof SetTreeNode$1)throw new Error("Please report error: Set iterator, unexpected stack for moveNext");return te.stack=SetTreeModule_collapseLHS(tail(ee)),!isEmpty(te.stack)}else throw new Error("Please report error: Set iterator, unexpected stack for moveNext")}else return te.started=!0,!isEmpty(te.stack)}function SetTreeModule_mkIEnumerator(te){let ee=SetTreeModule_mkIterator(te);return{"System.Collections.Generic.IEnumerator`1.get_Current"(){return SetTreeModule_current(ee)},"System.Collections.IEnumerator.get_Current"(){return SetTreeModule_current(ee)},"System.Collections.IEnumerator.MoveNext"(){return SetTreeModule_moveNext(ee)},"System.Collections.IEnumerator.Reset"(){ee=SetTreeModule_mkIterator(te)},Dispose(){}}}function SetTreeModule_compareStacks(te,ee,ne){e:for(;;){const re=te,se=ee,ie=ne;if(isEmpty(se))return isEmpty(ie)?0:-1;if(isEmpty(ie))return 1;if(head(ie)!=null)if(head(se)!=null){const oe=value(head(se)),me=value(head(ie));if(oe instanceof SetTreeNode$1){const pe=oe;if(SetTreeNode$1__get_Left(pe)==null)if(me instanceof SetTreeNode$1){const he=me;if(SetTreeNode$1__get_Left(he)==null){const ue=re.Compare(SetTreeLeaf$1__get_Key(pe),SetTreeLeaf$1__get_Key(he))|0;if(ue!==0)return ue|0;te=re,ee=cons(SetTreeNode$1__get_Right(pe),tail(se)),ne=cons(SetTreeNode$1__get_Right(he),tail(ie));continue e}else{let ue,de,Ae,Se,ce;switch(isEmpty(se)?isEmpty(ie)?ue=2:head(ie)!=null?(ue=1,Se=tail(ie),ce=value(head(ie))):ue=2:head(se)!=null?(ue=0,de=tail(se),Ae=value(head(se))):isEmpty(ie)?ue=2:head(ie)!=null?(ue=1,Se=tail(ie),ce=value(head(ie))):ue=2,ue){case 0:if(Ae instanceof SetTreeNode$1){const fe=Ae;te=re,ee=ofArrayWithTail([SetTreeNode$1__get_Left(fe),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(fe),void 0,SetTreeNode$1__get_Right(fe),0)],de),ne=ie;continue e}else{te=re,ee=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(Ae))],de),ne=ie;continue e}case 1:if(ce instanceof SetTreeNode$1){const fe=ce;te=re,ee=se,ne=ofArrayWithTail([SetTreeNode$1__get_Left(fe),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(fe),void 0,SetTreeNode$1__get_Right(fe),0)],Se);continue e}else{te=re,ee=se,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ce))],Se);continue e}default:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const he=re.Compare(SetTreeLeaf$1__get_Key(pe),SetTreeLeaf$1__get_Key(me))|0;if(he!==0)return he|0;te=re,ee=cons(SetTreeNode$1__get_Right(pe),tail(se)),ne=cons(void 0,tail(ie));continue e}else{let he,ue,de,Ae,Se;switch(isEmpty(se)?isEmpty(ie)?he=2:head(ie)!=null?(he=1,Ae=tail(ie),Se=value(head(ie))):he=2:head(se)!=null?(he=0,ue=tail(se),de=value(head(se))):isEmpty(ie)?he=2:head(ie)!=null?(he=1,Ae=tail(ie),Se=value(head(ie))):he=2,he){case 0:if(de instanceof SetTreeNode$1){const ce=de;te=re,ee=ofArrayWithTail([SetTreeNode$1__get_Left(ce),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(ce),void 0,SetTreeNode$1__get_Right(ce),0)],ue),ne=ie;continue e}else{te=re,ee=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(de))],ue),ne=ie;continue e}case 1:if(Se instanceof SetTreeNode$1){const ce=Se;te=re,ee=se,ne=ofArrayWithTail([SetTreeNode$1__get_Left(ce),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(ce),void 0,SetTreeNode$1__get_Right(ce),0)],Ae);continue e}else{te=re,ee=se,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(Se))],Ae);continue e}default:throw new Error("unexpected state in SetTree.compareStacks")}}}else if(me instanceof SetTreeNode$1){const pe=me;if(SetTreeNode$1__get_Left(pe)==null){const he=re.Compare(SetTreeLeaf$1__get_Key(oe),SetTreeLeaf$1__get_Key(pe))|0;if(he!==0)return he|0;te=re,ee=cons(void 0,tail(se)),ne=cons(SetTreeNode$1__get_Right(pe),tail(ie));continue e}else{let he,ue,de,Ae,Se;switch(isEmpty(se)?isEmpty(ie)?he=2:head(ie)!=null?(he=1,Ae=tail(ie),Se=value(head(ie))):he=2:head(se)!=null?(he=0,ue=tail(se),de=value(head(se))):isEmpty(ie)?he=2:head(ie)!=null?(he=1,Ae=tail(ie),Se=value(head(ie))):he=2,he){case 0:if(de instanceof SetTreeNode$1){const ce=de;te=re,ee=ofArrayWithTail([SetTreeNode$1__get_Left(ce),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(ce),void 0,SetTreeNode$1__get_Right(ce),0)],ue),ne=ie;continue e}else{te=re,ee=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(de))],ue),ne=ie;continue e}case 1:if(Se instanceof SetTreeNode$1){const ce=Se;te=re,ee=se,ne=ofArrayWithTail([SetTreeNode$1__get_Left(ce),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(ce),void 0,SetTreeNode$1__get_Right(ce),0)],Ae);continue e}else{te=re,ee=se,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(Se))],Ae);continue e}default:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const pe=re.Compare(SetTreeLeaf$1__get_Key(oe),SetTreeLeaf$1__get_Key(me))|0;if(pe!==0)return pe|0;te=re,ee=tail(se),ne=tail(ie);continue e}}else{value(head(ie));let oe,me,pe,he,ue;switch(isEmpty(se)?isEmpty(ie)?oe=2:head(ie)!=null?(oe=1,he=tail(ie),ue=value(head(ie))):oe=2:head(se)!=null?(oe=0,me=tail(se),pe=value(head(se))):isEmpty(ie)?oe=2:head(ie)!=null?(oe=1,he=tail(ie),ue=value(head(ie))):oe=2,oe){case 0:if(pe instanceof SetTreeNode$1){const de=pe;te=re,ee=ofArrayWithTail([SetTreeNode$1__get_Left(de),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(de),void 0,SetTreeNode$1__get_Right(de),0)],me),ne=ie;continue e}else{te=re,ee=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(pe))],me),ne=ie;continue e}case 1:if(ue instanceof SetTreeNode$1){const de=ue;te=re,ee=se,ne=ofArrayWithTail([SetTreeNode$1__get_Left(de),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(de),void 0,SetTreeNode$1__get_Right(de),0)],he);continue e}else{te=re,ee=se,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ue))],he);continue e}default:throw new Error("unexpected state in SetTree.compareStacks")}}else if(head(se)!=null){value(head(se));let oe,me,pe,he,ue;switch(isEmpty(se)?isEmpty(ie)?oe=2:head(ie)!=null?(oe=1,he=tail(ie),ue=value(head(ie))):oe=2:head(se)!=null?(oe=0,me=tail(se),pe=value(head(se))):isEmpty(ie)?oe=2:head(ie)!=null?(oe=1,he=tail(ie),ue=value(head(ie))):oe=2,oe){case 0:if(pe instanceof SetTreeNode$1){const de=pe;te=re,ee=ofArrayWithTail([SetTreeNode$1__get_Left(de),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(de),void 0,SetTreeNode$1__get_Right(de),0)],me),ne=ie;continue e}else{te=re,ee=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(pe))],me),ne=ie;continue e}case 1:if(ue instanceof SetTreeNode$1){const de=ue;te=re,ee=se,ne=ofArrayWithTail([SetTreeNode$1__get_Left(de),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(de),void 0,SetTreeNode$1__get_Right(de),0)],he);continue e}else{te=re,ee=se,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ue))],he);continue e}default:throw new Error("unexpected state in SetTree.compareStacks")}}else{te=re,ee=tail(se),ne=tail(ie);continue e}}}function SetTreeModule_compare(te,ee,ne){return ee==null?ne==null?0:-1:ne==null?1:SetTreeModule_compareStacks(te,singleton$1(ee),singleton$1(ne))|0}function SetTreeModule_copyToArray(te,ee,ne){let re=ne;SetTreeModule_iter(se=>{ee[re]=se,re=re+1|0},te)}function SetTreeModule_mkFromEnumerator(te,ee,ne){e:for(;;){const re=te,se=ee,ie=ne;if(ie["System.Collections.IEnumerator.MoveNext"]()){te=re,ee=SetTreeModule_add(re,ie["System.Collections.Generic.IEnumerator`1.get_Current"](),se),ne=ie;continue e}else return se}}function SetTreeModule_ofArray(te,ee){return fold$2((ne,re)=>SetTreeModule_add(te,re,ne),void 0,ee)}function SetTreeModule_ofList(te,ee){return fold$1((ne,re)=>SetTreeModule_add(te,re,ne),void 0,ee)}function SetTreeModule_ofSeq(te,ee){if(isArrayLike(ee))return SetTreeModule_ofArray(te,ee);if(ee instanceof FSharpList)return SetTreeModule_ofList(te,ee);{const ne=getEnumerator(ee);try{return SetTreeModule_mkFromEnumerator(te,void 0,ne)}finally{disposeSafe(ne)}}}class FSharpSet{constructor(ee,ne){this.comparer=ee,this.tree=ne}GetHashCode(){return FSharpSet__ComputeHashCode(this)|0}Equals(ee){let ne;const re=this;return ee instanceof FSharpSet&&(ne=ee,SetTreeModule_compare(FSharpSet__get_Comparer(re),FSharpSet__get_Tree(re),FSharpSet__get_Tree(ne))===0)}toString(){return"set ["+join("; ",map$2(ne=>toString$3(ne),this))+"]"}get[Symbol.toStringTag](){return"FSharpSet"}toJSON(){const ee=this;return Array.from(ee)}CompareTo(ee){const ne=this;return SetTreeModule_compare(FSharpSet__get_Comparer(ne),FSharpSet__get_Tree(ne),FSharpSet__get_Tree(ee))|0}"System.Collections.Generic.ICollection`1.Add2B595"(ee){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Remove2B595"(ee){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Contains2B595"(ee){const ne=this;return SetTreeModule_mem(FSharpSet__get_Comparer(ne),ee,FSharpSet__get_Tree(ne))}"System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(ee,ne){SetTreeModule_copyToArray(FSharpSet__get_Tree(this),ee,ne)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return FSharpSet__get_Count(this)|0}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return FSharpSet__get_Count(this)|0}GetEnumerator(){return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(this))}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(this))}get size(){return FSharpSet__get_Count(this)|0}add(ee){throw new Error("Set cannot be mutated")}clear(){throw new Error("Set cannot be mutated")}delete(ee){throw new Error("Set cannot be mutated")}has(ee){return FSharpSet__Contains(this,ee)}keys(){return map$2(ne=>ne,this)}values(){return map$2(ne=>ne,this)}entries(){return map$2(ne=>[ne,ne],this)}forEach(ee,ne){const re=this;iterate(se=>{ee(se,se,re)},re)}}function FSharpSet_$ctor(te,ee){return new FSharpSet(te,ee)}function FSharpSet__get_Comparer(te){return te.comparer}function FSharpSet__get_Tree(te){return te.tree}function FSharpSet_Empty(te){return FSharpSet_$ctor(te,void 0)}function FSharpSet__Add(te,ee){return FSharpSet_$ctor(FSharpSet__get_Comparer(te),SetTreeModule_add(FSharpSet__get_Comparer(te),ee,FSharpSet__get_Tree(te)))}function FSharpSet__get_Count(te){return SetTreeModule_count(FSharpSet__get_Tree(te))}function FSharpSet__Contains(te,ee){return SetTreeModule_mem(FSharpSet__get_Comparer(te),ee,FSharpSet__get_Tree(te))}function FSharpSet__ComputeHashCode(te){let ee=0;const ne=getEnumerator(te);try{for(;ne["System.Collections.IEnumerator.MoveNext"]();){const re=ne["System.Collections.Generic.IEnumerator`1.get_Current"]();ee=(ee<<1)+structuralHash(re)+631|0}}finally{disposeSafe(ne)}return Math.abs(ee)|0}function contains(te,ee){return FSharpSet__Contains(ee,te)}function add$1(te,ee){return FSharpSet__Add(ee,te)}function empty(te){return FSharpSet_Empty(te)}function ofList(te,ee){return FSharpSet_$ctor(ee,SetTreeModule_ofSeq(ee,te))}function ofSeq(te,ee){return FSharpSet_$ctor(ee,SetTreeModule_ofSeq(ee,te))}function genericMsg(te,ee,ne){try{return"Expecting "+te+" but instead got:"+(ne?`
|
|
5
|
+
`:" ")+(JSON.stringify(ee,null,4)+"")}catch{return"Expecting "+te+" but decoder failed. Couldn't report given value due to circular structure."+(ne?`
|
|
6
|
+
`:" ")}}function errorToString(te,ee){const ne=ee.tag===2?genericMsg(ee.fields[0],ee.fields[1],!0):ee.tag===1?genericMsg(ee.fields[0],ee.fields[1],!1)+`
|
|
7
|
+
Reason: `+ee.fields[2]:ee.tag===3?genericMsg(ee.fields[0],ee.fields[1],!0):ee.tag===4?genericMsg(ee.fields[0],ee.fields[1],!0)+("\nNode `"+ee.fields[2]+"` is unkown."):ee.tag===5?"Expecting "+ee.fields[0]+`.
|
|
8
|
+
`+(JSON.stringify(ee.fields[1],null,4)+""):ee.tag===7?`The following errors were found:
|
|
9
9
|
|
|
10
|
-
`+
|
|
10
|
+
`+join(`
|
|
11
11
|
|
|
12
|
-
`,t.fields[0]):t.tag===6?"The following `failure` occurred with the decoder: "+t.fields[0]:Mt(t.fields[0],t.fields[1],!1);return t.tag===7?n:"Error at: `"+e+"`\n"+n}function Ii(e,t,n){const r=t(e,n);if(r.tag===1){const o=r.fields[0];return new _(1,[yc(o[0],o[1])])}else return new _(0,[r.fields[0]])}function bc(e,t){try{return Ii("$",e,JSON.parse(t))}catch(n){if(n instanceof SyntaxError)return new _(1,["Given an invalid JSON: "+n.message]);throw n}}function Pi(e,t){return typeof t=="string"?new _(0,[t]):new _(1,[[e,new v(0,["a string",t])]])}function vc(e,t){if(typeof t=="string"){const n=t;return n.length===1?new _(0,[n[0]]):new _(1,[[e,new v(0,["a single character string",t])]])}else return new _(1,[[e,new v(0,["a char",t])]])}function Sc(e,t){if(typeof t=="string"){let n,r="00000000-0000-0000-0000-000000000000";return n=[Da(t,new ae(()=>r,o=>{r=o})),r],n[0]?new _(0,[n[1]]):new _(1,[[e,new v(0,["a guid",t])]])}else return new _(1,[[e,new v(0,["a guid",t])]])}function Cc(e,t){return t==null?new _(0,[void 0]):new _(1,[[e,new v(0,["null",t])]])}const ho=e=>t=>{const n=e,r=t;if(typeof r=="number"){const o=r;return isFinite(o)&&Math.floor(o)===o?-128<=o&&o<=127?new _(0,[(o+128&255)-128]):new _(1,[[n,new v(1,["a sbyte",o,"Value was either too large or too small for a sbyte"])]]):new _(1,[[n,new v(1,["a sbyte",o,"Value is not an integral value"])]])}else if(typeof r=="string"){let o,s=0;return o=[kt(r,511,!1,8,new ae(()=>s,i=>{s=i|0})),s],o[0]?new _(0,[o[1]]):new _(1,[[n,new v(0,["a sbyte",r])]])}else return new _(1,[[n,new v(0,["a sbyte",r])]])},po=e=>t=>{const n=e,r=t;if(typeof r=="number"){const o=r;return isFinite(o)&&Math.floor(o)===o?0<=o&&o<=255?new _(0,[o&255]):new _(1,[[n,new v(1,["a byte",o,"Value was either too large or too small for a byte"])]]):new _(1,[[n,new v(1,["a byte",o,"Value is not an integral value"])]])}else if(typeof r=="string"){let o,s=0;return o=[kt(r,511,!0,8,new ae(()=>s,i=>{s=i})),s],o[0]?new _(0,[o[1]]):new _(1,[[n,new v(0,["a byte",r])]])}else return new _(1,[[n,new v(0,["a byte",r])]])},_o=e=>t=>{const n=e,r=t;if(typeof r=="number"){const o=r;return isFinite(o)&&Math.floor(o)===o?-32768<=o&&o<=32767?new _(0,[(o+32768&65535)-32768]):new _(1,[[n,new v(1,["an int16",o,"Value was either too large or too small for an int16"])]]):new _(1,[[n,new v(1,["an int16",o,"Value is not an integral value"])]])}else if(typeof r=="string"){let o,s=0;return o=[kt(r,511,!1,16,new ae(()=>s,i=>{s=i|0})),s],o[0]?new _(0,[o[1]]):new _(1,[[n,new v(0,["an int16",r])]])}else return new _(1,[[n,new v(0,["an int16",r])]])},mo=e=>t=>{const n=e,r=t;if(typeof r=="number"){const o=r;return isFinite(o)&&Math.floor(o)===o?0<=o&&o<=65535?new _(0,[o&65535]):new _(1,[[n,new v(1,["an uint16",o,"Value was either too large or too small for an uint16"])]]):new _(1,[[n,new v(1,["an uint16",o,"Value is not an integral value"])]])}else if(typeof r=="string"){let o,s=0;return o=[kt(r,511,!0,16,new ae(()=>s,i=>{s=i})),s],o[0]?new _(0,[o[1]]):new _(1,[[n,new v(0,["an uint16",r])]])}else return new _(1,[[n,new v(0,["an uint16",r])]])},go=e=>t=>{const n=e,r=t;if(typeof r=="number"){const o=r;return isFinite(o)&&Math.floor(o)===o?-2147483648<=o&&o<=2147483647?new _(0,[~~o]):new _(1,[[n,new v(1,["an int",o,"Value was either too large or too small for an int"])]]):new _(1,[[n,new v(1,["an int",o,"Value is not an integral value"])]])}else if(typeof r=="string"){let o,s=0;return o=[kt(r,511,!1,32,new ae(()=>s,i=>{s=i|0})),s],o[0]?new _(0,[o[1]]):new _(1,[[n,new v(0,["an int",r])]])}else return new _(1,[[n,new v(0,["an int",r])]])},wo=e=>t=>{const n=e,r=t;if(typeof r=="number"){const o=r;return isFinite(o)&&Math.floor(o)===o?0<=o&&o<=4294967295?new _(0,[o>>>0]):new _(1,[[n,new v(1,["an uint32",o,"Value was either too large or too small for an uint32"])]]):new _(1,[[n,new v(1,["an uint32",o,"Value is not an integral value"])]])}else if(typeof r=="string"){let o,s=0;return o=[kt(r,511,!0,32,new ae(()=>s,i=>{s=i})),s],o[0]?new _(0,[o[1]]):new _(1,[[n,new v(0,["an uint32",r])]])}else return new _(1,[[n,new v(0,["an uint32",r])]])};function xc(e,t){return typeof t=="boolean"?new _(0,[t]):new _(1,[[e,new v(0,["a boolean",t])]])}function Ec(e,t){return typeof t=="number"?new _(0,[t]):new _(1,[[e,new v(0,["a float",t])]])}function kc(e,t){return typeof t=="number"?new _(0,[t]):new _(1,[[e,new v(0,["a float32",t])]])}function Tc(e,t){if(typeof t=="string"){let n,r=_u();return n=[gu(t,new ae(()=>r,o=>{r=o})),r],n[0]?new _(0,[wu(n[1])]):new _(1,[[e,new v(0,["a datetime",t])]])}else return new _(1,[[e,new v(0,["a datetime",t])]])}function Mc(e,t){if(typeof t=="string"){let n,r=Ga();return n=[Wa(t,new ae(()=>r,o=>{r=o})),r],n[0]?new _(0,[n[1]]):new _(1,[[e,new v(0,["a datetimeoffset",t])]])}else return new _(1,[[e,new v(0,["a datetime",t])]])}function $c(e,t){if(typeof t=="string"){let n,r=0;return n=[tc(t,new ae(()=>r,o=>{r=o})),r],n[0]?new _(0,[n[1]]):new _(1,[[e,new v(0,["a timespan",t])]])}else return new _(1,[[e,new v(0,["a timespan",t])]])}function yo(e,t,n,r){let o;const s=n+".["+et(e)+"]";if(Array.isArray(r)){const i=r;return e<i.length?t(s,i[e]):new _(1,[[s,new v(5,["a longer array. Need index `"+et(e)+"` but there are only `"+(o=i.length,et(o))+"` entries",r])]])}else return new _(1,[[s,new v(0,["an array",r])]])}function Ic(e,t,n){return n==null?new _(0,[void 0]):ye(le,e(t,n))}function bo(e,t,n){if(Array.isArray(n)){let r=-1;return ye(br,xn((o,s)=>{if(r=r+1|0,o.tag===0){const i=e(t+".["+et(r)+"]",s);return i.tag===0?new _(0,[me(i.fields[0],o.fields[0])]):new _(1,[i.fields[0]])}else return o},new _(0,[J()]),n))}else return new _(1,[[t,new v(0,["a list",n])]])}function Pc(e,t,n){if(Array.isArray(n)){let r=-1;return ye(sa,xn((o,s)=>{if(r=r+1|0,o.tag===0){const i=e(t+".["+et(r)+"]",s);return i.tag===0?new _(0,[ie([i.fields[0]],o.fields[0])]):new _(1,[i.fields[0]])}else return o},new _(0,[[]]),n))}else return new _(1,[[t,new v(0,["a seq",n])]])}function vo(e,t,n){if(Array.isArray(n)){let r=-1;const o=n;return xn((s,i)=>{if(r=r+1|0,s.tag===0){const l=s.fields[0],a=e(t+".["+et(r)+"]",i);return a.tag===0?(l[r]=a.fields[0],new _(0,[l])):new _(1,[a.fields[0]])}else return s},new _(0,[Cn(new Array(o.length),0,o.length,null)]),o)}else return new _(1,[[t,new v(0,["an array",n])]])}function Ac(e,t,n){return((o,s)=>{e:for(;;){const i=o,l=s;if(I(i))return new _(1,[[t,new v(7,[l])]]);{const a=Ii(t,V(x(i)),n);if(a.tag===1){o=M(i),s=vr(l,Y(a.fields[0]));continue e}else return new _(0,[a.fields[0]])}}})(e,J())}function Oc(e,t,n){return new _(0,[e])}function So(e,t,n,r){const o=t(n,r);return o.tag===0?e(o.fields[0],n,r):new _(1,[o.fields[0]])}function Nc(e,t,n,r){const o=t(n,r);return o.tag===1?new _(1,[o.fields[0]]):new _(0,[e(o.fields[0])])}function Rc(e,t){let n;const r=e;return n=o=>s=>yo(0,r,o,s),o=>s=>So(zn(i=>{let l;const a=t;return l=c=>f=>yo(1,a,c,f),c=>f=>So((u,p,h)=>Oc([i,u]),V(l),c,f)}),V(n),o,s)}function Fc(e){return Ta(e,{Compare:be})}function Dc(e){return wc(e,{Compare:be})}function Vc(e,t,n){return n!==null&&Object.getPrototypeOf(n||!1)===Object.prototype?ti((r,o)=>{const s=r[0];return o.tag===0?ye(i=>me(i,o.fields[0]),r[1](t+"."+s)(n[s])):o},e,new _(0,[J()])):new _(1,[[t,new v(0,["an object",n])]])}function Lc(e,t,n,r){return r!==null&&Object.getPrototypeOf(r||!1)===Object.prototype?kn((o,s)=>{if(o.tag===0){const i=e(n,s);if(i.tag===0){const l=t(n+"."+s,r[s]);return l.tag===0?new _(0,[me([i.fields[0],l.fields[0]],o.fields[0])]):new _(1,[l.fields[0]])}else return new _(1,[i.fields[0]])}else return o},new _(0,[J()]),Object.keys(r)):new _(1,[[n,new v(0,["an object",r])]])}function Ai(e,t,n,r){let o;const s=t.length+e|0;if(s!==r.length)return new _(1,[[n,new v(6,[(o=r.length|0,yt(We("Expected array of length %i but got %i"))(s)(o))])]]);{let i=new _(0,[J()]);for(let l=e;l<=r.length-1;l++)if(i.tag===0){const a=i.fields[0],c=yt(We("%s[%i]"))(n)(l),f=t[l-e],u=r[l];i=ye(p=>me(p,a),f(c)(u))}return ye(br,i)}}function Co(e,t,n,r,o,s){const i=Pu(l=>ht(l)===r,Fs(n));if(i!=null){const l=i,a=xt(c=>Ee(e,t,!1,c[1]),Hs(l));return ye(c=>Gl(l,Wt(c)),a.length===0&&s.length<=1?new _(0,[J()]):Ai(1,a,o,s))}else return new _(1,[[o,new v(6,["Cannot find case "+r+" in "+R(n)])]])}function xo(e,t,n,r){let o;const s=new ae(Te());let i;const l=R(r);i=l===""?e:pi(l,s,e);let a;if(Ls(r)){const c=xt(f=>[vi(t,ht(f)),Ee(i,t,!1,f[1])],Nt(r));a=f=>u=>ye(p=>zl(r,Wt(p)),Vc(c,f,u))}else if(Vs(r))a=c=>f=>{if(typeof f=="string")return Co(i,t,r,f,c,[]);if(Array.isArray(f)){const u=f;return eu(p=>Co(i,t,r,p,c,u),Pi(c+"[0]",u[0]))}else return new _(1,[[c,new v(0,["a string or array",f])]])};else if(n)a=c=>f=>new _(1,[[c,new v(2,["an extra coder for "+R(r),f])]]);else throw new Error((o=R(r),yt(We(`Cannot generate auto decoder for %s. Please pass an extra decoder.
|
|
12
|
+
`,ee.fields[0]):ee.tag===6?"The following `failure` occurred with the decoder: "+ee.fields[0]:genericMsg(ee.fields[0],ee.fields[1],!1);return ee.tag===7?ne:"Error at: `"+te+"`\n"+ne}function fromValue(te,ee,ne){const re=ee(te,ne);if(re.tag===1){const se=re.fields[0];return new FSharpResult$2(1,[errorToString(se[0],se[1])])}else return new FSharpResult$2(0,[re.fields[0]])}function fromString(te,ee){try{return fromValue("$",te,JSON.parse(ee))}catch(ne){if(ne instanceof SyntaxError)return new FSharpResult$2(1,["Given an invalid JSON: "+ne.message]);throw ne}}function string(te,ee){return typeof ee=="string"?new FSharpResult$2(0,[ee]):new FSharpResult$2(1,[[te,new ErrorReason(0,["a string",ee])]])}function char(te,ee){if(typeof ee=="string"){const ne=ee;return ne.length===1?new FSharpResult$2(0,[ne[0]]):new FSharpResult$2(1,[[te,new ErrorReason(0,["a single character string",ee])]])}else return new FSharpResult$2(1,[[te,new ErrorReason(0,["a char",ee])]])}function guid$1(te,ee){if(typeof ee=="string"){let ne,re="00000000-0000-0000-0000-000000000000";return ne=[tryParse$3(ee,new FSharpRef(()=>re,se=>{re=se})),re],ne[0]?new FSharpResult$2(0,[ne[1]]):new FSharpResult$2(1,[[te,new ErrorReason(0,["a guid",ee])]])}else return new FSharpResult$2(1,[[te,new ErrorReason(0,["a guid",ee])]])}function unit$1(te,ee){return ee==null?new FSharpResult$2(0,[void 0]):new FSharpResult$2(1,[[te,new ErrorReason(0,["null",ee])]])}const sbyte=te=>ee=>{const ne=te,re=ee;if(typeof re=="number"){const se=re;return isFinite(se)&&Math.floor(se)===se?-128<=se&&se<=127?new FSharpResult$2(0,[(se+128&255)-128]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a sbyte",se,"Value was either too large or too small for a sbyte"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a sbyte",se,"Value is not an integral value"])]])}else if(typeof re=="string"){let se,ie=0;return se=[tryParse$2(re,511,!1,8,new FSharpRef(()=>ie,oe=>{ie=oe|0})),ie],se[0]?new FSharpResult$2(0,[se[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["a sbyte",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["a sbyte",re])]])},byte=te=>ee=>{const ne=te,re=ee;if(typeof re=="number"){const se=re;return isFinite(se)&&Math.floor(se)===se?0<=se&&se<=255?new FSharpResult$2(0,[se&255]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a byte",se,"Value was either too large or too small for a byte"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a byte",se,"Value is not an integral value"])]])}else if(typeof re=="string"){let se,ie=0;return se=[tryParse$2(re,511,!0,8,new FSharpRef(()=>ie,oe=>{ie=oe})),ie],se[0]?new FSharpResult$2(0,[se[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["a byte",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["a byte",re])]])},int16=te=>ee=>{const ne=te,re=ee;if(typeof re=="number"){const se=re;return isFinite(se)&&Math.floor(se)===se?-32768<=se&&se<=32767?new FSharpResult$2(0,[(se+32768&65535)-32768]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int16",se,"Value was either too large or too small for an int16"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int16",se,"Value is not an integral value"])]])}else if(typeof re=="string"){let se,ie=0;return se=[tryParse$2(re,511,!1,16,new FSharpRef(()=>ie,oe=>{ie=oe|0})),ie],se[0]?new FSharpResult$2(0,[se[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int16",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int16",re])]])},uint16=te=>ee=>{const ne=te,re=ee;if(typeof re=="number"){const se=re;return isFinite(se)&&Math.floor(se)===se?0<=se&&se<=65535?new FSharpResult$2(0,[se&65535]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint16",se,"Value was either too large or too small for an uint16"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint16",se,"Value is not an integral value"])]])}else if(typeof re=="string"){let se,ie=0;return se=[tryParse$2(re,511,!0,16,new FSharpRef(()=>ie,oe=>{ie=oe})),ie],se[0]?new FSharpResult$2(0,[se[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint16",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint16",re])]])},int=te=>ee=>{const ne=te,re=ee;if(typeof re=="number"){const se=re;return isFinite(se)&&Math.floor(se)===se?-2147483648<=se&&se<=2147483647?new FSharpResult$2(0,[~~se]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int",se,"Value was either too large or too small for an int"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int",se,"Value is not an integral value"])]])}else if(typeof re=="string"){let se,ie=0;return se=[tryParse$2(re,511,!1,32,new FSharpRef(()=>ie,oe=>{ie=oe|0})),ie],se[0]?new FSharpResult$2(0,[se[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int",re])]])},uint32=te=>ee=>{const ne=te,re=ee;if(typeof re=="number"){const se=re;return isFinite(se)&&Math.floor(se)===se?0<=se&&se<=4294967295?new FSharpResult$2(0,[se>>>0]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint32",se,"Value was either too large or too small for an uint32"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint32",se,"Value is not an integral value"])]])}else if(typeof re=="string"){let se,ie=0;return se=[tryParse$2(re,511,!0,32,new FSharpRef(()=>ie,oe=>{ie=oe})),ie],se[0]?new FSharpResult$2(0,[se[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint32",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint32",re])]])};function bool(te,ee){return typeof ee=="boolean"?new FSharpResult$2(0,[ee]):new FSharpResult$2(1,[[te,new ErrorReason(0,["a boolean",ee])]])}function float(te,ee){return typeof ee=="number"?new FSharpResult$2(0,[ee]):new FSharpResult$2(1,[[te,new ErrorReason(0,["a float",ee])]])}function float32(te,ee){return typeof ee=="number"?new FSharpResult$2(0,[ee]):new FSharpResult$2(1,[[te,new ErrorReason(0,["a float32",ee])]])}function datetimeUtc(te,ee){if(typeof ee=="string"){let ne,re=minValue$1();return ne=[tryParse$4(ee,new FSharpRef(()=>re,se=>{re=se})),re],ne[0]?new FSharpResult$2(0,[toUniversalTime(ne[1])]):new FSharpResult$2(1,[[te,new ErrorReason(0,["a datetime",ee])]])}else return new FSharpResult$2(1,[[te,new ErrorReason(0,["a datetime",ee])]])}function datetimeOffset$1(te,ee){if(typeof ee=="string"){let ne,re=minValue();return ne=[tryParse$1(ee,new FSharpRef(()=>re,se=>{re=se})),re],ne[0]?new FSharpResult$2(0,[ne[1]]):new FSharpResult$2(1,[[te,new ErrorReason(0,["a datetimeoffset",ee])]])}else return new FSharpResult$2(1,[[te,new ErrorReason(0,["a datetime",ee])]])}function timespan$1(te,ee){if(typeof ee=="string"){let ne,re=0;return ne=[tryParse(ee,new FSharpRef(()=>re,se=>{re=se})),re],ne[0]?new FSharpResult$2(0,[ne[1]]):new FSharpResult$2(1,[[te,new ErrorReason(0,["a timespan",ee])]])}else return new FSharpResult$2(1,[[te,new ErrorReason(0,["a timespan",ee])]])}function index$1(te,ee,ne,re){let se;const ie=ne+".["+int32ToString(te)+"]";if(Array.isArray(re)){const oe=re;return te<oe.length?ee(ie,oe[te]):new FSharpResult$2(1,[[ie,new ErrorReason(5,["a longer array. Need index `"+int32ToString(te)+"` but there are only `"+(se=oe.length,int32ToString(se))+"` entries",re])]])}else return new FSharpResult$2(1,[[ie,new ErrorReason(0,["an array",re])]])}function option$1(te,ee,ne){return ne==null?new FSharpResult$2(0,[void 0]):Result_Map(some,te(ee,ne))}function list(te,ee,ne){if(Array.isArray(ne)){let re=-1;return Result_Map(reverse$1,fold$2((se,ie)=>{if(re=re+1|0,se.tag===0){const oe=te(ee+".["+int32ToString(re)+"]",ie);return oe.tag===0?new FSharpResult$2(0,[cons(oe.fields[0],se.fields[0])]):new FSharpResult$2(1,[oe.fields[0]])}else return se},new FSharpResult$2(0,[empty$3()]),ne))}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a list",ne])]])}function seq$1(te,ee,ne){if(Array.isArray(ne)){let re=-1;return Result_Map(reverse,fold$2((se,ie)=>{if(re=re+1|0,se.tag===0){const oe=te(ee+".["+int32ToString(re)+"]",ie);return oe.tag===0?new FSharpResult$2(0,[append([oe.fields[0]],se.fields[0])]):new FSharpResult$2(1,[oe.fields[0]])}else return se},new FSharpResult$2(0,[[]]),ne))}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a seq",ne])]])}function array(te,ee,ne){if(Array.isArray(ne)){let re=-1;const se=ne;return fold$2((ie,oe)=>{if(re=re+1|0,ie.tag===0){const me=ie.fields[0],pe=te(ee+".["+int32ToString(re)+"]",oe);return pe.tag===0?(me[re]=pe.fields[0],new FSharpResult$2(0,[me])):new FSharpResult$2(1,[pe.fields[0]])}else return ie},new FSharpResult$2(0,[fill(new Array(se.length),0,se.length,null)]),se)}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["an array",ne])]])}function oneOf(te,ee,ne){return((se,ie)=>{e:for(;;){const oe=se,me=ie;if(isEmpty(oe))return new FSharpResult$2(1,[[ee,new ErrorReason(7,[me])]]);{const pe=fromValue(ee,uncurry2(head(oe)),ne);if(pe.tag===1){se=tail(oe),ie=append$1(me,singleton$1(pe.fields[0]));continue e}else return new FSharpResult$2(0,[pe.fields[0]])}}})(te,empty$3())}function succeed(te,ee,ne){return new FSharpResult$2(0,[te])}function andThen(te,ee,ne,re){const se=ee(ne,re);return se.tag===0?te(se.fields[0],ne,re):new FSharpResult$2(1,[se.fields[0]])}function map(te,ee,ne,re){const se=ee(ne,re);return se.tag===1?new FSharpResult$2(1,[se.fields[0]]):new FSharpResult$2(0,[te(se.fields[0])])}function tuple2(te,ee){let ne;const re=te;return ne=se=>ie=>index$1(0,re,se,ie),se=>ie=>andThen(uncurry3(oe=>{let me;const pe=ee;return me=he=>ue=>index$1(1,pe,he,ue),he=>ue=>andThen((de,Ae,Se)=>succeed([oe,de]),uncurry2(me),he,ue)}),uncurry2(ne),se,ie)}function toMap(te){return ofSeq$1(te,{Compare:compare$1})}function toSet(te){return ofSeq(te,{Compare:compare$1})}function autoObject(te,ee,ne){return ne!==null&&Object.getPrototypeOf(ne||!1)===Object.prototype?foldBack$1((re,se)=>{const ie=re[0];return se.tag===0?Result_Map(oe=>cons(oe,se.fields[0]),re[1](ee+"."+ie)(ne[ie])):se},te,new FSharpResult$2(0,[empty$3()])):new FSharpResult$2(1,[[ee,new ErrorReason(0,["an object",ne])]])}function autoObject2(te,ee,ne,re){return re!==null&&Object.getPrototypeOf(re||!1)===Object.prototype?fold((se,ie)=>{if(se.tag===0){const oe=te(ne,ie);if(oe.tag===0){const me=ee(ne+"."+ie,re[ie]);return me.tag===0?new FSharpResult$2(0,[cons([oe.fields[0],me.fields[0]],se.fields[0])]):new FSharpResult$2(1,[me.fields[0]])}else return new FSharpResult$2(1,[oe.fields[0]])}else return se},new FSharpResult$2(0,[empty$3()]),Object.keys(re)):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an object",re])]])}function mixedArray(te,ee,ne,re){let se;const ie=ee.length+te|0;if(ie!==re.length)return new FSharpResult$2(1,[[ne,new ErrorReason(6,[(se=re.length|0,toText(printf("Expected array of length %i but got %i"))(ie)(se))])]]);{let oe=new FSharpResult$2(0,[empty$3()]);for(let me=te;me<=re.length-1;me++)if(oe.tag===0){const pe=oe.fields[0],he=toText(printf("%s[%i]"))(ne)(me),ue=ee[me-te],de=re[me];oe=Result_Map(Ae=>cons(Ae,pe),ue(he)(de))}return Result_Map(reverse$1,oe)}}function makeUnion(te,ee,ne,re,se,ie){const oe=tryFind$1(me=>name(me)===re,getUnionCases(ne));if(oe!=null){const me=oe,pe=map$4(he=>autoDecoder(te,ee,!1,he[1]),getUnionCaseFields(me));return Result_Map(he=>makeUnion$1(me,toArray$1(he)),pe.length===0&&ie.length<=1?new FSharpResult$2(0,[empty$3()]):mixedArray(1,pe,se,ie))}else return new FSharpResult$2(1,[[se,new ErrorReason(6,["Cannot find case "+re+" in "+fullName(ne)])]])}function autoDecodeRecordsAndUnions(te,ee,ne,re){let se;const ie=new FSharpRef(defaultOf());let oe;const me=fullName(re);oe=me===""?te:add$2(me,ie,te);let pe;if(isRecord(re)){const he=map$4(ue=>[Util_Casing_convert(ee,name(ue)),autoDecoder(oe,ee,!1,ue[1])],getRecordElements(re));pe=ue=>de=>Result_Map(Ae=>makeRecord(re,toArray$1(Ae)),autoObject(he,ue,de))}else if(isUnion(re))pe=he=>ue=>{if(typeof ue=="string")return makeUnion(oe,ee,re,ue,he,[]);if(Array.isArray(ue)){const de=ue;return Result_Bind(Ae=>makeUnion(oe,ee,re,Ae,he,de),string(he+"[0]",de[0]))}else return new FSharpResult$2(1,[[he,new ErrorReason(0,["a string or array",ue])]])};else if(ne)pe=he=>ue=>new FSharpResult$2(1,[[he,new ErrorReason(2,["an extra coder for "+fullName(re),ue])]]);else throw new Error((se=fullName(re),toText(printf(`Cannot generate auto decoder for %s. Please pass an extra decoder.
|
|
13
13
|
|
|
14
|
-
Documentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders`))(
|
|
14
|
+
Documentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders`))(se)));return ie.contents=pe,pe}function autoDecoder(te,ee,ne,re){let se,ie,oe,me;const pe=fullName(re),he=tryFind(pe,te);if(he==null)if(isArray(re)){const ue=autoDecoder(te,ee,!1,getElementType(re));return de=>Ae=>array(uncurry2(ue),de,Ae)}else if(isEnum(re))switch(fullName(getEnumUnderlyingType(re))){case"System.SByte":return de=>Ae=>{const Se=re,ce=de,fe=Ae,ye=sbyte(ce)(fe);if(ye.tag===1)return new FSharpResult$2(1,[ye.fields[0]]);{const ve=ye.fields[0]|0;return contains$1(ve,getEnumValues(Se),{Equals:(Pe,we)=>Pe===we,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(Se,ve.toString())]):new FSharpResult$2(1,[[ce,new ErrorReason(1,[fullName(Se),fe,"Unkown value provided for the enum"])]])}};case"System.Byte":return de=>Ae=>{const Se=re,ce=de,fe=Ae,ye=byte(ce)(fe);if(ye.tag===1)return new FSharpResult$2(1,[ye.fields[0]]);{const ve=ye.fields[0];return contains$1(ve,getEnumValues(Se),{Equals:(Pe,we)=>Pe===we,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(Se,ve.toString())]):new FSharpResult$2(1,[[ce,new ErrorReason(1,[fullName(Se),fe,"Unkown value provided for the enum"])]])}};case"System.Int16":return de=>Ae=>{const Se=re,ce=de,fe=Ae,ye=int16(ce)(fe);if(ye.tag===1)return new FSharpResult$2(1,[ye.fields[0]]);{const ve=ye.fields[0]|0;return contains$1(ve,getEnumValues(Se),{Equals:(Pe,we)=>Pe===we,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(Se,int16ToString(ve))]):new FSharpResult$2(1,[[ce,new ErrorReason(1,[fullName(Se),fe,"Unkown value provided for the enum"])]])}};case"System.UInt16":return de=>Ae=>{const Se=re,ce=de,fe=Ae,ye=uint16(ce)(fe);if(ye.tag===1)return new FSharpResult$2(1,[ye.fields[0]]);{const ve=ye.fields[0];return contains$1(ve,getEnumValues(Se),{Equals:(Pe,we)=>Pe===we,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(Se,ve.toString())]):new FSharpResult$2(1,[[ce,new ErrorReason(1,[fullName(Se),fe,"Unkown value provided for the enum"])]])}};case"System.Int32":return de=>Ae=>{const Se=re,ce=de,fe=Ae,ye=int(ce)(fe);if(ye.tag===1)return new FSharpResult$2(1,[ye.fields[0]]);{const ve=ye.fields[0]|0;return contains$1(ve,getEnumValues(Se),{Equals:(Pe,we)=>Pe===we,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(Se,int32ToString(ve))]):new FSharpResult$2(1,[[ce,new ErrorReason(1,[fullName(Se),fe,"Unkown value provided for the enum"])]])}};case"System.UInt32":return de=>Ae=>{const Se=re,ce=de,fe=Ae,ye=uint32(ce)(fe);if(ye.tag===1)return new FSharpResult$2(1,[ye.fields[0]]);{const ve=ye.fields[0];return contains$1(ve,getEnumValues(Se),{Equals:(Pe,we)=>Pe===we,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(Se,ve.toString())]):new FSharpResult$2(1,[[ce,new ErrorReason(1,[fullName(Se),fe,"Unkown value provided for the enum"])]])}};default:{const de=fullName(re),Ae=toFail(printf(`Cannot generate auto decoder for %s.
|
|
15
15
|
Thoth.Json.Net only support the following enum types:
|
|
16
16
|
- sbyte
|
|
17
17
|
- byte
|
|
@@ -20,9 +20,9 @@ Thoth.Json.Net only support the following enum types:
|
|
|
20
20
|
- int
|
|
21
21
|
- uint32
|
|
22
22
|
If you can't use one of these types, please pass an extra decoder.
|
|
23
|
-
`))(
|
|
23
|
+
`))(de);return Se=>Ae(Se)}}else if(isGenericType(re))if(isTuple(re)){const ue=map$4(de=>autoDecoder(te,ee,!1,de),getTupleElements(re));return de=>Ae=>Array.isArray(Ae)?Result_Map(Se=>makeTuple(toArray$1(Se)),mixedArray(0,ue,de,Ae)):new FSharpResult$2(1,[[de,new ErrorReason(0,["an array",Ae])]])}else switch(fullName(getGenericTypeDefinition(re))){case"Microsoft.FSharp.Core.FSharpOption`1[System.Object]":return se=autoDecoder(te,ee,!0,getGenerics(re)[0]),de=>Ae=>option$1(uncurry2(se),de,Ae);case"Microsoft.FSharp.Collections.FSharpList`1[System.Object]":return ie=autoDecoder(te,ee,!1,getGenerics(re)[0]),de=>Ae=>list(uncurry2(ie),de,Ae);case"System.Collections.Generic.IEnumerable`1[System.Object]":return oe=autoDecoder(te,ee,!1,getGenerics(re)[0]),de=>Ae=>seq$1(uncurry2(oe),de,Ae);case"Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]":{const de=autoDecoder(te,ee,!1,getGenerics(re)[0]),Ae=autoDecoder(te,ee,!1,getGenerics(re)[1]);let Se;const ce=ofArray$2([fe=>ye=>autoObject2(uncurry2(de),uncurry2(Ae),fe,ye),(me=tuple2(uncurry2(de),uncurry2(Ae)),fe=>ye=>list(uncurry2(me),fe,ye))]);return Se=fe=>ye=>oneOf(ce,fe,ye),fe=>ye=>map(toMap,uncurry2(Se),fe,ye)}case"Microsoft.FSharp.Collections.FSharpSet`1[System.Object]":{const de=autoDecoder(te,ee,!1,getGenerics(re)[0]);return Ae=>Se=>{const ce=array(uncurry2(de),Ae,Se);return ce.tag===0?new FSharpResult$2(0,[toSet(ce.fields[0])]):new FSharpResult$2(1,[ce.fields[0]])}}default:return autoDecodeRecordsAndUnions(te,ee,ne,re)}else switch(pe){case"System.Boolean":return ue=>de=>bool(ue,de);case"Microsoft.FSharp.Core.Unit":return ue=>de=>unit$1(ue,de);case"System.String":return ue=>de=>string(ue,de);case"System.Char":return ue=>de=>char(ue,de);case"System.SByte":return sbyte;case"System.Byte":return byte;case"System.Int16":return int16;case"System.UInt16":return uint16;case"System.Int32":return int;case"System.UInt32":return uint32;case"System.Double":return ue=>de=>float(ue,de);case"System.Single":return ue=>de=>float32(ue,de);case"System.DateTime":return ue=>de=>datetimeUtc(ue,de);case"System.DateTimeOffset":return ue=>de=>datetimeOffset$1(ue,de);case"System.TimeSpan":return ue=>de=>timespan$1(ue,de);case"System.Guid":return ue=>de=>guid$1(ue,de);case"System.Object":return ue=>de=>new FSharpResult$2(0,[de]);default:return autoDecodeRecordsAndUnions(te,ee,ne,re)}else{const ue=he;return de=>Ae=>ue.contents(de)(Ae)}}function makeExtra$1(te){return te!=null?map$1((ee,ne)=>new FSharpRef(ne[1]),te.Coders):empty$1({Compare:comparePrimitives})}function Auto_generateBoxedDecoder_Z6670B51(te,ee,ne){const re=defaultArg(ee,new CaseStrategy(0,[]));return autoDecoder(makeExtra$1(ne),re,!1,te)}function makeRangeStepFunction(te,ee,ne,re){const se=compare$1(te,ne)|0;if(se===0)throw new Error("The step of a range cannot be zero");const ie=se>0;return oe=>{const me=compare$1(oe,ee)|0;return ie&&me<=0||!ie&&me>=0?[oe,re(oe,te)]:void 0}}function integralRangeStep(te,ee,ne,re,se){const ie=makeRangeStepFunction(ee,ne,re,se);return delay(()=>unfold(ie,te))}function rangeDouble(te,ee,ne){return integralRangeStep(te,ee,ne,0,(re,se)=>re+se)}class PathDto extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["BlobStorage","Unused"]}}function PathDto_$reflection(){return union_type("WorkplacePolicies.Api.Shared.Common.PathDto",[],PathDto,()=>[[["Item",string_type]],[]])}class FileDto extends Record{constructor(ee,ne){super(),this.Name=ee,this.Path=ne}}function FileDto_$reflection(){return record_type("WorkplacePolicies.Api.Shared.Common.FileDto",[],FileDto,()=>[["Name",string_type],["Path",PathDto_$reflection()]])}class AboutDto extends Record{constructor(ee,ne){super(),this.Copy=ee,this.Link=ne}}function AboutDto_$reflection(){return record_type("WorkplacePolicies.Api.Shared.Common.AboutDto",[],AboutDto,()=>[["Copy",string_type],["Link",string_type]])}class PolicyIdentifierDto extends Record{constructor(ee,ne){super(),this.PolicyId=ee,this.VersionNumber=ne|0}}function PolicyIdentifierDto_$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.PolicyIdentifierDto",[],PolicyIdentifierDto,()=>[["PolicyId",string_type],["VersionNumber",int32_type]])}class PolicyReviewItemStatusDto extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["Presented","Opened","Accepted"]}}function PolicyReviewItemStatusDto_$reflection(){return union_type("WorkplacePolicies.Api.Shared.BackendApiModels.PolicyReviewItemStatusDto",[],PolicyReviewItemStatusDto,()=>[[],[],[]])}function PolicyReviewItemStatusDto__ToNextStatus_468E0CC(te,ee){let ne;switch(te.tag){case 1:{switch(ee.tag){case 0:{ne=2;break}default:ne=1}break}case 2:{ne=3;break}default:ne=0}switch(ne){case 0:return ee;case 1:return ee;case 2:return te;default:return te}}class PolicyReviewItemDto extends Record{constructor(ee,ne){super(),this.Policy=ee,this.Status=ne}}function PolicyReviewItemDto_$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.PolicyReviewItemDto",[],PolicyReviewItemDto,()=>[["Policy",anonRecord_type(["About",AboutDto_$reflection()],["CreatedAt",class_type("System.DateTime")],["Description",string_type],["File",FileDto_$reflection()],["Identifier",PolicyIdentifierDto_$reflection()],["Title",string_type])],["Status",PolicyReviewItemStatusDto_$reflection()]])}class InitResponse extends Record{constructor(ee){super(),this.PolicyReviewList=ee}}function InitResponse_$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.InitResponse",[],InitResponse,()=>[["PolicyReviewList",list_type(PolicyReviewItemDto_$reflection())]])}class CommandRequest extends Record{constructor(ee){super(),this.Type=ee}}function CommandRequest_$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.CommandRequest",[],CommandRequest,()=>[["Type",CommandTypeDto_$reflection()]])}class CommandTypeDto extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["Present","Open","Accept","Complete"]}}function CommandTypeDto_$reflection(){return union_type("WorkplacePolicies.Api.Shared.BackendApiModels.CommandTypeDto",[],CommandTypeDto,()=>[[["Item",anonRecord_type(["PolicyIdentifierList",list_type(PolicyIdentifierDto_$reflection())])]],[["Item",PolicyIdentifierDto_$reflection()]],[["Item",PolicyIdentifierDto_$reflection()]],[["Item",anonRecord_type(["PolicyIdentifierList",list_type(PolicyIdentifierDto_$reflection())])]]])}function guid(te){return te}const nil=defaultOf();function seq(te){return Array.from(te)}function datetimeOffset(te){return toString$2(te,"O")}function timespan(te){return toString$1(te)}function unit(){return defaultOf()}function datetime(te){return toString$2(te,"O")}function toString(te,ee){return JSON.stringify(ee,void 0,some(te))}function option(te){return ee=>defaultArgWith(map$5(te,ee),()=>nil)}function autoEncodeRecordsAndUnions(te,ee,ne,re){let se;const ie=new FSharpRef(defaultOf());let oe;const me=fullName(re);oe=me===""?te:add$2(me,ie,te);let pe;if(isRecord(re)){const he=map$4(ue=>{const de=Util_Casing_convert(ee,name(ue)),Ae=autoEncoder(oe,ee,ne,ue[1]);return Se=>ce=>{const fe=getRecordField(Se,ue);return(!ne||ne&&fe!=null)&&(ce[de]=Ae(fe)),ce}},getRecordElements(re));pe=ue=>fold((de,Ae)=>Ae(ue)(de),{},he)}else if(isUnion(re))pe=he=>{const ue=getUnionFields(he,re),de=ue[0],Ae=ue[1],Se=Ae.length|0;if(Se===0)return name(de);{const ce=Se|0,fe=getUnionCaseFields(de),ye=fill(new Array(ce+1),0,ce+1,null);ye[0]=name(de);for(let ve=1;ve<=ce;ve++){const Pe=autoEncoder(oe,ee,ne,fe[ve-1][1]);ye[ve]=Pe(Ae[ve-1])}return ye}};else throw new Error((se=fullName(re),toText(printf(`Cannot generate auto encoder for %s. Please pass an extra encoder.
|
|
24
24
|
|
|
25
|
-
Documentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders`))(
|
|
25
|
+
Documentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders`))(se)));return ie.contents=pe,pe}function autoEncoder(te,ee,ne,re){const se=fullName(re),ie=tryFind(se,te);if(ie==null)if(isArray(re)){const oe=autoEncoder(te,ee,ne,getElementType(re));return me=>seq(map$2(oe,me))}else if(isEnum(re))switch(fullName(getEnumUnderlyingType(re))){case"System.SByte":return me=>me;case"System.Byte":return me=>me;case"System.Int16":return me=>me;case"System.UInt16":return me=>me;case"System.Int32":return me=>me;case"System.UInt32":return me=>me;default:{const me=fullName(re);return toFail(printf(`Cannot generate auto encoder for %s.
|
|
26
26
|
Thoth.Json.Net only support the following enum types:
|
|
27
27
|
- sbyte
|
|
28
28
|
- byte
|
|
@@ -34,7 +34,7 @@ Thoth.Json.Net only support the following enum types:
|
|
|
34
34
|
If you can't use one of these types, please pass an extra encoder.
|
|
35
35
|
|
|
36
36
|
Documentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders
|
|
37
|
-
`))(l)}}else if(Os(r))if(hr(r)){const i=xt(l=>Ne(e,t,n,l),Ds(r));return l=>Yt(oa((a,c)=>i[a](c),l))}else{const i=R(Ns(r));if(i==="Microsoft.FSharp.Core.FSharpOption`1[System.Object]"){const l=new _l(()=>ff(Ne(e,t,n,de(r)[0])));return a=>a==null?Oi:l.Value(a)}else if(i==="Microsoft.FSharp.Collections.FSharpList`1[System.Object]"||i==="Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"||i==="System.Collections.Generic.IEnumerable`1[System.Object]"){const l=Ne(e,t,n,de(r)[0]);return a=>Yt(we(l,a))}else if(i==="Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"){const l=de(r)[0],a=Ne(e,t,n,de(r)[1]);if(R(l)==="System.String"||R(l)==="System.Guid")return c=>kn((f,u)=>{const p=u;return f[p[0]]=a(p[1]),f},{},c);{let c;return c=Ne(e,t,n,l),u=>Yt(we(p=>{const h=p;return[c(h[0]),a(h[1])]},u))}}else return Eo(e,t,n,r)}else switch(o){case"System.Boolean":return i=>i;case"Microsoft.FSharp.Core.Unit":return uf;case"System.String":return i=>i;case"System.Char":return i=>i;case"System.SByte":return i=>i;case"System.Byte":return i=>i;case"System.Int16":return i=>i;case"System.UInt16":return i=>i;case"System.Int32":return i=>i;case"System.UInt32":return i=>i;case"System.Double":return i=>i;case"System.Single":return i=>i;case"System.DateTime":return af;case"System.DateTimeOffset":return sf;case"System.TimeSpan":return lf;case"System.Guid":return of;case"System.Object":return i=>i;default:return Eo(e,t,n,r)}else{const i=s;return l=>i.contents(l)}}function df(e){return e!=null?mi((t,n)=>new ae(n[0]),e.Coders):Cr({Compare:bn})}function hf(e,t,n,r){const o=Zn(t,new Tn(0,[])),s=Zn(r,!0);return Ne(df(n),o,s,e)}class pf{constructor(t,n){this.accessToken=n,this.baseUrl=`${t}/workplace-policies/backend`}}function _f(e,t){return new pf(e,t)}function mf(e){return Z.Delay(()=>{let t,n;const r=bi((t=yi(new mr(0,[]),wi(`${e.baseUrl}/init`)),Xn(gi(`Bearer ${e.accessToken}`),t)));return n=Z.Bind(r,o=>Z.Return(new _(0,[o]))),Z.Bind(n,o=>{const s=o;if(s.tag===1)return Z.Return(new _(1,[s.fields[0]]));{const i=s.fields[0];if(i.statusCode===200){const l=bc(V(jc(nf(),new Tn(1,[]),void 0)),i.responseText);return Z.Return(l)}else return Z.Return(new _(1,["Init request error"]))}})})}function Xt(e,t){return Z.Delay(()=>{let n,r,o;const s=new rf(t);let i;const l=bi((n=(r=(o=yi(new mr(1,[]),wi(`${e.baseUrl}/command`)),Xn(gi(`Bearer ${e.accessToken}`),o)),Pa(new Gs(1,[cf(0,hf(Ps,new Tn(1,[]),void 0,void 0)(s))]),r)),Xn($a("application/json"),n)));return i=Z.Bind(l,a=>Z.Return(new _(0,[a]))),Z.Bind(i,a=>{const c=a;return c.tag===1?Z.Return(new _(1,[c.fields[0]])):c.fields[0].statusCode===200?Z.Return(new _(0,[void 0])):Z.Return(new _(1,["Command request error"]))})})}function gf(){return J()}function Er(e){return Le("/",e)}function wf(e,t){const n=new Error("Duplicate SubId");return e(["Duplicate SubId: "+Er(t),n])}function Ni(e,t,n){try{F(n)}catch(r){e(["Error stopping subscription: "+Er(t),r])}}function yf(e,t,n,r){try{return[n,r(t)]}catch(o){e(["Error starting subscription: "+Er(n),o]);return}}function bf(e,t){pn(n=>{Ni(e,n[0],n[1])},t)}function ko(e,t,n,r,o,s){return pn(i=>{wf(e,i)},n),pn(i=>{Ni(e,i[0],i[1])},r),vr(o,Hu(i=>yf(e,t,i[0],i[1]),s))}function vf(){return[J(),mc({Compare:be}),J()]}function Sf(e,t,n,r,o){return er(e,r)?[me(e,n),r,o]:[n,_c(e,r),me([e,t],o)]}function Cf(e){return Fu((t,n)=>Sf(t[0],t[1],n[0],n[1],n[2]),e,vf())}const xf=J();function To(e,t){const n=gc(at(i=>i[0],e),{Compare:be}),r=Cf(t),o=r[1],s=r[0];if(n.Equals(o))return[s,J(),e,J()];{const i=Lu(l=>er(l[0],o),e);return[s,i[1],i[0],Vu(l=>!er(l[0],n),r[2])]}}class Ef{constructor(t,n,r){this.OnNext=t,this.OnError=n||(o=>{}),this.OnCompleted=r||(()=>{})}}function kf(e,t){t.Subscribe(new Ef(e))}class Tf{constructor(){this.delegates=[]}_add(t){this.delegates.push(t)}_remove(t){const n=this.delegates.indexOf(t);n>-1&&this.delegates.splice(n,1)}get Publish(){return $f(t=>{this._add(t)},t=>{this._remove(t)})}Trigger(t,n){let r=null;const o=n===void 0?t:(r=t,n);this.delegates.forEach(s=>{s(r,o)})}}class Mf extends Tf{}function $f(e,t){return{AddHandler(n){e(n)},RemoveHandler(n){t(n)},Subscribe(n){const r=(o,s)=>n.OnNext(s);return e(r),{Dispose(){t(r)}}}}}class If{constructor(t){this._enabled=!1,this._isDisposed=!1,this._intervalId=0,this._timeoutId=0,this.Interval=t&&t>0?t:100,this.AutoReset=!0,this._elapsed=new Mf}Elapsed(){return this._elapsed.Publish}get Enabled(){return this._enabled}set Enabled(t){!this._isDisposed&&this._enabled!==t&&(this._enabled=t,this._enabled?this.AutoReset?this._intervalId=setInterval(()=>{this.AutoReset||(this.Enabled=!1),this._elapsed.Trigger(new Date)},this.Interval):this._timeoutId=setTimeout(()=>{this.Enabled=!1,this._timeoutId=0,this.AutoReset&&(this.Enabled=!0),this._elapsed.Trigger(new Date)},this.Interval):(this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=0),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=0)))}Dispose(){this.Enabled=!1,this._isDisposed=!0}Close(){this.Dispose()}Start(){this.Enabled=!0}Stop(){this.Enabled=!1}}const Pf=If;function Af(e,t){console.error(le(e),t)}function Of(e,t){let n,r=new Pf(e);r.AutoReset=!1,n=r,kf(t,n.Elapsed()),n.Enabled=!0,n.Start()}function Mo(e,t,n){pn(r=>{try{r(t)}catch(o){e(o)}},n)}function je(){return J()}function $t(e,t,n,r){return Y(o=>{e(Z.Delay(()=>Z.Bind(iu(t(n)),s=>{const i=s;return i.tag===0&&o(r(i.fields[0])),Z.Zero()})))})}function It(e){Of(1,t=>{au(e)})}class mt extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Writable","ReadWritable"]}}class Nf{constructor(t){this.state=new mt(0,[Cn(new Array(Jr(t,10)),0,Jr(t,10),null),0])}}function Rf(e){return new Nf(e)}function $o(e){const t=e.state;if(t.tag===1){const n=t.fields[1]|0,r=t.fields[2]|0,o=t.fields[0],s=(r+1)%o.length|0;return s===n?e.state=new mt(0,[o,n]):e.state=new mt(1,[o,n,s]),le(o[r])}else return}function Ff(e,t){const n=e.state;if(n.tag===1){const r=n.fields[1]|0,o=n.fields[2]|0,s=n.fields[0];s[r]=t;const i=(r+1)%s.length|0;i===o?e.state=new mt(1,[Df(e,o,s),s.length,0]):e.state=new mt(1,[s,i,o])}else{const r=n.fields[1]|0,o=n.fields[0];o[r]=t;const s=(r+1)%o.length|0;e.state=new mt(1,[o,s,r])}}function Df(e,t,n){return Array.from($(()=>ie(ia(t,n),$(()=>ie(la(t,n),$(()=>ua(r=>T(Te()),Gc(0,1,n.length))))))))}class kr extends ue{constructor(t,n,r,o,s,i,l){super(),this.init=t,this.update=n,this.subscribe=r,this.view=o,this.setState=s,this.onError=i,this.termination=l}}function Vf(e,t,n){return new kr(e,t,r=>gf(),n,V(r=>{const o=Xe(n)(r);return s=>{o(s)}}),r=>{Af(r[0],r[1])},[r=>!1,r=>{}])}function Lf(e,t){return new kr(t.init,t.update,t.subscribe,t.view,e,t.onError,t.termination)}function Hf(e){return e.init}function jf(e,t,n,r,o,s,i){const l=Xe(e)(i.init),a=Pn(t)(Xe(i.update)),c=Pn(n)(Xe(i.view)),f=Pn(r)(Xe(i.setState));return new kr(l,V(a),Xe(o)(i.subscribe),V(c),V(f),i.onError,s(i.termination))}function Uf(e,t,n){let r;const o=n.init(t),s=o[0],i=n.subscribe(s),l=n.termination,a=Rf(10);let c=!1,f=s,u=xf,p=!1;const h=g=>{p||(Ff(a,g),c||(c=!0,m(),c=!1))},d=Xe(e)(h),m=()=>{let g,w=$o(a);for(;!p&&w!=null;){const C=y(w);if(l[0](C))bf(n.onError,u),l[1](f),p=!0;else{const k=n.update(C,f),q=k[0],H=n.subscribe(q);n.setState(q,d),Mo(te=>{n.onError([yt(We("Error handling the message: %A"))(C),te])},d,k[1]),f=q,u=(g=To(u,H),ko(n.onError,d,g[0],g[1],g[2],g[3])),w=$o(a)}}};c=!0,n.setState(s,d),Mo(g=>{n.onError([yt(We("Error intitializing:")),g])},d,o[1]),u=(r=To(u,i),ko(n.onError,d,r[0],r[1],r[2],r[3])),m(),c=!1}function Bf(e,t){Uf(V(n=>n),e,t)}function Gf(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Ri={exports:{}},Fi={};const zf=Gf(al);/**
|
|
37
|
+
`))(me)}}else if(isGenericType(re))if(isTuple(re)){const oe=map$4(me=>autoEncoder(te,ee,ne,me),getTupleElements(re));return me=>seq(mapIndexed((pe,he)=>oe[pe](he),me))}else{const oe=fullName(getGenericTypeDefinition(re));if(oe==="Microsoft.FSharp.Core.FSharpOption`1[System.Object]"){const me=new Lazy(()=>option(autoEncoder(te,ee,ne,getGenerics(re)[0])));return pe=>pe==null?nil:me.Value(pe)}else if(oe==="Microsoft.FSharp.Collections.FSharpList`1[System.Object]"||oe==="Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"||oe==="System.Collections.Generic.IEnumerable`1[System.Object]"){const me=autoEncoder(te,ee,ne,getGenerics(re)[0]);return pe=>seq(map$2(me,pe))}else if(oe==="Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"){const me=getGenerics(re)[0],pe=autoEncoder(te,ee,ne,getGenerics(re)[1]);if(fullName(me)==="System.String"||fullName(me)==="System.Guid")return he=>fold((ue,de)=>{const Ae=de;return ue[Ae[0]]=pe(Ae[1]),ue},{},he);{let he;return he=autoEncoder(te,ee,ne,me),de=>seq(map$2(Ae=>{const Se=Ae;return[he(Se[0]),pe(Se[1])]},de))}}else return autoEncodeRecordsAndUnions(te,ee,ne,re)}else switch(se){case"System.Boolean":return oe=>oe;case"Microsoft.FSharp.Core.Unit":return unit;case"System.String":return oe=>oe;case"System.Char":return oe=>oe;case"System.SByte":return oe=>oe;case"System.Byte":return oe=>oe;case"System.Int16":return oe=>oe;case"System.UInt16":return oe=>oe;case"System.Int32":return oe=>oe;case"System.UInt32":return oe=>oe;case"System.Double":return oe=>oe;case"System.Single":return oe=>oe;case"System.DateTime":return datetime;case"System.DateTimeOffset":return datetimeOffset;case"System.TimeSpan":return timespan;case"System.Guid":return guid;case"System.Object":return oe=>oe;default:return autoEncodeRecordsAndUnions(te,ee,ne,re)}else{const oe=ie;return me=>oe.contents(me)}}function makeExtra(te){return te!=null?map$1((ee,ne)=>new FSharpRef(ne[0]),te.Coders):empty$1({Compare:comparePrimitives})}function Auto_generateBoxedEncoder_437914C6(te,ee,ne,re){const se=defaultArg(ee,new CaseStrategy(0,[])),ie=defaultArg(re,!0);return autoEncoder(makeExtra(ne),se,ie,te)}class BackendService{constructor(ee,ne){this.accessToken=ne,this.baseUrl=`${ee}/workplace-policies/backend`}}function BackendService_$ctor_Z384F8060(te,ee){return new BackendService(te,ee)}function BackendService__GetInitState(te){return singleton$3.Delay(()=>{let ee;return singleton$3.Bind(Http_send((ee=Http_method(new HttpMethod(0,[]),Http_request(`${te.baseUrl}/init`)),Http_header(Headers_authorization(`Bearer ${te.accessToken}`),ee))),ne=>{const re=ne;return re.statusCode===200?singleton$3.Return(fromString(uncurry2(Auto_generateBoxedDecoder_Z6670B51(InitResponse_$reflection(),new CaseStrategy(1,[]),void 0)),re.responseText)):singleton$3.Return(new FSharpResult$2(1,["Init request error"]))})})}function BackendService__SendCommand_Z3B2D738(te,ee){return singleton$3.Delay(()=>{let ne,re,se;const ie=new CommandRequest(ee);return singleton$3.Bind(Http_send((ne=(re=(se=Http_method(new HttpMethod(1,[]),Http_request(`${te.baseUrl}/command`)),Http_header(Headers_authorization(`Bearer ${te.accessToken}`),se)),Http_content(new BodyContent(1,[toString(0,Auto_generateBoxedEncoder_437914C6(CommandRequest_$reflection(),new CaseStrategy(1,[]),void 0,void 0)(ie))]),re)),Http_header(Headers_contentType("application/json"),ne))),oe=>oe.statusCode===200?singleton$3.Return(new FSharpResult$2(0,[void 0])):singleton$3.Return(new FSharpResult$2(1,["Command request error"])))})}function Sub_none(){return empty$3()}function Sub_Internal_SubId_toString(te){return join("/",te)}function Sub_Internal_Fx_warnDupe(te,ee){const ne=new Error("Duplicate SubId");return te(["Duplicate SubId: "+Sub_Internal_SubId_toString(ee),ne])}function Sub_Internal_Fx_tryStop(te,ee,ne){try{disposeSafe(ne)}catch(re){te(["Error stopping subscription: "+Sub_Internal_SubId_toString(ee),re])}}function Sub_Internal_Fx_tryStart(te,ee,ne,re){try{return[ne,re(ee)]}catch(se){te(["Error starting subscription: "+Sub_Internal_SubId_toString(ne),se]);return}}function Sub_Internal_Fx_stop(te,ee){iterate$1(ne=>{Sub_Internal_Fx_tryStop(te,ne[0],ne[1])},ee)}function Sub_Internal_Fx_change(te,ee,ne,re,se,ie){return iterate$1(oe=>{Sub_Internal_Fx_warnDupe(te,oe)},ne),iterate$1(oe=>{Sub_Internal_Fx_tryStop(te,oe[0],oe[1])},re),append$1(se,choose(oe=>Sub_Internal_Fx_tryStart(te,ee,oe[0],oe[1]),ie))}function Sub_Internal_NewSubs_init(){return[empty$3(),empty({Compare:compare$1}),empty$3()]}function Sub_Internal_NewSubs_update(te,ee,ne,re,se){return contains(te,re)?[cons(te,ne),re,se]:[ne,add$1(te,re),cons([te,ee],se)]}function Sub_Internal_NewSubs_calculate(te){return foldBack((ee,ne)=>Sub_Internal_NewSubs_update(ee[0],ee[1],ne[0],ne[1],ne[2]),te,Sub_Internal_NewSubs_init())}const Sub_Internal_empty=empty$3();function Sub_Internal_diff(te,ee){const ne=ofList(map$3(oe=>oe[0],te),{Compare:compare$1}),re=Sub_Internal_NewSubs_calculate(ee),se=re[1],ie=re[0];if(ne.Equals(se))return[ie,empty$3(),te,empty$3()];{const oe=partition(me=>contains(me[0],se),te);return[ie,oe[1],oe[0],filter(me=>!contains(me[0],ne),re[2])]}}class Observer{constructor(ee,ne,re){this.OnNext=ee,this.OnError=ne||(se=>{}),this.OnCompleted=re||(()=>{})}}function add(te,ee){ee.Subscribe(new Observer(te))}class Event$2{constructor(){this.delegates=[]}_add(ee){this.delegates.push(ee)}_remove(ee){const ne=this.delegates.indexOf(ee);ne>-1&&this.delegates.splice(ne,1)}get Publish(){return createEvent(ee=>{this._add(ee)},ee=>{this._remove(ee)})}Trigger(ee,ne){let re=null;const se=ne===void 0?ee:(re=ee,ne);this.delegates.forEach(ie=>{ie(re,se)})}}let Event$1=class extends Event$2{};function createEvent(te,ee){return{AddHandler(ne){te(ne)},RemoveHandler(ne){ee(ne)},Subscribe(ne){const re=(se,ie)=>ne.OnNext(ie);return te(re),{Dispose(){ee(re)}}}}}class Timer{constructor(ee){this._enabled=!1,this._isDisposed=!1,this._intervalId=0,this._timeoutId=0,this.Interval=ee&&ee>0?ee:100,this.AutoReset=!0,this._elapsed=new Event$1}Elapsed(){return this._elapsed.Publish}get Enabled(){return this._enabled}set Enabled(ee){!this._isDisposed&&this._enabled!==ee&&(this._enabled=ee,this._enabled?this.AutoReset?this._intervalId=setInterval(()=>{this.AutoReset||(this.Enabled=!1),this._elapsed.Trigger(new Date)},this.Interval):this._timeoutId=setTimeout(()=>{this.Enabled=!1,this._timeoutId=0,this.AutoReset&&(this.Enabled=!0),this._elapsed.Trigger(new Date)},this.Interval):(this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=0),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=0)))}Dispose(){this.Enabled=!1,this._isDisposed=!0}Close(){this.Dispose()}Start(){this.Enabled=!0}Stop(){this.Enabled=!1}}const Timer$1=Timer;function Log_onError(te,ee){console.error(some(te),ee)}function Timer_delay(te,ee){let ne,re=new Timer$1(te);re.AutoReset=!1,ne=re,add(ee,ne.Elapsed()),ne.Enabled=!0,ne.Start()}function Cmd_exec(te,ee,ne){iterate$1(re=>{try{re(ee)}catch(se){te(se)}},ne)}function Cmd_none(){return empty$3()}function Cmd_OfAsyncWith_perform(te,ee,ne,re){return singleton$1(se=>{te(singleton$3.Delay(()=>singleton$3.Bind(catchAsync(ee(ne)),ie=>{const oe=ie;return oe.tag===0&&se(re(oe.fields[0])),singleton$3.Zero()})))})}function Cmd_OfAsync_start(te){Timer_delay(1,ee=>{startImmediate(te)})}class RingState$1 extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["Writable","ReadWritable"]}}class RingBuffer$1{constructor(ee){this.state=new RingState$1(0,[fill(new Array(max(ee,10)),0,max(ee,10),null),0])}}function RingBuffer$1_$ctor_Z524259A4(te){return new RingBuffer$1(te)}function RingBuffer$1__Pop(te){const ee=te.state;if(ee.tag===1){const ne=ee.fields[1]|0,re=ee.fields[2]|0,se=ee.fields[0],ie=(re+1)%se.length|0;return ie===ne?te.state=new RingState$1(0,[se,ne]):te.state=new RingState$1(1,[se,ne,ie]),some(se[re])}else return}function RingBuffer$1__Push_2B595(te,ee){const ne=te.state;if(ne.tag===1){const re=ne.fields[1]|0,se=ne.fields[2]|0,ie=ne.fields[0];ie[re]=ee;const oe=(re+1)%ie.length|0;oe===se?te.state=new RingState$1(1,[RingBuffer$1__doubleSize(te,se,ie),ie.length,0]):te.state=new RingState$1(1,[ie,oe,se])}else{const re=ne.fields[1]|0,se=ne.fields[0];se[re]=ee;const ie=(re+1)%se.length|0;te.state=new RingState$1(1,[se,ie,re])}}function RingBuffer$1__doubleSize(te,ee,ne){return Array.from(delay(()=>append(skip(ee,ne),delay(()=>append(take(ee,ne),delay(()=>collect(re=>singleton(defaultOf()),rangeDouble(0,1,ne.length))))))))}class Program$4 extends Record{constructor(ee,ne,re,se,ie,oe,me){super(),this.init=ee,this.update=ne,this.subscribe=re,this.view=se,this.setState=ie,this.onError=oe,this.termination=me}}function ProgramModule_mkProgram(te,ee,ne){return new Program$4(te,ee,re=>Sub_none(),ne,uncurry2(re=>{const se=curry2(ne)(re);return ie=>{se(ie)}}),re=>{Log_onError(re[0],re[1])},[re=>!1,re=>{}])}function ProgramModule_withSetState(te,ee){return new Program$4(ee.init,ee.update,ee.subscribe,ee.view,te,ee.onError,ee.termination)}function ProgramModule_init(te){return te.init}function ProgramModule_map(te,ee,ne,re,se,ie,oe){const me=curry2(te)(oe.init),pe=curry3(ee)(curry2(oe.update)),he=curry3(ne)(curry2(oe.view)),ue=curry3(re)(curry2(oe.setState));return new Program$4(me,uncurry2(pe),curry2(se)(oe.subscribe),uncurry2(he),uncurry2(ue),oe.onError,ie(oe.termination))}function ProgramModule_runWithDispatch(te,ee,ne){let re;const se=ne.init(ee),ie=se[0],oe=ne.subscribe(ie),me=ne.termination,pe=RingBuffer$1_$ctor_Z524259A4(10);let he=!1,ue=ie,de=Sub_Internal_empty,Ae=!1;const Se=ye=>{Ae||(RingBuffer$1__Push_2B595(pe,ye),he||(he=!0,fe(),he=!1))},ce=curry2(te)(Se),fe=()=>{let ye,ve=RingBuffer$1__Pop(pe);for(;!Ae&&ve!=null;){const Pe=value(ve);if(me[0](Pe))Sub_Internal_Fx_stop(ne.onError,de),me[1](ue),Ae=!0;else{const we=ne.update(Pe,ue),Te=we[0],Le=ne.subscribe(Te);ne.setState(Te,ce),Cmd_exec(Ne=>{ne.onError([toText(printf("Error handling the message: %A"))(Pe),Ne])},ce,we[1]),ue=Te,de=(ye=Sub_Internal_diff(de,Le),Sub_Internal_Fx_change(ne.onError,ce,ye[0],ye[1],ye[2],ye[3])),ve=RingBuffer$1__Pop(pe)}}};he=!0,ne.setState(ie,ce),Cmd_exec(ye=>{ne.onError([toText(printf("Error intitializing:")),ye])},ce,se[1]),de=(re=Sub_Internal_diff(de,oe),Sub_Internal_Fx_change(ne.onError,ce,re[0],re[1],re[2],re[3])),fe(),he=!1}function ProgramModule_runWith(te,ee){ProgramModule_runWithDispatch(uncurry2(ne=>ne),te,ee)}function getDefaultExportFromCjs(te){return te&&te.__esModule&&Object.prototype.hasOwnProperty.call(te,"default")?te.default:te}function getAugmentedNamespace(te){if(te.__esModule)return te;var ee=te.default;if(typeof ee=="function"){var ne=function re(){return this instanceof re?Reflect.construct(ee,arguments,this.constructor):ee.apply(this,arguments)};ne.prototype=ee.prototype}else ne={};return Object.defineProperty(ne,"__esModule",{value:!0}),Object.keys(te).forEach(function(re){var se=Object.getOwnPropertyDescriptor(te,re);Object.defineProperty(ne,re,se.get?se:{enumerable:!0,get:function(){return te[re]}})}),ne}var shim={exports:{}},useSyncExternalStoreShim_production_min={};const require$$0=getAugmentedNamespace(compat_module);/**
|
|
38
38
|
* @license React
|
|
39
39
|
* use-sync-external-store-shim.production.min.js
|
|
40
40
|
*
|
|
@@ -42,13 +42,20 @@ Documentation available at: https://thoth-org.github.io/Thoth.Json/documentation
|
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the MIT license found in the
|
|
44
44
|
* LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/var St=zf;function Wf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qf=typeof Object.is=="function"?Object.is:Wf,Zf=St.useState,Jf=St.useEffect,Kf=St.useLayoutEffect,Yf=St.useDebugValue;function Xf(e,t){var n=t(),r=Zf({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return Kf(function(){o.value=n,o.getSnapshot=t,Vn(o)&&s({inst:o})},[e,n,t]),Jf(function(){return Vn(o)&&s({inst:o}),e(function(){Vn(o)&&s({inst:o})})},[e]),Yf(n),n}function Vn(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qf(e,n)}catch{return!0}}function Qf(e,t){return t()}var ed=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Qf:Xf;Fi.useSyncExternalStore=St.useSyncExternalStore!==void 0?St.useSyncExternalStore:ed;Ri.exports=Fi;var td=Ri.exports;class nd{constructor(t,n,r){this.arg=n,this.dependencies=r;const o=t(),s=[];let i;const l=Hf(o)(this.arg);let a=l[0],c=l[1];i=[[a,f=>{s.push(f)},!1,s],c],this.state=i[0],this.cmd=i[1],this.subscribe=f=>{let u=!1;const p=Bn(this.state[0]);return Bf(this.arg,Lf((h,d)=>{const m=this.state;this.state=[h,d,!0,s],h!==m[0]&&f()},jf((h,d)=>{const m=this.cmd;return this.cmd=je(),[this.state[0],m]},(h,d,m)=>h(d)(this.state[0]),zn(h=>h),zn(h=>h),V(h=>h),h=>[d=>h[0](d)?!0:p&&u,d=>{const m=d;Bn(m)?F(m):h[1](d)}],o))),()=>{u=!0}}}}function Io(e,t,n){return new nd(e,t,n)}function rd(e){return e.state}function od(e){return e.subscribe}function sd(e,t,n){return oe(e.arg,t)?!oe(e.dependencies,n):!0}function id(e,t,n){const r=Lt(()=>Io(e,t,n)),o=r[0];sd(o,t,n)&&r[1](Io(e,t,n));const s=td.useSyncExternalStore(od(o),()=>rd(o)),i=s[2],l=s[3],a=s[1];return gn(()=>{if(i&&l.length>0){let c=z(l);try{for(;c["System.Collections.IEnumerator.MoveNext"]();){const f=c["System.Collections.Generic.IEnumerator`1.get_Current"]();setTimeout(()=>{a(f)})}}finally{F(c)}xl(l)}},[i,l]),[s[0],a]}const j=xs;function Di(e){return j.useState(e)}class L extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function tr(e){return e.tag===1}function Po(e,t){switch(t.tag){case 1:return new L(1,[]);case 3:return new L(3,[t.fields[0]]);case 2:try{return new L(2,[e(t.fields[0])])}catch(n){return new L(3,[n])}default:return new L(0,[])}}function ld(e){let t;t=new CustomEvent("step-completion",{bubbles:!0}),e.dispatchEvent(t)}class $e extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Requested","Finished"]}}class Dt extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Main","ReviewPolicy"]}}class pe extends ue{constructor(t,n,r,o,s,i){super(),this.Page=t,this.ReviewItemList=n,this.PresentPoliciesStatus=r,this.OpenPolicyStatus=o,this.AcceptPolicyStatus=s,this.ContinueStatus=i}}class _e extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["FetchReviewItemList","NavigatePage","PresentPolicies","OpenPolicy","AcceptPolicy","Continue"]}}function ud(){return[new pe(new Dt(0,[]),new L(0,[]),new L(0,[]),new L(0,[]),new L(0,[]),new L(0,[])),Y(e=>{e(new _e(0,[new $e(0,[])]))})]}function ad(e,t,n){let r,o;switch(t.tag){case 1:return[new pe(t.fields[0],n.ReviewItemList,n.PresentPoliciesStatus,n.OpenPolicyStatus,new L(0,[]),n.ContinueStatus),t.fields[0].tag===1?Y(s=>{s(new _e(3,[t.fields[0].fields[0],new $e(0,[])]))}):je()];case 2:return t.fields[1].tag===1?[new pe(n.Page,n.ReviewItemList,new L(2,[t.fields[1].fields[0]]),n.OpenPolicyStatus,n.AcceptPolicyStatus,n.ContinueStatus),je()]:[new pe(n.Page,n.ReviewItemList,new L(1,[]),n.OpenPolicyStatus,n.AcceptPolicyStatus,n.ContinueStatus),$t(s=>{It(s)},s=>Xt(e,s),new Kt(0,[{PolicyIdentifierList:at(s=>s.Policy.Identifier,t.fields[0])}]),s=>{const i=[t.fields[0],new $e(1,[s])];return new _e(2,[i[0],i[1]])})];case 3:return t.fields[1].tag===1?[new pe(n.Page,Po(s=>ye(i=>at(l=>oe(t.fields[0].Policy.Identifier,l.Policy.Identifier)?new nn(l.Policy,Dn(l.Status,new _t(1,[]))):l,i),s),n.ReviewItemList),n.PresentPoliciesStatus,new L(2,[t.fields[1].fields[0]]),n.AcceptPolicyStatus,n.ContinueStatus),je()]:[new pe(n.Page,n.ReviewItemList,n.PresentPoliciesStatus,new L(1,[]),n.AcceptPolicyStatus,n.ContinueStatus),$t(s=>{It(s)},s=>Xt(e,s),new Kt(1,[t.fields[0].Policy.Identifier]),s=>{const i=[t.fields[0],new $e(1,[s])];return new _e(3,[i[0],i[1]])})];case 4:if(t.fields[1].tag===1){const s=Po(i=>ye(l=>at(a=>oe(t.fields[0].Policy.Identifier,a.Policy.Identifier)?new nn(a.Policy,Dn(a.Status,new _t(2,[]))):a,l),i),n.ReviewItemList);return[new pe((r=n.Page,r.tag===1?(o=r.fields[0],new Dt(1,[new nn(o.Policy,Dn(o.Status,new _t(2,[])))])):new Dt(0,[])),s,n.PresentPoliciesStatus,n.OpenPolicyStatus,new L(2,[t.fields[1].fields[0]]),n.ContinueStatus),je()]}else return[new pe(n.Page,n.ReviewItemList,n.PresentPoliciesStatus,n.OpenPolicyStatus,new L(1,[]),n.ContinueStatus),$t(s=>{It(s)},s=>Xt(e,s),new Kt(2,[t.fields[0].Policy.Identifier]),s=>{const i=[t.fields[0],new $e(1,[s])];return new _e(4,[i[0],i[1]])})];case 5:if(t.fields[1].tag===1)return ld(document.querySelector("apollo-workplace-policies-app")),[new pe(n.Page,n.ReviewItemList,n.PresentPoliciesStatus,n.OpenPolicyStatus,n.AcceptPolicyStatus,new L(2,[t.fields[1].fields[0]])),je()];switch(n.ContinueStatus.tag){case 0:case 2:case 3:return[new pe(n.Page,n.ReviewItemList,n.PresentPoliciesStatus,n.OpenPolicyStatus,n.AcceptPolicyStatus,new L(1,[])),$t(i=>{It(i)},i=>Xt(e,i),new Kt(3,[{PolicyIdentifierList:at(i=>i.Policy.Identifier,t.fields[0])}]),i=>{const l=[t.fields[0],new $e(1,[i])];return new _e(5,[l[0],l[1]])})];default:return[n,je()]}default:return t.fields[0].tag===1?[new pe(n.Page,new L(2,[ye(s=>s.PolicyReviewList,t.fields[0].fields[0])]),n.PresentPoliciesStatus,n.OpenPolicyStatus,n.AcceptPolicyStatus,n.ContinueStatus),t.fields[0].fields[0].tag===1?je():Y(s=>{s(new _e(2,[t.fields[0].fields[0].fields[0].PolicyReviewList,new $e(0,[])]))})]:[new pe(n.Page,new L(1,[]),n.PresentPoliciesStatus,n.OpenPolicyStatus,n.AcceptPolicyStatus,n.ContinueStatus),$t(s=>{It(s)},()=>mf(e),void 0,s=>new _e(0,[new $e(1,[s])]))]}}const cd=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}[type=text],input:where(:not([type])),[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,input:where(:not([type])):focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#2563eb}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#2563eb;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}[type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}[type=checkbox]:checked:hover,[type=checkbox]:checked:focus,[type=radio]:checked:hover,[type=radio]:checked:focus{border-color:transparent;background-color:currentColor}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.mx-auto{margin-left:auto;margin-right:auto}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.inline{display:inline}.flex{display:flex}.h-10{height:2.5rem}.w-\\[4\\.75rem\\]{width:4.75rem}.w-full{width:100%}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.cursor-progress{cursor:progress}.flex-col-reverse{flex-direction:column-reverse}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-primary-base{border-color:var(--fl-color-primary)}.bg-primary-base{background-color:var(--fl-color-primary)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-1{padding:.25rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.font-inter{font-family:Inter,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-8{line-height:2rem}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-primary-base{color:var(--fl-color-primary)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline-offset-2{text-underline-offset:2px}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:-my-\\[1px\\]:hover{margin-top:-1px;margin-bottom:-1px}.hover\\:border-2:hover{border-width:2px}.hover\\:border-primary-base:hover{border-color:var(--fl-color-primary)}.hover\\:text-primary-base:hover{color:var(--fl-color-primary)}.hover\\:underline:hover{text-decoration-line:underline}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-primary-base:focus-visible{outline-color:var(--fl-color-primary)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:cursor-progress:disabled{cursor:progress}.disabled\\:border:disabled{border-width:1px}.disabled\\:border-gray-300:disabled{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.disabled\\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.disabled\\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\\:mr-2{margin-right:.5rem}.sm\\:mr-2\\.5{margin-right:.625rem}.sm\\:mt-0{margin-top:0}.sm\\:mt-10{margin-top:2.5rem}.sm\\:w-\\[12\\.5rem\\]{width:12.5rem}.sm\\:w-\\[35rem\\]{width:35rem}.sm\\:max-w-\\[57rem\\]{max-width:57rem}.sm\\:flex-row{flex-direction:row}.sm\\:p-5{padding:1.25rem}.sm\\:p-6{padding:1.5rem}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\\:text-base{font-size:1rem;line-height:1.5rem}.sm\\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\\:leading-6{line-height:1.5rem}.sm\\:leading-7{line-height:1.75rem}.sm\\:leading-8{line-height:2rem}.sm\\:leading-9{line-height:2.25rem}}
|
|
46
|
-
`,fd=(()=>Me(cd))(),dd=e=>b("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b("g",{clipPath:"url(#clip0_3040_23717)"},b("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"currentColor"}),b("path",{d:"M6 12L10 16L18 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),b("defs",null,b("clipPath",{id:"clip0_3040_23717"},b("rect",{width:24,height:24,fill:"white"})))),hd=e=>b("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b("path",{d:"M9 6L15 12L9 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),pd=e=>b("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),_d=e=>b("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 4H15.5C15.6326 4 15.7597 4.05268 15.8535 4.14645C15.9473 4.24022 16 4.36739 16 4.5V9.5C15.9999 9.59894 15.9706 9.69565 15.9156 9.77789C15.8606 9.86013 15.7824 9.92421 15.691 9.962C15.6303 9.98677 15.5655 9.99967 15.5 10C15.4343 10.0001 15.3692 9.98729 15.3084 9.96223C15.2477 9.93718 15.1925 9.9004 15.146 9.854L13.354 8.061L10.707 10.707C10.6147 10.8025 10.5044 10.8787 10.3824 10.9311C10.2604 10.9835 10.1291 11.0111 9.99636 11.0123C9.86358 11.0134 9.7319 10.9881 9.609 10.9378C9.48611 10.8875 9.37446 10.8133 9.28056 10.7194C9.18667 10.6255 9.11242 10.5139 9.06214 10.391C9.01186 10.2681 8.98655 10.1364 8.98771 10.0036C8.98886 9.87082 9.01645 9.7396 9.06886 9.6176C9.12127 9.49559 9.19745 9.38525 9.29296 9.293L11.939 6.646L10.146 4.854C10.0759 4.78407 10.0281 4.6949 10.0087 4.59779C9.98935 4.50068 9.99926 4.40001 10.0372 4.30854C10.0751 4.21706 10.1393 4.13891 10.2217 4.08398C10.3041 4.02905 10.4009 3.99982 10.5 4ZM12 16H6C5.46957 16 4.96086 15.7893 4.58579 15.4142C4.21071 15.0391 4 14.5304 4 14V8C4 7.46957 4.21071 6.96086 4.58579 6.58579C4.96086 6.21071 5.46957 6 6 6H7C7.26522 6 7.51957 6.10536 7.70711 6.29289C7.89464 6.48043 8 6.73478 8 7C8 7.26522 7.89464 7.51957 7.70711 7.70711C7.51957 7.89464 7.26522 8 7 8H6V14H12V13C12 12.7348 12.1054 12.4804 12.2929 12.2929C12.4804 12.1054 12.7348 12 13 12C13.2652 12 13.5196 12.1054 13.7071 12.2929C13.8946 12.4804 14 12.7348 14 13V14C14 14.5304 13.7893 15.0391 13.4142 15.4142C13.0391 15.7893 12.5304 16 12 16Z",fill:"currentColor"})),md=e=>b("svg",{width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b("g",{id:"Loader Mini"},b("path",{id:"Ellipse 2",d:"M18.5 10C18.5 14.4183 14.9183 18 10.5 18C6.08172 18 2.5 14.4183 2.5 10C2.5 5.58172 6.08172 2 10.5 2C14.9183 2 18.5 5.58172 18.5 10ZM4.49743 10C4.49743 13.3151 7.18487 16.0026 10.5 16.0026C13.8151 16.0026 16.5026 13.3151 16.5026 10C16.5026 6.68487 13.8151 3.99743 10.5 3.99743C7.18487 3.99743 4.49743 6.68487 4.49743 10Z",fill:"white",fillOpacity:.3}),b("path",{id:"Ellipse 2_2",d:"M10.5 3C10.5 2.44772 10.9494 1.99356 11.4974 2.06242C12.2053 2.15137 12.8996 2.3348 13.5615 2.60896C14.5321 3.011 15.414 3.60028 16.1569 4.34315C16.8997 5.08602 17.489 5.96793 17.891 6.93853C18.1652 7.60043 18.3486 8.29473 18.4376 9.0026C18.5064 9.55057 18.0523 10 17.5 10C16.9477 10 16.5085 9.54925 16.4169 9.00462C16.342 8.55939 16.2169 8.12298 16.0433 7.7039C15.7417 6.97595 15.2998 6.31451 14.7426 5.75736C14.1855 5.20021 13.5241 4.75825 12.7961 4.45672C12.377 4.28313 11.9406 4.15804 11.4954 4.08314C10.9508 3.99152 10.5 3.55228 10.5 3Z",fill:"white"}))),gd=e=>b("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b("path",{d:"M18 12H6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),wd=e=>b("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b("path",{d:"M12 6V12M12 12V18M12 12H18M12 12L6 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));class ft extends W{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Height","Width","ClassName"]}}function rt(e,t){return j.createElement(e,Oa(t,1))}function Vi(e){return rt(dd,e)}function yd(e){return rt(hd,e)}function bd(e){return rt(pd,e)}function vd(e){return rt(_d,e)}function Li(e){return rt(md,e)}function Sd(e){return rt(gd,e)}function Cd(e){return rt(wd,e)}function xd(e){let t,n,r;const o=e.dispatch,s=e.acceptPolicyStatus,i=e.policyReviewItem,l=Di(!1),a=l[0];return b("div",K(U([["className","w-full p-1 sm:p-5"],(t=[b("div",K(U([["className","flex justify-between items-center"],(n=ge($(()=>{let c,f;return ie(T(b("div",K(U([["className","flex items-center"],(c=[b("div",K(U([["onClick",u=>{o(new _e(1,[new Dt(0,[])]))}],(f=[bd(Y(new ft(2,["cursor-pointer text-gray-900 hover:text-primary-base"])))],["children",j.Children.toArray(Array.from(f))])]))),b("div",{className:"ml-1 mr-4 text-base sm:text-lg leading-6 sm:leading-7 font-semibold text-gray-900",children:i.Policy.Title})],["children",j.Children.toArray(Array.from(c))])])))),$(()=>{let u,p,h;return i.Status.tag===2?T(b("div",K(U([["className","flex items-center flex-col-reverse sm:flex-row"],(u=[b("span",{className:"mt-1 sm:mt-0 sm:mr-2.5 text-sm leading-5 font-medium text-gray-500",children:"Accepted"}),Vi(Y(new ft(2,["text-primary-base"])))],["children",j.Children.toArray(Array.from(u))])])))):T(b("button",K(U([["type","button"],["disabled",tr(s)],(p=`
|
|
45
|
+
*/var e=require$$0;function h(te,ee){return te===ee&&(te!==0||1/te===1/ee)||te!==te&&ee!==ee}var k=typeof Object.is=="function"?Object.is:h,l$1=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(te,ee){var ne=ee(),re=l$1({inst:{value:ne,getSnapshot:ee}}),se=re[0].inst,ie=re[1];return n(function(){se.value=ne,se.getSnapshot=ee,r$2(se)&&ie({inst:se})},[te,ne,ee]),m(function(){return r$2(se)&&ie({inst:se}),te(function(){r$2(se)&&ie({inst:se})})},[te]),p(ne),ne}function r$2(te){var ee=te.getSnapshot;te=te.value;try{var ne=ee();return!k(te,ne)}catch{return!0}}function t(te,ee){return ee()}var u$1=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?t:q;useSyncExternalStoreShim_production_min.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u$1;shim.exports=useSyncExternalStoreShim_production_min;var shimExports=shim.exports;class Util_ElmishState$3{constructor(ee,ne,re){this.arg=ne,this.dependencies=re;const se=ee(),ie=[];let oe;const me=ProgramModule_init(se)(this.arg);let pe=me[0],he=me[1];oe=[[pe,ue=>{ie.push(ue)},!1,ie],he],this.state=oe[0],this.cmd=oe[1],this.subscribe=ue=>{let de=!1;const Ae=isDisposable(this.state[0]);return ProgramModule_runWith(this.arg,ProgramModule_withSetState((Se,ce)=>{const fe=this.state;this.state=[Se,ce,!0,ie],Se!==fe[0]&&ue()},ProgramModule_map((Se,ce)=>{const fe=this.cmd;return this.cmd=Cmd_none(),[this.state[0],fe]},(Se,ce,fe)=>Se(ce)(this.state[0]),uncurry3(Se=>Se),uncurry3(Se=>Se),uncurry2(Se=>Se),Se=>[ce=>Se[0](ce)?!0:Ae&&de,ce=>{const fe=ce;isDisposable(fe)?disposeSafe(fe):Se[1](ce)}],se))),()=>{de=!0}}}}function Util_ElmishState$3_$ctor_Z29FF63CF(te,ee,ne){return new Util_ElmishState$3(te,ee,ne)}function Util_ElmishState$3__get_State(te){return te.state}function Util_ElmishState$3__get_Subscribe(te){return te.subscribe}function Util_ElmishState$3__IsOutdated_1954DBC6(te,ee,ne){return equals$1(te.arg,ee)?!equals$1(te.dependencies,ne):!0}function React_useElmish_Z6C327F2E(te,ee,ne){const re=h$1(()=>Util_ElmishState$3_$ctor_Z29FF63CF(te,ee,ne)),se=re[0];Util_ElmishState$3__IsOutdated_1954DBC6(se,ee,ne)&&re[1](Util_ElmishState$3_$ctor_Z29FF63CF(te,ee,ne));const ie=shimExports.useSyncExternalStore(Util_ElmishState$3__get_Subscribe(se),()=>Util_ElmishState$3__get_State(se)),oe=ie[2],me=ie[3],pe=ie[1];return p$1(()=>{if(oe&&me.length>0){let he=getEnumerator(me);try{for(;he["System.Collections.IEnumerator.MoveNext"]();){const ue=he["System.Collections.Generic.IEnumerator`1.get_Current"]();setTimeout(()=>{pe(ue)})}}finally{disposeSafe(he)}clear(me)}},[oe,me]),[ie[0],pe]}const Interop_reactApi=Cn;function useReact_useRef_1505(te){return Interop_reactApi.useRef(te)}function useFeliz_React__React_useState_Static_1505(te){return Interop_reactApi.useState(te)}class Deferred$1 extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function Deferred_inProgress(te){return te.tag===1}function Deferred_map(te,ee){switch(ee.tag){case 1:return new Deferred$1(1,[]);case 3:return new Deferred$1(3,[ee.fields[0]]);case 2:try{return new Deferred$1(2,[te(ee.fields[0])])}catch(ne){return new Deferred$1(3,[ne])}default:return new Deferred$1(0,[])}}function notifyCompletion(te){let ee;ee=new CustomEvent("step-completion",{bubbles:!0}),te.dispatchEvent(ee)}class AsyncOperationStatus$1 extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["Requested","Finished"]}}let Page$2=class extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["Main","ReviewPolicy"]}};class State extends Record{constructor(ee,ne,re,se,ie,oe){super(),this.Page=ee,this.ReviewItemList=ne,this.PresentPoliciesStatus=re,this.OpenPolicyStatus=se,this.AcceptPolicyStatus=ie,this.ContinueStatus=oe}}class Msg extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["FetchReviewItemList","NavigatePage","PresentPolicies","OpenPolicy","AcceptPolicy","Continue"]}}function StateModule_init(){return[new State(new Page$2(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[])),singleton$1(te=>{te(new Msg(0,[new AsyncOperationStatus$1(0,[])]))})]}function StateModule_update(te,ee,ne){let re,se;switch(ee.tag){case 1:return[new State(ee.fields[0],ne.ReviewItemList,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(0,[]),ne.ContinueStatus),ee.fields[0].tag===1?singleton$1(ie=>{ie(new Msg(3,[ee.fields[0].fields[0],new AsyncOperationStatus$1(0,[])]))}):Cmd_none()];case 2:return ee.fields[1].tag===1?[new State(ne.Page,ne.ReviewItemList,new Deferred$1(2,[ee.fields[1].fields[0]]),ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_none()]:[new State(ne.Page,ne.ReviewItemList,new Deferred$1(1,[]),ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(ie=>{Cmd_OfAsync_start(ie)},ie=>BackendService__SendCommand_Z3B2D738(te,ie),new CommandTypeDto(0,[{PolicyIdentifierList:map$3(ie=>ie.Policy.Identifier,ee.fields[0])}]),ie=>{const oe=[ee.fields[0],new AsyncOperationStatus$1(1,[ie])];return new Msg(2,[oe[0],oe[1]])})];case 3:return ee.fields[1].tag===1?[new State(ne.Page,Deferred_map(ie=>Result_Map(oe=>map$3(me=>equals$1(ee.fields[0].Policy.Identifier,me.Policy.Identifier)?new PolicyReviewItemDto(me.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(me.Status,new PolicyReviewItemStatusDto(1,[]))):me,oe),ie),ne.ReviewItemList),ne.PresentPoliciesStatus,new Deferred$1(2,[ee.fields[1].fields[0]]),ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_none()]:[new State(ne.Page,ne.ReviewItemList,ne.PresentPoliciesStatus,new Deferred$1(1,[]),ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(ie=>{Cmd_OfAsync_start(ie)},ie=>BackendService__SendCommand_Z3B2D738(te,ie),new CommandTypeDto(1,[ee.fields[0].Policy.Identifier]),ie=>{const oe=[ee.fields[0],new AsyncOperationStatus$1(1,[ie])];return new Msg(3,[oe[0],oe[1]])})];case 4:if(ee.fields[1].tag===1){const ie=Deferred_map(oe=>Result_Map(me=>map$3(pe=>equals$1(ee.fields[0].Policy.Identifier,pe.Policy.Identifier)?new PolicyReviewItemDto(pe.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(pe.Status,new PolicyReviewItemStatusDto(2,[]))):pe,me),oe),ne.ReviewItemList);return[new State((re=ne.Page,re.tag===1?(se=re.fields[0],new Page$2(1,[new PolicyReviewItemDto(se.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(se.Status,new PolicyReviewItemStatusDto(2,[])))])):new Page$2(0,[])),ie,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(2,[ee.fields[1].fields[0]]),ne.ContinueStatus),Cmd_none()]}else return[new State(ne.Page,ne.ReviewItemList,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(1,[]),ne.ContinueStatus),Cmd_OfAsyncWith_perform(ie=>{Cmd_OfAsync_start(ie)},ie=>BackendService__SendCommand_Z3B2D738(te,ie),new CommandTypeDto(2,[ee.fields[0].Policy.Identifier]),ie=>{const oe=[ee.fields[0],new AsyncOperationStatus$1(1,[ie])];return new Msg(4,[oe[0],oe[1]])})];case 5:if(ee.fields[1].tag===1)return notifyCompletion(document.querySelector("apollo-workplace-policies-app")),[new State(ne.Page,ne.ReviewItemList,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,new Deferred$1(2,[ee.fields[1].fields[0]])),Cmd_none()];switch(ne.ContinueStatus.tag){case 0:case 2:case 3:return[new State(ne.Page,ne.ReviewItemList,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,new Deferred$1(1,[])),Cmd_OfAsyncWith_perform(oe=>{Cmd_OfAsync_start(oe)},oe=>BackendService__SendCommand_Z3B2D738(te,oe),new CommandTypeDto(3,[{PolicyIdentifierList:map$3(oe=>oe.Policy.Identifier,ee.fields[0])}]),oe=>{const me=[ee.fields[0],new AsyncOperationStatus$1(1,[oe])];return new Msg(5,[me[0],me[1]])})];default:return[ne,Cmd_none()]}default:return ee.fields[0].tag===1?[new State(ne.Page,new Deferred$1(2,[Result_Map(ie=>ie.PolicyReviewList,ee.fields[0].fields[0])]),ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),ee.fields[0].fields[0].tag===1?Cmd_none():singleton$1(ie=>{ie(new Msg(2,[ee.fields[0].fields[0].fields[0].PolicyReviewList,new AsyncOperationStatus$1(0,[])]))})]:[new State(ne.Page,new Deferred$1(1,[]),ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(ie=>{Cmd_OfAsync_start(ie)},()=>BackendService__GetInitState(te),void 0,ie=>new Msg(0,[new AsyncOperationStatus$1(1,[ie])]))]}}const index=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-10{height:2.5rem}.w-\\[4\\.75rem\\]{width:4.75rem}.w-full{width:100%}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.cursor-progress{cursor:progress}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-primary-base{border-color:var(--fl-color-primary)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-primary-base{background-color:var(--fl-color-primary)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-1{padding:.25rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.font-inter{font-family:Inter,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-8{line-height:2rem}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-primary-base{color:var(--fl-color-primary)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline-offset-2{text-underline-offset:2px}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:-my-\\[1\\.5px\\]:hover{margin-top:-1.5px;margin-bottom:-1.5px}.hover\\:border-2:hover{border-width:2px}.hover\\:border-primary-base:hover{border-color:var(--fl-color-primary)}.hover\\:text-primary-base:hover{color:var(--fl-color-primary)}.hover\\:underline:hover{text-decoration-line:underline}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-primary-base:focus-visible{outline-color:var(--fl-color-primary)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:cursor-progress:disabled{cursor:progress}.disabled\\:border:disabled{border-width:1px}.disabled\\:border-gray-300:disabled{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.disabled\\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.disabled\\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\\:mr-2{margin-right:.5rem}.sm\\:mr-2\\.5{margin-right:.625rem}.sm\\:mt-0{margin-top:0}.sm\\:mt-10{margin-top:2.5rem}.sm\\:mt-6{margin-top:1.5rem}.sm\\:mt-\\[1px\\]{margin-top:1px}.sm\\:w-\\[12\\.5rem\\]{width:12.5rem}.sm\\:w-\\[35rem\\]{width:35rem}.sm\\:max-w-\\[57rem\\]{max-width:57rem}.sm\\:flex-row{flex-direction:row}.sm\\:p-5{padding:1.25rem}.sm\\:p-6{padding:1.5rem}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\\:text-base{font-size:1rem;line-height:1.5rem}.sm\\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\\:leading-6{line-height:1.5rem}.sm\\:leading-7{line-height:1.75rem}.sm\\:leading-8{line-height:2rem}.sm\\:leading-9{line-height:2.25rem}}@media (min-width: 1024px){.lg\\:block{display:block}}
|
|
46
|
+
`,css=(()=>toString$3(index))(),SvgCheck=te=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...te},y$1("g",{clipPath:"url(#clip0_3040_23717)"},y$1("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"currentColor"}),y$1("path",{d:"M6 12L10 16L18 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),y$1("defs",null,y$1("clipPath",{id:"clip0_3040_23717"},y$1("rect",{width:24,height:24,fill:"white"})))),SvgChevronRight=te=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...te},y$1("path",{d:"M9 6L15 12L9 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgChevronLeft=te=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...te},y$1("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgLaunch=te=>y$1("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...te},y$1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 4H15.5C15.6326 4 15.7597 4.05268 15.8535 4.14645C15.9473 4.24022 16 4.36739 16 4.5V9.5C15.9999 9.59894 15.9706 9.69565 15.9156 9.77789C15.8606 9.86013 15.7824 9.92421 15.691 9.962C15.6303 9.98677 15.5655 9.99967 15.5 10C15.4343 10.0001 15.3692 9.98729 15.3084 9.96223C15.2477 9.93718 15.1925 9.9004 15.146 9.854L13.354 8.061L10.707 10.707C10.6147 10.8025 10.5044 10.8787 10.3824 10.9311C10.2604 10.9835 10.1291 11.0111 9.99636 11.0123C9.86358 11.0134 9.7319 10.9881 9.609 10.9378C9.48611 10.8875 9.37446 10.8133 9.28056 10.7194C9.18667 10.6255 9.11242 10.5139 9.06214 10.391C9.01186 10.2681 8.98655 10.1364 8.98771 10.0036C8.98886 9.87082 9.01645 9.7396 9.06886 9.6176C9.12127 9.49559 9.19745 9.38525 9.29296 9.293L11.939 6.646L10.146 4.854C10.0759 4.78407 10.0281 4.6949 10.0087 4.59779C9.98935 4.50068 9.99926 4.40001 10.0372 4.30854C10.0751 4.21706 10.1393 4.13891 10.2217 4.08398C10.3041 4.02905 10.4009 3.99982 10.5 4ZM12 16H6C5.46957 16 4.96086 15.7893 4.58579 15.4142C4.21071 15.0391 4 14.5304 4 14V8C4 7.46957 4.21071 6.96086 4.58579 6.58579C4.96086 6.21071 5.46957 6 6 6H7C7.26522 6 7.51957 6.10536 7.70711 6.29289C7.89464 6.48043 8 6.73478 8 7C8 7.26522 7.89464 7.51957 7.70711 7.70711C7.51957 7.89464 7.26522 8 7 8H6V14H12V13C12 12.7348 12.1054 12.4804 12.2929 12.2929C12.4804 12.1054 12.7348 12 13 12C13.2652 12 13.5196 12.1054 13.7071 12.2929C13.8946 12.4804 14 12.7348 14 13V14C14 14.5304 13.7893 15.0391 13.4142 15.4142C13.0391 15.7893 12.5304 16 12 16Z",fill:"currentColor"})),SvgLoader=te=>y$1("svg",{width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...te},y$1("g",{id:"Loader Mini"},y$1("path",{id:"Ellipse 2",d:"M18.5 10C18.5 14.4183 14.9183 18 10.5 18C6.08172 18 2.5 14.4183 2.5 10C2.5 5.58172 6.08172 2 10.5 2C14.9183 2 18.5 5.58172 18.5 10ZM4.49743 10C4.49743 13.3151 7.18487 16.0026 10.5 16.0026C13.8151 16.0026 16.5026 13.3151 16.5026 10C16.5026 6.68487 13.8151 3.99743 10.5 3.99743C7.18487 3.99743 4.49743 6.68487 4.49743 10Z",fill:"white",fillOpacity:.3}),y$1("path",{id:"Ellipse 2_2",d:"M10.5 3C10.5 2.44772 10.9494 1.99356 11.4974 2.06242C12.2053 2.15137 12.8996 2.3348 13.5615 2.60896C14.5321 3.011 15.414 3.60028 16.1569 4.34315C16.8997 5.08602 17.489 5.96793 17.891 6.93853C18.1652 7.60043 18.3486 8.29473 18.4376 9.0026C18.5064 9.55057 18.0523 10 17.5 10C16.9477 10 16.5085 9.54925 16.4169 9.00462C16.342 8.55939 16.2169 8.12298 16.0433 7.7039C15.7417 6.97595 15.2998 6.31451 14.7426 5.75736C14.1855 5.20021 13.5241 4.75825 12.7961 4.45672C12.377 4.28313 11.9406 4.15804 11.4954 4.08314C10.9508 3.99152 10.5 3.55228 10.5 3Z",fill:"white"}))),SvgMinus=te=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...te},y$1("path",{d:"M18 12H6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgPlus=te=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...te},y$1("path",{d:"M12 6V12M12 12V18M12 12H18M12 12L6 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));class Prop extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["Height","Width","ClassName"]}}function importSvg(te,ee){return Interop_reactApi.createElement(te,keyValueList(ee,1))}function check(te){return importSvg(SvgCheck,te)}function chevronRight(te){return importSvg(SvgChevronRight,te)}function chevronLeft(te){return importSvg(SvgChevronLeft,te)}function launch(te){return importSvg(SvgLaunch,te)}function loader(te){return importSvg(SvgLoader,te)}function minus(te){return importSvg(SvgMinus,te)}function plus(te){return importSvg(SvgPlus,te)}function commonjsRequire(te){throw new Error('Could not dynamically require "'+te+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(ee,ne){module.exports=ne()})(globalThis,()=>(()=>{var __webpack_modules__=[,(te,ee)=>{var $t;Object.defineProperty(ee,"__esModule",{value:!0}),ee.VerbosityLevel=ee.Util=ee.UnknownErrorException=ee.UnexpectedResponseException=ee.TextRenderingMode=ee.RenderingIntentFlag=ee.PromiseCapability=ee.PermissionFlag=ee.PasswordResponses=ee.PasswordException=ee.PageActionEventType=ee.OPS=ee.MissingPDFException=ee.MAX_IMAGE_SIZE_TO_CACHE=ee.LINE_FACTOR=ee.LINE_DESCENT_FACTOR=ee.InvalidPDFException=ee.ImageKind=ee.IDENTITY_MATRIX=ee.FormatError=ee.FeatureTest=ee.FONT_IDENTITY_MATRIX=ee.DocumentActionEventType=ee.CMapCompressionType=ee.BaseException=ee.BASELINE_FACTOR=ee.AnnotationType=ee.AnnotationStateModelType=ee.AnnotationReviewState=ee.AnnotationReplyType=ee.AnnotationMode=ee.AnnotationMarkedState=ee.AnnotationFlag=ee.AnnotationFieldFlag=ee.AnnotationEditorType=ee.AnnotationEditorPrefix=ee.AnnotationEditorParamsType=ee.AnnotationBorderStyleType=ee.AnnotationActionEventType=ee.AbortException=void 0,ee.assert=dt,ee.bytesToString=Be,ee.createValidAbsoluteUrl=mt,ee.getModificationDate=At,ee.getVerbosityLevel=it,ee.info=ht,ee.isArrayBuffer=pt,ee.isArrayEqual=wt,ee.normalizeUnicode=vt,ee.objectFromMap=Fe,ee.objectSize=Ce,ee.setVerbosityLevel=ct,ee.shadow=qe,ee.string32=be,ee.stringToBytes=le,ee.stringToPDFString=et,ee.stringToUTF8String=nt,ee.unreachable=gt,ee.utf8StringToString=ft,ee.warn=at;const ne=[1,0,0,1,0,0];ee.IDENTITY_MATRIX=ne;const re=[.001,0,0,.001,0,0];ee.FONT_IDENTITY_MATRIX=re;const se=1e7;ee.MAX_IMAGE_SIZE_TO_CACHE=se;const ie=1.35;ee.LINE_FACTOR=ie;const oe=.35;ee.LINE_DESCENT_FACTOR=oe;const me=oe/ie;ee.BASELINE_FACTOR=me;const pe={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};ee.RenderingIntentFlag=pe;const he={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};ee.AnnotationMode=he;const ue="pdfjs_internal_editor_";ee.AnnotationEditorPrefix=ue;const de={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};ee.AnnotationEditorType=de;const Ae={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};ee.AnnotationEditorParamsType=Ae;const Se={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};ee.PermissionFlag=Se;const ce={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};ee.TextRenderingMode=ce;const fe={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};ee.ImageKind=fe;const ye={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};ee.AnnotationType=ye;const ve={MARKED:"Marked",REVIEW:"Review"};ee.AnnotationStateModelType=ve;const Pe={MARKED:"Marked",UNMARKED:"Unmarked"};ee.AnnotationMarkedState=Pe;const we={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};ee.AnnotationReviewState=we;const Te={GROUP:"Group",REPLY:"R"};ee.AnnotationReplyType=Te;const Le={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};ee.AnnotationFlag=Le;const Ne={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};ee.AnnotationFieldFlag=Ne;const Me={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};ee.AnnotationBorderStyleType=Me;const ae={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};ee.AnnotationActionEventType=ae;const ge={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};ee.DocumentActionEventType=ge;const $e={O:"PageOpen",C:"PageClose"};ee.PageActionEventType=$e;const _e={ERRORS:0,WARNINGS:1,INFOS:5};ee.VerbosityLevel=_e;const ke={NONE:0,BINARY:1};ee.CMapCompressionType=ke;const We={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};ee.OPS=We;const ze={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};ee.PasswordResponses=ze;let Qe=_e.WARNINGS;function ct(ut){Number.isInteger(ut)&&(Qe=ut)}function it(){return Qe}function ht(ut){Qe>=_e.INFOS&&console.log(`Info: ${ut}`)}function at(ut){Qe>=_e.WARNINGS&&console.log(`Warning: ${ut}`)}function gt(ut){throw new Error(ut)}function dt(ut,De){ut||gt(De)}function yt(ut){switch(ut==null?void 0:ut.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function mt(ut,De=null,He=null){if(!ut)return null;try{if(He&&typeof ut=="string"){if(He.addDefaultProtocol&&ut.startsWith("www.")){const bt=ut.match(/\./g);(bt==null?void 0:bt.length)>=2&&(ut=`http://${ut}`)}if(He.tryConvertEncoding)try{ut=nt(ut)}catch{}}const lt=De?new URL(ut,De):new URL(ut);if(yt(lt))return lt}catch{}return null}function qe(ut,De,He,lt=!1){return Object.defineProperty(ut,De,{value:He,enumerable:!lt,configurable:!0,writable:!1}),He}const Ee=function(){function De(He,lt){this.constructor===De&>("Cannot initialize BaseException."),this.message=He,this.name=lt}return De.prototype=new Error,De.constructor=De,De}();ee.BaseException=Ee;class xe extends Ee{constructor(De,He){super(De,"PasswordException"),this.code=He}}ee.PasswordException=xe;class Oe extends Ee{constructor(De,He){super(De,"UnknownErrorException"),this.details=He}}ee.UnknownErrorException=Oe;class Ge extends Ee{constructor(De){super(De,"InvalidPDFException")}}ee.InvalidPDFException=Ge;class Ve extends Ee{constructor(De){super(De,"MissingPDFException")}}ee.MissingPDFException=Ve;class Ke extends Ee{constructor(De,He){super(De,"UnexpectedResponseException"),this.status=He}}ee.UnexpectedResponseException=Ke;class je extends Ee{constructor(De){super(De,"FormatError")}}ee.FormatError=je;class Ue extends Ee{constructor(De){super(De,"AbortException")}}ee.AbortException=Ue;function Be(ut){(typeof ut!="object"||(ut==null?void 0:ut.length)===void 0)&>("Invalid argument for bytesToString");const De=ut.length,He=8192;if(De<He)return String.fromCharCode.apply(null,ut);const lt=[];for(let bt=0;bt<De;bt+=He){const Et=Math.min(bt+He,De),xt=ut.subarray(bt,Et);lt.push(String.fromCharCode.apply(null,xt))}return lt.join("")}function le(ut){typeof ut!="string"&>("Invalid argument for stringToBytes");const De=ut.length,He=new Uint8Array(De);for(let lt=0;lt<De;++lt)He[lt]=ut.charCodeAt(lt)&255;return He}function be(ut){return String.fromCharCode(ut>>24&255,ut>>16&255,ut>>8&255,ut&255)}function Ce(ut){return Object.keys(ut).length}function Fe(ut){const De=Object.create(null);for(const[He,lt]of ut)De[He]=lt;return De}function Ie(){const ut=new Uint8Array(4);return ut[0]=1,new Uint32Array(ut.buffer,0,1)[0]===1}function Xe(){try{return new Function(""),!0}catch{return!1}}class tt{static get isLittleEndian(){return qe(this,"isLittleEndian",Ie())}static get isEvalSupported(){return qe(this,"isEvalSupported",Xe())}static get isOffscreenCanvasSupported(){return qe(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?qe(this,"platform",{isWin:!1,isMac:!1}):qe(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}}ee.FeatureTest=tt;const Ze=[...Array(256).keys()].map(ut=>ut.toString(16).padStart(2,"0"));class st{static makeHexColor(De,He,lt){return`#${Ze[De]}${Ze[He]}${Ze[lt]}`}static scaleMinMax(De,He){let lt;De[0]?(De[0]<0&&(lt=He[0],He[0]=He[1],He[1]=lt),He[0]*=De[0],He[1]*=De[0],De[3]<0&&(lt=He[2],He[2]=He[3],He[3]=lt),He[2]*=De[3],He[3]*=De[3]):(lt=He[0],He[0]=He[2],He[2]=lt,lt=He[1],He[1]=He[3],He[3]=lt,De[1]<0&&(lt=He[2],He[2]=He[3],He[3]=lt),He[2]*=De[1],He[3]*=De[1],De[2]<0&&(lt=He[0],He[0]=He[1],He[1]=lt),He[0]*=De[2],He[1]*=De[2]),He[0]+=De[4],He[1]+=De[4],He[2]+=De[5],He[3]+=De[5]}static transform(De,He){return[De[0]*He[0]+De[2]*He[1],De[1]*He[0]+De[3]*He[1],De[0]*He[2]+De[2]*He[3],De[1]*He[2]+De[3]*He[3],De[0]*He[4]+De[2]*He[5]+De[4],De[1]*He[4]+De[3]*He[5]+De[5]]}static applyTransform(De,He){const lt=De[0]*He[0]+De[1]*He[2]+He[4],bt=De[0]*He[1]+De[1]*He[3]+He[5];return[lt,bt]}static applyInverseTransform(De,He){const lt=He[0]*He[3]-He[1]*He[2],bt=(De[0]*He[3]-De[1]*He[2]+He[2]*He[5]-He[4]*He[3])/lt,Et=(-De[0]*He[1]+De[1]*He[0]+He[4]*He[1]-He[5]*He[0])/lt;return[bt,Et]}static getAxialAlignedBoundingBox(De,He){const lt=st.applyTransform(De,He),bt=st.applyTransform(De.slice(2,4),He),Et=st.applyTransform([De[0],De[3]],He),xt=st.applyTransform([De[2],De[1]],He);return[Math.min(lt[0],bt[0],Et[0],xt[0]),Math.min(lt[1],bt[1],Et[1],xt[1]),Math.max(lt[0],bt[0],Et[0],xt[0]),Math.max(lt[1],bt[1],Et[1],xt[1])]}static inverseTransform(De){const He=De[0]*De[3]-De[1]*De[2];return[De[3]/He,-De[1]/He,-De[2]/He,De[0]/He,(De[2]*De[5]-De[4]*De[3])/He,(De[4]*De[1]-De[5]*De[0])/He]}static singularValueDecompose2dScale(De){const He=[De[0],De[2],De[1],De[3]],lt=De[0]*He[0]+De[1]*He[2],bt=De[0]*He[1]+De[1]*He[3],Et=De[2]*He[0]+De[3]*He[2],xt=De[2]*He[1]+De[3]*He[3],Rt=(lt+xt)/2,Pt=Math.sqrt((lt+xt)**2-4*(lt*xt-Et*bt))/2,kt=Rt+Pt||1,Ct=Rt-Pt||1;return[Math.sqrt(kt),Math.sqrt(Ct)]}static normalizeRect(De){const He=De.slice(0);return De[0]>De[2]&&(He[0]=De[2],He[2]=De[0]),De[1]>De[3]&&(He[1]=De[3],He[3]=De[1]),He}static intersect(De,He){const lt=Math.max(Math.min(De[0],De[2]),Math.min(He[0],He[2])),bt=Math.min(Math.max(De[0],De[2]),Math.max(He[0],He[2]));if(lt>bt)return null;const Et=Math.max(Math.min(De[1],De[3]),Math.min(He[1],He[3])),xt=Math.min(Math.max(De[1],De[3]),Math.max(He[1],He[3]));return Et>xt?null:[lt,Et,bt,xt]}static bezierBoundingBox(De,He,lt,bt,Et,xt,Rt,Pt){const kt=[],Ct=[[],[]];let It,Ft,Ot,Mt,jt,Bt,Ut,Wt;for(let zt=0;zt<2;++zt){if(zt===0?(Ft=6*De-12*lt+6*Et,It=-3*De+9*lt-9*Et+3*Rt,Ot=3*lt-3*De):(Ft=6*He-12*bt+6*xt,It=-3*He+9*bt-9*xt+3*Pt,Ot=3*bt-3*He),Math.abs(It)<1e-12){if(Math.abs(Ft)<1e-12)continue;Mt=-Ot/Ft,0<Mt&&Mt<1&&kt.push(Mt);continue}Ut=Ft*Ft-4*Ot*It,Wt=Math.sqrt(Ut),!(Ut<0)&&(jt=(-Ft+Wt)/(2*It),0<jt&&jt<1&&kt.push(jt),Bt=(-Ft-Wt)/(2*It),0<Bt&&Bt<1&&kt.push(Bt))}let Dt=kt.length,Nt;const Vt=Dt;for(;Dt--;)Mt=kt[Dt],Nt=1-Mt,Ct[0][Dt]=Nt*Nt*Nt*De+3*Nt*Nt*Mt*lt+3*Nt*Mt*Mt*Et+Mt*Mt*Mt*Rt,Ct[1][Dt]=Nt*Nt*Nt*He+3*Nt*Nt*Mt*bt+3*Nt*Mt*Mt*xt+Mt*Mt*Mt*Pt;return Ct[0][Vt]=De,Ct[1][Vt]=He,Ct[0][Vt+1]=Rt,Ct[1][Vt+1]=Pt,Ct[0].length=Ct[1].length=Vt+2,[Math.min(...Ct[0]),Math.min(...Ct[1]),Math.max(...Ct[0]),Math.max(...Ct[1])]}}ee.Util=st;const ot=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function et(ut){if(ut[0]>="ï"){let He;if(ut[0]==="þ"&&ut[1]==="ÿ"?He="utf-16be":ut[0]==="ÿ"&&ut[1]==="þ"?He="utf-16le":ut[0]==="ï"&&ut[1]==="»"&&ut[2]==="¿"&&(He="utf-8"),He)try{const lt=new TextDecoder(He,{fatal:!0}),bt=le(ut);return lt.decode(bt)}catch(lt){at(`stringToPDFString: "${lt}".`)}}const De=[];for(let He=0,lt=ut.length;He<lt;He++){const bt=ot[ut.charCodeAt(He)];De.push(bt?String.fromCharCode(bt):ut.charAt(He))}return De.join("")}function nt(ut){return decodeURIComponent(escape(ut))}function ft(ut){return unescape(encodeURIComponent(ut))}function pt(ut){return typeof ut=="object"&&(ut==null?void 0:ut.byteLength)!==void 0}function wt(ut,De){if(ut.length!==De.length)return!1;for(let He=0,lt=ut.length;He<lt;He++)if(ut[He]!==De[He])return!1;return!0}function At(ut=new Date){return[ut.getUTCFullYear().toString(),(ut.getUTCMonth()+1).toString().padStart(2,"0"),ut.getUTCDate().toString().padStart(2,"0"),ut.getUTCHours().toString().padStart(2,"0"),ut.getUTCMinutes().toString().padStart(2,"0"),ut.getUTCSeconds().toString().padStart(2,"0")].join("")}class Tt{constructor(){Je(this,$t,!1);this.promise=new Promise((De,He)=>{this.resolve=lt=>{_t(this,$t,!0),De(lt)},this.reject=lt=>{_t(this,$t,!0),He(lt)}})}get settled(){return Re(this,$t)}}$t=new WeakMap,ee.PromiseCapability=Tt;let Ye=null,St=null;function vt(ut){return Ye||(Ye=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,St=new Map([["ſt","ſt"]])),ut.replaceAll(Ye,(De,He,lt)=>He?He.normalize("NFKC"):St.get(lt))}},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var te,ne,re,se,Yt,oe,Pn,pe,he,ue,de,Ae,Se,ce,fe,On,ve,Pe,In,Te,Le;Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_is_node=__w_pdfjs_require__(10),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_xfa_text=__w_pdfjs_require__(19);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultFilterFactory=_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:Me,NodeCMapReaderFactory:ae,NodeFilterFactory:ge,NodeStandardFontDataFactory:$e}=__w_pdfjs_require__(20);exports.DefaultCanvasFactory=DefaultCanvasFactory=Me,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=ae,exports.DefaultFilterFactory=DefaultFilterFactory=ge,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=$e}let createPDFNetworkStream;if(_is_node.isNodeJS){const{PDFNodeStream:Me}=__w_pdfjs_require__(21);createPDFNetworkStream=ae=>new Me(ae)}else{const{PDFNetworkStream:Me}=__w_pdfjs_require__(24),{PDFFetchStream:ae}=__w_pdfjs_require__(25);createPDFNetworkStream=ge=>(0,_display_utils.isValidFetchUrl)(ge.url)?new ae(ge):new Me(ge)}function getDocument(Me){if(typeof Me=="string"||Me instanceof URL?Me={url:Me}:(0,_util.isArrayBuffer)(Me)&&(Me={data:Me}),typeof Me!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!Me.url&&!Me.data&&!Me.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const ae=new PDFDocumentLoadingTask,{docId:ge}=ae,$e=Me.url?getUrlProp(Me.url):null,_e=Me.data?getDataProp(Me.data):null,ke=Me.httpHeaders||null,We=Me.withCredentials===!0,ze=Me.password??null,Qe=Me.range instanceof PDFDataRangeTransport?Me.range:null,ct=Number.isInteger(Me.rangeChunkSize)&&Me.rangeChunkSize>0?Me.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let it=Me.worker instanceof PDFWorker?Me.worker:null;const ht=Me.verbosity,at=typeof Me.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(Me.docBaseUrl)?Me.docBaseUrl:null,gt=typeof Me.cMapUrl=="string"?Me.cMapUrl:null,dt=Me.cMapPacked!==!1,yt=Me.CMapReaderFactory||DefaultCMapReaderFactory,mt=typeof Me.standardFontDataUrl=="string"?Me.standardFontDataUrl:null,qe=Me.StandardFontDataFactory||DefaultStandardFontDataFactory,Ee=Me.stopAtErrors!==!0,xe=Number.isInteger(Me.maxImageSize)&&Me.maxImageSize>-1?Me.maxImageSize:-1,Oe=Me.isEvalSupported!==!1,Ge=typeof Me.isOffscreenCanvasSupported=="boolean"?Me.isOffscreenCanvasSupported:!_is_node.isNodeJS,Ve=Number.isInteger(Me.canvasMaxAreaInBytes)?Me.canvasMaxAreaInBytes:-1,Ke=typeof Me.disableFontFace=="boolean"?Me.disableFontFace:_is_node.isNodeJS,je=Me.fontExtraProperties===!0,Ue=Me.enableXfa===!0,Be=Me.ownerDocument||globalThis.document,le=Me.disableRange===!0,be=Me.disableStream===!0,Ce=Me.disableAutoFetch===!0,Fe=Me.pdfBug===!0,Ie=Qe?Qe.length:Me.length??NaN,Xe=typeof Me.useSystemFonts=="boolean"?Me.useSystemFonts:!_is_node.isNodeJS&&!Ke,tt=typeof Me.useWorkerFetch=="boolean"?Me.useWorkerFetch:yt===_display_utils.DOMCMapReaderFactory&&qe===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(gt,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(mt,document.baseURI),Ze=Me.canvasFactory||new DefaultCanvasFactory({ownerDocument:Be}),st=Me.filterFactory||new DefaultFilterFactory({docId:ge,ownerDocument:Be}),ot=null;(0,_util.setVerbosityLevel)(ht);const et={canvasFactory:Ze,filterFactory:st};if(tt||(et.cMapReaderFactory=new yt({baseUrl:gt,isCompressed:dt}),et.standardFontDataFactory=new qe({baseUrl:mt})),!it){const pt={verbosity:ht,port:_worker_options.GlobalWorkerOptions.workerPort};it=pt.port?PDFWorker.fromPort(pt):new PDFWorker(pt),ae._worker=it}const nt={docId:ge,apiVersion:"3.6.172",data:_e,password:ze,disableAutoFetch:Ce,rangeChunkSize:ct,length:Ie,docBaseUrl:at,enableXfa:Ue,evaluatorOptions:{maxImageSize:xe,disableFontFace:Ke,ignoreErrors:Ee,isEvalSupported:Oe,isOffscreenCanvasSupported:Ge,canvasMaxAreaInBytes:Ve,fontExtraProperties:je,useSystemFonts:Xe,cMapUrl:tt?gt:null,standardFontDataUrl:tt?mt:null}},ft={ignoreErrors:Ee,isEvalSupported:Oe,disableFontFace:Ke,fontExtraProperties:je,enableXfa:Ue,ownerDocument:Be,disableAutoFetch:Ce,pdfBug:Fe,styleElement:ot};return it.promise.then(function(){if(ae.destroyed)throw new Error("Loading aborted");const pt=_fetchDocument(it,nt),wt=new Promise(function(At){let Tt;Qe?Tt=new _transport_stream.PDFDataTransportStream({length:Ie,initialData:Qe.initialData,progressiveDone:Qe.progressiveDone,contentDispositionFilename:Qe.contentDispositionFilename,disableRange:le,disableStream:be},Qe):_e||(Tt=createPDFNetworkStream({url:$e,length:Ie,httpHeaders:ke,withCredentials:We,rangeChunkSize:ct,disableRange:le,disableStream:be})),At(Tt)});return Promise.all([pt,wt]).then(function([At,Tt]){if(ae.destroyed)throw new Error("Loading aborted");const Ye=new _message_handler.MessageHandler(ge,At,it.port),St=new WorkerTransport(Ye,ae,Tt,ft,et);ae._transport=St,Ye.send("Ready",null)})}).catch(ae._capability.reject),ae}async function _fetchDocument(Me,ae){if(Me.destroyed)throw new Error("Worker was destroyed");const ge=await Me.messageHandler.sendWithPromise("GetDocRequest",ae,ae.data?[ae.data.buffer]:null);if(Me.destroyed)throw new Error("Worker was destroyed");return ge}function getUrlProp(Me){if(Me instanceof URL)return Me.href;try{return new URL(Me,window.location).href}catch{if(_is_node.isNodeJS&&typeof Me=="string")return Me}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(Me){if(_is_node.isNodeJS&&typeof Buffer<"u"&&Me instanceof Buffer)return(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`."),new Uint8Array(Me);if(Me instanceof Uint8Array&&Me.byteLength===Me.buffer.byteLength)return Me;if(typeof Me=="string")return(0,_util.stringToBytes)(Me);if(typeof Me=="object"&&!isNaN(Me==null?void 0:Me.length)||(0,_util.isArrayBuffer)(Me))return new Uint8Array(Me);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const ee=class ee{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${xn(ee,te)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var ae;this.destroyed=!0,await((ae=this._transport)==null?void 0:ae.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};te=new WeakMap,Je(ee,te,0);let PDFDocumentLoadingTask=ee;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(ae,ge,$e=!1,_e=null){this.length=ae,this.initialData=ge,this.progressiveDone=$e,this.contentDispositionFilename=_e,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(ae){this._rangeListeners.push(ae)}addProgressListener(ae){this._progressListeners.push(ae)}addProgressiveReadListener(ae){this._progressiveReadListeners.push(ae)}addProgressiveDoneListener(ae){this._progressiveDoneListeners.push(ae)}onDataRange(ae,ge){for(const $e of this._rangeListeners)$e(ae,ge)}onDataProgress(ae,ge){this._readyCapability.promise.then(()=>{for(const $e of this._progressListeners)$e(ae,ge)})}onDataProgressiveRead(ae){this._readyCapability.promise.then(()=>{for(const ge of this._progressiveReadListeners)ge(ae)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const ae of this._progressiveDoneListeners)ae()})}transportReady(){this._readyCapability.resolve()}requestDataRange(ae,ge){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(ae,ge){this._pdfInfo=ae,this._transport=ge}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(ae){return this._transport.getPage(ae)}getPageIndex(ae){return this._transport.getPageIndex(ae)}getDestinations(){return this._transport.getDestinations()}getDestination(ae){return this._transport.getDestination(ae)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(ae=!1){return this._transport.startCleanup(ae||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(ae,ge,$e,_e=!1){Je(this,se);Je(this,oe);Je(this,ne,null);Je(this,re,!1);this._pageIndex=ae,this._pageInfo=ge,this._transport=$e,this._stats=_e?new _display_utils.StatTimer:null,this._pdfBug=_e,this.commonObjs=$e.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:ae,rotation:ge=this.rotate,offsetX:$e=0,offsetY:_e=0,dontFlip:ke=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:ae,rotation:ge,offsetX:$e,offsetY:_e,dontFlip:ke})}getAnnotations({intent:ae="display"}={}){const ge=this._transport.getRenderingIntent(ae);return this._transport.getAnnotations(this._pageIndex,ge.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var ae;return((ae=this._transport._htmlForXfa)==null?void 0:ae.children[this._pageIndex])||null}render({canvasContext:ae,viewport:ge,intent:$e="display",annotationMode:_e=_util.AnnotationMode.ENABLE,transform:ke=null,background:We=null,optionalContentConfigPromise:ze=null,annotationCanvasMap:Qe=null,pageColors:ct=null,printAnnotationStorage:it=null}){var qe,Ee,xe;if((qe=arguments[0])!=null&&qe.canvasFactory)throw new Error("render no longer accepts the `canvasFactory`-option, please pass it to the `getDocument`-function instead.");(Ee=this._stats)==null||Ee.time("Overall");const ht=this._transport.getRenderingIntent($e,_e,it);_t(this,re,!1),rt(this,oe,Pn).call(this),ze||(ze=this._transport.getOptionalContentConfig());let at=this._intentStates.get(ht.cacheKey);at||(at=Object.create(null),this._intentStates.set(ht.cacheKey,at)),at.streamReaderCancelTimeout&&(clearTimeout(at.streamReaderCancelTimeout),at.streamReaderCancelTimeout=null);const gt=!!(ht.renderingIntent&_util.RenderingIntentFlag.PRINT);at.displayReadyCapability||(at.displayReadyCapability=new _util.PromiseCapability,at.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(xe=this._stats)==null||xe.time("Page Request"),this._pumpOperatorList(ht));const dt=Oe=>{var Ge,Ve;at.renderTasks.delete(yt),(this._maybeCleanupAfterRender||gt)&&_t(this,re,!0),rt(this,se,Yt).call(this,!gt),Oe?(yt.capability.reject(Oe),this._abortOperatorList({intentState:at,reason:Oe instanceof Error?Oe:new Error(Oe)})):yt.capability.resolve(),(Ge=this._stats)==null||Ge.timeEnd("Rendering"),(Ve=this._stats)==null||Ve.timeEnd("Overall")},yt=new InternalRenderTask({callback:dt,params:{canvasContext:ae,viewport:ge,transform:ke,background:We},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:Qe,operatorList:at.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!gt,pdfBug:this._pdfBug,pageColors:ct});(at.renderTasks||(at.renderTasks=new Set)).add(yt);const mt=yt.task;return Promise.all([at.displayReadyCapability.promise,ze]).then(([Oe,Ge])=>{var Ve;if(Re(this,re)){dt();return}(Ve=this._stats)==null||Ve.time("Rendering"),yt.initializeGraphics({transparency:Oe,optionalContentConfig:Ge}),yt.operatorListChanged()}).catch(dt),mt}getOperatorList({intent:ae="display",annotationMode:ge=_util.AnnotationMode.ENABLE,printAnnotationStorage:$e=null}={}){var Qe;function _e(){We.operatorList.lastChunk&&(We.opListReadCapability.resolve(We.operatorList),We.renderTasks.delete(ze))}const ke=this._transport.getRenderingIntent(ae,ge,$e,!0);let We=this._intentStates.get(ke.cacheKey);We||(We=Object.create(null),this._intentStates.set(ke.cacheKey,We));let ze;return We.opListReadCapability||(ze=Object.create(null),ze.operatorListChanged=_e,We.opListReadCapability=new _util.PromiseCapability,(We.renderTasks||(We.renderTasks=new Set)).add(ze),We.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(Qe=this._stats)==null||Qe.time("Page Request"),this._pumpOperatorList(ke)),We.opListReadCapability.promise}streamTextContent({includeMarkedContent:ae=!1,disableNormalization:ge=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:ae===!0,disableNormalization:ge===!0},{highWaterMark:100,size(_e){return _e.items.length}})}getTextContent(ae={}){if(this._transport._htmlForXfa)return this.getXfa().then($e=>_xfa_text.XfaText.textContent($e));const ge=this.streamTextContent(ae);return new Promise(function($e,_e){function ke(){We.read().then(function({value:Qe,done:ct}){if(ct){$e(ze);return}Object.assign(ze.styles,Qe.styles),ze.items.push(...Qe.items),ke()},_e)}const We=ge.getReader(),ze={items:[],styles:Object.create(null)};ke()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const ae=[];for(const ge of this._intentStates.values())if(this._abortOperatorList({intentState:ge,reason:new Error("Page was destroyed."),force:!0}),!ge.opListReadCapability)for(const $e of ge.renderTasks)ae.push($e.completed),$e.cancel();return this.objs.clear(),_t(this,re,!1),rt(this,oe,Pn).call(this),Promise.all(ae)}cleanup(ae=!1){_t(this,re,!0);const ge=rt(this,se,Yt).call(this,!1);return ae&&ge&&this._stats&&(this._stats=new _display_utils.StatTimer),ge}_startRenderPage(ae,ge){var _e,ke;const $e=this._intentStates.get(ge);$e&&((_e=this._stats)==null||_e.timeEnd("Page Request"),(ke=$e.displayReadyCapability)==null||ke.resolve(ae))}_renderPageChunk(ae,ge){for(let $e=0,_e=ae.length;$e<_e;$e++)ge.operatorList.fnArray.push(ae.fnArray[$e]),ge.operatorList.argsArray.push(ae.argsArray[$e]);ge.operatorList.lastChunk=ae.lastChunk,ge.operatorList.separateAnnots=ae.separateAnnots;for(const $e of ge.renderTasks)$e.operatorListChanged();ae.lastChunk&&rt(this,se,Yt).call(this,!0)}_pumpOperatorList({renderingIntent:ae,cacheKey:ge,annotationStorageMap:$e}){const ke=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:ae,cacheKey:ge,annotationStorage:$e}).getReader(),We=this._intentStates.get(ge);We.streamReader=ke;const ze=()=>{ke.read().then(({value:Qe,done:ct})=>{if(ct){We.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Qe,We),ze())},Qe=>{if(We.streamReader=null,!this._transport.destroyed){if(We.operatorList){We.operatorList.lastChunk=!0;for(const ct of We.renderTasks)ct.operatorListChanged();rt(this,se,Yt).call(this,!0)}if(We.displayReadyCapability)We.displayReadyCapability.reject(Qe);else if(We.opListReadCapability)We.opListReadCapability.reject(Qe);else throw Qe}})};ze()}_abortOperatorList({intentState:ae,reason:ge,force:$e=!1}){if(ae.streamReader){if(ae.streamReaderCancelTimeout&&(clearTimeout(ae.streamReaderCancelTimeout),ae.streamReaderCancelTimeout=null),!$e){if(ae.renderTasks.size>0)return;if(ge instanceof _display_utils.RenderingCancelledException){let _e=RENDERING_CANCELLED_TIMEOUT;ge.extraDelay>0&&ge.extraDelay<1e3&&(_e+=ge.extraDelay),ae.streamReaderCancelTimeout=setTimeout(()=>{ae.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:ae,reason:ge,force:!0})},_e);return}}if(ae.streamReader.cancel(new _util.AbortException(ge.message)).catch(()=>{}),ae.streamReader=null,!this._transport.destroyed){for(const[_e,ke]of this._intentStates)if(ke===ae){this._intentStates.delete(_e);break}this.cleanup()}}}get stats(){return this._stats}}ne=new WeakMap,re=new WeakMap,se=new WeakSet,Yt=function(ae=!1){if(rt(this,oe,Pn).call(this),!Re(this,re))return!1;if(ae)return _t(this,ne,setTimeout(()=>{_t(this,ne,null),rt(this,se,Yt).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:ge,operatorList:$e}of this._intentStates.values())if(ge.size>0||!$e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),_t(this,re,!1),!0},oe=new WeakSet,Pn=function(){Re(this,ne)&&(clearTimeout(Re(this,ne)),_t(this,ne,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){Je(this,pe,new Set);Je(this,he,Promise.resolve())}postMessage(ae,ge){const $e={data:structuredClone(ae,ge?{transfer:ge}:null)};Re(this,he).then(()=>{for(const _e of Re(this,pe))_e.call(this,$e)})}addEventListener(ae,ge){Re(this,pe).add(ge)}removeEventListener(ae,ge){Re(this,pe).delete(ge)}terminate(){Re(this,pe).clear()}}pe=new WeakMap,he=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_is_node.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const Me=(ue=document==null?void 0:document.currentScript)==null?void 0:ue.src;Me&&(PDFWorkerUtil.fallbackWorkerSrc=Me.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(Me,ae){let ge;try{if(ge=new URL(Me),!ge.origin||ge.origin==="null")return!1}catch{return!1}const $e=new URL(ae,ge);return ge.origin===$e.origin},PDFWorkerUtil.createCDNWrapper=function(Me){const ae=`importScripts("${Me}");`;return URL.createObjectURL(new Blob([ae]))}}const _PDFWorker=class _PDFWorker{constructor({name:Me=null,port:ae=null,verbosity:ge=(0,_util.getVerbosityLevel)()}={}){if(ae&&Re(_PDFWorker,de).has(ae))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=Me,this.destroyed=!1,this.verbosity=ge,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,ae){Re(_PDFWorker,de).set(ae,this),this._initializeFromPort(ae);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(Me){this._port=Me,this._messageHandler=new _message_handler.MessageHandler("main","worker",Me),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:Me}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,Me)||(Me=PDFWorkerUtil.createCDNWrapper(new URL(Me,window.location).href));const ae=new Worker(Me),ge=new _message_handler.MessageHandler("main","worker",ae),$e=()=>{ae.removeEventListener("error",_e),ge.destroy(),ae.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},_e=()=>{this._webWorker||$e()};ae.addEventListener("error",_e),ge.on("test",We=>{if(ae.removeEventListener("error",_e),this.destroyed){$e();return}We?(this._messageHandler=ge,this._port=ae,this._webWorker=ae,this._readyCapability.resolve(),ge.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),ge.destroy(),ae.terminate())}),ge.on("ready",We=>{if(ae.removeEventListener("error",_e),this.destroyed){$e();return}try{ke()}catch{this._setupFakeWorker()}});const ke=()=>{const We=new Uint8Array;ge.send("test",We,[We.buffer])};ke();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(Me=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const ae=new LoopbackPort;this._port=ae;const ge=`fake${PDFWorkerUtil.fakeWorkerId++}`,$e=new _message_handler.MessageHandler(ge+"_worker",ge,ae);Me.setup($e,ae);const _e=new _message_handler.MessageHandler(ge,ge+"_worker",ae);this._messageHandler=_e,this._readyCapability.resolve(),_e.send("configure",{verbosity:this.verbosity})}).catch(Me=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${Me.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),Re(_PDFWorker,de).delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(Me){if(!(Me!=null&&Me.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Re(this,de).has(Me.port)?Re(this,de).get(Me.port):new _PDFWorker(Me)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var Me;try{return((Me=globalThis.pdfjsWorker)==null?void 0:Me.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};de=new WeakMap,Je(_PDFWorker,de,new WeakMap);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(ae,ge,$e,_e,ke){Je(this,fe);Je(this,Ae,new Map);Je(this,Se,new Map);Je(this,ce,new Map);this.messageHandler=ae,this.loadingTask=ge,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:_e.ownerDocument,styleElement:_e.styleElement}),this._params=_e,this.canvasFactory=ke.canvasFactory,this.filterFactory=ke.filterFactory,this.cMapReaderFactory=ke.cMapReaderFactory,this.standardFontDataFactory=ke.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=$e,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(ae,ge=_util.AnnotationMode.ENABLE,$e=null,_e=!1){let ke=_util.RenderingIntentFlag.DISPLAY,We=null;switch(ae){case"any":ke=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":ke=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${ae}`)}switch(ge){case _util.AnnotationMode.DISABLE:ke+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:ke+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:ke+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,We=(ke&_util.RenderingIntentFlag.PRINT&&$e instanceof _annotation_storage.PrintAnnotationStorage?$e:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${ge}`)}return _e&&(ke+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:ke,cacheKey:`${ke}_${_annotation_storage.AnnotationStorage.getHash(We)}`,annotationStorageMap:We}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const ae=[];for(const $e of Re(this,Se).values())ae.push($e._destroy());Re(this,Se).clear(),Re(this,ce).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const ge=this.messageHandler.sendWithPromise("Terminate",null);return ae.push(ge),Promise.all(ae).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),Re(this,Ae).clear(),this.filterFactory.destroy(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:ae,loadingTask:ge}=this;ae.on("GetReader",($e,_e)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=ke=>{this._lastProgress={loaded:ke.loaded,total:ke.total}},_e.onPull=()=>{this._fullReader.read().then(function({value:ke,done:We}){if(We){_e.close();return}(0,_util.assert)(ke instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),_e.enqueue(new Uint8Array(ke),1,[ke])}).catch(ke=>{_e.error(ke)})},_e.onCancel=ke=>{this._fullReader.cancel(ke),_e.ready.catch(We=>{if(!this.destroyed)throw We})}}),ae.on("ReaderHeadersReady",$e=>{const _e=new _util.PromiseCapability,ke=this._fullReader;return ke.headersReady.then(()=>{var We;(!ke.isStreamingSupported||!ke.isRangeSupported)&&(this._lastProgress&&((We=ge.onProgress)==null||We.call(ge,this._lastProgress)),ke.onProgress=ze=>{var Qe;(Qe=ge.onProgress)==null||Qe.call(ge,{loaded:ze.loaded,total:ze.total})}),_e.resolve({isStreamingSupported:ke.isStreamingSupported,isRangeSupported:ke.isRangeSupported,contentLength:ke.contentLength})},_e.reject),_e.promise}),ae.on("GetRangeReader",($e,_e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const ke=this._networkStream.getRangeReader($e.begin,$e.end);if(!ke){_e.close();return}_e.onPull=()=>{ke.read().then(function({value:We,done:ze}){if(ze){_e.close();return}(0,_util.assert)(We instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),_e.enqueue(new Uint8Array(We),1,[We])}).catch(We=>{_e.error(We)})},_e.onCancel=We=>{ke.cancel(We),_e.ready.catch(ze=>{if(!this.destroyed)throw ze})}}),ae.on("GetDoc",({pdfInfo:$e})=>{this._numPages=$e.numPages,this._htmlForXfa=$e.htmlForXfa,delete $e.htmlForXfa,ge._capability.resolve(new PDFDocumentProxy($e,this))}),ae.on("DocException",function($e){let _e;switch($e.name){case"PasswordException":_e=new _util.PasswordException($e.message,$e.code);break;case"InvalidPDFException":_e=new _util.InvalidPDFException($e.message);break;case"MissingPDFException":_e=new _util.MissingPDFException($e.message);break;case"UnexpectedResponseException":_e=new _util.UnexpectedResponseException($e.message,$e.status);break;case"UnknownErrorException":_e=new _util.UnknownErrorException($e.message,$e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}ge._capability.reject(_e)}),ae.on("PasswordRequest",$e=>{if(this._passwordCapability=new _util.PromiseCapability,ge.onPassword){const _e=ke=>{ke instanceof Error?this._passwordCapability.reject(ke):this._passwordCapability.resolve({password:ke})};try{ge.onPassword(_e,$e.code)}catch(ke){this._passwordCapability.reject(ke)}}else this._passwordCapability.reject(new _util.PasswordException($e.message,$e.code));return this._passwordCapability.promise}),ae.on("DataLoaded",$e=>{var _e;(_e=ge.onProgress)==null||_e.call(ge,{loaded:$e.length,total:$e.length}),this.downloadInfoCapability.resolve($e)}),ae.on("StartRenderPage",$e=>{if(this.destroyed)return;Re(this,Se).get($e.pageIndex)._startRenderPage($e.transparency,$e.cacheKey)}),ae.on("commonobj",([$e,_e,ke])=>{var We;if(!this.destroyed&&!this.commonObjs.has($e))switch(_e){case"Font":const ze=this._params;if("error"in ke){const it=ke.error;(0,_util.warn)(`Error during font loading: ${it}`),this.commonObjs.resolve($e,it);break}const Qe=ze.pdfBug&&((We=globalThis.FontInspector)!=null&&We.enabled)?(it,ht)=>globalThis.FontInspector.fontAdded(it,ht):null,ct=new _font_loader.FontFaceObject(ke,{isEvalSupported:ze.isEvalSupported,disableFontFace:ze.disableFontFace,ignoreErrors:ze.ignoreErrors,inspectFont:Qe});this.fontLoader.bind(ct).catch(it=>ae.sendWithPromise("FontFallback",{id:$e})).finally(()=>{!ze.fontExtraProperties&&ct.data&&(ct.data=null),this.commonObjs.resolve($e,ct)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve($e,ke);break;default:throw new Error(`Got unknown common object type ${_e}`)}}),ae.on("obj",([$e,_e,ke,We])=>{var Qe;if(this.destroyed)return;const ze=Re(this,Se).get(_e);if(!ze.objs.has($e))switch(ke){case"Image":if(ze.objs.resolve($e,We),We){let ct;if(We.bitmap){const{width:it,height:ht}=We;ct=it*ht*4}else ct=((Qe=We.data)==null?void 0:Qe.length)||0;ct>_util.MAX_IMAGE_SIZE_TO_CACHE&&(ze._maybeCleanupAfterRender=!0)}break;case"Pattern":ze.objs.resolve($e,We);break;default:throw new Error(`Got unknown object type ${ke}`)}}),ae.on("DocProgress",$e=>{var _e;this.destroyed||(_e=ge.onProgress)==null||_e.call(ge,{loaded:$e.loaded,total:$e.total})}),ae.on("FetchBuiltInCMap",$e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch($e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),ae.on("FetchStandardFontData",$e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch($e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var ae;return this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:((ae=this._fullReader)==null?void 0:ae.filename)??null}).finally(()=>{this.annotationStorage.resetModified()})}getPage(ae){if(!Number.isInteger(ae)||ae<=0||ae>this._numPages)return Promise.reject(new Error("Invalid page request."));const ge=ae-1,$e=Re(this,ce).get(ge);if($e)return $e;const _e=this.messageHandler.sendWithPromise("GetPage",{pageIndex:ge}).then(ke=>{if(this.destroyed)throw new Error("Transport destroyed");const We=new PDFPageProxy(ge,ke,this,this._params.pdfBug);return Re(this,Se).set(ge,We),We});return Re(this,ce).set(ge,_e),_e}getPageIndex(ae){return typeof ae!="object"||ae===null||!Number.isInteger(ae.num)||ae.num<0||!Number.isInteger(ae.gen)||ae.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:ae.num,gen:ae.gen})}getAnnotations(ae,ge){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:ae,intent:ge})}getFieldObjects(){return rt(this,fe,On).call(this,"GetFieldObjects")}hasJSActions(){return rt(this,fe,On).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(ae){return typeof ae!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:ae})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(ae){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:ae})}getStructTree(ae){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:ae})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(ae=>new _optional_content_config.OptionalContentConfig(ae))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const ae="GetMetadata",ge=Re(this,Ae).get(ae);if(ge)return ge;const $e=this.messageHandler.sendWithPromise(ae,null).then(_e=>{var ke,We;return{info:_e[0],metadata:_e[1]?new _metadata.Metadata(_e[1]):null,contentDispositionFilename:((ke=this._fullReader)==null?void 0:ke.filename)??null,contentLength:((We=this._fullReader)==null?void 0:We.contentLength)??null}});return Re(this,Ae).set(ae,$e),$e}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(ae=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const ge of Re(this,Se).values())if(!ge.cleanup())throw new Error(`startCleanup: Page ${ge.pageNumber} is currently rendering.`);this.commonObjs.clear(),ae||this.fontLoader.clear(),Re(this,Ae).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:ae,enableXfa:ge}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:ae,enableXfa:ge})}}Ae=new WeakMap,Se=new WeakMap,ce=new WeakMap,fe=new WeakSet,On=function(ae,ge=null){const $e=Re(this,Ae).get(ae);if($e)return $e;const _e=this.messageHandler.sendWithPromise(ae,ge);return Re(this,Ae).set(ae,_e),_e};class PDFObjects{constructor(){Je(this,Pe);Je(this,ve,Object.create(null))}get(ae,ge=null){if(ge){const _e=rt(this,Pe,In).call(this,ae);return _e.capability.promise.then(()=>ge(_e.data)),null}const $e=Re(this,ve)[ae];if(!($e!=null&&$e.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${ae}.`);return $e.data}has(ae){const ge=Re(this,ve)[ae];return(ge==null?void 0:ge.capability.settled)||!1}resolve(ae,ge=null){const $e=rt(this,Pe,In).call(this,ae);$e.data=ge,$e.capability.resolve()}clear(){var ae;for(const ge in Re(this,ve)){const{data:$e}=Re(this,ve)[ge];(ae=$e==null?void 0:$e.bitmap)==null||ae.close()}_t(this,ve,Object.create(null))}}ve=new WeakMap,Pe=new WeakSet,In=function(ae){const ge=Re(this,ve)[ae];return ge||(Re(this,ve)[ae]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(ae){Je(this,Te,null);_t(this,Te,ae),this.onContinue=null}get promise(){return Re(this,Te).capability.promise}cancel(ae=0){Re(this,Te).cancel(null,ae)}get separateAnnots(){const{separateAnnots:ae}=Re(this,Te).operatorList;if(!ae)return!1;const{annotationCanvasMap:ge}=Re(this,Te);return ae.form||ae.canvas&&(ge==null?void 0:ge.size)>0}}Te=new WeakMap,exports.RenderTask=RenderTask;const Ne=class Ne{constructor({callback:ae,params:ge,objs:$e,commonObjs:_e,annotationCanvasMap:ke,operatorList:We,pageIndex:ze,canvasFactory:Qe,filterFactory:ct,useRequestAnimationFrame:it=!1,pdfBug:ht=!1,pageColors:at=null}){this.callback=ae,this.params=ge,this.objs=$e,this.commonObjs=_e,this.annotationCanvasMap=ke,this.operatorListIdx=null,this.operatorList=We,this._pageIndex=ze,this.canvasFactory=Qe,this.filterFactory=ct,this._pdfBug=ht,this.pageColors=at,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=it===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=ge.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:ae=!1,optionalContentConfig:ge}){var ze,Qe;if(this.cancelled)return;if(this._canvas){if(Re(Ne,Le).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");Re(Ne,Le).add(this._canvas)}this._pdfBug&&((ze=globalThis.StepperManager)!=null&&ze.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:$e,viewport:_e,transform:ke,background:We}=this.params;this.gfx=new _canvas.CanvasGraphics($e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:ge},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:ke,viewport:_e,transparency:ae,background:We}),this.operatorListIdx=0,this.graphicsReady=!0,(Qe=this.graphicsReadyCallback)==null||Qe.call(this)}cancel(ae=null,ge=0){var $e;this.running=!1,this.cancelled=!0,($e=this.gfx)==null||$e.endDrawing(),this._canvas&&Re(Ne,Le).delete(this._canvas),this.callback(ae||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas",ge))}operatorListChanged(){var ae;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(ae=this.stepper)==null||ae.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(this.pageColors),this._canvas&&Re(Ne,Le).delete(this._canvas),this.callback())))}};Le=new WeakMap,Je(Ne,Le,new WeakSet);let InternalRenderTask=Ne;const version="3.6.172";exports.version=version;const build="4d3dfe254";exports.build=build},(te,ee,ne)=>{var pe,he,ue,rr,Ae;Object.defineProperty(ee,"__esModule",{value:!0}),ee.PrintAnnotationStorage=ee.AnnotationStorage=void 0;var re=ne(1),se=ne(4),ie=ne(8);class oe{constructor(){Je(this,ue);Je(this,pe,!1);Je(this,he,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(ce,fe){const ye=Re(this,he).get(ce);return ye===void 0?fe:Object.assign(fe,ye)}getRawValue(ce){return Re(this,he).get(ce)}remove(ce){if(Re(this,he).delete(ce),Re(this,he).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const fe of Re(this,he).values())if(fe instanceof se.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(ce,fe){const ye=Re(this,he).get(ce);let ve=!1;if(ye!==void 0)for(const[Pe,we]of Object.entries(fe))ye[Pe]!==we&&(ve=!0,ye[Pe]=we);else ve=!0,Re(this,he).set(ce,fe);ve&&rt(this,ue,rr).call(this),fe instanceof se.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(fe.constructor._type)}has(ce){return Re(this,he).has(ce)}getAll(){return Re(this,he).size>0?(0,re.objectFromMap)(Re(this,he)):null}setAll(ce){for(const[fe,ye]of Object.entries(ce))this.setValue(fe,ye)}get size(){return Re(this,he).size}resetModified(){Re(this,pe)&&(_t(this,pe,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new me(this)}get serializable(){if(Re(this,he).size===0)return null;const ce=new Map;for(const[fe,ye]of Re(this,he)){const ve=ye instanceof se.AnnotationEditor?ye.serialize():ye;ve&&ce.set(fe,ve)}return ce}static getHash(ce){if(!ce)return"";const fe=new ie.MurmurHash3_64;for(const[ye,ve]of ce)fe.update(`${ye}:${JSON.stringify(ve)}`);return fe.hexdigest()}}pe=new WeakMap,he=new WeakMap,ue=new WeakSet,rr=function(){Re(this,pe)||(_t(this,pe,!0),typeof this.onSetModified=="function"&&this.onSetModified())},ee.AnnotationStorage=oe;class me extends oe{constructor(fe){super();Je(this,Ae,null);_t(this,Ae,structuredClone(fe.serializable))}get print(){(0,re.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return Re(this,Ae)}}Ae=new WeakMap,ee.PrintAnnotationStorage=me},(te,ee,ne)=>{var oe,me,pe,he,ue,de;Object.defineProperty(ee,"__esModule",{value:!0}),ee.AnnotationEditor=void 0;var re=ne(5),se=ne(1);const Ae=class Ae{constructor(ce){Je(this,oe,this.focusin.bind(this));Je(this,me,this.focusout.bind(this));Je(this,pe,!1);Je(this,he,!1);Je(this,ue,!1);Lt(this,"_uiManager",null);Je(this,de,Ae._zIndex++);this.constructor===Ae&&(0,se.unreachable)("Cannot initialize AnnotationEditor."),this.parent=ce.parent,this.id=ce.id,this.width=this.height=null,this.pageIndex=ce.parent.pageIndex,this.name=ce.name,this.div=null,this._uiManager=ce.uiManager;const{rotation:fe,rawDims:{pageWidth:ye,pageHeight:ve,pageX:Pe,pageY:we}}=this.parent.viewport;this.rotation=fe,this.pageRotation=(360+fe-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[ye,ve],this.pageTranslation=[Pe,we];const[Te,Le]=this.parentDimensions;this.x=ce.x/Te,this.y=ce.y/Le,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,se.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(ce){this._uiManager.addCommands(ce)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=Re(this,de)}setParent(ce){ce!==null&&(this.pageIndex=ce.pageIndex,this.pageDimensions=ce.pageDimensions),this.parent=ce}focusin(ce){Re(this,pe)?_t(this,pe,!1):this.parent.setSelected(this)}focusout(ce){var ye;if(!this.isAttachedToDOM)return;const fe=ce.relatedTarget;fe!=null&&fe.closest(`#${this.id}`)||(ce.preventDefault(),(ye=this.parent)!=null&&ye.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(ce){const fe=this.parent.div.getBoundingClientRect();this.startX=ce.clientX-fe.x,this.startY=ce.clientY-fe.y,ce.dataTransfer.setData("text/plain",this.id),ce.dataTransfer.effectAllowed="move"}setAt(ce,fe,ye,ve){const[Pe,we]=this.parentDimensions;[ye,ve]=this.screenToPageTranslation(ye,ve),this.x=(ce+ye)/Pe,this.y=(fe+ve)/we,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}translate(ce,fe){const[ye,ve]=this.parentDimensions;[ce,fe]=this.screenToPageTranslation(ce,fe),this.x+=ce/ye,this.y+=fe/ve,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}screenToPageTranslation(ce,fe){switch(this.parentRotation){case 90:return[fe,-ce];case 180:return[-ce,-fe];case 270:return[-fe,ce];default:return[ce,fe]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{realScale:ce}=this._uiManager.viewParameters,[fe,ye]=this.pageDimensions;return[fe*ce,ye*ce]}setDims(ce,fe){const[ye,ve]=this.parentDimensions;this.div.style.width=`${100*ce/ye}%`,this.div.style.height=`${100*fe/ve}%`}fixDims(){const{style:ce}=this.div,{height:fe,width:ye}=ce,ve=ye.endsWith("%"),Pe=fe.endsWith("%");if(ve&&Pe)return;const[we,Te]=this.parentDimensions;ve||(ce.width=`${100*parseFloat(ye)/we}%`),Pe||(ce.height=`${100*parseFloat(fe)/Te}%`)}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",Re(this,oe)),this.div.addEventListener("focusout",Re(this,me));const[ce,fe]=this.getInitialTranslation();return this.translate(ce,fe),(0,re.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(ce){const{isMac:fe}=se.FeatureTest.platform;if(ce.button!==0||ce.ctrlKey&&fe){ce.preventDefault();return}ce.ctrlKey&&!fe||ce.shiftKey||ce.metaKey&&fe?this.parent.toggleSelected(this):this.parent.setSelected(this),_t(this,pe,!0)}getRect(ce,fe){const ye=this.parentScale,[ve,Pe]=this.pageDimensions,[we,Te]=this.pageTranslation,Le=ce/ye,Ne=fe/ye,Me=this.x*ve,ae=this.y*Pe,ge=this.width*ve,$e=this.height*Pe;switch(this.rotation){case 0:return[Me+Le+we,Pe-ae-Ne-$e+Te,Me+Le+ge+we,Pe-ae-Ne+Te];case 90:return[Me+Ne+we,Pe-ae+Le+Te,Me+Ne+$e+we,Pe-ae+Le+ge+Te];case 180:return[Me-Le-ge+we,Pe-ae+Ne+Te,Me-Le+we,Pe-ae+Ne+$e+Te];case 270:return[Me-Ne-$e+we,Pe-ae-Le-ge+Te,Me-Ne+we,Pe-ae-Le+Te];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(ce,fe){const[ye,ve,Pe,we]=ce,Te=Pe-ye,Le=we-ve;switch(this.rotation){case 0:return[ye,fe-we,Te,Le];case 90:return[ye,fe-ve,Le,Te];case 180:return[Pe,fe-ve,Te,Le];case 270:return[Pe,fe-we,Le,Te];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){_t(this,ue,!0)}disableEditMode(){_t(this,ue,!1)}isInEditMode(){return Re(this,ue)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var ce;(ce=this.div)==null||ce.addEventListener("focusin",Re(this,oe))}serialize(){(0,se.unreachable)("An editor must be serializable")}static deserialize(ce,fe,ye){const ve=new this.prototype.constructor({parent:fe,id:fe.getNextId(),uiManager:ye});ve.rotation=ce.rotation;const[Pe,we]=ve.pageDimensions,[Te,Le,Ne,Me]=ve.getRectInCurrentCoords(ce.rect,we);return ve.x=Te/Pe,ve.y=Le/we,ve.width=Ne/Pe,ve.height=Me/we,ve}remove(){this.div.removeEventListener("focusin",Re(this,oe)),this.div.removeEventListener("focusout",Re(this,me)),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){var ce;(ce=this.div)==null||ce.classList.add("selectedEditor")}unselect(){var ce;(ce=this.div)==null||ce.classList.remove("selectedEditor")}updateParams(ce,fe){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return Re(this,he)}set isEditing(ce){_t(this,he,ce),ce?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}};oe=new WeakMap,me=new WeakMap,pe=new WeakMap,he=new WeakMap,ue=new WeakMap,de=new WeakMap,Lt(Ae,"_colorManager",new re.ColorManager),Lt(Ae,"_zIndex",1);let ie=Ae;ee.AnnotationEditor=ie},(te,ee,ne)=>{var Ae,Se,ce,fe,ye,ve,sr,Te,Le,Ne,Me,ae,ge,$e,_e,ke,We,ze,Qe,ct,it,ht,at,gt,dt,yt,mt,qe,Ee,xe,Oe,ir,Ve,Dn,je,or,Be,ar,be,Ht,Fe,An,Xe,lr,Ze,cr,ot,Nn,nt,wn,pt,jn;Object.defineProperty(ee,"__esModule",{value:!0}),ee.KeyboardManager=ee.CommandManager=ee.ColorManager=ee.AnnotationEditorUIManager=void 0,ee.bindEvents=ie,ee.opacityToHex=oe;var re=ne(1),se=ne(6);function ie(Tt,Ye,St){for(const vt of St)Ye.addEventListener(vt,Tt[vt].bind(Tt))}function oe(Tt){return Math.round(Math.min(255,Math.max(1,255*Tt))).toString(16).padStart(2,"0")}class me{constructor(){Je(this,Ae,0)}getId(){return`${re.AnnotationEditorPrefix}${xn(this,Ae)._++}`}}Ae=new WeakMap;class pe{constructor(Ye=128){Je(this,Se,[]);Je(this,ce,!1);Je(this,fe,void 0);Je(this,ye,-1);_t(this,fe,Ye)}add({cmd:Ye,undo:St,mustExec:vt,type:$t=NaN,overwriteIfSameType:ut=!1,keepUndo:De=!1}){if(vt&&Ye(),Re(this,ce))return;const He={cmd:Ye,undo:St,type:$t};if(Re(this,ye)===-1){Re(this,Se).length>0&&(Re(this,Se).length=0),_t(this,ye,0),Re(this,Se).push(He);return}if(ut&&Re(this,Se)[Re(this,ye)].type===$t){De&&(He.undo=Re(this,Se)[Re(this,ye)].undo),Re(this,Se)[Re(this,ye)]=He;return}const lt=Re(this,ye)+1;lt===Re(this,fe)?Re(this,Se).splice(0,1):(_t(this,ye,lt),lt<Re(this,Se).length&&Re(this,Se).splice(lt)),Re(this,Se).push(He)}undo(){Re(this,ye)!==-1&&(_t(this,ce,!0),Re(this,Se)[Re(this,ye)].undo(),_t(this,ce,!1),_t(this,ye,Re(this,ye)-1))}redo(){Re(this,ye)<Re(this,Se).length-1&&(_t(this,ye,Re(this,ye)+1),_t(this,ce,!0),Re(this,Se)[Re(this,ye)].cmd(),_t(this,ce,!1))}hasSomethingToUndo(){return Re(this,ye)!==-1}hasSomethingToRedo(){return Re(this,ye)<Re(this,Se).length-1}destroy(){_t(this,Se,null)}}Se=new WeakMap,ce=new WeakMap,fe=new WeakMap,ye=new WeakMap,ee.CommandManager=pe;class he{constructor(Ye){Je(this,ve);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:St}=re.FeatureTest.platform;for(const[vt,$t]of Ye)for(const ut of vt){const De=ut.startsWith("mac+");St&&De?(this.callbacks.set(ut.slice(4),$t),this.allKeys.add(ut.split("+").at(-1))):!St&&!De&&(this.callbacks.set(ut,$t),this.allKeys.add(ut.split("+").at(-1)))}}exec(Ye,St){if(!this.allKeys.has(St.key))return;const vt=this.callbacks.get(rt(this,ve,sr).call(this,St));vt&&(vt.bind(Ye)(),St.stopPropagation(),St.preventDefault())}}ve=new WeakSet,sr=function(Ye){Ye.altKey&&this.buffer.push("alt"),Ye.ctrlKey&&this.buffer.push("ctrl"),Ye.metaKey&&this.buffer.push("meta"),Ye.shiftKey&&this.buffer.push("shift"),this.buffer.push(Ye.key);const St=this.buffer.join("+");return this.buffer.length=0,St},ee.KeyboardManager=he;const we=class we{get _colors(){const Ye=new Map([["CanvasText",null],["Canvas",null]]);return(0,se.getColorValues)(Ye),(0,re.shadow)(this,"_colors",Ye)}convert(Ye){const St=(0,se.getRGB)(Ye);if(!window.matchMedia("(forced-colors: active)").matches)return St;for(const[vt,$t]of this._colors)if($t.every((ut,De)=>ut===St[De]))return we._colorsMapping.get(vt);return St}getHexCode(Ye){const St=this._colors.get(Ye);return St?re.Util.makeHexColor(...St):Ye}};Lt(we,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let ue=we;ee.ColorManager=ue;const At=class At{constructor(Ye,St,vt){Je(this,Oe);Je(this,Ve);Je(this,je);Je(this,Be);Je(this,be);Je(this,Fe);Je(this,Xe);Je(this,Ze);Je(this,ot);Je(this,nt);Je(this,pt);Je(this,Te,null);Je(this,Le,new Map);Je(this,Ne,new Map);Je(this,Me,null);Je(this,ae,new pe);Je(this,ge,0);Je(this,$e,null);Je(this,_e,new Set);Je(this,ke,null);Je(this,We,new me);Je(this,ze,!1);Je(this,Qe,re.AnnotationEditorType.NONE);Je(this,ct,new Set);Je(this,it,this.copy.bind(this));Je(this,ht,this.cut.bind(this));Je(this,at,this.paste.bind(this));Je(this,gt,this.keydown.bind(this));Je(this,dt,this.onEditingAction.bind(this));Je(this,yt,this.onPageChanging.bind(this));Je(this,mt,this.onScaleChanging.bind(this));Je(this,qe,this.onRotationChanging.bind(this));Je(this,Ee,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});Je(this,xe,null);_t(this,xe,Ye),_t(this,ke,St),Re(this,ke)._on("editingaction",Re(this,dt)),Re(this,ke)._on("pagechanging",Re(this,yt)),Re(this,ke)._on("scalechanging",Re(this,mt)),Re(this,ke)._on("rotationchanging",Re(this,qe)),_t(this,Me,vt),this.viewParameters={realScale:se.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){rt(this,Ve,Dn).call(this),Re(this,ke)._off("editingaction",Re(this,dt)),Re(this,ke)._off("pagechanging",Re(this,yt)),Re(this,ke)._off("scalechanging",Re(this,mt)),Re(this,ke)._off("rotationchanging",Re(this,qe));for(const Ye of Re(this,Ne).values())Ye.destroy();Re(this,Ne).clear(),Re(this,Le).clear(),Re(this,_e).clear(),_t(this,Te,null),Re(this,ct).clear(),Re(this,ae).destroy()}onPageChanging({pageNumber:Ye}){_t(this,ge,Ye-1)}focusMainContainer(){Re(this,xe).focus()}addShouldRescale(Ye){Re(this,_e).add(Ye)}removeShouldRescale(Ye){Re(this,_e).delete(Ye)}onScaleChanging({scale:Ye}){this.commitOrRemove(),this.viewParameters.realScale=Ye*se.PixelsPerInch.PDF_TO_CSS_UNITS;for(const St of Re(this,_e))St.onScaleChanging()}onRotationChanging({pagesRotation:Ye}){this.commitOrRemove(),this.viewParameters.rotation=Ye}addToAnnotationStorage(Ye){!Ye.isEmpty()&&Re(this,Me)&&!Re(this,Me).has(Ye.id)&&Re(this,Me).setValue(Ye.id,Ye)}copy(Ye){if(Ye.preventDefault(),Re(this,Te)&&Re(this,Te).commitOrRemove(),!this.hasSelection)return;const St=[];for(const vt of Re(this,ct))vt.isEmpty()||St.push(vt.serialize());St.length!==0&&Ye.clipboardData.setData("application/pdfjs",JSON.stringify(St))}cut(Ye){this.copy(Ye),this.delete()}paste(Ye){Ye.preventDefault();let St=Ye.clipboardData.getData("application/pdfjs");if(!St)return;try{St=JSON.parse(St)}catch($t){(0,re.warn)(`paste: "${$t.message}".`);return}if(!Array.isArray(St))return;this.unselectAll();const vt=Re(this,Ne).get(Re(this,ge));try{const $t=[];for(const He of St){const lt=vt.deserialize(He);if(!lt)return;$t.push(lt)}const ut=()=>{for(const He of $t)rt(this,ot,Nn).call(this,He);rt(this,pt,jn).call(this,$t)},De=()=>{for(const He of $t)He.remove()};this.addCommands({cmd:ut,undo:De,mustExec:!0})}catch($t){(0,re.warn)(`paste: "${$t.message}".`)}}keydown(Ye){var St;(St=this.getActive())!=null&&St.shouldGetKeyboardEvents()||At._keyboardManager.exec(this,Ye)}onEditingAction(Ye){["undo","redo","delete","selectAll"].includes(Ye.name)&&this[Ye.name]()}setEditingState(Ye){Ye?(rt(this,Oe,ir).call(this),rt(this,je,or).call(this),rt(this,be,Ht).call(this,{isEditing:Re(this,Qe)!==re.AnnotationEditorType.NONE,isEmpty:rt(this,nt,wn).call(this),hasSomethingToUndo:Re(this,ae).hasSomethingToUndo(),hasSomethingToRedo:Re(this,ae).hasSomethingToRedo(),hasSelectedEditor:!1})):(rt(this,Ve,Dn).call(this),rt(this,Be,ar).call(this),rt(this,be,Ht).call(this,{isEditing:!1}))}registerEditorTypes(Ye){if(!Re(this,$e)){_t(this,$e,Ye);for(const St of Re(this,$e))rt(this,Fe,An).call(this,St.defaultPropertiesToUpdate)}}getId(){return Re(this,We).getId()}get currentLayer(){return Re(this,Ne).get(Re(this,ge))}get currentPageIndex(){return Re(this,ge)}addLayer(Ye){Re(this,Ne).set(Ye.pageIndex,Ye),Re(this,ze)?Ye.enable():Ye.disable()}removeLayer(Ye){Re(this,Ne).delete(Ye.pageIndex)}updateMode(Ye){if(_t(this,Qe,Ye),Ye===re.AnnotationEditorType.NONE)this.setEditingState(!1),rt(this,Ze,cr).call(this);else{this.setEditingState(!0),rt(this,Xe,lr).call(this);for(const St of Re(this,Ne).values())St.updateMode(Ye)}}updateToolbar(Ye){Ye!==Re(this,Qe)&&Re(this,ke).dispatch("switchannotationeditormode",{source:this,mode:Ye})}updateParams(Ye,St){if(Re(this,$e)){for(const vt of Re(this,ct))vt.updateParams(Ye,St);for(const vt of Re(this,$e))vt.updateDefaultParams(Ye,St)}}getEditors(Ye){const St=[];for(const vt of Re(this,Le).values())vt.pageIndex===Ye&&St.push(vt);return St}getEditor(Ye){return Re(this,Le).get(Ye)}addEditor(Ye){Re(this,Le).set(Ye.id,Ye)}removeEditor(Ye){var St;Re(this,Le).delete(Ye.id),this.unselect(Ye),(St=Re(this,Me))==null||St.remove(Ye.id)}setActiveEditor(Ye){Re(this,Te)!==Ye&&(_t(this,Te,Ye),Ye&&rt(this,Fe,An).call(this,Ye.propertiesToUpdate))}toggleSelected(Ye){if(Re(this,ct).has(Ye)){Re(this,ct).delete(Ye),Ye.unselect(),rt(this,be,Ht).call(this,{hasSelectedEditor:this.hasSelection});return}Re(this,ct).add(Ye),Ye.select(),rt(this,Fe,An).call(this,Ye.propertiesToUpdate),rt(this,be,Ht).call(this,{hasSelectedEditor:!0})}setSelected(Ye){for(const St of Re(this,ct))St!==Ye&&St.unselect();Re(this,ct).clear(),Re(this,ct).add(Ye),Ye.select(),rt(this,Fe,An).call(this,Ye.propertiesToUpdate),rt(this,be,Ht).call(this,{hasSelectedEditor:!0})}isSelected(Ye){return Re(this,ct).has(Ye)}unselect(Ye){Ye.unselect(),Re(this,ct).delete(Ye),rt(this,be,Ht).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return Re(this,ct).size!==0}undo(){Re(this,ae).undo(),rt(this,be,Ht).call(this,{hasSomethingToUndo:Re(this,ae).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:rt(this,nt,wn).call(this)})}redo(){Re(this,ae).redo(),rt(this,be,Ht).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:Re(this,ae).hasSomethingToRedo(),isEmpty:rt(this,nt,wn).call(this)})}addCommands(Ye){Re(this,ae).add(Ye),rt(this,be,Ht).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:rt(this,nt,wn).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const Ye=[...Re(this,ct)],St=()=>{for(const $t of Ye)$t.remove()},vt=()=>{for(const $t of Ye)rt(this,ot,Nn).call(this,$t)};this.addCommands({cmd:St,undo:vt,mustExec:!0})}commitOrRemove(){var Ye;(Ye=Re(this,Te))==null||Ye.commitOrRemove()}selectAll(){for(const Ye of Re(this,ct))Ye.commit();rt(this,pt,jn).call(this,Re(this,Le).values())}unselectAll(){if(Re(this,Te)){Re(this,Te).commitOrRemove();return}if(Re(this,ct).size!==0){for(const Ye of Re(this,ct))Ye.unselect();Re(this,ct).clear(),rt(this,be,Ht).call(this,{hasSelectedEditor:!1})}}isActive(Ye){return Re(this,Te)===Ye}getActive(){return Re(this,Te)}getMode(){return Re(this,Qe)}};Te=new WeakMap,Le=new WeakMap,Ne=new WeakMap,Me=new WeakMap,ae=new WeakMap,ge=new WeakMap,$e=new WeakMap,_e=new WeakMap,ke=new WeakMap,We=new WeakMap,ze=new WeakMap,Qe=new WeakMap,ct=new WeakMap,it=new WeakMap,ht=new WeakMap,at=new WeakMap,gt=new WeakMap,dt=new WeakMap,yt=new WeakMap,mt=new WeakMap,qe=new WeakMap,Ee=new WeakMap,xe=new WeakMap,Oe=new WeakSet,ir=function(){Re(this,xe).addEventListener("keydown",Re(this,gt))},Ve=new WeakSet,Dn=function(){Re(this,xe).removeEventListener("keydown",Re(this,gt))},je=new WeakSet,or=function(){document.addEventListener("copy",Re(this,it)),document.addEventListener("cut",Re(this,ht)),document.addEventListener("paste",Re(this,at))},Be=new WeakSet,ar=function(){document.removeEventListener("copy",Re(this,it)),document.removeEventListener("cut",Re(this,ht)),document.removeEventListener("paste",Re(this,at))},be=new WeakSet,Ht=function(Ye){Object.entries(Ye).some(([vt,$t])=>Re(this,Ee)[vt]!==$t)&&Re(this,ke).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(Re(this,Ee),Ye)})},Fe=new WeakSet,An=function(Ye){Re(this,ke).dispatch("annotationeditorparamschanged",{source:this,details:Ye})},Xe=new WeakSet,lr=function(){if(!Re(this,ze)){_t(this,ze,!0);for(const Ye of Re(this,Ne).values())Ye.enable()}},Ze=new WeakSet,cr=function(){if(this.unselectAll(),Re(this,ze)){_t(this,ze,!1);for(const Ye of Re(this,Ne).values())Ye.disable()}},ot=new WeakSet,Nn=function(Ye){const St=Re(this,Ne).get(Ye.pageIndex);St?St.addOrRebuild(Ye):this.addEditor(Ye)},nt=new WeakSet,wn=function(){if(Re(this,Le).size===0)return!0;if(Re(this,Le).size===1)for(const Ye of Re(this,Le).values())return Ye.isEmpty();return!1},pt=new WeakSet,jn=function(Ye){Re(this,ct).clear();for(const St of Ye)St.isEmpty()||(Re(this,ct).add(St),St.select());rt(this,be,Ht).call(this,{hasSelectedEditor:!0})},Lt(At,"_keyboardManager",new he([[["ctrl+a","mac+meta+a"],At.prototype.selectAll],[["ctrl+z","mac+meta+z"],At.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],At.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],At.prototype.delete],[["Escape","mac+Escape"],At.prototype.unselectAll]]));let de=At;ee.AnnotationEditorUIManager=de},(te,ee,ne)=>{var it,ht,at,gt,dt,yt,mt,qe,Ee,Zt,Oe,Xt,Ve,Gt;Object.defineProperty(ee,"__esModule",{value:!0}),ee.StatTimer=ee.RenderingCancelledException=ee.PixelsPerInch=ee.PageViewport=ee.PDFDateString=ee.DOMStandardFontDataFactory=ee.DOMSVGFactory=ee.DOMFilterFactory=ee.DOMCanvasFactory=ee.DOMCMapReaderFactory=ee.AnnotationPrefix=void 0,ee.deprecated=Me,ee.getColorValues=ke,ee.getCurrentTransform=We,ee.getCurrentTransformInverse=ze,ee.getFilenameFromUrl=Pe,ee.getPdfFilenameFromUrl=we,ee.getRGB=_e,ee.getXfaPageViewport=$e,ee.isDataScheme=ye,ee.isPdfFile=ve,ee.isValidFetchUrl=Le,ee.loadScript=Ne,ee.setLayerDimensions=Qe;var re=ne(7),se=ne(1);const ie="http://www.w3.org/2000/svg",oe="pdfjs_internal_id_";ee.AnnotationPrefix=oe;const ct=class ct{};Lt(ct,"CSS",96),Lt(ct,"PDF",72),Lt(ct,"PDF_TO_CSS_UNITS",ct.CSS/ct.PDF);let me=ct;ee.PixelsPerInch=me;class pe extends re.BaseFilterFactory{constructor({docId:Be,ownerDocument:le=globalThis.document}={}){super();Je(this,Ee);Je(this,Oe);Je(this,Ve);Je(this,it,void 0);Je(this,ht,void 0);Je(this,at,void 0);Je(this,gt,void 0);Je(this,dt,void 0);Je(this,yt,void 0);Je(this,mt,void 0);Je(this,qe,0);_t(this,at,Be),_t(this,gt,le)}addFilter(Be){if(!Be)return"none";let le=Re(this,Ee,Zt).get(Be);if(le)return le;let be,Ce,Fe,Ie;if(Be.length===1){const ot=Be[0],et=new Array(256);for(let nt=0;nt<256;nt++)et[nt]=ot[nt]/255;Ie=be=Ce=Fe=et.join(",")}else{const[ot,et,nt]=Be,ft=new Array(256),pt=new Array(256),wt=new Array(256);for(let At=0;At<256;At++)ft[At]=ot[At]/255,pt[At]=et[At]/255,wt[At]=nt[At]/255;be=ft.join(","),Ce=pt.join(","),Fe=wt.join(","),Ie=`${be}${Ce}${Fe}`}if(le=Re(this,Ee,Zt).get(Ie),le)return Re(this,Ee,Zt).set(Be,le),le;const Xe=`g_${Re(this,at)}_transfer_map_${xn(this,qe)._++}`,tt=`url(#${Xe})`;Re(this,Ee,Zt).set(Be,tt),Re(this,Ee,Zt).set(Ie,tt);const Ze=Re(this,gt).createElementNS(ie,"filter",ie);Ze.setAttribute("id",Xe),Ze.setAttribute("color-interpolation-filters","sRGB");const st=Re(this,gt).createElementNS(ie,"feComponentTransfer");return Ze.append(st),rt(this,Ve,Gt).call(this,st,"feFuncR",be),rt(this,Ve,Gt).call(this,st,"feFuncG",Ce),rt(this,Ve,Gt).call(this,st,"feFuncB",Fe),Re(this,Oe,Xt).append(Ze),tt}addHCMFilter(Be,le){var nt;const be=`${Be}-${le}`;if(Re(this,yt)===be)return Re(this,mt);if(_t(this,yt,be),_t(this,mt,"none"),(nt=Re(this,dt))==null||nt.remove(),!Be||!le)return Re(this,mt);Re(this,Oe,Xt).style.color=Be,Be=getComputedStyle(Re(this,Oe,Xt)).getPropertyValue("color");const Ce=_e(Be);Be=se.Util.makeHexColor(...Ce),Re(this,Oe,Xt).style.color=le,le=getComputedStyle(Re(this,Oe,Xt)).getPropertyValue("color");const Fe=_e(le);if(le=se.Util.makeHexColor(...Fe),Re(this,Oe,Xt).style.color="",Be==="#000000"&&le==="#ffffff"||Be===le)return Re(this,mt);const Ie=new Array(256);for(let ft=0;ft<=255;ft++){const pt=ft/255;Ie[ft]=pt<=.03928?pt/12.92:((pt+.055)/1.055)**2.4}const Xe=Ie.join(","),tt=`g_${Re(this,at)}_hcm_filter`,Ze=_t(this,dt,Re(this,gt).createElementNS(ie,"filter",ie));Ze.setAttribute("id",tt),Ze.setAttribute("color-interpolation-filters","sRGB");let st=Re(this,gt).createElementNS(ie,"feComponentTransfer");Ze.append(st),rt(this,Ve,Gt).call(this,st,"feFuncR",Xe),rt(this,Ve,Gt).call(this,st,"feFuncG",Xe),rt(this,Ve,Gt).call(this,st,"feFuncB",Xe);const ot=Re(this,gt).createElementNS(ie,"feColorMatrix");ot.setAttribute("type","matrix"),ot.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),Ze.append(ot),st=Re(this,gt).createElementNS(ie,"feComponentTransfer"),Ze.append(st);const et=(ft,pt)=>{const wt=Ce[ft]/255,At=Fe[ft]/255,Tt=new Array(pt+1);for(let Ye=0;Ye<=pt;Ye++)Tt[Ye]=wt+Ye/pt*(At-wt);return Tt.join(",")};return rt(this,Ve,Gt).call(this,st,"feFuncR",et(0,5)),rt(this,Ve,Gt).call(this,st,"feFuncG",et(1,5)),rt(this,Ve,Gt).call(this,st,"feFuncB",et(2,5)),Re(this,Oe,Xt).append(Ze),_t(this,mt,`url(#${tt})`),Re(this,mt)}destroy(Be=!1){Be&&Re(this,mt)||(Re(this,ht)&&(Re(this,ht).parentNode.parentNode.remove(),_t(this,ht,null)),Re(this,it)&&(Re(this,it).clear(),_t(this,it,null)),_t(this,qe,0))}}it=new WeakMap,ht=new WeakMap,at=new WeakMap,gt=new WeakMap,dt=new WeakMap,yt=new WeakMap,mt=new WeakMap,qe=new WeakMap,Ee=new WeakSet,Zt=function(){return Re(this,it)||_t(this,it,new Map)},Oe=new WeakSet,Xt=function(){if(!Re(this,ht)){const Be=Re(this,gt).createElement("div"),{style:le}=Be;le.visibility="hidden",le.contain="strict",le.width=le.height=0,le.position="absolute",le.top=le.left=0,le.zIndex=-1;const be=Re(this,gt).createElementNS(ie,"svg");be.setAttribute("width",0),be.setAttribute("height",0),_t(this,ht,Re(this,gt).createElementNS(ie,"defs")),Be.append(be),be.append(Re(this,ht)),Re(this,gt).body.append(Be)}return Re(this,ht)},Ve=new WeakSet,Gt=function(Be,le,be){const Ce=Re(this,gt).createElementNS(ie,le);Ce.setAttribute("type","discrete"),Ce.setAttribute("tableValues",be),Be.append(Ce)},ee.DOMFilterFactory=pe;class he extends re.BaseCanvasFactory{constructor({ownerDocument:Ue=globalThis.document}={}){super(),this._document=Ue}_createCanvas(Ue,Be){const le=this._document.createElement("canvas");return le.width=Ue,le.height=Be,le}}ee.DOMCanvasFactory=he;async function ue(je,Ue=!1){if(Le(je,document.baseURI)){const Be=await fetch(je);if(!Be.ok)throw new Error(Be.statusText);return Ue?new Uint8Array(await Be.arrayBuffer()):(0,se.stringToBytes)(await Be.text())}return new Promise((Be,le)=>{const be=new XMLHttpRequest;be.open("GET",je,!0),Ue&&(be.responseType="arraybuffer"),be.onreadystatechange=()=>{if(be.readyState===XMLHttpRequest.DONE){if(be.status===200||be.status===0){let Ce;if(Ue&&be.response?Ce=new Uint8Array(be.response):!Ue&&be.responseText&&(Ce=(0,se.stringToBytes)(be.responseText)),Ce){Be(Ce);return}}le(new Error(be.statusText))}},be.send(null)})}class de extends re.BaseCMapReaderFactory{_fetchData(Ue,Be){return ue(Ue,this.isCompressed).then(le=>({cMapData:le,compressionType:Be}))}}ee.DOMCMapReaderFactory=de;class Ae extends re.BaseStandardFontDataFactory{_fetchData(Ue){return ue(Ue,!0)}}ee.DOMStandardFontDataFactory=Ae;class Se extends re.BaseSVGFactory{_createSVG(Ue){return document.createElementNS(ie,Ue)}}ee.DOMSVGFactory=Se;class ce{constructor({viewBox:Ue,scale:Be,rotation:le,offsetX:be=0,offsetY:Ce=0,dontFlip:Fe=!1}){this.viewBox=Ue,this.scale=Be,this.rotation=le,this.offsetX=be,this.offsetY=Ce;const Ie=(Ue[2]+Ue[0])/2,Xe=(Ue[3]+Ue[1])/2;let tt,Ze,st,ot;switch(le%=360,le<0&&(le+=360),le){case 180:tt=-1,Ze=0,st=0,ot=1;break;case 90:tt=0,Ze=1,st=1,ot=0;break;case 270:tt=0,Ze=-1,st=-1,ot=0;break;case 0:tt=1,Ze=0,st=0,ot=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Fe&&(st=-st,ot=-ot);let et,nt,ft,pt;tt===0?(et=Math.abs(Xe-Ue[1])*Be+be,nt=Math.abs(Ie-Ue[0])*Be+Ce,ft=(Ue[3]-Ue[1])*Be,pt=(Ue[2]-Ue[0])*Be):(et=Math.abs(Ie-Ue[0])*Be+be,nt=Math.abs(Xe-Ue[1])*Be+Ce,ft=(Ue[2]-Ue[0])*Be,pt=(Ue[3]-Ue[1])*Be),this.transform=[tt*Be,Ze*Be,st*Be,ot*Be,et-tt*Be*Ie-st*Be*Xe,nt-Ze*Be*Ie-ot*Be*Xe],this.width=ft,this.height=pt}get rawDims(){const{viewBox:Ue}=this;return(0,se.shadow)(this,"rawDims",{pageWidth:Ue[2]-Ue[0],pageHeight:Ue[3]-Ue[1],pageX:Ue[0],pageY:Ue[1]})}clone({scale:Ue=this.scale,rotation:Be=this.rotation,offsetX:le=this.offsetX,offsetY:be=this.offsetY,dontFlip:Ce=!1}={}){return new ce({viewBox:this.viewBox.slice(),scale:Ue,rotation:Be,offsetX:le,offsetY:be,dontFlip:Ce})}convertToViewportPoint(Ue,Be){return se.Util.applyTransform([Ue,Be],this.transform)}convertToViewportRectangle(Ue){const Be=se.Util.applyTransform([Ue[0],Ue[1]],this.transform),le=se.Util.applyTransform([Ue[2],Ue[3]],this.transform);return[Be[0],Be[1],le[0],le[1]]}convertToPdfPoint(Ue,Be){return se.Util.applyInverseTransform([Ue,Be],this.transform)}}ee.PageViewport=ce;class fe extends se.BaseException{constructor(Ue,Be,le=0){super(Ue,"RenderingCancelledException"),this.type=Be,this.extraDelay=le}}ee.RenderingCancelledException=fe;function ye(je){const Ue=je.length;let Be=0;for(;Be<Ue&&je[Be].trim()==="";)Be++;return je.substring(Be,Be+5).toLowerCase()==="data:"}function ve(je){return typeof je=="string"&&/\.pdf$/i.test(je)}function Pe(je,Ue=!1){return Ue||([je]=je.split(/[#?]/,1)),je.substring(je.lastIndexOf("/")+1)}function we(je,Ue="document.pdf"){if(typeof je!="string")return Ue;if(ye(je))return(0,se.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),Ue;const Be=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,le=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,be=Be.exec(je);let Ce=le.exec(be[1])||le.exec(be[2])||le.exec(be[3]);if(Ce&&(Ce=Ce[0],Ce.includes("%")))try{Ce=le.exec(decodeURIComponent(Ce))[0]}catch{}return Ce||Ue}class Te{constructor(){Lt(this,"started",Object.create(null));Lt(this,"times",[])}time(Ue){Ue in this.started&&(0,se.warn)(`Timer is already running for ${Ue}`),this.started[Ue]=Date.now()}timeEnd(Ue){Ue in this.started||(0,se.warn)(`Timer has not been started for ${Ue}`),this.times.push({name:Ue,start:this.started[Ue],end:Date.now()}),delete this.started[Ue]}toString(){const Ue=[];let Be=0;for(const{name:le}of this.times)Be=Math.max(le.length,Be);for(const{name:le,start:be,end:Ce}of this.times)Ue.push(`${le.padEnd(Be)} ${Ce-be}ms
|
|
47
|
+
`);return Ue.join("")}}ee.StatTimer=Te;function Le(je,Ue){try{const{protocol:Be}=Ue?new URL(je,Ue):new URL(je);return Be==="http:"||Be==="https:"}catch{return!1}}function Ne(je,Ue=!1){return new Promise((Be,le)=>{const be=document.createElement("script");be.src=je,be.onload=function(Ce){Ue&&be.remove(),Be(Ce)},be.onerror=function(){le(new Error(`Cannot load script at: ${be.src}`))},(document.head||document.documentElement).append(be)})}function Me(je){console.log("Deprecated API usage: "+je)}let ae;class ge{static toDateObject(Ue){if(!Ue||typeof Ue!="string")return null;ae||(ae=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const Be=ae.exec(Ue);if(!Be)return null;const le=parseInt(Be[1],10);let be=parseInt(Be[2],10);be=be>=1&&be<=12?be-1:0;let Ce=parseInt(Be[3],10);Ce=Ce>=1&&Ce<=31?Ce:1;let Fe=parseInt(Be[4],10);Fe=Fe>=0&&Fe<=23?Fe:0;let Ie=parseInt(Be[5],10);Ie=Ie>=0&&Ie<=59?Ie:0;let Xe=parseInt(Be[6],10);Xe=Xe>=0&&Xe<=59?Xe:0;const tt=Be[7]||"Z";let Ze=parseInt(Be[8],10);Ze=Ze>=0&&Ze<=23?Ze:0;let st=parseInt(Be[9],10)||0;return st=st>=0&&st<=59?st:0,tt==="-"?(Fe+=Ze,Ie+=st):tt==="+"&&(Fe-=Ze,Ie-=st),new Date(Date.UTC(le,be,Ce,Fe,Ie,Xe))}}ee.PDFDateString=ge;function $e(je,{scale:Ue=1,rotation:Be=0}){const{width:le,height:be}=je.attributes.style,Ce=[0,0,parseInt(le),parseInt(be)];return new ce({viewBox:Ce,scale:Ue,rotation:Be})}function _e(je){if(je.startsWith("#")){const Ue=parseInt(je.slice(1),16);return[(Ue&16711680)>>16,(Ue&65280)>>8,Ue&255]}return je.startsWith("rgb(")?je.slice(4,-1).split(",").map(Ue=>parseInt(Ue)):je.startsWith("rgba(")?je.slice(5,-1).split(",").map(Ue=>parseInt(Ue)).slice(0,3):((0,se.warn)(`Not a valid color format: "${je}"`),[0,0,0])}function ke(je){const Ue=document.createElement("span");Ue.style.visibility="hidden",document.body.append(Ue);for(const Be of je.keys()){Ue.style.color=Be;const le=window.getComputedStyle(Ue).color;je.set(Be,_e(le))}Ue.remove()}function We(je){const{a:Ue,b:Be,c:le,d:be,e:Ce,f:Fe}=je.getTransform();return[Ue,Be,le,be,Ce,Fe]}function ze(je){const{a:Ue,b:Be,c:le,d:be,e:Ce,f:Fe}=je.getTransform().invertSelf();return[Ue,Be,le,be,Ce,Fe]}function Qe(je,Ue,Be=!1,le=!0){if(Ue instanceof ce){const{pageWidth:be,pageHeight:Ce}=Ue.rawDims,{style:Fe}=je,Ie=`calc(var(--scale-factor) * ${be}px)`,Xe=`calc(var(--scale-factor) * ${Ce}px)`;!Be||Ue.rotation%180===0?(Fe.width=Ie,Fe.height=Xe):(Fe.width=Xe,Fe.height=Ie)}le&&je.setAttribute("data-main-rotation",Ue.rotation)}},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.BaseStandardFontDataFactory=ee.BaseSVGFactory=ee.BaseFilterFactory=ee.BaseCanvasFactory=ee.BaseCMapReaderFactory=void 0;var re=ne(1);class se{constructor(){this.constructor===se&&(0,re.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(ue){return"none"}addHCMFilter(ue,de){return"none"}destroy(ue=!1){}}ee.BaseFilterFactory=se;class ie{constructor(){this.constructor===ie&&(0,re.unreachable)("Cannot initialize BaseCanvasFactory.")}create(ue,de){if(ue<=0||de<=0)throw new Error("Invalid canvas size");const Ae=this._createCanvas(ue,de);return{canvas:Ae,context:Ae.getContext("2d")}}reset(ue,de,Ae){if(!ue.canvas)throw new Error("Canvas is not specified");if(de<=0||Ae<=0)throw new Error("Invalid canvas size");ue.canvas.width=de,ue.canvas.height=Ae}destroy(ue){if(!ue.canvas)throw new Error("Canvas is not specified");ue.canvas.width=0,ue.canvas.height=0,ue.canvas=null,ue.context=null}_createCanvas(ue,de){(0,re.unreachable)("Abstract method `_createCanvas` called.")}}ee.BaseCanvasFactory=ie;class oe{constructor({baseUrl:ue=null,isCompressed:de=!0}){this.constructor===oe&&(0,re.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=ue,this.isCompressed=de}async fetch({name:ue}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!ue)throw new Error("CMap name must be specified.");const de=this.baseUrl+ue+(this.isCompressed?".bcmap":""),Ae=this.isCompressed?re.CMapCompressionType.BINARY:re.CMapCompressionType.NONE;return this._fetchData(de,Ae).catch(Se=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${de}`)})}_fetchData(ue,de){(0,re.unreachable)("Abstract method `_fetchData` called.")}}ee.BaseCMapReaderFactory=oe;class me{constructor({baseUrl:ue=null}){this.constructor===me&&(0,re.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=ue}async fetch({filename:ue}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!ue)throw new Error("Font filename must be specified.");const de=`${this.baseUrl}${ue}`;return this._fetchData(de).catch(Ae=>{throw new Error(`Unable to load font data at: ${de}`)})}_fetchData(ue){(0,re.unreachable)("Abstract method `_fetchData` called.")}}ee.BaseStandardFontDataFactory=me;class pe{constructor(){this.constructor===pe&&(0,re.unreachable)("Cannot initialize BaseSVGFactory.")}create(ue,de,Ae=!1){if(ue<=0||de<=0)throw new Error("Invalid SVG dimensions");const Se=this._createSVG("svg:svg");return Se.setAttribute("version","1.1"),Ae||(Se.setAttribute("width",`${ue}px`),Se.setAttribute("height",`${de}px`)),Se.setAttribute("preserveAspectRatio","none"),Se.setAttribute("viewBox",`0 0 ${ue} ${de}`),Se}createElement(ue){if(typeof ue!="string")throw new Error("Invalid SVG element type");return this._createSVG(ue)}_createSVG(ue){(0,re.unreachable)("Abstract method `_createSVG` called.")}}ee.BaseSVGFactory=pe},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.MurmurHash3_64=void 0;var re=ne(1);const se=3285377520,ie=4294901760,oe=65535;class me{constructor(he){this.h1=he?he&4294967295:se,this.h2=he?he&4294967295:se}update(he){let ue,de;if(typeof he=="string"){ue=new Uint8Array(he.length*2),de=0;for(let Me=0,ae=he.length;Me<ae;Me++){const ge=he.charCodeAt(Me);ge<=255?ue[de++]=ge:(ue[de++]=ge>>>8,ue[de++]=ge&255)}}else if((0,re.isArrayBuffer)(he))ue=he.slice(),de=ue.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const Ae=de>>2,Se=de-Ae*4,ce=new Uint32Array(ue.buffer,0,Ae);let fe=0,ye=0,ve=this.h1,Pe=this.h2;const we=3432918353,Te=461845907,Le=we&oe,Ne=Te&oe;for(let Me=0;Me<Ae;Me++)Me&1?(fe=ce[Me],fe=fe*we&ie|fe*Le&oe,fe=fe<<15|fe>>>17,fe=fe*Te&ie|fe*Ne&oe,ve^=fe,ve=ve<<13|ve>>>19,ve=ve*5+3864292196):(ye=ce[Me],ye=ye*we&ie|ye*Le&oe,ye=ye<<15|ye>>>17,ye=ye*Te&ie|ye*Ne&oe,Pe^=ye,Pe=Pe<<13|Pe>>>19,Pe=Pe*5+3864292196);switch(fe=0,Se){case 3:fe^=ue[Ae*4+2]<<16;case 2:fe^=ue[Ae*4+1]<<8;case 1:fe^=ue[Ae*4],fe=fe*we&ie|fe*Le&oe,fe=fe<<15|fe>>>17,fe=fe*Te&ie|fe*Ne&oe,Ae&1?ve^=fe:Pe^=fe}this.h1=ve,this.h2=Pe}hexdigest(){let he=this.h1,ue=this.h2;return he^=ue>>>1,he=he*3981806797&ie|he*36045&oe,ue=ue*4283543511&ie|((ue<<16|he>>>16)*2950163797&ie)>>>16,he^=ue>>>1,he=he*444984403&ie|he*60499&oe,ue=ue*3301882366&ie|((ue<<16|he>>>16)*3120437893&ie)>>>16,he^=ue>>>1,(he>>>0).toString(16).padStart(8,"0")+(ue>>>0).toString(16).padStart(8,"0")}}ee.MurmurHash3_64=me},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.FontLoader=ee.FontFaceObject=void 0;var re=ne(1),se=ne(10);class ie{constructor({ownerDocument:pe=globalThis.document,styleElement:he=null}){this._document=pe,this.nativeFontFaces=[],this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(pe){this.nativeFontFaces.push(pe),this._document.fonts.add(pe)}insertRule(pe){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const he=this.styleElement.sheet;he.insertRule(pe,he.cssRules.length)}clear(){for(const pe of this.nativeFontFaces)this._document.fonts.delete(pe);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(pe){if(pe.attached||pe.missingFile)return;if(pe.attached=!0,this.isFontLoadingAPISupported){const ue=pe.createNativeFontFace();if(ue){this.addNativeFontFace(ue);try{await ue.loaded}catch(de){throw(0,re.warn)(`Failed to load font '${ue.family}': '${de}'.`),pe.disableFontFace=!0,de}}return}const he=pe.createFontFaceRule();if(he){if(this.insertRule(he),this.isSyncFontLoadingSupported)return;await new Promise(ue=>{const de=this._queueLoadingCallback(ue);this._prepareFontLoadEvent(pe,de)})}}get isFontLoadingAPISupported(){var he;const pe=!!((he=this._document)!=null&&he.fonts);return(0,re.shadow)(this,"isFontLoadingAPISupported",pe)}get isSyncFontLoadingSupported(){let pe=!1;return(se.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(pe=!0),(0,re.shadow)(this,"isSyncFontLoadingSupported",pe)}_queueLoadingCallback(pe){function he(){for((0,re.assert)(!de.done,"completeRequest() cannot be called twice."),de.done=!0;ue.length>0&&ue[0].done;){const Ae=ue.shift();setTimeout(Ae.callback,0)}}const{loadingRequests:ue}=this,de={done:!1,complete:he,callback:pe};return ue.push(de),de}get _loadTestFont(){const pe=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,re.shadow)(this,"_loadTestFont",pe)}_prepareFontLoadEvent(pe,he){function ue(_e,ke){return _e.charCodeAt(ke)<<24|_e.charCodeAt(ke+1)<<16|_e.charCodeAt(ke+2)<<8|_e.charCodeAt(ke+3)&255}function de(_e,ke,We,ze){const Qe=_e.substring(0,ke),ct=_e.substring(ke+We);return Qe+ze+ct}let Ae,Se;const ce=this._document.createElement("canvas");ce.width=1,ce.height=1;const fe=ce.getContext("2d");let ye=0;function ve(_e,ke){if(++ye>30){(0,re.warn)("Load test font never loaded."),ke();return}if(fe.font="30px "+_e,fe.fillText(".",0,20),fe.getImageData(0,0,1,1).data[3]>0){ke();return}setTimeout(ve.bind(null,_e,ke))}const Pe=`lt${Date.now()}${this.loadTestFontId++}`;let we=this._loadTestFont;we=de(we,976,Pe.length,Pe);const Le=16,Ne=1482184792;let Me=ue(we,Le);for(Ae=0,Se=Pe.length-3;Ae<Se;Ae+=4)Me=Me-Ne+ue(Pe,Ae)|0;Ae<Pe.length&&(Me=Me-Ne+ue(Pe+"XXX",Ae)|0),we=de(we,Le,4,(0,re.string32)(Me));const ae=`url(data:font/opentype;base64,${btoa(we)});`,ge=`@font-face {font-family:"${Pe}";src:${ae}}`;this.insertRule(ge);const $e=this._document.createElement("div");$e.style.visibility="hidden",$e.style.width=$e.style.height="10px",$e.style.position="absolute",$e.style.top=$e.style.left="0px";for(const _e of[pe.loadedName,Pe]){const ke=this._document.createElement("span");ke.textContent="Hi",ke.style.fontFamily=_e,$e.append(ke)}this._document.body.append($e),ve(Pe,()=>{$e.remove(),he.complete()})}}ee.FontLoader=ie;class oe{constructor(pe,{isEvalSupported:he=!0,disableFontFace:ue=!1,ignoreErrors:de=!1,inspectFont:Ae=null}){this.compiledGlyphs=Object.create(null);for(const Se in pe)this[Se]=pe[Se];this.isEvalSupported=he!==!1,this.disableFontFace=ue===!0,this.ignoreErrors=de===!0,this._inspectFont=Ae}createNativeFontFace(){var he;if(!this.data||this.disableFontFace)return null;let pe;if(!this.cssFontInfo)pe=new FontFace(this.loadedName,this.data,{});else{const ue={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(ue.style=`oblique ${this.cssFontInfo.italicAngle}deg`),pe=new FontFace(this.cssFontInfo.fontFamily,this.data,ue)}return(he=this._inspectFont)==null||he.call(this,this),pe}createFontFaceRule(){var de;if(!this.data||this.disableFontFace)return null;const pe=(0,re.bytesToString)(this.data),he=`url(data:${this.mimetype};base64,${btoa(pe)});`;let ue;if(!this.cssFontInfo)ue=`@font-face {font-family:"${this.loadedName}";src:${he}}`;else{let Ae=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(Ae+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),ue=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${Ae}src:${he}}`}return(de=this._inspectFont)==null||de.call(this,this,he),ue}getPathGenerator(pe,he){if(this.compiledGlyphs[he]!==void 0)return this.compiledGlyphs[he];let ue;try{ue=pe.get(this.loadedName+"_path_"+he)}catch(de){if(!this.ignoreErrors)throw de;return(0,re.warn)(`getPathGenerator - ignoring character: "${de}".`),this.compiledGlyphs[he]=function(Ae,Se){}}if(this.isEvalSupported&&re.FeatureTest.isEvalSupported){const de=[];for(const Ae of ue){const Se=Ae.args!==void 0?Ae.args.join(","):"";de.push("c.",Ae.cmd,"(",Se,`);
|
|
48
|
+
`)}return this.compiledGlyphs[he]=new Function("c","size",de.join(""))}return this.compiledGlyphs[he]=function(de,Ae){for(const Se of ue)Se.cmd==="scale"&&(Se.args=[Ae,-Ae]),de[Se.cmd].apply(de,Se.args)}}}ee.FontFaceObject=oe},(te,ee)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.isNodeJS=void 0;const ne=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");ee.isNodeJS=ne},(te,ee,ne)=>{var at,Bn,dt,Un;Object.defineProperty(ee,"__esModule",{value:!0}),ee.CanvasGraphics=void 0;var re=ne(1),se=ne(6),ie=ne(12),oe=ne(13),me=ne(10);const pe=16,he=100,ue=4096,de=15,Ae=10,Se=1e3,ce=16;function fe(qe,Ee){if(qe._removeMirroring)throw new Error("Context is already forwarding operations.");qe.__originalSave=qe.save,qe.__originalRestore=qe.restore,qe.__originalRotate=qe.rotate,qe.__originalScale=qe.scale,qe.__originalTranslate=qe.translate,qe.__originalTransform=qe.transform,qe.__originalSetTransform=qe.setTransform,qe.__originalResetTransform=qe.resetTransform,qe.__originalClip=qe.clip,qe.__originalMoveTo=qe.moveTo,qe.__originalLineTo=qe.lineTo,qe.__originalBezierCurveTo=qe.bezierCurveTo,qe.__originalRect=qe.rect,qe.__originalClosePath=qe.closePath,qe.__originalBeginPath=qe.beginPath,qe._removeMirroring=()=>{qe.save=qe.__originalSave,qe.restore=qe.__originalRestore,qe.rotate=qe.__originalRotate,qe.scale=qe.__originalScale,qe.translate=qe.__originalTranslate,qe.transform=qe.__originalTransform,qe.setTransform=qe.__originalSetTransform,qe.resetTransform=qe.__originalResetTransform,qe.clip=qe.__originalClip,qe.moveTo=qe.__originalMoveTo,qe.lineTo=qe.__originalLineTo,qe.bezierCurveTo=qe.__originalBezierCurveTo,qe.rect=qe.__originalRect,qe.closePath=qe.__originalClosePath,qe.beginPath=qe.__originalBeginPath,delete qe._removeMirroring},qe.save=function(){Ee.save(),this.__originalSave()},qe.restore=function(){Ee.restore(),this.__originalRestore()},qe.translate=function(Oe,Ge){Ee.translate(Oe,Ge),this.__originalTranslate(Oe,Ge)},qe.scale=function(Oe,Ge){Ee.scale(Oe,Ge),this.__originalScale(Oe,Ge)},qe.transform=function(Oe,Ge,Ve,Ke,je,Ue){Ee.transform(Oe,Ge,Ve,Ke,je,Ue),this.__originalTransform(Oe,Ge,Ve,Ke,je,Ue)},qe.setTransform=function(Oe,Ge,Ve,Ke,je,Ue){Ee.setTransform(Oe,Ge,Ve,Ke,je,Ue),this.__originalSetTransform(Oe,Ge,Ve,Ke,je,Ue)},qe.resetTransform=function(){Ee.resetTransform(),this.__originalResetTransform()},qe.rotate=function(Oe){Ee.rotate(Oe),this.__originalRotate(Oe)},qe.clip=function(Oe){Ee.clip(Oe),this.__originalClip(Oe)},qe.moveTo=function(xe,Oe){Ee.moveTo(xe,Oe),this.__originalMoveTo(xe,Oe)},qe.lineTo=function(xe,Oe){Ee.lineTo(xe,Oe),this.__originalLineTo(xe,Oe)},qe.bezierCurveTo=function(xe,Oe,Ge,Ve,Ke,je){Ee.bezierCurveTo(xe,Oe,Ge,Ve,Ke,je),this.__originalBezierCurveTo(xe,Oe,Ge,Ve,Ke,je)},qe.rect=function(xe,Oe,Ge,Ve){Ee.rect(xe,Oe,Ge,Ve),this.__originalRect(xe,Oe,Ge,Ve)},qe.closePath=function(){Ee.closePath(),this.__originalClosePath()},qe.beginPath=function(){Ee.beginPath(),this.__originalBeginPath()}}class ye{constructor(Ee){this.canvasFactory=Ee,this.cache=Object.create(null)}getCanvas(Ee,xe,Oe){let Ge;return this.cache[Ee]!==void 0?(Ge=this.cache[Ee],this.canvasFactory.reset(Ge,xe,Oe)):(Ge=this.canvasFactory.create(xe,Oe),this.cache[Ee]=Ge),Ge}delete(Ee){delete this.cache[Ee]}clear(){for(const Ee in this.cache){const xe=this.cache[Ee];this.canvasFactory.destroy(xe),delete this.cache[Ee]}}}function ve(qe,Ee,xe,Oe,Ge,Ve,Ke,je,Ue,Be){const[le,be,Ce,Fe,Ie,Xe]=(0,se.getCurrentTransform)(qe);if(be===0&&Ce===0){const st=Ke*le+Ie,ot=Math.round(st),et=je*Fe+Xe,nt=Math.round(et),ft=(Ke+Ue)*le+Ie,pt=Math.abs(Math.round(ft)-ot)||1,wt=(je+Be)*Fe+Xe,At=Math.abs(Math.round(wt)-nt)||1;return qe.setTransform(Math.sign(le),0,0,Math.sign(Fe),ot,nt),qe.drawImage(Ee,xe,Oe,Ge,Ve,0,0,pt,At),qe.setTransform(le,be,Ce,Fe,Ie,Xe),[pt,At]}if(le===0&&Fe===0){const st=je*Ce+Ie,ot=Math.round(st),et=Ke*be+Xe,nt=Math.round(et),ft=(je+Be)*Ce+Ie,pt=Math.abs(Math.round(ft)-ot)||1,wt=(Ke+Ue)*be+Xe,At=Math.abs(Math.round(wt)-nt)||1;return qe.setTransform(0,Math.sign(be),Math.sign(Ce),0,ot,nt),qe.drawImage(Ee,xe,Oe,Ge,Ve,0,0,At,pt),qe.setTransform(le,be,Ce,Fe,Ie,Xe),[At,pt]}qe.drawImage(Ee,xe,Oe,Ge,Ve,Ke,je,Ue,Be);const tt=Math.hypot(le,be),Ze=Math.hypot(Ce,Fe);return[tt*Ue,Ze*Be]}function Pe(qe){const{width:Ee,height:xe}=qe;if(Ee>Se||xe>Se)return null;const Oe=1e3,Ge=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),Ve=Ee+1;let Ke=new Uint8Array(Ve*(xe+1)),je,Ue,Be;const le=Ee+7&-8;let be=new Uint8Array(le*xe),Ce=0;for(const Ze of qe.data){let st=128;for(;st>0;)be[Ce++]=Ze&st?0:255,st>>=1}let Fe=0;for(Ce=0,be[Ce]!==0&&(Ke[0]=1,++Fe),Ue=1;Ue<Ee;Ue++)be[Ce]!==be[Ce+1]&&(Ke[Ue]=be[Ce]?2:1,++Fe),Ce++;for(be[Ce]!==0&&(Ke[Ue]=2,++Fe),je=1;je<xe;je++){Ce=je*le,Be=je*Ve,be[Ce-le]!==be[Ce]&&(Ke[Be]=be[Ce]?1:8,++Fe);let Ze=(be[Ce]?4:0)+(be[Ce-le]?8:0);for(Ue=1;Ue<Ee;Ue++)Ze=(Ze>>2)+(be[Ce+1]?4:0)+(be[Ce-le+1]?8:0),Ge[Ze]&&(Ke[Be+Ue]=Ge[Ze],++Fe),Ce++;if(be[Ce-le]!==be[Ce]&&(Ke[Be+Ue]=be[Ce]?2:4,++Fe),Fe>Oe)return null}for(Ce=le*(xe-1),Be=je*Ve,be[Ce]!==0&&(Ke[Be]=8,++Fe),Ue=1;Ue<Ee;Ue++)be[Ce]!==be[Ce+1]&&(Ke[Be+Ue]=be[Ce]?4:8,++Fe),Ce++;if(be[Ce]!==0&&(Ke[Be+Ue]=4,++Fe),Fe>Oe)return null;const Ie=new Int32Array([0,Ve,-1,0,-Ve,0,0,0,1]),Xe=new Path2D;for(je=0;Fe&&je<=xe;je++){let Ze=je*Ve;const st=Ze+Ee;for(;Ze<st&&!Ke[Ze];)Ze++;if(Ze===st)continue;Xe.moveTo(Ze%Ve,je);const ot=Ze;let et=Ke[Ze];do{const nt=Ie[et];do Ze+=nt;while(!Ke[Ze]);const ft=Ke[Ze];ft!==5&&ft!==10?(et=ft,Ke[Ze]=0):(et=ft&51*et>>4,Ke[Ze]&=et>>2|et<<2),Xe.lineTo(Ze%Ve,Ze/Ve|0),Ke[Ze]||--Fe}while(ot!==Ze);--je}return be=null,Ke=null,function(Ze){Ze.save(),Ze.scale(1/Ee,-1/xe),Ze.translate(0,-xe),Ze.fill(Xe),Ze.beginPath(),Ze.restore()}}class we{constructor(Ee,xe){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=re.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=re.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=re.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,Ee,xe])}clone(){const Ee=Object.create(this);return Ee.clipBox=this.clipBox.slice(),Ee}setCurrentPoint(Ee,xe){this.x=Ee,this.y=xe}updatePathMinMax(Ee,xe,Oe){[xe,Oe]=re.Util.applyTransform([xe,Oe],Ee),this.minX=Math.min(this.minX,xe),this.minY=Math.min(this.minY,Oe),this.maxX=Math.max(this.maxX,xe),this.maxY=Math.max(this.maxY,Oe)}updateRectMinMax(Ee,xe){const Oe=re.Util.applyTransform(xe,Ee),Ge=re.Util.applyTransform(xe.slice(2),Ee);this.minX=Math.min(this.minX,Oe[0],Ge[0]),this.minY=Math.min(this.minY,Oe[1],Ge[1]),this.maxX=Math.max(this.maxX,Oe[0],Ge[0]),this.maxY=Math.max(this.maxY,Oe[1],Ge[1])}updateScalingPathMinMax(Ee,xe){re.Util.scaleMinMax(Ee,xe),this.minX=Math.min(this.minX,xe[0]),this.maxX=Math.max(this.maxX,xe[1]),this.minY=Math.min(this.minY,xe[2]),this.maxY=Math.max(this.maxY,xe[3])}updateCurvePathMinMax(Ee,xe,Oe,Ge,Ve,Ke,je,Ue,Be,le){const be=re.Util.bezierBoundingBox(xe,Oe,Ge,Ve,Ke,je,Ue,Be);if(le){le[0]=Math.min(le[0],be[0],be[2]),le[1]=Math.max(le[1],be[0],be[2]),le[2]=Math.min(le[2],be[1],be[3]),le[3]=Math.max(le[3],be[1],be[3]);return}this.updateRectMinMax(Ee,be)}getPathBoundingBox(Ee=ie.PathType.FILL,xe=null){const Oe=[this.minX,this.minY,this.maxX,this.maxY];if(Ee===ie.PathType.STROKE){xe||(0,re.unreachable)("Stroke bounding box must include transform.");const Ge=re.Util.singularValueDecompose2dScale(xe),Ve=Ge[0]*this.lineWidth/2,Ke=Ge[1]*this.lineWidth/2;Oe[0]-=Ve,Oe[1]-=Ke,Oe[2]+=Ve,Oe[3]+=Ke}return Oe}updateClipFromPath(){const Ee=re.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(Ee||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(Ee){this.clipBox=Ee,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(Ee=ie.PathType.FILL,xe=null){return re.Util.intersect(this.clipBox,this.getPathBoundingBox(Ee,xe))}}function Te(qe,Ee){if(typeof ImageData<"u"&&Ee instanceof ImageData){qe.putImageData(Ee,0,0);return}const xe=Ee.height,Oe=Ee.width,Ge=xe%ce,Ve=(xe-Ge)/ce,Ke=Ge===0?Ve:Ve+1,je=qe.createImageData(Oe,ce);let Ue=0,Be;const le=Ee.data,be=je.data;let Ce,Fe,Ie,Xe;if(Ee.kind===re.ImageKind.GRAYSCALE_1BPP){const tt=le.byteLength,Ze=new Uint32Array(be.buffer,0,be.byteLength>>2),st=Ze.length,ot=Oe+7>>3,et=4294967295,nt=re.FeatureTest.isLittleEndian?4278190080:255;for(Ce=0;Ce<Ke;Ce++){for(Ie=Ce<Ve?ce:Ge,Be=0,Fe=0;Fe<Ie;Fe++){const ft=tt-Ue;let pt=0;const wt=ft>ot?Oe:ft*8-7,At=wt&-8;let Tt=0,Ye=0;for(;pt<At;pt+=8)Ye=le[Ue++],Ze[Be++]=Ye&128?et:nt,Ze[Be++]=Ye&64?et:nt,Ze[Be++]=Ye&32?et:nt,Ze[Be++]=Ye&16?et:nt,Ze[Be++]=Ye&8?et:nt,Ze[Be++]=Ye&4?et:nt,Ze[Be++]=Ye&2?et:nt,Ze[Be++]=Ye&1?et:nt;for(;pt<wt;pt++)Tt===0&&(Ye=le[Ue++],Tt=128),Ze[Be++]=Ye&Tt?et:nt,Tt>>=1}for(;Be<st;)Ze[Be++]=0;qe.putImageData(je,0,Ce*ce)}}else if(Ee.kind===re.ImageKind.RGBA_32BPP){for(Fe=0,Xe=Oe*ce*4,Ce=0;Ce<Ve;Ce++)be.set(le.subarray(Ue,Ue+Xe)),Ue+=Xe,qe.putImageData(je,0,Fe),Fe+=ce;Ce<Ke&&(Xe=Oe*Ge*4,be.set(le.subarray(Ue,Ue+Xe)),qe.putImageData(je,0,Fe))}else if(Ee.kind===re.ImageKind.RGB_24BPP)for(Ie=ce,Xe=Oe*Ie,Ce=0;Ce<Ke;Ce++){for(Ce>=Ve&&(Ie=Ge,Xe=Oe*Ie),Be=0,Fe=Xe;Fe--;)be[Be++]=le[Ue++],be[Be++]=le[Ue++],be[Be++]=le[Ue++],be[Be++]=255;qe.putImageData(je,0,Ce*ce)}else throw new Error(`bad image kind: ${Ee.kind}`)}function Le(qe,Ee){if(Ee.bitmap){qe.drawImage(Ee.bitmap,0,0);return}const xe=Ee.height,Oe=Ee.width,Ge=xe%ce,Ve=(xe-Ge)/ce,Ke=Ge===0?Ve:Ve+1,je=qe.createImageData(Oe,ce);let Ue=0;const Be=Ee.data,le=je.data;for(let be=0;be<Ke;be++){const Ce=be<Ve?ce:Ge;({srcPos:Ue}=(0,oe.convertBlackAndWhiteToRGBA)({src:Be,srcPos:Ue,dest:le,width:Oe,height:Ce,nonBlackColor:0})),qe.putImageData(je,0,be*ce)}}function Ne(qe,Ee){const xe=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const Oe of xe)qe[Oe]!==void 0&&(Ee[Oe]=qe[Oe]);qe.setLineDash!==void 0&&(Ee.setLineDash(qe.getLineDash()),Ee.lineDashOffset=qe.lineDashOffset)}function Me(qe){qe.strokeStyle=qe.fillStyle="#000000",qe.fillRule="nonzero",qe.globalAlpha=1,qe.lineWidth=1,qe.lineCap="butt",qe.lineJoin="miter",qe.miterLimit=10,qe.globalCompositeOperation="source-over",qe.font="10px sans-serif",qe.setLineDash!==void 0&&(qe.setLineDash([]),qe.lineDashOffset=0),me.isNodeJS||(qe.filter="none")}function ae(qe,Ee,xe,Oe){const Ge=qe.length;for(let Ve=3;Ve<Ge;Ve+=4){const Ke=qe[Ve];if(Ke===0)qe[Ve-3]=Ee,qe[Ve-2]=xe,qe[Ve-1]=Oe;else if(Ke<255){const je=255-Ke;qe[Ve-3]=qe[Ve-3]*Ke+Ee*je>>8,qe[Ve-2]=qe[Ve-2]*Ke+xe*je>>8,qe[Ve-1]=qe[Ve-1]*Ke+Oe*je>>8}}}function ge(qe,Ee,xe){const Oe=qe.length,Ge=1/255;for(let Ve=3;Ve<Oe;Ve+=4){const Ke=xe?xe[qe[Ve]]:qe[Ve];Ee[Ve]=Ee[Ve]*Ke*Ge|0}}function $e(qe,Ee,xe){const Oe=qe.length;for(let Ge=3;Ge<Oe;Ge+=4){const Ve=qe[Ge-3]*77+qe[Ge-2]*152+qe[Ge-1]*28;Ee[Ge]=xe?Ee[Ge]*xe[Ve>>8]>>8:Ee[Ge]*Ve>>16}}function _e(qe,Ee,xe,Oe,Ge,Ve,Ke,je,Ue,Be,le){const be=!!Ve,Ce=be?Ve[0]:0,Fe=be?Ve[1]:0,Ie=be?Ve[2]:0;let Xe;Ge==="Luminosity"?Xe=$e:Xe=ge;const Ze=Math.min(Oe,Math.ceil(1048576/xe));for(let st=0;st<Oe;st+=Ze){const ot=Math.min(Ze,Oe-st),et=qe.getImageData(je-Be,st+(Ue-le),xe,ot),nt=Ee.getImageData(je,st+Ue,xe,ot);be&&ae(et.data,Ce,Fe,Ie),Xe(et.data,nt.data,Ke),Ee.putImageData(nt,je,st+Ue)}}function ke(qe,Ee,xe,Oe){const Ge=Oe[0],Ve=Oe[1],Ke=Oe[2]-Ge,je=Oe[3]-Ve;Ke===0||je===0||(_e(Ee.context,xe,Ke,je,Ee.subtype,Ee.backdrop,Ee.transferMap,Ge,Ve,Ee.offsetX,Ee.offsetY),qe.save(),qe.globalAlpha=1,qe.globalCompositeOperation="source-over",qe.setTransform(1,0,0,1,0,0),qe.drawImage(xe.canvas,0,0),qe.restore())}function We(qe,Ee){const xe=re.Util.singularValueDecompose2dScale(qe);xe[0]=Math.fround(xe[0]),xe[1]=Math.fround(xe[1]);const Oe=Math.fround((globalThis.devicePixelRatio||1)*se.PixelsPerInch.PDF_TO_CSS_UNITS);return Ee!==void 0?Ee:xe[0]<=Oe||xe[1]<=Oe}const ze=["butt","round","square"],Qe=["miter","round","bevel"],ct={},it={},mt=class mt{constructor(Ee,xe,Oe,Ge,Ve,{optionalContentConfig:Ke,markedContentStack:je=null},Ue,Be){Je(this,at);Je(this,dt);this.ctx=Ee,this.current=new we(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=xe,this.objs=Oe,this.canvasFactory=Ge,this.filterFactory=Ve,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=je||[],this.optionalContentConfig=Ke,this.cachedCanvases=new ye(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=Ue,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=Be,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(Ee,xe=null){return typeof Ee=="string"?Ee.startsWith("g_")?this.commonObjs.get(Ee):this.objs.get(Ee):xe}beginDrawing({transform:Ee,viewport:xe,transparency:Oe=!1,background:Ge=null}){const Ve=this.ctx.canvas.width,Ke=this.ctx.canvas.height,je=this.ctx.fillStyle;if(this.ctx.fillStyle=Ge||"#ffffff",this.ctx.fillRect(0,0,Ve,Ke),this.ctx.fillStyle=je,Oe){const Ue=this.cachedCanvases.getCanvas("transparent",Ve,Ke);this.compositeCtx=this.ctx,this.transparentCanvas=Ue.canvas,this.ctx=Ue.context,this.ctx.save(),this.ctx.transform(...(0,se.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),Me(this.ctx),Ee&&(this.ctx.transform(...Ee),this.outputScaleX=Ee[0],this.outputScaleY=Ee[0]),this.ctx.transform(...xe.transform),this.viewportScale=xe.scale,this.baseTransform=(0,se.getCurrentTransform)(this.ctx)}executeOperatorList(Ee,xe,Oe,Ge){const Ve=Ee.argsArray,Ke=Ee.fnArray;let je=xe||0;const Ue=Ve.length;if(Ue===je)return je;const Be=Ue-je>Ae&&typeof Oe=="function",le=Be?Date.now()+de:0;let be=0;const Ce=this.commonObjs,Fe=this.objs;let Ie;for(;;){if(Ge!==void 0&&je===Ge.nextBreakPoint)return Ge.breakIt(je,Oe),je;if(Ie=Ke[je],Ie!==re.OPS.dependency)this[Ie].apply(this,Ve[je]);else for(const Xe of Ve[je]){const tt=Xe.startsWith("g_")?Ce:Fe;if(!tt.has(Xe))return tt.get(Xe,Oe),je}if(je++,je===Ue)return je;if(Be&&++be>Ae){if(Date.now()>le)return Oe(),je;be=0}}}endDrawing(){rt(this,at,Bn).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const Ee of this._cachedBitmapsMap.values()){for(const xe of Ee.values())typeof HTMLCanvasElement<"u"&&xe instanceof HTMLCanvasElement&&(xe.width=xe.height=0);Ee.clear()}this._cachedBitmapsMap.clear(),rt(this,dt,Un).call(this)}_scaleImage(Ee,xe){const Oe=Ee.width,Ge=Ee.height;let Ve=Math.max(Math.hypot(xe[0],xe[1]),1),Ke=Math.max(Math.hypot(xe[2],xe[3]),1),je=Oe,Ue=Ge,Be="prescale1",le,be;for(;Ve>2&&je>1||Ke>2&&Ue>1;){let Ce=je,Fe=Ue;Ve>2&&je>1&&(Ce=je>=16384?Math.floor(je/2)-1||1:Math.ceil(je/2),Ve/=je/Ce),Ke>2&&Ue>1&&(Fe=Ue>=16384?Math.floor(Ue/2)-1||1:Math.ceil(Ue)/2,Ke/=Ue/Fe),le=this.cachedCanvases.getCanvas(Be,Ce,Fe),be=le.context,be.clearRect(0,0,Ce,Fe),be.drawImage(Ee,0,0,je,Ue,0,0,Ce,Fe),Ee=le.canvas,je=Ce,Ue=Fe,Be=Be==="prescale1"?"prescale2":"prescale1"}return{img:Ee,paintWidth:je,paintHeight:Ue}}_createMaskCanvas(Ee){const xe=this.ctx,{width:Oe,height:Ge}=Ee,Ve=this.current.fillColor,Ke=this.current.patternFill,je=(0,se.getCurrentTransform)(xe);let Ue,Be,le,be;if((Ee.bitmap||Ee.data)&&Ee.count>1){const pt=Ee.bitmap||Ee.data.buffer;Be=JSON.stringify(Ke?je:[je.slice(0,4),Ve]),Ue=this._cachedBitmapsMap.get(pt),Ue||(Ue=new Map,this._cachedBitmapsMap.set(pt,Ue));const wt=Ue.get(Be);if(wt&&!Ke){const At=Math.round(Math.min(je[0],je[2])+je[4]),Tt=Math.round(Math.min(je[1],je[3])+je[5]);return{canvas:wt,offsetX:At,offsetY:Tt}}le=wt}le||(be=this.cachedCanvases.getCanvas("maskCanvas",Oe,Ge),Le(be.context,Ee));let Ce=re.Util.transform(je,[1/Oe,0,0,-1/Ge,0,0]);Ce=re.Util.transform(Ce,[1,0,0,1,0,-Ge]);const Fe=re.Util.applyTransform([0,0],Ce),Ie=re.Util.applyTransform([Oe,Ge],Ce),Xe=re.Util.normalizeRect([Fe[0],Fe[1],Ie[0],Ie[1]]),tt=Math.round(Xe[2]-Xe[0])||1,Ze=Math.round(Xe[3]-Xe[1])||1,st=this.cachedCanvases.getCanvas("fillCanvas",tt,Ze),ot=st.context,et=Math.min(Fe[0],Ie[0]),nt=Math.min(Fe[1],Ie[1]);ot.translate(-et,-nt),ot.transform(...Ce),le||(le=this._scaleImage(be.canvas,(0,se.getCurrentTransformInverse)(ot)),le=le.img,Ue&&Ke&&Ue.set(Be,le)),ot.imageSmoothingEnabled=We((0,se.getCurrentTransform)(ot),Ee.interpolate),ve(ot,le,0,0,le.width,le.height,0,0,Oe,Ge),ot.globalCompositeOperation="source-in";const ft=re.Util.transform((0,se.getCurrentTransformInverse)(ot),[1,0,0,1,-et,-nt]);return ot.fillStyle=Ke?Ve.getPattern(xe,this,ft,ie.PathType.FILL):Ve,ot.fillRect(0,0,Oe,Ge),Ue&&!Ke&&(this.cachedCanvases.delete("fillCanvas"),Ue.set(Be,st.canvas)),{canvas:st.canvas,offsetX:Math.round(et),offsetY:Math.round(nt)}}setLineWidth(Ee){Ee!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=Ee,this.ctx.lineWidth=Ee}setLineCap(Ee){this.ctx.lineCap=ze[Ee]}setLineJoin(Ee){this.ctx.lineJoin=Qe[Ee]}setMiterLimit(Ee){this.ctx.miterLimit=Ee}setDash(Ee,xe){const Oe=this.ctx;Oe.setLineDash!==void 0&&(Oe.setLineDash(Ee),Oe.lineDashOffset=xe)}setRenderingIntent(Ee){}setFlatness(Ee){}setGState(Ee){for(const[xe,Oe]of Ee)switch(xe){case"LW":this.setLineWidth(Oe);break;case"LC":this.setLineCap(Oe);break;case"LJ":this.setLineJoin(Oe);break;case"ML":this.setMiterLimit(Oe);break;case"D":this.setDash(Oe[0],Oe[1]);break;case"RI":this.setRenderingIntent(Oe);break;case"FL":this.setFlatness(Oe);break;case"Font":this.setFont(Oe[0],Oe[1]);break;case"CA":this.current.strokeAlpha=Oe;break;case"ca":this.current.fillAlpha=Oe,this.ctx.globalAlpha=Oe;break;case"BM":this.ctx.globalCompositeOperation=Oe;break;case"SMask":this.current.activeSMask=Oe?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(Oe);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const Ee=this.inSMaskMode;this.current.activeSMask&&!Ee?this.beginSMaskMode():!this.current.activeSMask&&Ee&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const Ee=this.ctx.canvas.width,xe=this.ctx.canvas.height,Oe="smaskGroupAt"+this.groupLevel,Ge=this.cachedCanvases.getCanvas(Oe,Ee,xe);this.suspendedCtx=this.ctx,this.ctx=Ge.context;const Ve=this.ctx;Ve.setTransform(...(0,se.getCurrentTransform)(this.suspendedCtx)),Ne(this.suspendedCtx,Ve),fe(Ve,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Ne(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(Ee){if(!this.current.activeSMask)return;Ee?(Ee[0]=Math.floor(Ee[0]),Ee[1]=Math.floor(Ee[1]),Ee[2]=Math.ceil(Ee[2]),Ee[3]=Math.ceil(Ee[3])):Ee=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const xe=this.current.activeSMask,Oe=this.suspendedCtx;ke(Oe,xe,this.ctx,Ee),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(Ne(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const Ee=this.current;this.stateStack.push(Ee),this.current=Ee.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Ne(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null)}transform(Ee,xe,Oe,Ge,Ve,Ke){this.ctx.transform(Ee,xe,Oe,Ge,Ve,Ke),this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null}constructPath(Ee,xe,Oe){const Ge=this.ctx,Ve=this.current;let Ke=Ve.x,je=Ve.y,Ue,Be;const le=(0,se.getCurrentTransform)(Ge),be=le[0]===0&&le[3]===0||le[1]===0&&le[2]===0,Ce=be?Oe.slice(0):null;for(let Fe=0,Ie=0,Xe=Ee.length;Fe<Xe;Fe++)switch(Ee[Fe]|0){case re.OPS.rectangle:Ke=xe[Ie++],je=xe[Ie++];const tt=xe[Ie++],Ze=xe[Ie++],st=Ke+tt,ot=je+Ze;Ge.moveTo(Ke,je),tt===0||Ze===0?Ge.lineTo(st,ot):(Ge.lineTo(st,je),Ge.lineTo(st,ot),Ge.lineTo(Ke,ot)),be||Ve.updateRectMinMax(le,[Ke,je,st,ot]),Ge.closePath();break;case re.OPS.moveTo:Ke=xe[Ie++],je=xe[Ie++],Ge.moveTo(Ke,je),be||Ve.updatePathMinMax(le,Ke,je);break;case re.OPS.lineTo:Ke=xe[Ie++],je=xe[Ie++],Ge.lineTo(Ke,je),be||Ve.updatePathMinMax(le,Ke,je);break;case re.OPS.curveTo:Ue=Ke,Be=je,Ke=xe[Ie+4],je=xe[Ie+5],Ge.bezierCurveTo(xe[Ie],xe[Ie+1],xe[Ie+2],xe[Ie+3],Ke,je),Ve.updateCurvePathMinMax(le,Ue,Be,xe[Ie],xe[Ie+1],xe[Ie+2],xe[Ie+3],Ke,je,Ce),Ie+=6;break;case re.OPS.curveTo2:Ue=Ke,Be=je,Ge.bezierCurveTo(Ke,je,xe[Ie],xe[Ie+1],xe[Ie+2],xe[Ie+3]),Ve.updateCurvePathMinMax(le,Ue,Be,Ke,je,xe[Ie],xe[Ie+1],xe[Ie+2],xe[Ie+3],Ce),Ke=xe[Ie+2],je=xe[Ie+3],Ie+=4;break;case re.OPS.curveTo3:Ue=Ke,Be=je,Ke=xe[Ie+2],je=xe[Ie+3],Ge.bezierCurveTo(xe[Ie],xe[Ie+1],Ke,je,Ke,je),Ve.updateCurvePathMinMax(le,Ue,Be,xe[Ie],xe[Ie+1],Ke,je,Ke,je,Ce),Ie+=4;break;case re.OPS.closePath:Ge.closePath();break}be&&Ve.updateScalingPathMinMax(le,Ce),Ve.setCurrentPoint(Ke,je)}closePath(){this.ctx.closePath()}stroke(Ee=!0){const xe=this.ctx,Oe=this.current.strokeColor;xe.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof Oe=="object"&&(Oe!=null&&Oe.getPattern)?(xe.save(),xe.strokeStyle=Oe.getPattern(xe,this,(0,se.getCurrentTransformInverse)(xe),ie.PathType.STROKE),this.rescaleAndStroke(!1),xe.restore()):this.rescaleAndStroke(!0)),Ee&&this.consumePath(this.current.getClippedPathBoundingBox()),xe.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(Ee=!0){const xe=this.ctx,Oe=this.current.fillColor,Ge=this.current.patternFill;let Ve=!1;Ge&&(xe.save(),xe.fillStyle=Oe.getPattern(xe,this,(0,se.getCurrentTransformInverse)(xe),ie.PathType.FILL),Ve=!0);const Ke=this.current.getClippedPathBoundingBox();this.contentVisible&&Ke!==null&&(this.pendingEOFill?(xe.fill("evenodd"),this.pendingEOFill=!1):xe.fill()),Ve&&xe.restore(),Ee&&this.consumePath(Ke)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=ct}eoClip(){this.pendingClip=it}beginText(){this.current.textMatrix=re.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const Ee=this.pendingTextPaths,xe=this.ctx;if(Ee===void 0){xe.beginPath();return}xe.save(),xe.beginPath();for(const Oe of Ee)xe.setTransform(...Oe.transform),xe.translate(Oe.x,Oe.y),Oe.addToPath(xe,Oe.fontSize);xe.restore(),xe.clip(),xe.beginPath(),delete this.pendingTextPaths}setCharSpacing(Ee){this.current.charSpacing=Ee}setWordSpacing(Ee){this.current.wordSpacing=Ee}setHScale(Ee){this.current.textHScale=Ee/100}setLeading(Ee){this.current.leading=-Ee}setFont(Ee,xe){const Oe=this.commonObjs.get(Ee),Ge=this.current;if(!Oe)throw new Error(`Can't find font for ${Ee}`);if(Ge.fontMatrix=Oe.fontMatrix||re.FONT_IDENTITY_MATRIX,(Ge.fontMatrix[0]===0||Ge.fontMatrix[3]===0)&&(0,re.warn)("Invalid font matrix for font "+Ee),xe<0?(xe=-xe,Ge.fontDirection=-1):Ge.fontDirection=1,this.current.font=Oe,this.current.fontSize=xe,Oe.isType3Font)return;const Ve=Oe.loadedName||"sans-serif";let Ke="normal";Oe.black?Ke="900":Oe.bold&&(Ke="bold");const je=Oe.italic?"italic":"normal",Ue=`"${Ve}", ${Oe.fallbackName}`;let Be=xe;xe<pe?Be=pe:xe>he&&(Be=he),this.current.fontSizeScale=xe/Be,this.ctx.font=`${je} ${Ke} ${Be}px ${Ue}`}setTextRenderingMode(Ee){this.current.textRenderingMode=Ee}setTextRise(Ee){this.current.textRise=Ee}moveText(Ee,xe){this.current.x=this.current.lineX+=Ee,this.current.y=this.current.lineY+=xe}setLeadingMoveText(Ee,xe){this.setLeading(-xe),this.moveText(Ee,xe)}setTextMatrix(Ee,xe,Oe,Ge,Ve,Ke){this.current.textMatrix=[Ee,xe,Oe,Ge,Ve,Ke],this.current.textMatrixScale=Math.hypot(Ee,xe),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(Ee,xe,Oe,Ge){const Ve=this.ctx,Ke=this.current,je=Ke.font,Ue=Ke.textRenderingMode,Be=Ke.fontSize/Ke.fontSizeScale,le=Ue&re.TextRenderingMode.FILL_STROKE_MASK,be=!!(Ue&re.TextRenderingMode.ADD_TO_PATH_FLAG),Ce=Ke.patternFill&&!je.missingFile;let Fe;(je.disableFontFace||be||Ce)&&(Fe=je.getPathGenerator(this.commonObjs,Ee)),je.disableFontFace||Ce?(Ve.save(),Ve.translate(xe,Oe),Ve.beginPath(),Fe(Ve,Be),Ge&&Ve.setTransform(...Ge),(le===re.TextRenderingMode.FILL||le===re.TextRenderingMode.FILL_STROKE)&&Ve.fill(),(le===re.TextRenderingMode.STROKE||le===re.TextRenderingMode.FILL_STROKE)&&Ve.stroke(),Ve.restore()):((le===re.TextRenderingMode.FILL||le===re.TextRenderingMode.FILL_STROKE)&&Ve.fillText(Ee,xe,Oe),(le===re.TextRenderingMode.STROKE||le===re.TextRenderingMode.FILL_STROKE)&&Ve.strokeText(Ee,xe,Oe)),be&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,se.getCurrentTransform)(Ve),x:xe,y:Oe,fontSize:Be,addToPath:Fe})}get isFontSubpixelAAEnabled(){const{context:Ee}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);Ee.scale(1.5,1),Ee.fillText("I",0,10);const xe=Ee.getImageData(0,0,10,10).data;let Oe=!1;for(let Ge=3;Ge<xe.length;Ge+=4)if(xe[Ge]>0&&xe[Ge]<255){Oe=!0;break}return(0,re.shadow)(this,"isFontSubpixelAAEnabled",Oe)}showText(Ee){const xe=this.current,Oe=xe.font;if(Oe.isType3Font)return this.showType3Text(Ee);const Ge=xe.fontSize;if(Ge===0)return;const Ve=this.ctx,Ke=xe.fontSizeScale,je=xe.charSpacing,Ue=xe.wordSpacing,Be=xe.fontDirection,le=xe.textHScale*Be,be=Ee.length,Ce=Oe.vertical,Fe=Ce?1:-1,Ie=Oe.defaultVMetrics,Xe=Ge*xe.fontMatrix[0],tt=xe.textRenderingMode===re.TextRenderingMode.FILL&&!Oe.disableFontFace&&!xe.patternFill;Ve.save(),Ve.transform(...xe.textMatrix),Ve.translate(xe.x,xe.y+xe.textRise),Be>0?Ve.scale(le,-1):Ve.scale(le,1);let Ze;if(xe.patternFill){Ve.save();const ft=xe.fillColor.getPattern(Ve,this,(0,se.getCurrentTransformInverse)(Ve),ie.PathType.FILL);Ze=(0,se.getCurrentTransform)(Ve),Ve.restore(),Ve.fillStyle=ft}let st=xe.lineWidth;const ot=xe.textMatrixScale;if(ot===0||st===0){const ft=xe.textRenderingMode&re.TextRenderingMode.FILL_STROKE_MASK;(ft===re.TextRenderingMode.STROKE||ft===re.TextRenderingMode.FILL_STROKE)&&(st=this.getSinglePixelWidth())}else st/=ot;if(Ke!==1&&(Ve.scale(Ke,Ke),st/=Ke),Ve.lineWidth=st,Oe.isInvalidPDFjsFont){const ft=[];let pt=0;for(const wt of Ee)ft.push(wt.unicode),pt+=wt.width;Ve.fillText(ft.join(""),0,0),xe.x+=pt*Xe*le,Ve.restore(),this.compose();return}let et=0,nt;for(nt=0;nt<be;++nt){const ft=Ee[nt];if(typeof ft=="number"){et+=Fe*ft*Ge/1e3;continue}let pt=!1;const wt=(ft.isSpace?Ue:0)+je,At=ft.fontChar,Tt=ft.accent;let Ye,St,vt=ft.width;if(Ce){const ut=ft.vmetric||Ie,De=-(ft.vmetric?ut[1]:vt*.5)*Xe,He=ut[2]*Xe;vt=ut?-ut[0]:vt,Ye=De/Ke,St=(et+He)/Ke}else Ye=et/Ke,St=0;if(Oe.remeasure&&vt>0){const ut=Ve.measureText(At).width*1e3/Ge*Ke;if(vt<ut&&this.isFontSubpixelAAEnabled){const De=vt/ut;pt=!0,Ve.save(),Ve.scale(De,1),Ye/=De}else vt!==ut&&(Ye+=(vt-ut)/2e3*Ge/Ke)}if(this.contentVisible&&(ft.isInFont||Oe.missingFile)){if(tt&&!Tt)Ve.fillText(At,Ye,St);else if(this.paintChar(At,Ye,St,Ze),Tt){const ut=Ye+Ge*Tt.offset.x/Ke,De=St-Ge*Tt.offset.y/Ke;this.paintChar(Tt.fontChar,ut,De,Ze)}}let $t;Ce?$t=vt*Xe-wt*Be:$t=vt*Xe+wt*Be,et+=$t,pt&&Ve.restore()}Ce?xe.y-=et:xe.x+=et*le,Ve.restore(),this.compose()}showType3Text(Ee){const xe=this.ctx,Oe=this.current,Ge=Oe.font,Ve=Oe.fontSize,Ke=Oe.fontDirection,je=Ge.vertical?1:-1,Ue=Oe.charSpacing,Be=Oe.wordSpacing,le=Oe.textHScale*Ke,be=Oe.fontMatrix||re.FONT_IDENTITY_MATRIX,Ce=Ee.length,Fe=Oe.textRenderingMode===re.TextRenderingMode.INVISIBLE;let Ie,Xe,tt,Ze;if(!(Fe||Ve===0)){for(this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,xe.save(),xe.transform(...Oe.textMatrix),xe.translate(Oe.x,Oe.y),xe.scale(le,Ke),Ie=0;Ie<Ce;++Ie){if(Xe=Ee[Ie],typeof Xe=="number"){Ze=je*Xe*Ve/1e3,this.ctx.translate(Ze,0),Oe.x+=Ze*le;continue}const st=(Xe.isSpace?Be:0)+Ue,ot=Ge.charProcOperatorList[Xe.operatorListId];if(!ot){(0,re.warn)(`Type3 character "${Xe.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=Xe,this.save(),xe.scale(Ve,Ve),xe.transform(...be),this.executeOperatorList(ot),this.restore()),tt=re.Util.applyTransform([Xe.width,0],be)[0]*Ve+st,xe.translate(tt,0),Oe.x+=tt*le}xe.restore(),this.processingType3=null}}setCharWidth(Ee,xe){}setCharWidthAndBounds(Ee,xe,Oe,Ge,Ve,Ke){this.ctx.rect(Oe,Ge,Ve-Oe,Ke-Ge),this.ctx.clip(),this.endPath()}getColorN_Pattern(Ee){let xe;if(Ee[0]==="TilingPattern"){const Oe=Ee[1],Ge=this.baseTransform||(0,se.getCurrentTransform)(this.ctx),Ve={createCanvasGraphics:Ke=>new mt(Ke,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};xe=new ie.TilingPattern(Ee,Oe,this.ctx,Ve,Ge)}else xe=this._getPattern(Ee[1],Ee[2]);return xe}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(Ee,xe,Oe){const Ge=re.Util.makeHexColor(Ee,xe,Oe);this.ctx.strokeStyle=Ge,this.current.strokeColor=Ge}setFillRGBColor(Ee,xe,Oe){const Ge=re.Util.makeHexColor(Ee,xe,Oe);this.ctx.fillStyle=Ge,this.current.fillColor=Ge,this.current.patternFill=!1}_getPattern(Ee,xe=null){let Oe;return this.cachedPatterns.has(Ee)?Oe=this.cachedPatterns.get(Ee):(Oe=(0,ie.getShadingPattern)(this.getObject(Ee)),this.cachedPatterns.set(Ee,Oe)),xe&&(Oe.matrix=xe),Oe}shadingFill(Ee){if(!this.contentVisible)return;const xe=this.ctx;this.save();const Oe=this._getPattern(Ee);xe.fillStyle=Oe.getPattern(xe,this,(0,se.getCurrentTransformInverse)(xe),ie.PathType.SHADING);const Ge=(0,se.getCurrentTransformInverse)(xe);if(Ge){const Ve=xe.canvas,Ke=Ve.width,je=Ve.height,Ue=re.Util.applyTransform([0,0],Ge),Be=re.Util.applyTransform([0,je],Ge),le=re.Util.applyTransform([Ke,0],Ge),be=re.Util.applyTransform([Ke,je],Ge),Ce=Math.min(Ue[0],Be[0],le[0],be[0]),Fe=Math.min(Ue[1],Be[1],le[1],be[1]),Ie=Math.max(Ue[0],Be[0],le[0],be[0]),Xe=Math.max(Ue[1],Be[1],le[1],be[1]);this.ctx.fillRect(Ce,Fe,Ie-Ce,Xe-Fe)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,re.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,re.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(Ee,xe){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(Ee)&&Ee.length===6&&this.transform(...Ee),this.baseTransform=(0,se.getCurrentTransform)(this.ctx),xe)){const Oe=xe[2]-xe[0],Ge=xe[3]-xe[1];this.ctx.rect(xe[0],xe[1],Oe,Ge),this.current.updateRectMinMax((0,se.getCurrentTransform)(this.ctx),xe),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(Ee){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const xe=this.ctx;Ee.isolated||(0,re.info)("TODO: Support non-isolated groups."),Ee.knockout&&(0,re.warn)("Knockout groups not supported.");const Oe=(0,se.getCurrentTransform)(xe);if(Ee.matrix&&xe.transform(...Ee.matrix),!Ee.bbox)throw new Error("Bounding box is required.");let Ge=re.Util.getAxialAlignedBoundingBox(Ee.bbox,(0,se.getCurrentTransform)(xe));const Ve=[0,0,xe.canvas.width,xe.canvas.height];Ge=re.Util.intersect(Ge,Ve)||[0,0,0,0];const Ke=Math.floor(Ge[0]),je=Math.floor(Ge[1]);let Ue=Math.max(Math.ceil(Ge[2])-Ke,1),Be=Math.max(Math.ceil(Ge[3])-je,1),le=1,be=1;Ue>ue&&(le=Ue/ue,Ue=ue),Be>ue&&(be=Be/ue,Be=ue),this.current.startNewPathAndClipBox([0,0,Ue,Be]);let Ce="groupAt"+this.groupLevel;Ee.smask&&(Ce+="_smask_"+this.smaskCounter++%2);const Fe=this.cachedCanvases.getCanvas(Ce,Ue,Be),Ie=Fe.context;Ie.scale(1/le,1/be),Ie.translate(-Ke,-je),Ie.transform(...Oe),Ee.smask?this.smaskStack.push({canvas:Fe.canvas,context:Ie,offsetX:Ke,offsetY:je,scaleX:le,scaleY:be,subtype:Ee.smask.subtype,backdrop:Ee.smask.backdrop,transferMap:Ee.smask.transferMap||null,startTransformInverse:null}):(xe.setTransform(1,0,0,1,0,0),xe.translate(Ke,je),xe.scale(le,be),xe.save()),Ne(xe,Ie),this.ctx=Ie,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(xe),this.groupLevel++}endGroup(Ee){if(!this.contentVisible)return;this.groupLevel--;const xe=this.ctx,Oe=this.groupStack.pop();if(this.ctx=Oe,this.ctx.imageSmoothingEnabled=!1,Ee.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const Ge=(0,se.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...Ge);const Ve=re.Util.getAxialAlignedBoundingBox([0,0,xe.canvas.width,xe.canvas.height],Ge);this.ctx.drawImage(xe.canvas,0,0),this.ctx.restore(),this.compose(Ve)}}beginAnnotation(Ee,xe,Oe,Ge,Ve){if(rt(this,at,Bn).call(this),Me(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(xe)&&xe.length===4){const Ke=xe[2]-xe[0],je=xe[3]-xe[1];if(Ve&&this.annotationCanvasMap){Oe=Oe.slice(),Oe[4]-=xe[0],Oe[5]-=xe[1],xe=xe.slice(),xe[0]=xe[1]=0,xe[2]=Ke,xe[3]=je;const[Ue,Be]=re.Util.singularValueDecompose2dScale((0,se.getCurrentTransform)(this.ctx)),{viewportScale:le}=this,be=Math.ceil(Ke*this.outputScaleX*le),Ce=Math.ceil(je*this.outputScaleY*le);this.annotationCanvas=this.canvasFactory.create(be,Ce);const{canvas:Fe,context:Ie}=this.annotationCanvas;this.annotationCanvasMap.set(Ee,Fe),this.annotationCanvas.savedCtx=this.ctx,this.ctx=Ie,this.ctx.save(),this.ctx.setTransform(Ue,0,0,-Be,0,je*Be),Me(this.ctx)}else Me(this.ctx),this.ctx.rect(xe[0],xe[1],Ke,je),this.ctx.clip(),this.endPath()}this.current=new we(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...Oe),this.transform(...Ge)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),rt(this,dt,Un).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(Ee){if(!this.contentVisible)return;const xe=Ee.count;Ee=this.getObject(Ee.data,Ee),Ee.count=xe;const Oe=this.ctx,Ge=this.processingType3;if(Ge&&(Ge.compiled===void 0&&(Ge.compiled=Pe(Ee)),Ge.compiled)){Ge.compiled(Oe);return}const Ve=this._createMaskCanvas(Ee),Ke=Ve.canvas;Oe.save(),Oe.setTransform(1,0,0,1,0,0),Oe.drawImage(Ke,Ve.offsetX,Ve.offsetY),Oe.restore(),this.compose()}paintImageMaskXObjectRepeat(Ee,xe,Oe=0,Ge=0,Ve,Ke){if(!this.contentVisible)return;Ee=this.getObject(Ee.data,Ee);const je=this.ctx;je.save();const Ue=(0,se.getCurrentTransform)(je);je.transform(xe,Oe,Ge,Ve,0,0);const Be=this._createMaskCanvas(Ee);je.setTransform(1,0,0,1,Be.offsetX-Ue[4],Be.offsetY-Ue[5]);for(let le=0,be=Ke.length;le<be;le+=2){const Ce=re.Util.transform(Ue,[xe,Oe,Ge,Ve,Ke[le],Ke[le+1]]),[Fe,Ie]=re.Util.applyTransform([0,0],Ce);je.drawImage(Be.canvas,Fe,Ie)}je.restore(),this.compose()}paintImageMaskXObjectGroup(Ee){if(!this.contentVisible)return;const xe=this.ctx,Oe=this.current.fillColor,Ge=this.current.patternFill;for(const Ve of Ee){const{data:Ke,width:je,height:Ue,transform:Be}=Ve,le=this.cachedCanvases.getCanvas("maskCanvas",je,Ue),be=le.context;be.save();const Ce=this.getObject(Ke,Ve);Le(be,Ce),be.globalCompositeOperation="source-in",be.fillStyle=Ge?Oe.getPattern(be,this,(0,se.getCurrentTransformInverse)(xe),ie.PathType.FILL):Oe,be.fillRect(0,0,je,Ue),be.restore(),xe.save(),xe.transform(...Be),xe.scale(1,-1),ve(xe,le.canvas,0,0,je,Ue,0,-1,1,1),xe.restore()}this.compose()}paintImageXObject(Ee){if(!this.contentVisible)return;const xe=this.getObject(Ee);if(!xe){(0,re.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(xe)}paintImageXObjectRepeat(Ee,xe,Oe,Ge){if(!this.contentVisible)return;const Ve=this.getObject(Ee);if(!Ve){(0,re.warn)("Dependent image isn't ready yet");return}const Ke=Ve.width,je=Ve.height,Ue=[];for(let Be=0,le=Ge.length;Be<le;Be+=2)Ue.push({transform:[xe,0,0,Oe,Ge[Be],Ge[Be+1]],x:0,y:0,w:Ke,h:je});this.paintInlineImageXObjectGroup(Ve,Ue)}applyTransferMapsToCanvas(Ee){return this.current.transferMaps!=="none"&&(Ee.filter=this.current.transferMaps,Ee.drawImage(Ee.canvas,0,0),Ee.filter="none"),Ee.canvas}applyTransferMapsToBitmap(Ee){if(this.current.transferMaps==="none")return Ee.bitmap;const{bitmap:xe,width:Oe,height:Ge}=Ee,Ve=this.cachedCanvases.getCanvas("inlineImage",Oe,Ge),Ke=Ve.context;return Ke.filter=this.current.transferMaps,Ke.drawImage(xe,0,0),Ke.filter="none",Ve.canvas}paintInlineImageXObject(Ee){if(!this.contentVisible)return;const xe=Ee.width,Oe=Ee.height,Ge=this.ctx;this.save(),me.isNodeJS||(Ge.filter="none"),Ge.scale(1/xe,-1/Oe);let Ve;if(Ee.bitmap)Ve=this.applyTransferMapsToBitmap(Ee);else if(typeof HTMLElement=="function"&&Ee instanceof HTMLElement||!Ee.data)Ve=Ee;else{const Ue=this.cachedCanvases.getCanvas("inlineImage",xe,Oe).context;Te(Ue,Ee),Ve=this.applyTransferMapsToCanvas(Ue)}const Ke=this._scaleImage(Ve,(0,se.getCurrentTransformInverse)(Ge));Ge.imageSmoothingEnabled=We((0,se.getCurrentTransform)(Ge),Ee.interpolate),ve(Ge,Ke.img,0,0,Ke.paintWidth,Ke.paintHeight,0,-Oe,xe,Oe),this.compose(),this.restore()}paintInlineImageXObjectGroup(Ee,xe){if(!this.contentVisible)return;const Oe=this.ctx;let Ge;if(Ee.bitmap)Ge=Ee.bitmap;else{const Ve=Ee.width,Ke=Ee.height,Ue=this.cachedCanvases.getCanvas("inlineImage",Ve,Ke).context;Te(Ue,Ee),Ge=this.applyTransferMapsToCanvas(Ue)}for(const Ve of xe)Oe.save(),Oe.transform(...Ve.transform),Oe.scale(1,-1),ve(Oe,Ge,Ve.x,Ve.y,Ve.w,Ve.h,0,-1,1,1),Oe.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(Ee){}markPointProps(Ee,xe){}beginMarkedContent(Ee){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(Ee,xe){Ee==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(xe)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(Ee){const xe=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(Ee);const Oe=this.ctx;this.pendingClip&&(xe||(this.pendingClip===it?Oe.clip("evenodd"):Oe.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),Oe.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const Ee=(0,se.getCurrentTransform)(this.ctx);if(Ee[1]===0&&Ee[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(Ee[0]),Math.abs(Ee[3]));else{const xe=Math.abs(Ee[0]*Ee[3]-Ee[2]*Ee[1]),Oe=Math.hypot(Ee[0],Ee[2]),Ge=Math.hypot(Ee[1],Ee[3]);this._cachedGetSinglePixelWidth=Math.max(Oe,Ge)/xe}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:Ee}=this.current,xe=(0,se.getCurrentTransform)(this.ctx);let Oe,Ge;if(xe[1]===0&&xe[2]===0){const Ve=Math.abs(xe[0]),Ke=Math.abs(xe[3]);if(Ee===0)Oe=1/Ve,Ge=1/Ke;else{const je=Ve*Ee,Ue=Ke*Ee;Oe=je<1?1/je:1,Ge=Ue<1?1/Ue:1}}else{const Ve=Math.abs(xe[0]*xe[3]-xe[2]*xe[1]),Ke=Math.hypot(xe[0],xe[1]),je=Math.hypot(xe[2],xe[3]);if(Ee===0)Oe=je/Ve,Ge=Ke/Ve;else{const Ue=Ee*Ve;Oe=je>Ue?je/Ue:1,Ge=Ke>Ue?Ke/Ue:1}}this._cachedScaleForStroking=[Oe,Ge]}return this._cachedScaleForStroking}rescaleAndStroke(Ee){const{ctx:xe}=this,{lineWidth:Oe}=this.current,[Ge,Ve]=this.getScaleForStroking();if(xe.lineWidth=Oe||1,Ge===1&&Ve===1){xe.stroke();return}let Ke,je,Ue;Ee&&(Ke=(0,se.getCurrentTransform)(xe),je=xe.getLineDash().slice(),Ue=xe.lineDashOffset),xe.scale(Ge,Ve);const Be=Math.max(Ge,Ve);xe.setLineDash(xe.getLineDash().map(le=>le/Be)),xe.lineDashOffset/=Be,xe.stroke(),Ee&&(xe.setTransform(...Ke),xe.setLineDash(je),xe.lineDashOffset=Ue)}isContentVisible(){for(let Ee=this.markedContentStack.length-1;Ee>=0;Ee--)if(!this.markedContentStack[Ee].visible)return!1;return!0}};at=new WeakSet,Bn=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},dt=new WeakSet,Un=function(){if(this.pageColors){const Ee=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(Ee!=="none"){const xe=this.ctx.filter;this.ctx.filter=Ee,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=xe}}};let ht=mt;ee.CanvasGraphics=ht;for(const qe in re.OPS)ht.prototype[qe]!==void 0&&(ht.prototype[re.OPS[qe]]=ht.prototype[qe])},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.TilingPattern=ee.PathType=void 0,ee.getShadingPattern=Se;var re=ne(1),se=ne(6);const ie={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};ee.PathType=ie;function oe(ve,Pe){if(!Pe)return;const we=Pe[2]-Pe[0],Te=Pe[3]-Pe[1],Le=new Path2D;Le.rect(Pe[0],Pe[1],we,Te),ve.clip(Le)}class me{constructor(){this.constructor===me&&(0,re.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,re.unreachable)("Abstract method `getPattern` called.")}}class pe extends me{constructor(Pe){super(),this._type=Pe[1],this._bbox=Pe[2],this._colorStops=Pe[3],this._p0=Pe[4],this._p1=Pe[5],this._r0=Pe[6],this._r1=Pe[7],this.matrix=null}_createGradient(Pe){let we;this._type==="axial"?we=Pe.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(we=Pe.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const Te of this._colorStops)we.addColorStop(Te[0],Te[1]);return we}getPattern(Pe,we,Te,Le){let Ne;if(Le===ie.STROKE||Le===ie.FILL){const Me=we.current.getClippedPathBoundingBox(Le,(0,se.getCurrentTransform)(Pe))||[0,0,0,0],ae=Math.ceil(Me[2]-Me[0])||1,ge=Math.ceil(Me[3]-Me[1])||1,$e=we.cachedCanvases.getCanvas("pattern",ae,ge,!0),_e=$e.context;_e.clearRect(0,0,_e.canvas.width,_e.canvas.height),_e.beginPath(),_e.rect(0,0,_e.canvas.width,_e.canvas.height),_e.translate(-Me[0],-Me[1]),Te=re.Util.transform(Te,[1,0,0,1,Me[0],Me[1]]),_e.transform(...we.baseTransform),this.matrix&&_e.transform(...this.matrix),oe(_e,this._bbox),_e.fillStyle=this._createGradient(_e),_e.fill(),Ne=Pe.createPattern($e.canvas,"no-repeat");const ke=new DOMMatrix(Te);Ne.setTransform(ke)}else oe(Pe,this._bbox),Ne=this._createGradient(Pe);return Ne}}function he(ve,Pe,we,Te,Le,Ne,Me,ae){const ge=Pe.coords,$e=Pe.colors,_e=ve.data,ke=ve.width*4;let We;ge[we+1]>ge[Te+1]&&(We=we,we=Te,Te=We,We=Ne,Ne=Me,Me=We),ge[Te+1]>ge[Le+1]&&(We=Te,Te=Le,Le=We,We=Me,Me=ae,ae=We),ge[we+1]>ge[Te+1]&&(We=we,we=Te,Te=We,We=Ne,Ne=Me,Me=We);const ze=(ge[we]+Pe.offsetX)*Pe.scaleX,Qe=(ge[we+1]+Pe.offsetY)*Pe.scaleY,ct=(ge[Te]+Pe.offsetX)*Pe.scaleX,it=(ge[Te+1]+Pe.offsetY)*Pe.scaleY,ht=(ge[Le]+Pe.offsetX)*Pe.scaleX,at=(ge[Le+1]+Pe.offsetY)*Pe.scaleY;if(Qe>=at)return;const gt=$e[Ne],dt=$e[Ne+1],yt=$e[Ne+2],mt=$e[Me],qe=$e[Me+1],Ee=$e[Me+2],xe=$e[ae],Oe=$e[ae+1],Ge=$e[ae+2],Ve=Math.round(Qe),Ke=Math.round(at);let je,Ue,Be,le,be,Ce,Fe,Ie;for(let Xe=Ve;Xe<=Ke;Xe++){if(Xe<it){let et;Xe<Qe?et=0:et=(Qe-Xe)/(Qe-it),je=ze-(ze-ct)*et,Ue=gt-(gt-mt)*et,Be=dt-(dt-qe)*et,le=yt-(yt-Ee)*et}else{let et;Xe>at?et=1:it===at?et=0:et=(it-Xe)/(it-at),je=ct-(ct-ht)*et,Ue=mt-(mt-xe)*et,Be=qe-(qe-Oe)*et,le=Ee-(Ee-Ge)*et}let tt;Xe<Qe?tt=0:Xe>at?tt=1:tt=(Qe-Xe)/(Qe-at),be=ze-(ze-ht)*tt,Ce=gt-(gt-xe)*tt,Fe=dt-(dt-Oe)*tt,Ie=yt-(yt-Ge)*tt;const Ze=Math.round(Math.min(je,be)),st=Math.round(Math.max(je,be));let ot=ke*Xe+Ze*4;for(let et=Ze;et<=st;et++)tt=(je-et)/(je-be),tt<0?tt=0:tt>1&&(tt=1),_e[ot++]=Ue-(Ue-Ce)*tt|0,_e[ot++]=Be-(Be-Fe)*tt|0,_e[ot++]=le-(le-Ie)*tt|0,_e[ot++]=255}}function ue(ve,Pe,we){const Te=Pe.coords,Le=Pe.colors;let Ne,Me;switch(Pe.type){case"lattice":const ae=Pe.verticesPerRow,ge=Math.floor(Te.length/ae)-1,$e=ae-1;for(Ne=0;Ne<ge;Ne++){let _e=Ne*ae;for(let ke=0;ke<$e;ke++,_e++)he(ve,we,Te[_e],Te[_e+1],Te[_e+ae],Le[_e],Le[_e+1],Le[_e+ae]),he(ve,we,Te[_e+ae+1],Te[_e+1],Te[_e+ae],Le[_e+ae+1],Le[_e+1],Le[_e+ae])}break;case"triangles":for(Ne=0,Me=Te.length;Ne<Me;Ne+=3)he(ve,we,Te[Ne],Te[Ne+1],Te[Ne+2],Le[Ne],Le[Ne+1],Le[Ne+2]);break;default:throw new Error("illegal figure")}}class de extends me{constructor(Pe){super(),this._coords=Pe[2],this._colors=Pe[3],this._figures=Pe[4],this._bounds=Pe[5],this._bbox=Pe[7],this._background=Pe[8],this.matrix=null}_createMeshCanvas(Pe,we,Te){const ae=Math.floor(this._bounds[0]),ge=Math.floor(this._bounds[1]),$e=Math.ceil(this._bounds[2])-ae,_e=Math.ceil(this._bounds[3])-ge,ke=Math.min(Math.ceil(Math.abs($e*Pe[0]*1.1)),3e3),We=Math.min(Math.ceil(Math.abs(_e*Pe[1]*1.1)),3e3),ze=$e/ke,Qe=_e/We,ct={coords:this._coords,colors:this._colors,offsetX:-ae,offsetY:-ge,scaleX:1/ze,scaleY:1/Qe},it=ke+2*2,ht=We+2*2,at=Te.getCanvas("mesh",it,ht,!1),gt=at.context,dt=gt.createImageData(ke,We);if(we){const mt=dt.data;for(let qe=0,Ee=mt.length;qe<Ee;qe+=4)mt[qe]=we[0],mt[qe+1]=we[1],mt[qe+2]=we[2],mt[qe+3]=255}for(const mt of this._figures)ue(dt,mt,ct);return gt.putImageData(dt,2,2),{canvas:at.canvas,offsetX:ae-2*ze,offsetY:ge-2*Qe,scaleX:ze,scaleY:Qe}}getPattern(Pe,we,Te,Le){oe(Pe,this._bbox);let Ne;if(Le===ie.SHADING)Ne=re.Util.singularValueDecompose2dScale((0,se.getCurrentTransform)(Pe));else if(Ne=re.Util.singularValueDecompose2dScale(we.baseTransform),this.matrix){const ae=re.Util.singularValueDecompose2dScale(this.matrix);Ne=[Ne[0]*ae[0],Ne[1]*ae[1]]}const Me=this._createMeshCanvas(Ne,Le===ie.SHADING?null:this._background,we.cachedCanvases);return Le!==ie.SHADING&&(Pe.setTransform(...we.baseTransform),this.matrix&&Pe.transform(...this.matrix)),Pe.translate(Me.offsetX,Me.offsetY),Pe.scale(Me.scaleX,Me.scaleY),Pe.createPattern(Me.canvas,"no-repeat")}}class Ae extends me{getPattern(){return"hotpink"}}function Se(ve){switch(ve[0]){case"RadialAxial":return new pe(ve);case"Mesh":return new de(ve);case"Dummy":return new Ae}throw new Error(`Unknown IR type: ${ve[0]}`)}const ce={COLORED:1,UNCOLORED:2},ye=class ye{constructor(Pe,we,Te,Le,Ne){this.operatorList=Pe[2],this.matrix=Pe[3]||[1,0,0,1,0,0],this.bbox=Pe[4],this.xstep=Pe[5],this.ystep=Pe[6],this.paintType=Pe[7],this.tilingType=Pe[8],this.color=we,this.ctx=Te,this.canvasGraphicsFactory=Le,this.baseTransform=Ne}createPatternCanvas(Pe){const we=this.operatorList,Te=this.bbox,Le=this.xstep,Ne=this.ystep,Me=this.paintType,ae=this.tilingType,ge=this.color,$e=this.canvasGraphicsFactory;(0,re.info)("TilingType: "+ae);const _e=Te[0],ke=Te[1],We=Te[2],ze=Te[3],Qe=re.Util.singularValueDecompose2dScale(this.matrix),ct=re.Util.singularValueDecompose2dScale(this.baseTransform),it=[Qe[0]*ct[0],Qe[1]*ct[1]],ht=this.getSizeAndScale(Le,this.ctx.canvas.width,it[0]),at=this.getSizeAndScale(Ne,this.ctx.canvas.height,it[1]),gt=Pe.cachedCanvases.getCanvas("pattern",ht.size,at.size,!0),dt=gt.context,yt=$e.createCanvasGraphics(dt);yt.groupLevel=Pe.groupLevel,this.setFillAndStrokeStyleToContext(yt,Me,ge);let mt=_e,qe=ke,Ee=We,xe=ze;return _e<0&&(mt=0,Ee+=Math.abs(_e)),ke<0&&(qe=0,xe+=Math.abs(ke)),dt.translate(-(ht.scale*mt),-(at.scale*qe)),yt.transform(ht.scale,0,0,at.scale,0,0),dt.save(),this.clipBbox(yt,mt,qe,Ee,xe),yt.baseTransform=(0,se.getCurrentTransform)(yt.ctx),yt.executeOperatorList(we),yt.endDrawing(),{canvas:gt.canvas,scaleX:ht.scale,scaleY:at.scale,offsetX:mt,offsetY:qe}}getSizeAndScale(Pe,we,Te){Pe=Math.abs(Pe);const Le=Math.max(ye.MAX_PATTERN_SIZE,we);let Ne=Math.ceil(Pe*Te);return Ne>=Le?Ne=Le:Te=Ne/Pe,{scale:Te,size:Ne}}clipBbox(Pe,we,Te,Le,Ne){const Me=Le-we,ae=Ne-Te;Pe.ctx.rect(we,Te,Me,ae),Pe.current.updateRectMinMax((0,se.getCurrentTransform)(Pe.ctx),[we,Te,Le,Ne]),Pe.clip(),Pe.endPath()}setFillAndStrokeStyleToContext(Pe,we,Te){const Le=Pe.ctx,Ne=Pe.current;switch(we){case ce.COLORED:const Me=this.ctx;Le.fillStyle=Me.fillStyle,Le.strokeStyle=Me.strokeStyle,Ne.fillColor=Me.fillStyle,Ne.strokeColor=Me.strokeStyle;break;case ce.UNCOLORED:const ae=re.Util.makeHexColor(Te[0],Te[1],Te[2]);Le.fillStyle=ae,Le.strokeStyle=ae,Ne.fillColor=ae,Ne.strokeColor=ae;break;default:throw new re.FormatError(`Unsupported paint type: ${we}`)}}getPattern(Pe,we,Te,Le){let Ne=Te;Le!==ie.SHADING&&(Ne=re.Util.transform(Ne,we.baseTransform),this.matrix&&(Ne=re.Util.transform(Ne,this.matrix)));const Me=this.createPatternCanvas(we);let ae=new DOMMatrix(Ne);ae=ae.translate(Me.offsetX,Me.offsetY),ae=ae.scale(1/Me.scaleX,1/Me.scaleY);const ge=Pe.createPattern(Me.canvas,"repeat");return ge.setTransform(ae),ge}};Lt(ye,"MAX_PATTERN_SIZE",3e3);let fe=ye;ee.TilingPattern=fe},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.convertBlackAndWhiteToRGBA=ie,ee.convertToRGBA=se,ee.grayToRGBA=me;var re=ne(1);function se(pe){switch(pe.kind){case re.ImageKind.GRAYSCALE_1BPP:return ie(pe);case re.ImageKind.RGB_24BPP:return oe(pe)}return null}function ie({src:pe,srcPos:he=0,dest:ue,width:de,height:Ae,nonBlackColor:Se=4294967295,inverseDecode:ce=!1}){const fe=re.FeatureTest.isLittleEndian?4278190080:255,[ye,ve]=ce?[Se,fe]:[fe,Se],Pe=de>>3,we=de&7,Te=pe.length;ue=new Uint32Array(ue.buffer);let Le=0;for(let Ne=0;Ne<Ae;Ne++){for(const ae=he+Pe;he<ae;he++){const ge=he<Te?pe[he]:255;ue[Le++]=ge&128?ve:ye,ue[Le++]=ge&64?ve:ye,ue[Le++]=ge&32?ve:ye,ue[Le++]=ge&16?ve:ye,ue[Le++]=ge&8?ve:ye,ue[Le++]=ge&4?ve:ye,ue[Le++]=ge&2?ve:ye,ue[Le++]=ge&1?ve:ye}if(we===0)continue;const Me=he<Te?pe[he++]:255;for(let ae=0;ae<we;ae++)ue[Le++]=Me&1<<7-ae?ve:ye}return{srcPos:he,destPos:Le}}function oe({src:pe,srcPos:he=0,dest:ue,destPos:de=0,width:Ae,height:Se}){let ce=0;const fe=pe.length>>2,ye=new Uint32Array(pe.buffer,he,fe);if(re.FeatureTest.isLittleEndian){for(;ce<fe-2;ce+=3,de+=4){const ve=ye[ce],Pe=ye[ce+1],we=ye[ce+2];ue[de]=ve|4278190080,ue[de+1]=ve>>>24|Pe<<8|4278190080,ue[de+2]=Pe>>>16|we<<16|4278190080,ue[de+3]=we>>>8|4278190080}for(let ve=ce*4,Pe=pe.length;ve<Pe;ve+=3)ue[de++]=pe[ve]|pe[ve+1]<<8|pe[ve+2]<<16|4278190080}else{for(;ce<fe-2;ce+=3,de+=4){const ve=ye[ce],Pe=ye[ce+1],we=ye[ce+2];ue[de]=ve|255,ue[de+1]=ve<<24|Pe>>>8|255,ue[de+2]=Pe<<16|we>>>16|255,ue[de+3]=we<<8|255}for(let ve=ce*4,Pe=pe.length;ve<Pe;ve+=3)ue[de++]=pe[ve]<<24|pe[ve+1]<<16|pe[ve+2]<<8|255}return{srcPos:he,destPos:de}}function me(pe,he){if(re.FeatureTest.isLittleEndian)for(let ue=0,de=pe.length;ue<de;ue++)he[ue]=pe[ue]*65793|4278190080;else for(let ue=0,de=pe.length;ue<de;ue++)he[ue]=pe[ue]*16843008|255}},(te,ee)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.GlobalWorkerOptions=void 0;const ne=Object.create(null);ee.GlobalWorkerOptions=ne,ne.workerPort=null,ne.workerSrc=""},(te,ee,ne)=>{var pe,ur,ue,dr,Ae,Rn;Object.defineProperty(ee,"__esModule",{value:!0}),ee.MessageHandler=void 0;var re=ne(1);const se={UNKNOWN:0,DATA:1,ERROR:2},ie={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function oe(ce){switch(ce instanceof Error||typeof ce=="object"&&ce!==null||(0,re.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),ce.name){case"AbortException":return new re.AbortException(ce.message);case"MissingPDFException":return new re.MissingPDFException(ce.message);case"PasswordException":return new re.PasswordException(ce.message,ce.code);case"UnexpectedResponseException":return new re.UnexpectedResponseException(ce.message,ce.status);case"UnknownErrorException":return new re.UnknownErrorException(ce.message,ce.details);default:return new re.UnknownErrorException(ce.message,ce.toString())}}class me{constructor(fe,ye,ve){Je(this,pe);Je(this,ue);Je(this,Ae);this.sourceName=fe,this.targetName=ye,this.comObj=ve,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=Pe=>{const we=Pe.data;if(we.targetName!==this.sourceName)return;if(we.stream){rt(this,ue,dr).call(this,we);return}if(we.callback){const Le=we.callbackId,Ne=this.callbackCapabilities[Le];if(!Ne)throw new Error(`Cannot resolve callback ${Le}`);if(delete this.callbackCapabilities[Le],we.callback===se.DATA)Ne.resolve(we.data);else if(we.callback===se.ERROR)Ne.reject(oe(we.reason));else throw new Error("Unexpected callback case");return}const Te=this.actionHandler[we.action];if(!Te)throw new Error(`Unknown action from worker: ${we.action}`);if(we.callbackId){const Le=this.sourceName,Ne=we.sourceName;new Promise(function(Me){Me(Te(we.data))}).then(function(Me){ve.postMessage({sourceName:Le,targetName:Ne,callback:se.DATA,callbackId:we.callbackId,data:Me})},function(Me){ve.postMessage({sourceName:Le,targetName:Ne,callback:se.ERROR,callbackId:we.callbackId,reason:oe(Me)})});return}if(we.streamId){rt(this,pe,ur).call(this,we);return}Te(we.data)},ve.addEventListener("message",this._onComObjOnMessage)}on(fe,ye){const ve=this.actionHandler;if(ve[fe])throw new Error(`There is already an actionName called "${fe}"`);ve[fe]=ye}send(fe,ye,ve){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:fe,data:ye},ve)}sendWithPromise(fe,ye,ve){const Pe=this.callbackId++,we=new re.PromiseCapability;this.callbackCapabilities[Pe]=we;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:fe,callbackId:Pe,data:ye},ve)}catch(Te){we.reject(Te)}return we.promise}sendWithStream(fe,ye,ve,Pe){const we=this.streamId++,Te=this.sourceName,Le=this.targetName,Ne=this.comObj;return new ReadableStream({start:Me=>{const ae=new re.PromiseCapability;return this.streamControllers[we]={controller:Me,startCall:ae,pullCall:null,cancelCall:null,isClosed:!1},Ne.postMessage({sourceName:Te,targetName:Le,action:fe,streamId:we,data:ye,desiredSize:Me.desiredSize},Pe),ae.promise},pull:Me=>{const ae=new re.PromiseCapability;return this.streamControllers[we].pullCall=ae,Ne.postMessage({sourceName:Te,targetName:Le,stream:ie.PULL,streamId:we,desiredSize:Me.desiredSize}),ae.promise},cancel:Me=>{(0,re.assert)(Me instanceof Error,"cancel must have a valid reason");const ae=new re.PromiseCapability;return this.streamControllers[we].cancelCall=ae,this.streamControllers[we].isClosed=!0,Ne.postMessage({sourceName:Te,targetName:Le,stream:ie.CANCEL,streamId:we,reason:oe(Me)}),ae.promise}},ve)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}pe=new WeakSet,ur=function(fe){const ye=fe.streamId,ve=this.sourceName,Pe=fe.sourceName,we=this.comObj,Te=this,Le=this.actionHandler[fe.action],Ne={enqueue(Me,ae=1,ge){if(this.isCancelled)return;const $e=this.desiredSize;this.desiredSize-=ae,$e>0&&this.desiredSize<=0&&(this.sinkCapability=new re.PromiseCapability,this.ready=this.sinkCapability.promise),we.postMessage({sourceName:ve,targetName:Pe,stream:ie.ENQUEUE,streamId:ye,chunk:Me},ge)},close(){this.isCancelled||(this.isCancelled=!0,we.postMessage({sourceName:ve,targetName:Pe,stream:ie.CLOSE,streamId:ye}),delete Te.streamSinks[ye])},error(Me){(0,re.assert)(Me instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,we.postMessage({sourceName:ve,targetName:Pe,stream:ie.ERROR,streamId:ye,reason:oe(Me)}))},sinkCapability:new re.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:fe.desiredSize,ready:null};Ne.sinkCapability.resolve(),Ne.ready=Ne.sinkCapability.promise,this.streamSinks[ye]=Ne,new Promise(function(Me){Me(Le(fe.data,Ne))}).then(function(){we.postMessage({sourceName:ve,targetName:Pe,stream:ie.START_COMPLETE,streamId:ye,success:!0})},function(Me){we.postMessage({sourceName:ve,targetName:Pe,stream:ie.START_COMPLETE,streamId:ye,reason:oe(Me)})})},ue=new WeakSet,dr=function(fe){const ye=fe.streamId,ve=this.sourceName,Pe=fe.sourceName,we=this.comObj,Te=this.streamControllers[ye],Le=this.streamSinks[ye];switch(fe.stream){case ie.START_COMPLETE:fe.success?Te.startCall.resolve():Te.startCall.reject(oe(fe.reason));break;case ie.PULL_COMPLETE:fe.success?Te.pullCall.resolve():Te.pullCall.reject(oe(fe.reason));break;case ie.PULL:if(!Le){we.postMessage({sourceName:ve,targetName:Pe,stream:ie.PULL_COMPLETE,streamId:ye,success:!0});break}Le.desiredSize<=0&&fe.desiredSize>0&&Le.sinkCapability.resolve(),Le.desiredSize=fe.desiredSize,new Promise(function(Ne){var Me;Ne((Me=Le.onPull)==null?void 0:Me.call(Le))}).then(function(){we.postMessage({sourceName:ve,targetName:Pe,stream:ie.PULL_COMPLETE,streamId:ye,success:!0})},function(Ne){we.postMessage({sourceName:ve,targetName:Pe,stream:ie.PULL_COMPLETE,streamId:ye,reason:oe(Ne)})});break;case ie.ENQUEUE:if((0,re.assert)(Te,"enqueue should have stream controller"),Te.isClosed)break;Te.controller.enqueue(fe.chunk);break;case ie.CLOSE:if((0,re.assert)(Te,"close should have stream controller"),Te.isClosed)break;Te.isClosed=!0,Te.controller.close(),rt(this,Ae,Rn).call(this,Te,ye);break;case ie.ERROR:(0,re.assert)(Te,"error should have stream controller"),Te.controller.error(oe(fe.reason)),rt(this,Ae,Rn).call(this,Te,ye);break;case ie.CANCEL_COMPLETE:fe.success?Te.cancelCall.resolve():Te.cancelCall.reject(oe(fe.reason)),rt(this,Ae,Rn).call(this,Te,ye);break;case ie.CANCEL:if(!Le)break;new Promise(function(Ne){var Me;Ne((Me=Le.onCancel)==null?void 0:Me.call(Le,oe(fe.reason)))}).then(function(){we.postMessage({sourceName:ve,targetName:Pe,stream:ie.CANCEL_COMPLETE,streamId:ye,success:!0})},function(Ne){we.postMessage({sourceName:ve,targetName:Pe,stream:ie.CANCEL_COMPLETE,streamId:ye,reason:oe(Ne)})}),Le.sinkCapability.reject(oe(fe.reason)),Le.isCancelled=!0,delete this.streamSinks[ye];break;default:throw new Error("Unexpected stream case")}},Ae=new WeakSet,Rn=async function(fe,ye){var ve,Pe,we;await Promise.allSettled([(ve=fe.startCall)==null?void 0:ve.promise,(Pe=fe.pullCall)==null?void 0:Pe.promise,(we=fe.cancelCall)==null?void 0:we.promise]),delete this.streamControllers[ye]},ee.MessageHandler=me},(te,ee,ne)=>{var ie,oe;Object.defineProperty(ee,"__esModule",{value:!0}),ee.Metadata=void 0;var re=ne(1);class se{constructor({parsedData:pe,rawData:he}){Je(this,ie,void 0);Je(this,oe,void 0);_t(this,ie,pe),_t(this,oe,he)}getRaw(){return Re(this,oe)}get(pe){return Re(this,ie).get(pe)??null}getAll(){return(0,re.objectFromMap)(Re(this,ie))}has(pe){return Re(this,ie).has(pe)}}ie=new WeakMap,oe=new WeakMap,ee.Metadata=se},(te,ee,ne)=>{var pe,he,ue,de,Ae,Se,Hn;Object.defineProperty(ee,"__esModule",{value:!0}),ee.OptionalContentConfig=void 0;var re=ne(1),se=ne(8);const ie=Symbol("INTERNAL");class oe{constructor(ye,ve){Je(this,pe,!0);this.name=ye,this.intent=ve}get visible(){return Re(this,pe)}_setVisible(ye,ve){ye!==ie&&(0,re.unreachable)("Internal method `_setVisible` called."),_t(this,pe,ve)}}pe=new WeakMap;class me{constructor(ye){Je(this,Se);Je(this,he,null);Je(this,ue,new Map);Je(this,de,null);Je(this,Ae,null);if(this.name=null,this.creator=null,ye!==null){this.name=ye.name,this.creator=ye.creator,_t(this,Ae,ye.order);for(const ve of ye.groups)Re(this,ue).set(ve.id,new oe(ve.name,ve.intent));if(ye.baseState==="OFF")for(const ve of Re(this,ue).values())ve._setVisible(ie,!1);for(const ve of ye.on)Re(this,ue).get(ve)._setVisible(ie,!0);for(const ve of ye.off)Re(this,ue).get(ve)._setVisible(ie,!1);_t(this,de,this.getHash())}}isVisible(ye){if(Re(this,ue).size===0)return!0;if(!ye)return(0,re.warn)("Optional content group not defined."),!0;if(ye.type==="OCG")return Re(this,ue).has(ye.id)?Re(this,ue).get(ye.id).visible:((0,re.warn)(`Optional content group not found: ${ye.id}`),!0);if(ye.type==="OCMD"){if(ye.expression)return rt(this,Se,Hn).call(this,ye.expression);if(!ye.policy||ye.policy==="AnyOn"){for(const ve of ye.ids){if(!Re(this,ue).has(ve))return(0,re.warn)(`Optional content group not found: ${ve}`),!0;if(Re(this,ue).get(ve).visible)return!0}return!1}else if(ye.policy==="AllOn"){for(const ve of ye.ids){if(!Re(this,ue).has(ve))return(0,re.warn)(`Optional content group not found: ${ve}`),!0;if(!Re(this,ue).get(ve).visible)return!1}return!0}else if(ye.policy==="AnyOff"){for(const ve of ye.ids){if(!Re(this,ue).has(ve))return(0,re.warn)(`Optional content group not found: ${ve}`),!0;if(!Re(this,ue).get(ve).visible)return!0}return!1}else if(ye.policy==="AllOff"){for(const ve of ye.ids){if(!Re(this,ue).has(ve))return(0,re.warn)(`Optional content group not found: ${ve}`),!0;if(Re(this,ue).get(ve).visible)return!1}return!0}return(0,re.warn)(`Unknown optional content policy ${ye.policy}.`),!0}return(0,re.warn)(`Unknown group type ${ye.type}.`),!0}setVisibility(ye,ve=!0){if(!Re(this,ue).has(ye)){(0,re.warn)(`Optional content group not found: ${ye}`);return}Re(this,ue).get(ye)._setVisible(ie,!!ve),_t(this,he,null)}get hasInitialVisibility(){return this.getHash()===Re(this,de)}getOrder(){return Re(this,ue).size?Re(this,Ae)?Re(this,Ae).slice():[...Re(this,ue).keys()]:null}getGroups(){return Re(this,ue).size>0?(0,re.objectFromMap)(Re(this,ue)):null}getGroup(ye){return Re(this,ue).get(ye)||null}getHash(){if(Re(this,he)!==null)return Re(this,he);const ye=new se.MurmurHash3_64;for(const[ve,Pe]of Re(this,ue))ye.update(`${ve}:${Pe.visible}`);return _t(this,he,ye.hexdigest())}}he=new WeakMap,ue=new WeakMap,de=new WeakMap,Ae=new WeakMap,Se=new WeakSet,Hn=function(ye){const ve=ye.length;if(ve<2)return!0;const Pe=ye[0];for(let we=1;we<ve;we++){const Te=ye[we];let Le;if(Array.isArray(Te))Le=rt(this,Se,Hn).call(this,Te);else if(Re(this,ue).has(Te))Le=Re(this,ue).get(Te).visible;else return(0,re.warn)(`Optional content group not found: ${Te}`),!0;switch(Pe){case"And":if(!Le)return!1;break;case"Or":if(Le)return!0;break;case"Not":return!Le;default:return!0}}return Pe==="And"},ee.OptionalContentConfig=me},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.PDFDataTransportStream=void 0;var re=ne(1),se=ne(6);class ie{constructor({length:he,initialData:ue,progressiveDone:de=!1,contentDispositionFilename:Ae=null,disableRange:Se=!1,disableStream:ce=!1},fe){if((0,re.assert)(fe,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=de,this._contentDispositionFilename=Ae,(ue==null?void 0:ue.length)>0){const ye=ue instanceof Uint8Array&&ue.byteLength===ue.buffer.byteLength?ue.buffer:new Uint8Array(ue).buffer;this._queuedChunks.push(ye)}this._pdfDataRangeTransport=fe,this._isStreamingSupported=!ce,this._isRangeSupported=!Se,this._contentLength=he,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((ye,ve)=>{this._onReceiveData({begin:ye,chunk:ve})}),this._pdfDataRangeTransport.addProgressListener((ye,ve)=>{this._onProgress({loaded:ye,total:ve})}),this._pdfDataRangeTransport.addProgressiveReadListener(ye=>{this._onReceiveData({chunk:ye})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:he,chunk:ue}){const de=ue instanceof Uint8Array&&ue.byteLength===ue.buffer.byteLength?ue.buffer:new Uint8Array(ue).buffer;if(he===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(de):this._queuedChunks.push(de);else{const Ae=this._rangeReaders.some(function(Se){return Se._begin!==he?!1:(Se._enqueue(de),!0)});(0,re.assert)(Ae,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var he;return((he=this._fullRequestReader)==null?void 0:he._loaded)??0}_onProgress(he){var ue,de,Ae,Se;he.total===void 0?(de=(ue=this._rangeReaders[0])==null?void 0:ue.onProgress)==null||de.call(ue,{loaded:he.loaded}):(Se=(Ae=this._fullRequestReader)==null?void 0:Ae.onProgress)==null||Se.call(Ae,{loaded:he.loaded,total:he.total})}_onProgressiveDone(){var he;(he=this._fullRequestReader)==null||he.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(he){const ue=this._rangeReaders.indexOf(he);ue>=0&&this._rangeReaders.splice(ue,1)}getFullReader(){(0,re.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const he=this._queuedChunks;return this._queuedChunks=null,new oe(this,he,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(he,ue){if(ue<=this._progressiveDataLength)return null;const de=new me(this,he,ue);return this._pdfDataRangeTransport.requestDataRange(he,ue),this._rangeReaders.push(de),de}cancelAllRequests(he){var ue;(ue=this._fullRequestReader)==null||ue.cancel(he);for(const de of this._rangeReaders.slice(0))de.cancel(he);this._pdfDataRangeTransport.abort()}}ee.PDFDataTransportStream=ie;class oe{constructor(he,ue,de=!1,Ae=null){this._stream=he,this._done=de||!1,this._filename=(0,se.isPdfFile)(Ae)?Ae:null,this._queuedChunks=ue||[],this._loaded=0;for(const Se of this._queuedChunks)this._loaded+=Se.byteLength;this._requests=[],this._headersReady=Promise.resolve(),he._fullRequestReader=this,this.onProgress=null}_enqueue(he){this._done||(this._requests.length>0?this._requests.shift().resolve({value:he,done:!1}):this._queuedChunks.push(he),this._loaded+=he.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const he=new re.PromiseCapability;return this._requests.push(he),he.promise}cancel(he){this._done=!0;for(const ue of this._requests)ue.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class me{constructor(he,ue,de){this._stream=he,this._begin=ue,this._end=de,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(he){if(!this._done){if(this._requests.length===0)this._queuedChunk=he;else{this._requests.shift().resolve({value:he,done:!1});for(const de of this._requests)de.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const ue=this._queuedChunk;return this._queuedChunk=null,{value:ue,done:!1}}if(this._done)return{value:void 0,done:!0};const he=new re.PromiseCapability;return this._requests.push(he),he.promise}cancel(he){this._done=!0;for(const ue of this._requests)ue.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(te,ee)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.XfaText=void 0;class ne{static textContent(se){const ie=[],oe={items:ie,styles:Object.create(null)};function me(pe){var de;if(!pe)return;let he=null;const ue=pe.name;if(ue==="#text")he=pe.value;else if(ne.shouldBuildText(ue))(de=pe==null?void 0:pe.attributes)!=null&&de.textContent?he=pe.attributes.textContent:pe.value&&(he=pe.value);else return;if(he!==null&&ie.push({str:he}),!!pe.children)for(const Ae of pe.children)me(Ae)}return me(se),oe}static shouldBuildText(se){return!(se==="textarea"||se==="input"||se==="option"||se==="select")}}ee.XfaText=ne},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.NodeStandardFontDataFactory=ee.NodeFilterFactory=ee.NodeCanvasFactory=ee.NodeCMapReaderFactory=void 0;var re=ne(7);const se=function(he){return new Promise((ue,de)=>{require$$5.readFile(he,(Se,ce)=>{if(Se||!ce){de(new Error(Se));return}ue(new Uint8Array(ce))})})};class ie extends re.BaseFilterFactory{}ee.NodeFilterFactory=ie;class oe extends re.BaseCanvasFactory{_createCanvas(ue,de){return require$$5.createCanvas(ue,de)}}ee.NodeCanvasFactory=oe;class me extends re.BaseCMapReaderFactory{_fetchData(ue,de){return se(ue).then(Ae=>({cMapData:Ae,compressionType:de}))}}ee.NodeCMapReaderFactory=me;class pe extends re.BaseStandardFontDataFactory{_fetchData(ue){return se(ue)}}ee.NodeStandardFontDataFactory=pe},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.PDFNodeStream=void 0;var re=ne(1),se=ne(22);const ie=require$$5,oe=require$$5,me=require$$5,pe=require$$5,he=/^file:\/\/\/[a-zA-Z]:\//;function ue(we){const Te=pe.parse(we);return Te.protocol==="file:"||Te.host?Te:/^[a-z]:[/\\]/i.test(we)?pe.parse(`file:///${we}`):(Te.host||(Te.protocol="file:"),Te)}class de{constructor(Te){this.source=Te,this.url=ue(Te.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&Te.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Te;return((Te=this._fullRequestReader)==null?void 0:Te._loaded)??0}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new ve(this):new fe(this),this._fullRequestReader}getRangeReader(Te,Le){if(Le<=this._progressiveDataLength)return null;const Ne=this.isFsUrl?new Pe(this,Te,Le):new ye(this,Te,Le);return this._rangeRequestReaders.push(Ne),Ne}cancelAllRequests(Te){var Le;(Le=this._fullRequestReader)==null||Le.cancel(Te);for(const Ne of this._rangeRequestReaders.slice(0))Ne.cancel(Te)}}ee.PDFNodeStream=de;class Ae{constructor(Te){this._url=Te.url,this._done=!1,this._storedError=null,this.onProgress=null;const Le=Te.source;this._contentLength=Le.length,this._loaded=0,this._filename=null,this._disableRange=Le.disableRange||!1,this._rangeChunkSize=Le.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!Le.disableStream,this._isRangeSupported=!Le.disableRange,this._readableStream=null,this._readCapability=new re.PromiseCapability,this._headersCapability=new re.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var Ne;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Te=this._readableStream.read();return Te===null?(this._readCapability=new re.PromiseCapability,this.read()):(this._loaded+=Te.length,(Ne=this.onProgress)==null||Ne.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(Te).buffer,done:!1})}cancel(Te){if(!this._readableStream){this._error(Te);return}this._readableStream.destroy(Te)}_error(Te){this._storedError=Te,this._readCapability.resolve()}_setReadableStream(Te){this._readableStream=Te,Te.on("readable",()=>{this._readCapability.resolve()}),Te.on("end",()=>{Te.destroy(),this._done=!0,this._readCapability.resolve()}),Te.on("error",Le=>{this._error(Le)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new re.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Se{constructor(Te){this._url=Te.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new re.PromiseCapability;const Le=Te.source;this._isStreamingSupported=!Le.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var Ne;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Te=this._readableStream.read();return Te===null?(this._readCapability=new re.PromiseCapability,this.read()):(this._loaded+=Te.length,(Ne=this.onProgress)==null||Ne.call(this,{loaded:this._loaded}),{value:new Uint8Array(Te).buffer,done:!1})}cancel(Te){if(!this._readableStream){this._error(Te);return}this._readableStream.destroy(Te)}_error(Te){this._storedError=Te,this._readCapability.resolve()}_setReadableStream(Te){this._readableStream=Te,Te.on("readable",()=>{this._readCapability.resolve()}),Te.on("end",()=>{Te.destroy(),this._done=!0,this._readCapability.resolve()}),Te.on("error",Le=>{this._error(Le)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function ce(we,Te){return{protocol:we.protocol,auth:we.auth,host:we.hostname,port:we.port,path:we.path,method:"GET",headers:Te}}class fe extends Ae{constructor(Te){super(Te);const Le=Ne=>{if(Ne.statusCode===404){const $e=new re.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=$e,this._headersCapability.reject($e);return}this._headersCapability.resolve(),this._setReadableStream(Ne);const Me=$e=>this._readableStream.headers[$e.toLowerCase()],{allowRangeRequests:ae,suggestedLength:ge}=(0,se.validateRangeRequestCapabilities)({getResponseHeader:Me,isHttp:Te.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=ae,this._contentLength=ge||this._contentLength,this._filename=(0,se.extractFilenameFromHeader)(Me)};this._request=null,this._url.protocol==="http:"?this._request=oe.request(ce(this._url,Te.httpHeaders),Le):this._request=me.request(ce(this._url,Te.httpHeaders),Le),this._request.on("error",Ne=>{this._storedError=Ne,this._headersCapability.reject(Ne)}),this._request.end()}}class ye extends Se{constructor(Te,Le,Ne){super(Te),this._httpHeaders={};for(const ae in Te.httpHeaders){const ge=Te.httpHeaders[ae];ge!==void 0&&(this._httpHeaders[ae]=ge)}this._httpHeaders.Range=`bytes=${Le}-${Ne-1}`;const Me=ae=>{if(ae.statusCode===404){const ge=new re.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=ge;return}this._setReadableStream(ae)};this._request=null,this._url.protocol==="http:"?this._request=oe.request(ce(this._url,this._httpHeaders),Me):this._request=me.request(ce(this._url,this._httpHeaders),Me),this._request.on("error",ae=>{this._storedError=ae}),this._request.end()}}class ve extends Ae{constructor(Te){super(Te);let Le=decodeURIComponent(this._url.path);he.test(this._url.href)&&(Le=Le.replace(/^\//,"")),ie.lstat(Le,(Ne,Me)=>{if(Ne){Ne.code==="ENOENT"&&(Ne=new re.MissingPDFException(`Missing PDF "${Le}".`)),this._storedError=Ne,this._headersCapability.reject(Ne);return}this._contentLength=Me.size,this._setReadableStream(ie.createReadStream(Le)),this._headersCapability.resolve()})}}class Pe extends Se{constructor(Te,Le,Ne){super(Te);let Me=decodeURIComponent(this._url.path);he.test(this._url.href)&&(Me=Me.replace(/^\//,"")),this._setReadableStream(ie.createReadStream(Me,{start:Le,end:Ne-1}))}}},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.createResponseStatusError=pe,ee.extractFilenameFromHeader=me,ee.validateRangeRequestCapabilities=oe,ee.validateResponseStatus=he;var re=ne(1),se=ne(23),ie=ne(6);function oe({getResponseHeader:ue,isHttp:de,rangeChunkSize:Ae,disableRange:Se}){const ce={allowRangeRequests:!1,suggestedLength:void 0},fe=parseInt(ue("Content-Length"),10);return!Number.isInteger(fe)||(ce.suggestedLength=fe,fe<=2*Ae)||Se||!de||ue("Accept-Ranges")!=="bytes"||(ue("Content-Encoding")||"identity")!=="identity"||(ce.allowRangeRequests=!0),ce}function me(ue){const de=ue("Content-Disposition");if(de){let Ae=(0,se.getFilenameFromContentDispositionHeader)(de);if(Ae.includes("%"))try{Ae=decodeURIComponent(Ae)}catch{}if((0,ie.isPdfFile)(Ae))return Ae}return null}function pe(ue,de){return ue===404||ue===0&&de.startsWith("file:")?new re.MissingPDFException('Missing PDF "'+de+'".'):new re.UnexpectedResponseException(`Unexpected server response (${ue}) while retrieving PDF "${de}".`,ue)}function he(ue){return ue===200||ue===206}},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.getFilenameFromContentDispositionHeader=se;var re=ne(1);function se(ie){let oe=!0,me=pe("filename\\*","i").exec(ie);if(me){me=me[1];let fe=Ae(me);return fe=unescape(fe),fe=Se(fe),fe=ce(fe),ue(fe)}if(me=de(ie),me){const fe=ce(me);return ue(fe)}if(me=pe("filename","i").exec(ie),me){me=me[1];let fe=Ae(me);return fe=ce(fe),ue(fe)}function pe(fe,ye){return new RegExp("(?:^|;)\\s*"+fe+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',ye)}function he(fe,ye){if(fe){if(!/^[\x00-\xFF]+$/.test(ye))return ye;try{const ve=new TextDecoder(fe,{fatal:!0}),Pe=(0,re.stringToBytes)(ye);ye=ve.decode(Pe),oe=!1}catch{}}return ye}function ue(fe){return oe&&/[\x80-\xff]/.test(fe)&&(fe=he("utf-8",fe),oe&&(fe=he("iso-8859-1",fe))),fe}function de(fe){const ye=[];let ve;const Pe=pe("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(ve=Pe.exec(fe))!==null;){let[,Te,Le,Ne]=ve;if(Te=parseInt(Te,10),Te in ye){if(Te===0)break;continue}ye[Te]=[Le,Ne]}const we=[];for(let Te=0;Te<ye.length&&Te in ye;++Te){let[Le,Ne]=ye[Te];Ne=Ae(Ne),Le&&(Ne=unescape(Ne),Te===0&&(Ne=Se(Ne))),we.push(Ne)}return we.join("")}function Ae(fe){if(fe.startsWith('"')){const ye=fe.slice(1).split('\\"');for(let ve=0;ve<ye.length;++ve){const Pe=ye[ve].indexOf('"');Pe!==-1&&(ye[ve]=ye[ve].slice(0,Pe),ye.length=ve+1),ye[ve]=ye[ve].replaceAll(/\\(.)/g,"$1")}fe=ye.join('"')}return fe}function Se(fe){const ye=fe.indexOf("'");if(ye===-1)return fe;const ve=fe.slice(0,ye),we=fe.slice(ye+1).replace(/^[^']*'/,"");return he(ve,we)}function ce(fe){return!fe.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(fe)?fe:fe.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(ye,ve,Pe,we){if(Pe==="q"||Pe==="Q")return we=we.replaceAll("_"," "),we=we.replaceAll(/=([0-9a-fA-F]{2})/g,function(Te,Le){return String.fromCharCode(parseInt(Le,16))}),he(ve,we);try{we=atob(we)}catch{}return he(ve,we)})}return""}},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.PDFNetworkStream=void 0;var re=ne(1),se=ne(22);const ie=200,oe=206;function me(Ae){const Se=Ae.response;return typeof Se!="string"?Se:(0,re.stringToBytes)(Se).buffer}class pe{constructor(Se,ce={}){this.url=Se,this.isHttp=/^https?:/i.test(Se),this.httpHeaders=this.isHttp&&ce.httpHeaders||Object.create(null),this.withCredentials=ce.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(Se,ce,fe){const ye={begin:Se,end:ce};for(const ve in fe)ye[ve]=fe[ve];return this.request(ye)}requestFull(Se){return this.request(Se)}request(Se){const ce=new XMLHttpRequest,fe=this.currXhrId++,ye=this.pendingRequests[fe]={xhr:ce};ce.open("GET",this.url),ce.withCredentials=this.withCredentials;for(const ve in this.httpHeaders){const Pe=this.httpHeaders[ve];Pe!==void 0&&ce.setRequestHeader(ve,Pe)}return this.isHttp&&"begin"in Se&&"end"in Se?(ce.setRequestHeader("Range",`bytes=${Se.begin}-${Se.end-1}`),ye.expectedStatus=oe):ye.expectedStatus=ie,ce.responseType="arraybuffer",Se.onError&&(ce.onerror=function(ve){Se.onError(ce.status)}),ce.onreadystatechange=this.onStateChange.bind(this,fe),ce.onprogress=this.onProgress.bind(this,fe),ye.onHeadersReceived=Se.onHeadersReceived,ye.onDone=Se.onDone,ye.onError=Se.onError,ye.onProgress=Se.onProgress,ce.send(null),fe}onProgress(Se,ce){var ye;const fe=this.pendingRequests[Se];fe&&((ye=fe.onProgress)==null||ye.call(fe,ce))}onStateChange(Se,ce){var Te,Le,Ne;const fe=this.pendingRequests[Se];if(!fe)return;const ye=fe.xhr;if(ye.readyState>=2&&fe.onHeadersReceived&&(fe.onHeadersReceived(),delete fe.onHeadersReceived),ye.readyState!==4||!(Se in this.pendingRequests))return;if(delete this.pendingRequests[Se],ye.status===0&&this.isHttp){(Te=fe.onError)==null||Te.call(fe,ye.status);return}const ve=ye.status||ie;if(!(ve===ie&&fe.expectedStatus===oe)&&ve!==fe.expectedStatus){(Le=fe.onError)==null||Le.call(fe,ye.status);return}const we=me(ye);if(ve===oe){const Me=ye.getResponseHeader("Content-Range"),ae=/bytes (\d+)-(\d+)\/(\d+)/.exec(Me);fe.onDone({begin:parseInt(ae[1],10),chunk:we})}else we?fe.onDone({begin:0,chunk:we}):(Ne=fe.onError)==null||Ne.call(fe,ye.status)}getRequestXhr(Se){return this.pendingRequests[Se].xhr}isPendingRequest(Se){return Se in this.pendingRequests}abortRequest(Se){const ce=this.pendingRequests[Se].xhr;delete this.pendingRequests[Se],ce.abort()}}class he{constructor(Se){this._source=Se,this._manager=new pe(Se.url,{httpHeaders:Se.httpHeaders,withCredentials:Se.withCredentials}),this._rangeChunkSize=Se.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(Se){const ce=this._rangeRequestReaders.indexOf(Se);ce>=0&&this._rangeRequestReaders.splice(ce,1)}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new ue(this._manager,this._source),this._fullRequestReader}getRangeReader(Se,ce){const fe=new de(this._manager,Se,ce);return fe.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(fe),fe}cancelAllRequests(Se){var ce;(ce=this._fullRequestReader)==null||ce.cancel(Se);for(const fe of this._rangeRequestReaders.slice(0))fe.cancel(Se)}}ee.PDFNetworkStream=he;class ue{constructor(Se,ce){this._manager=Se;const fe={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=ce.url,this._fullRequestId=Se.requestFull(fe),this._headersReceivedCapability=new re.PromiseCapability,this._disableRange=ce.disableRange||!1,this._contentLength=ce.length,this._rangeChunkSize=ce.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const Se=this._fullRequestId,ce=this._manager.getRequestXhr(Se),fe=Pe=>ce.getResponseHeader(Pe),{allowRangeRequests:ye,suggestedLength:ve}=(0,se.validateRangeRequestCapabilities)({getResponseHeader:fe,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});ye&&(this._isRangeSupported=!0),this._contentLength=ve||this._contentLength,this._filename=(0,se.extractFilenameFromHeader)(fe),this._isRangeSupported&&this._manager.abortRequest(Se),this._headersReceivedCapability.resolve()}_onDone(Se){if(Se&&(this._requests.length>0?this._requests.shift().resolve({value:Se.chunk,done:!1}):this._cachedChunks.push(Se.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const ce of this._requests)ce.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(Se){this._storedError=(0,se.createResponseStatusError)(Se,this._url),this._headersReceivedCapability.reject(this._storedError);for(const ce of this._requests)ce.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(Se){var ce;(ce=this.onProgress)==null||ce.call(this,{loaded:Se.loaded,total:Se.lengthComputable?Se.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const Se=new re.PromiseCapability;return this._requests.push(Se),Se.promise}cancel(Se){this._done=!0,this._headersReceivedCapability.reject(Se);for(const ce of this._requests)ce.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class de{constructor(Se,ce,fe){this._manager=Se;const ye={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=Se.url,this._requestId=Se.requestRange(ce,fe,ye),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var Se;(Se=this.onClosed)==null||Se.call(this,this)}_onDone(Se){const ce=Se.chunk;this._requests.length>0?this._requests.shift().resolve({value:ce,done:!1}):this._queuedChunk=ce,this._done=!0;for(const fe of this._requests)fe.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(Se){this._storedError=(0,se.createResponseStatusError)(Se,this._url);for(const ce of this._requests)ce.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(Se){var ce;this.isStreamingSupported||(ce=this.onProgress)==null||ce.call(this,{loaded:Se.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const ce=this._queuedChunk;return this._queuedChunk=null,{value:ce,done:!1}}if(this._done)return{value:void 0,done:!0};const Se=new re.PromiseCapability;return this._requests.push(Se),Se.promise}cancel(Se){this._done=!0;for(const ce of this._requests)ce.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.PDFFetchStream=void 0;var re=ne(1),se=ne(22);function ie(de,Ae,Se){return{method:"GET",headers:de,signal:Se.signal,mode:"cors",credentials:Ae?"include":"same-origin",redirect:"follow"}}function oe(de){const Ae=new Headers;for(const Se in de){const ce=de[Se];ce!==void 0&&Ae.append(Se,ce)}return Ae}function me(de){return de instanceof Uint8Array?de.buffer:de instanceof ArrayBuffer?de:((0,re.warn)(`getArrayBuffer - unexpected data format: ${de}`),new Uint8Array(de).buffer)}class pe{constructor(Ae){this.source=Ae,this.isHttp=/^https?:/i.test(Ae.url),this.httpHeaders=this.isHttp&&Ae.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Ae;return((Ae=this._fullRequestReader)==null?void 0:Ae._loaded)??0}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new he(this),this._fullRequestReader}getRangeReader(Ae,Se){if(Se<=this._progressiveDataLength)return null;const ce=new ue(this,Ae,Se);return this._rangeRequestReaders.push(ce),ce}cancelAllRequests(Ae){var Se;(Se=this._fullRequestReader)==null||Se.cancel(Ae);for(const ce of this._rangeRequestReaders.slice(0))ce.cancel(Ae)}}ee.PDFFetchStream=pe;class he{constructor(Ae){this._stream=Ae,this._reader=null,this._loaded=0,this._filename=null;const Se=Ae.source;this._withCredentials=Se.withCredentials||!1,this._contentLength=Se.length,this._headersCapability=new re.PromiseCapability,this._disableRange=Se.disableRange||!1,this._rangeChunkSize=Se.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!Se.disableStream,this._isRangeSupported=!Se.disableRange,this._headers=oe(this._stream.httpHeaders);const ce=Se.url;fetch(ce,ie(this._headers,this._withCredentials,this._abortController)).then(fe=>{if(!(0,se.validateResponseStatus)(fe.status))throw(0,se.createResponseStatusError)(fe.status,ce);this._reader=fe.body.getReader(),this._headersCapability.resolve();const ye=we=>fe.headers.get(we),{allowRangeRequests:ve,suggestedLength:Pe}=(0,se.validateRangeRequestCapabilities)({getResponseHeader:ye,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=ve,this._contentLength=Pe||this._contentLength,this._filename=(0,se.extractFilenameFromHeader)(ye),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new re.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var ce;await this._headersCapability.promise;const{value:Ae,done:Se}=await this._reader.read();return Se?{value:Ae,done:Se}:(this._loaded+=Ae.byteLength,(ce=this.onProgress)==null||ce.call(this,{loaded:this._loaded,total:this._contentLength}),{value:me(Ae),done:!1})}cancel(Ae){var Se;(Se=this._reader)==null||Se.cancel(Ae),this._abortController.abort()}}class ue{constructor(Ae,Se,ce){this._stream=Ae,this._reader=null,this._loaded=0;const fe=Ae.source;this._withCredentials=fe.withCredentials||!1,this._readCapability=new re.PromiseCapability,this._isStreamingSupported=!fe.disableStream,this._abortController=new AbortController,this._headers=oe(this._stream.httpHeaders),this._headers.append("Range",`bytes=${Se}-${ce-1}`);const ye=fe.url;fetch(ye,ie(this._headers,this._withCredentials,this._abortController)).then(ve=>{if(!(0,se.validateResponseStatus)(ve.status))throw(0,se.createResponseStatusError)(ve.status,ye);this._readCapability.resolve(),this._reader=ve.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var ce;await this._readCapability.promise;const{value:Ae,done:Se}=await this._reader.read();return Se?{value:Ae,done:Se}:(this._loaded+=Ae.byteLength,(ce=this.onProgress)==null||ce.call(this,{loaded:this._loaded}),{value:me(Ae),done:!1})}cancel(Ae){var Se;(Se=this._reader)==null||Se.cancel(Ae),this._abortController.abort()}}},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.TextLayerRenderTask=void 0,ee.renderTextLayer=fe,ee.updateTextLayer=ye;var re=ne(1),se=ne(6);const ie=1e5,oe=30,me=.8,pe=new Map;function he(ve,Pe){let we;if(Pe&&re.FeatureTest.isOffscreenCanvasSupported)we=new OffscreenCanvas(ve,ve).getContext("2d",{alpha:!1});else{const Te=document.createElement("canvas");Te.width=Te.height=ve,we=Te.getContext("2d",{alpha:!1})}return we}function ue(ve,Pe){const we=pe.get(ve);if(we)return we;const Te=he(oe,Pe);Te.font=`${oe}px ${ve}`;const Le=Te.measureText("");let Ne=Le.fontBoundingBoxAscent,Me=Math.abs(Le.fontBoundingBoxDescent);if(Ne){const ge=Ne/(Ne+Me);return pe.set(ve,ge),Te.canvas.width=Te.canvas.height=0,ge}Te.strokeStyle="red",Te.clearRect(0,0,oe,oe),Te.strokeText("g",0,0);let ae=Te.getImageData(0,0,oe,oe).data;Me=0;for(let ge=ae.length-1-3;ge>=0;ge-=4)if(ae[ge]>0){Me=Math.ceil(ge/4/oe);break}Te.clearRect(0,0,oe,oe),Te.strokeText("A",0,oe),ae=Te.getImageData(0,0,oe,oe).data,Ne=0;for(let ge=0,$e=ae.length;ge<$e;ge+=4)if(ae[ge]>0){Ne=oe-Math.floor(ge/4/oe);break}if(Te.canvas.width=Te.canvas.height=0,Ne){const ge=Ne/(Ne+Me);return pe.set(ve,ge),ge}return pe.set(ve,me),me}function de(ve,Pe,we){const Te=document.createElement("span"),Le={angle:0,canvasWidth:0,hasText:Pe.str!=="",hasEOL:Pe.hasEOL,fontSize:0};ve._textDivs.push(Te);const Ne=re.Util.transform(ve._transform,Pe.transform);let Me=Math.atan2(Ne[1],Ne[0]);const ae=we[Pe.fontName];ae.vertical&&(Me+=Math.PI/2);const ge=Math.hypot(Ne[2],Ne[3]),$e=ge*ue(ae.fontFamily,ve._isOffscreenCanvasSupported);let _e,ke;Me===0?(_e=Ne[4],ke=Ne[5]-$e):(_e=Ne[4]+$e*Math.sin(Me),ke=Ne[5]-$e*Math.cos(Me));const We="calc(var(--scale-factor)*",ze=Te.style;ve._container===ve._rootContainer?(ze.left=`${(100*_e/ve._pageWidth).toFixed(2)}%`,ze.top=`${(100*ke/ve._pageHeight).toFixed(2)}%`):(ze.left=`${We}${_e.toFixed(2)}px)`,ze.top=`${We}${ke.toFixed(2)}px)`),ze.fontSize=`${We}${ge.toFixed(2)}px)`,ze.fontFamily=ae.fontFamily,Le.fontSize=ge,Te.setAttribute("role","presentation"),Te.textContent=Pe.str,Te.dir=Pe.dir,ve._fontInspectorEnabled&&(Te.dataset.fontName=Pe.fontName),Me!==0&&(Le.angle=Me*(180/Math.PI));let Qe=!1;if(Pe.str.length>1)Qe=!0;else if(Pe.str!==" "&&Pe.transform[0]!==Pe.transform[3]){const ct=Math.abs(Pe.transform[0]),it=Math.abs(Pe.transform[3]);ct!==it&&Math.max(ct,it)/Math.min(ct,it)>1.5&&(Qe=!0)}Qe&&(Le.canvasWidth=ae.vertical?Pe.height:Pe.width),ve._textDivProperties.set(Te,Le),ve._isReadableStream&&ve._layoutText(Te)}function Ae(ve){const{div:Pe,scale:we,properties:Te,ctx:Le,prevFontSize:Ne,prevFontFamily:Me}=ve,{style:ae}=Pe;let ge="";if(Te.canvasWidth!==0&&Te.hasText){const{fontFamily:$e}=ae,{canvasWidth:_e,fontSize:ke}=Te;(Ne!==ke||Me!==$e)&&(Le.font=`${ke*we}px ${$e}`,ve.prevFontSize=ke,ve.prevFontFamily=$e);const{width:We}=Le.measureText(Pe.textContent);We>0&&(ge=`scaleX(${_e*we/We})`)}Te.angle!==0&&(ge=`rotate(${Te.angle}deg) ${ge}`),ge.length>0&&(ae.transform=ge)}function Se(ve){if(ve._canceled)return;const Pe=ve._textDivs,we=ve._capability;if(Pe.length>ie){we.resolve();return}if(!ve._isReadableStream)for(const Le of Pe)ve._layoutText(Le);we.resolve()}class ce{constructor({textContentSource:Pe,container:we,viewport:Te,textDivs:Le,textDivProperties:Ne,textContentItemsStr:Me,isOffscreenCanvasSupported:ae}){var We;this._textContentSource=Pe,this._isReadableStream=Pe instanceof ReadableStream,this._container=this._rootContainer=we,this._textDivs=Le||[],this._textContentItemsStr=Me||[],this._isOffscreenCanvasSupported=ae,this._fontInspectorEnabled=!!((We=globalThis.FontInspector)!=null&&We.enabled),this._reader=null,this._textDivProperties=Ne||new WeakMap,this._canceled=!1,this._capability=new re.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:Te.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:he(0,ae)};const{pageWidth:ge,pageHeight:$e,pageX:_e,pageY:ke}=Te.rawDims;this._transform=[1,0,0,-1,-_e,ke+$e],this._pageWidth=ge,this._pageHeight=$e,(0,se.setLayerDimensions)(we,Te),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new re.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new re.AbortException("TextLayer task cancelled."))}_processItems(Pe,we){for(const Te of Pe){if(Te.str===void 0){if(Te.type==="beginMarkedContentProps"||Te.type==="beginMarkedContent"){const Le=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),Te.id!==null&&this._container.setAttribute("id",`${Te.id}`),Le.append(this._container)}else Te.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(Te.str),de(this,Te,we)}}_layoutText(Pe){const we=this._layoutTextParams.properties=this._textDivProperties.get(Pe);if(this._layoutTextParams.div=Pe,Ae(this._layoutTextParams),we.hasText&&this._container.append(Pe),we.hasEOL){const Te=document.createElement("br");Te.setAttribute("role","presentation"),this._container.append(Te)}}_render(){const Pe=new re.PromiseCapability;let we=Object.create(null);if(this._isReadableStream){const Te=()=>{this._reader.read().then(({value:Le,done:Ne})=>{if(Ne){Pe.resolve();return}Object.assign(we,Le.styles),this._processItems(Le.items,we),Te()},Pe.reject)};this._reader=this._textContentSource.getReader(),Te()}else if(this._textContentSource){const{items:Te,styles:Le}=this._textContentSource;this._processItems(Te,Le),Pe.resolve()}else throw new Error('No "textContentSource" parameter specified.');Pe.promise.then(()=>{we=null,Se(this)},this._capability.reject)}}ee.TextLayerRenderTask=ce;function fe(ve){!ve.textContentSource&&(ve.textContent||ve.textContentStream)&&((0,se.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),ve.textContentSource=ve.textContent||ve.textContentStream);const{container:Pe,viewport:we}=ve,Te=getComputedStyle(Pe),Le=Te.getPropertyValue("visibility"),Ne=parseFloat(Te.getPropertyValue("--scale-factor"));Le==="visible"&&(!Ne||Math.abs(Ne-we.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const Me=new ce(ve);return Me._render(),Me}function ye({container:ve,viewport:Pe,textDivs:we,textDivProperties:Te,isOffscreenCanvasSupported:Le,mustRotate:Ne=!0,mustRescale:Me=!0}){if(Ne&&(0,se.setLayerDimensions)(ve,{rotation:Pe.rotation}),Me){const ae=he(0,Le),$e={prevFontSize:null,prevFontFamily:null,div:null,scale:Pe.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:ae};for(const _e of we)$e.properties=Te.get(_e),$e.div=_e,Ae($e)}}},(te,ee,ne)=>{var he,ue,de,Ae,Se,ce,fe,ye,ve,Wn,we,hr,Le,Vn,Me,Gn;Object.defineProperty(ee,"__esModule",{value:!0}),ee.AnnotationEditorLayer=void 0;var re=ne(1),se=ne(5),ie=ne(28),oe=ne(29),me=ne(6);const ge=class ge{constructor(_e){Je(this,ve);Je(this,we);Je(this,Le);Je(this,Me);Je(this,he,void 0);Je(this,ue,!1);Je(this,de,this.pointerup.bind(this));Je(this,Ae,this.pointerdown.bind(this));Je(this,Se,new Map);Je(this,ce,!1);Je(this,fe,!1);Je(this,ye,void 0);ge._initialized||(ge._initialized=!0,ie.FreeTextEditor.initialize(_e.l10n),oe.InkEditor.initialize(_e.l10n)),_e.uiManager.registerEditorTypes([ie.FreeTextEditor,oe.InkEditor]),_t(this,ye,_e.uiManager),this.pageIndex=_e.pageIndex,this.div=_e.div,_t(this,he,_e.accessibilityManager),Re(this,ye).addLayer(this)}get isEmpty(){return Re(this,Se).size===0}updateToolbar(_e){Re(this,ye).updateToolbar(_e)}updateMode(_e=Re(this,ye).getMode()){rt(this,Me,Gn).call(this),_e===re.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),Re(this,ye).unselectAll(),_e!==re.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",_e===re.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",_e===re.AnnotationEditorType.INK),this.div.hidden=!1)}addInkEditorIfNeeded(_e){if(!_e&&Re(this,ye).getMode()!==re.AnnotationEditorType.INK)return;if(!_e){for(const We of Re(this,Se).values())if(We.isEmpty()){We.setInBackground();return}}rt(this,Le,Vn).call(this,{offsetX:0,offsetY:0}).setInBackground()}setEditingState(_e){Re(this,ye).setEditingState(_e)}addCommands(_e){Re(this,ye).addCommands(_e)}enable(){this.div.style.pointerEvents="auto";for(const _e of Re(this,Se).values())_e.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const _e of Re(this,Se).values())_e.disableEditing();rt(this,Me,Gn).call(this),this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(_e){Re(this,ye).getActive()!==_e&&Re(this,ye).setActiveEditor(_e)}enableClick(){this.div.addEventListener("pointerdown",Re(this,Ae)),this.div.addEventListener("pointerup",Re(this,de))}disableClick(){this.div.removeEventListener("pointerdown",Re(this,Ae)),this.div.removeEventListener("pointerup",Re(this,de))}attach(_e){Re(this,Se).set(_e.id,_e)}detach(_e){var ke;Re(this,Se).delete(_e.id),(ke=Re(this,he))==null||ke.removePointerInTextLayer(_e.contentDiv)}remove(_e){Re(this,ye).removeEditor(_e),this.detach(_e),_e.div.style.display="none",setTimeout(()=>{_e.div.style.display="",_e.div.remove(),_e.isAttachedToDOM=!1,document.activeElement===document.body&&Re(this,ye).focusMainContainer()},0),Re(this,fe)||this.addInkEditorIfNeeded(!1)}add(_e){if(rt(this,ve,Wn).call(this,_e),Re(this,ye).addEditor(_e),this.attach(_e),!_e.isAttachedToDOM){const ke=_e.render();this.div.append(ke),_e.isAttachedToDOM=!0}this.moveEditorInDOM(_e),_e.onceAdded(),Re(this,ye).addToAnnotationStorage(_e)}moveEditorInDOM(_e){var ke;(ke=Re(this,he))==null||ke.moveElementInDOM(this.div,_e.div,_e.contentDiv,!0)}addOrRebuild(_e){_e.needsToBeRebuilt()?_e.rebuild():this.add(_e)}addANewEditor(_e){const ke=()=>{this.addOrRebuild(_e)},We=()=>{_e.remove()};this.addCommands({cmd:ke,undo:We,mustExec:!0})}addUndoableEditor(_e){const ke=()=>{this.addOrRebuild(_e)},We=()=>{_e.remove()};this.addCommands({cmd:ke,undo:We,mustExec:!1})}getNextId(){return Re(this,ye).getId()}deserialize(_e){switch(_e.annotationType){case re.AnnotationEditorType.FREETEXT:return ie.FreeTextEditor.deserialize(_e,this,Re(this,ye));case re.AnnotationEditorType.INK:return oe.InkEditor.deserialize(_e,this,Re(this,ye))}return null}setSelected(_e){Re(this,ye).setSelected(_e)}toggleSelected(_e){Re(this,ye).toggleSelected(_e)}isSelected(_e){return Re(this,ye).isSelected(_e)}unselect(_e){Re(this,ye).unselect(_e)}pointerup(_e){const{isMac:ke}=re.FeatureTest.platform;if(!(_e.button!==0||_e.ctrlKey&&ke)&&_e.target===this.div&&Re(this,ce)){if(_t(this,ce,!1),!Re(this,ue)){_t(this,ue,!0);return}rt(this,Le,Vn).call(this,_e)}}pointerdown(_e){const{isMac:ke}=re.FeatureTest.platform;if(_e.button!==0||_e.ctrlKey&&ke||_e.target!==this.div)return;_t(this,ce,!0);const We=Re(this,ye).getActive();_t(this,ue,!We||We.isEmpty())}drop(_e){const ke=_e.dataTransfer.getData("text/plain"),We=Re(this,ye).getEditor(ke);if(!We)return;_e.preventDefault(),_e.dataTransfer.dropEffect="move",rt(this,ve,Wn).call(this,We);const ze=this.div.getBoundingClientRect(),Qe=_e.clientX-ze.x,ct=_e.clientY-ze.y;We.translate(Qe-We.startX,ct-We.startY),this.moveEditorInDOM(We),We.div.focus()}dragover(_e){_e.preventDefault()}destroy(){var _e,ke;((_e=Re(this,ye).getActive())==null?void 0:_e.parent)===this&&Re(this,ye).setActiveEditor(null);for(const We of Re(this,Se).values())(ke=Re(this,he))==null||ke.removePointerInTextLayer(We.contentDiv),We.setParent(null),We.isAttachedToDOM=!1,We.div.remove();this.div=null,Re(this,Se).clear(),Re(this,ye).removeLayer(this)}render({viewport:_e}){this.viewport=_e,(0,me.setLayerDimensions)(this.div,_e),(0,se.bindEvents)(this,this.div,["dragover","drop"]);for(const ke of Re(this,ye).getEditors(this.pageIndex))this.add(ke);this.updateMode()}update({viewport:_e}){Re(this,ye).commitOrRemove(),this.viewport=_e,(0,me.setLayerDimensions)(this.div,{rotation:_e.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:_e,pageHeight:ke}=this.viewport.rawDims;return[_e,ke]}};he=new WeakMap,ue=new WeakMap,de=new WeakMap,Ae=new WeakMap,Se=new WeakMap,ce=new WeakMap,fe=new WeakMap,ye=new WeakMap,ve=new WeakSet,Wn=function(_e){var ke;_e.parent!==this&&(this.attach(_e),(ke=_e.parent)==null||ke.detach(_e),_e.setParent(this),_e.div&&_e.isAttachedToDOM&&(_e.div.remove(),this.div.append(_e.div)))},we=new WeakSet,hr=function(_e){switch(Re(this,ye).getMode()){case re.AnnotationEditorType.FREETEXT:return new ie.FreeTextEditor(_e);case re.AnnotationEditorType.INK:return new oe.InkEditor(_e)}return null},Le=new WeakSet,Vn=function(_e){const ke=this.getNextId(),We=rt(this,we,hr).call(this,{parent:this,id:ke,x:_e.offsetX,y:_e.offsetY,uiManager:Re(this,ye)});return We&&this.add(We),We},Me=new WeakSet,Gn=function(){_t(this,fe,!0);for(const _e of Re(this,Se).values())_e.isEmpty()&&_e.remove();_t(this,fe,!1)},Lt(ge,"_initialized",!1);let pe=ge;ee.AnnotationEditorLayer=pe},(te,ee,ne)=>{var me,pe,he,ue,de,Ae,Se,ce,fe,ye,fr,Pe,pr,Te,gr,Ne,qn;Object.defineProperty(ee,"__esModule",{value:!0}),ee.FreeTextEditor=void 0;var re=ne(1),se=ne(5),ie=ne(4);const ae=class ae extends ie.AnnotationEditor{constructor(_e){super({..._e,name:"freeTextEditor"});Je(this,ye);Je(this,Pe);Je(this,Te);Je(this,Ne);Je(this,me,this.editorDivBlur.bind(this));Je(this,pe,this.editorDivFocus.bind(this));Je(this,he,this.editorDivInput.bind(this));Je(this,ue,this.editorDivKeydown.bind(this));Je(this,de,void 0);Je(this,Ae,"");Je(this,Se,`${this.id}-editor`);Je(this,ce,!1);Je(this,fe,void 0);_t(this,de,_e.color||ae._defaultColor||ie.AnnotationEditor._defaultLineColor),_t(this,fe,_e.fontSize||ae._defaultFontSize)}static initialize(_e){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map(We=>[We,_e.get(We)]));const ke=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(ke.getPropertyValue("--freetext-padding"))}static updateDefaultParams(_e,ke){switch(_e){case re.AnnotationEditorParamsType.FREETEXT_SIZE:ae._defaultFontSize=ke;break;case re.AnnotationEditorParamsType.FREETEXT_COLOR:ae._defaultColor=ke;break}}updateParams(_e,ke){switch(_e){case re.AnnotationEditorParamsType.FREETEXT_SIZE:rt(this,ye,fr).call(this,ke);break;case re.AnnotationEditorParamsType.FREETEXT_COLOR:rt(this,Pe,pr).call(this,ke);break}}static get defaultPropertiesToUpdate(){return[[re.AnnotationEditorParamsType.FREETEXT_SIZE,ae._defaultFontSize],[re.AnnotationEditorParamsType.FREETEXT_COLOR,ae._defaultColor||ie.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[re.AnnotationEditorParamsType.FREETEXT_SIZE,Re(this,fe)],[re.AnnotationEditorParamsType.FREETEXT_COLOR,Re(this,de)]]}getInitialTranslation(){const _e=this.parentScale;return[-ae._internalPadding*_e,-(ae._internalPadding+Re(this,fe))*_e]}rebuild(){super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(re.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",Re(this,ue)),this.editorDiv.addEventListener("focus",Re(this,pe)),this.editorDiv.addEventListener("blur",Re(this,me)),this.editorDiv.addEventListener("input",Re(this,he)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",Re(this,Se)),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",Re(this,ue)),this.editorDiv.removeEventListener("focus",Re(this,pe)),this.editorDiv.removeEventListener("blur",Re(this,me)),this.editorDiv.removeEventListener("input",Re(this,he)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(_e){super.focusin(_e),_e.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}commit(){this.isInEditMode()&&(super.commit(),Re(this,ce)||(_t(this,ce,!0),this.parent.addUndoableEditor(this)),this.disableEditMode(),_t(this,Ae,rt(this,Te,gr).call(this).trimEnd()),rt(this,Ne,qn).call(this))}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(_e){this.enableEditMode(),this.editorDiv.focus()}keydown(_e){_e.target===this.div&&_e.key==="Enter"&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(_e){ae._keyboardManager.exec(this,_e)}editorDivFocus(_e){this.isEditing=!0}editorDivBlur(_e){this.isEditing=!1}editorDivInput(_e){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let _e,ke;this.width&&(_e=this.x,ke=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",Re(this,Se)),this.enableEditing(),ae._l10nPromise.get("editor_free_text2_aria_label").then(ze=>{var Qe;return(Qe=this.editorDiv)==null?void 0:Qe.setAttribute("aria-label",ze)}),ae._l10nPromise.get("free_text2_default_content").then(ze=>{var Qe;return(Qe=this.editorDiv)==null?void 0:Qe.setAttribute("default-content",ze)}),this.editorDiv.contentEditable=!0;const{style:We}=this.editorDiv;if(We.fontSize=`calc(${Re(this,fe)}px * var(--scale-factor))`,We.color=Re(this,de),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,se.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[ze,Qe]=this.parentDimensions;this.setAt(_e*ze,ke*Qe,this.width*ze,this.height*Qe);for(const ct of Re(this,Ae).split(`
|
|
49
|
+
`)){const it=document.createElement("div");it.append(ct?document.createTextNode(ct):document.createElement("br")),this.editorDiv.append(it)}this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(_e,ke,We){const ze=super.deserialize(_e,ke,We);return _t(ze,fe,_e.fontSize),_t(ze,de,re.Util.makeHexColor(..._e.color)),_t(ze,Ae,_e.value),ze}serialize(){if(this.isEmpty())return null;const _e=ae._internalPadding*this.parentScale,ke=this.getRect(_e,_e),We=ie.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:Re(this,de));return{annotationType:re.AnnotationEditorType.FREETEXT,color:We,fontSize:Re(this,fe),value:Re(this,Ae),pageIndex:this.pageIndex,rect:ke,rotation:this.rotation}}};me=new WeakMap,pe=new WeakMap,he=new WeakMap,ue=new WeakMap,de=new WeakMap,Ae=new WeakMap,Se=new WeakMap,ce=new WeakMap,fe=new WeakMap,ye=new WeakSet,fr=function(_e){const ke=ze=>{this.editorDiv.style.fontSize=`calc(${ze}px * var(--scale-factor))`,this.translate(0,-(ze-Re(this,fe))*this.parentScale),_t(this,fe,ze),rt(this,Ne,qn).call(this)},We=Re(this,fe);this.addCommands({cmd:()=>{ke(_e)},undo:()=>{ke(We)},mustExec:!0,type:re.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Pe=new WeakSet,pr=function(_e){const ke=Re(this,de);this.addCommands({cmd:()=>{_t(this,de,this.editorDiv.style.color=_e)},undo:()=>{_t(this,de,this.editorDiv.style.color=ke)},mustExec:!0,type:re.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Te=new WeakSet,gr=function(){const _e=this.editorDiv.getElementsByTagName("div");if(_e.length===0)return this.editorDiv.innerText;const ke=[];for(const We of _e)ke.push(We.innerText.replace(/\r\n?|\n/,""));return ke.join(`
|
|
50
|
+
`)},Ne=new WeakSet,qn=function(){const[_e,ke]=this.parentDimensions;let We;if(this.isAttachedToDOM)We=this.div.getBoundingClientRect();else{const{currentLayer:ze,div:Qe}=this,ct=Qe.style.display;Qe.style.display="hidden",ze.div.append(this.div),We=Qe.getBoundingClientRect(),Qe.remove(),Qe.style.display=ct}this.width=We.width/_e,this.height=We.height/ke},Lt(ae,"_freeTextDefaultContent",""),Lt(ae,"_l10nPromise"),Lt(ae,"_internalPadding",0),Lt(ae,"_defaultColor",null),Lt(ae,"_defaultFontSize",10),Lt(ae,"_keyboardManager",new se.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],ae.prototype.commitOrRemove]])),Lt(ae,"_type","freetext");let oe=ae;ee.FreeTextEditor=oe},(te,ee,ne)=>{var he,ue,de,Ae,Se,ce,fe,ye,ve,Pe,we,Te,Le,Ne,Me,mr,ge,_r,_e,yr,We,br,Qe,zn,it,Sr,at,vr,dt,Ar,mt,qt,Ee,Xn,Oe,$n,Ve,Mn,je,Jt,Be,Kn,be,kn,Fe,Yn,Xe,wr,Ze,Tr,ot,Er,nt,Zn,pt,Fn,At,Qt,Ye,Jn;Object.defineProperty(ee,"__esModule",{value:!0}),ee.InkEditor=void 0,Object.defineProperty(ee,"fitCurve",{enumerable:!0,get:function(){return ie.fitCurve}});var re=ne(1),se=ne(4),ie=ne(30),oe=ne(5);const me=16,vt=class vt extends se.AnnotationEditor{constructor(De){super({...De,name:"inkEditor"});Je(this,Me);Je(this,ge);Je(this,_e);Je(this,We);Je(this,Qe);Je(this,it);Je(this,at);Je(this,dt);Je(this,mt);Je(this,Ee);Je(this,Oe);Je(this,Ve);Je(this,je);Je(this,Be);Je(this,be);Je(this,Xe);Je(this,Ze);Je(this,ot);Je(this,nt);Je(this,pt);Je(this,At);Je(this,Ye);Je(this,he,0);Je(this,ue,0);Je(this,de,0);Je(this,Ae,this.canvasPointermove.bind(this));Je(this,Se,this.canvasPointerleave.bind(this));Je(this,ce,this.canvasPointerup.bind(this));Je(this,fe,this.canvasPointerdown.bind(this));Je(this,ye,!1);Je(this,ve,!1);Je(this,Pe,null);Je(this,we,null);Je(this,Te,0);Je(this,Le,0);Je(this,Ne,null);this.color=De.color||null,this.thickness=De.thickness||null,this.opacity=De.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(De){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map(He=>[He,De.get(He)]))}static updateDefaultParams(De,He){switch(De){case re.AnnotationEditorParamsType.INK_THICKNESS:vt._defaultThickness=He;break;case re.AnnotationEditorParamsType.INK_COLOR:vt._defaultColor=He;break;case re.AnnotationEditorParamsType.INK_OPACITY:vt._defaultOpacity=He/100;break}}updateParams(De,He){switch(De){case re.AnnotationEditorParamsType.INK_THICKNESS:rt(this,Me,mr).call(this,He);break;case re.AnnotationEditorParamsType.INK_COLOR:rt(this,ge,_r).call(this,He);break;case re.AnnotationEditorParamsType.INK_OPACITY:rt(this,_e,yr).call(this,He);break}}static get defaultPropertiesToUpdate(){return[[re.AnnotationEditorParamsType.INK_THICKNESS,vt._defaultThickness],[re.AnnotationEditorParamsType.INK_COLOR,vt._defaultColor||se.AnnotationEditor._defaultLineColor],[re.AnnotationEditorParamsType.INK_OPACITY,Math.round(vt._defaultOpacity*100)]]}get propertiesToUpdate(){return[[re.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||vt._defaultThickness],[re.AnnotationEditorParamsType.INK_COLOR,this.color||vt._defaultColor||se.AnnotationEditor._defaultLineColor],[re.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??vt._defaultOpacity))]]}rebuild(){super.rebuild(),this.div!==null&&(this.canvas||(rt(this,Oe,$n).call(this),rt(this,Ve,Mn).call(this)),this.isAttachedToDOM||(this.parent.add(this),rt(this,je,Jt).call(this)),rt(this,At,Qt).call(this))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,Re(this,we).disconnect(),_t(this,we,null),super.remove())}setParent(De){!this.parent&&De?this._uiManager.removeShouldRescale(this):this.parent&&De===null&&this._uiManager.addShouldRescale(this),super.setParent(De)}onScaleChanging(){const[De,He]=this.parentDimensions,lt=this.width*De,bt=this.height*He;this.setDimensions(lt,bt)}enableEditMode(){Re(this,ye)||this.canvas===null||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",Re(this,fe)),this.canvas.addEventListener("pointerup",Re(this,ce)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",Re(this,fe)),this.canvas.removeEventListener("pointerup",Re(this,ce)))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){Re(this,ye)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),_t(this,ye,!0),this.div.classList.add("disabled"),rt(this,At,Qt).call(this,!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus({preventScroll:!0}))}focusin(De){super.focusin(De),this.enableEditMode()}canvasPointerdown(De){De.button!==0||!this.isInEditMode()||Re(this,ye)||(this.setInForeground(),De.type!=="mouse"&&this.div.focus(),De.stopPropagation(),this.canvas.addEventListener("pointerleave",Re(this,Se)),this.canvas.addEventListener("pointermove",Re(this,Ae)),rt(this,it,Sr).call(this,De.offsetX,De.offsetY))}canvasPointermove(De){De.stopPropagation(),rt(this,at,vr).call(this,De.offsetX,De.offsetY)}canvasPointerup(De){De.button===0&&this.isInEditMode()&&this.currentPath.length!==0&&(De.stopPropagation(),rt(this,Ee,Xn).call(this,De),this.setInBackground())}canvasPointerleave(De){rt(this,Ee,Xn).call(this,De),this.setInBackground()}render(){if(this.div)return this.div;let De,He;this.width&&(De=this.x,He=this.y),super.render(),vt._l10nPromise.get("editor_ink2_aria_label").then(Rt=>{var Pt;return(Pt=this.div)==null?void 0:Pt.setAttribute("aria-label",Rt)});const[lt,bt,Et,xt]=rt(this,We,br).call(this);if(this.setAt(lt,bt,0,0),this.setDims(Et,xt),rt(this,Oe,$n).call(this),this.width){const[Rt,Pt]=this.parentDimensions;this.setAt(De*Rt,He*Pt,this.width*Rt,this.height*Pt),_t(this,ve,!0),rt(this,je,Jt).call(this),this.setDims(this.width*Rt,this.height*Pt),rt(this,mt,qt).call(this),rt(this,Ye,Jn).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return rt(this,Ve,Mn).call(this),this.div}setDimensions(De,He){const lt=Math.round(De),bt=Math.round(He);if(Re(this,Te)===lt&&Re(this,Le)===bt)return;_t(this,Te,lt),_t(this,Le,bt),this.canvas.style.visibility="hidden",Re(this,he)&&Math.abs(Re(this,he)-De/He)>.01&&(He=Math.ceil(De/Re(this,he)),this.setDims(De,He));const[Et,xt]=this.parentDimensions;this.width=De/Et,this.height=He/xt,Re(this,ye)&&rt(this,Be,Kn).call(this,De,He),rt(this,je,Jt).call(this),rt(this,mt,qt).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(De,He,lt){var Ft,Ot;const bt=super.deserialize(De,He,lt);bt.thickness=De.thickness,bt.color=re.Util.makeHexColor(...De.color),bt.opacity=De.opacity;const[Et,xt]=bt.pageDimensions,Rt=bt.width*Et,Pt=bt.height*xt,kt=bt.parentScale,Ct=De.thickness/2;_t(bt,he,Rt/Pt),_t(bt,ye,!0),_t(bt,Te,Math.round(Rt)),_t(bt,Le,Math.round(Pt));for(const{bezier:Mt}of De.paths){const jt=[];bt.paths.push(jt);let Bt=kt*(Mt[0]-Ct),Ut=kt*(Pt-Mt[1]-Ct);for(let Dt=2,Nt=Mt.length;Dt<Nt;Dt+=6){const Vt=kt*(Mt[Dt]-Ct),zt=kt*(Pt-Mt[Dt+1]-Ct),Tn=kt*(Mt[Dt+2]-Ct),En=kt*(Pt-Mt[Dt+3]-Ct),tr=kt*(Mt[Dt+4]-Ct),nr=kt*(Pt-Mt[Dt+5]-Ct);jt.push([[Bt,Ut],[Vt,zt],[Tn,En],[tr,nr]]),Bt=tr,Ut=nr}const Wt=rt(this,Fe,Yn).call(this,jt);bt.bezierPath2D.push(Wt)}const It=rt(Ft=bt,nt,Zn).call(Ft);return _t(bt,de,Math.max(me,It[2]-It[0])),_t(bt,ue,Math.max(me,It[3]-It[1])),rt(Ot=bt,Be,Kn).call(Ot,Rt,Pt),bt}serialize(){if(this.isEmpty())return null;const De=this.getRect(0,0),He=this.rotation%180===0?De[3]-De[1]:De[2]-De[0],lt=se.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:re.AnnotationEditorType.INK,color:lt,thickness:this.thickness,opacity:this.opacity,paths:rt(this,Xe,wr).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,He),pageIndex:this.pageIndex,rect:De,rotation:this.rotation}}};he=new WeakMap,ue=new WeakMap,de=new WeakMap,Ae=new WeakMap,Se=new WeakMap,ce=new WeakMap,fe=new WeakMap,ye=new WeakMap,ve=new WeakMap,Pe=new WeakMap,we=new WeakMap,Te=new WeakMap,Le=new WeakMap,Ne=new WeakMap,Me=new WeakSet,mr=function(De){const He=this.thickness;this.addCommands({cmd:()=>{this.thickness=De,rt(this,At,Qt).call(this)},undo:()=>{this.thickness=He,rt(this,At,Qt).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},ge=new WeakSet,_r=function(De){const He=this.color;this.addCommands({cmd:()=>{this.color=De,rt(this,mt,qt).call(this)},undo:()=>{this.color=He,rt(this,mt,qt).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},_e=new WeakSet,yr=function(De){De/=100;const He=this.opacity;this.addCommands({cmd:()=>{this.opacity=De,rt(this,mt,qt).call(this)},undo:()=>{this.opacity=He,rt(this,mt,qt).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},We=new WeakSet,br=function(){const{parentRotation:De,parentDimensions:[He,lt]}=this;switch(De){case 90:return[0,lt,lt,He];case 180:return[He,lt,He,lt];case 270:return[He,0,lt,He];default:return[0,0,He,lt]}},Qe=new WeakSet,zn=function(){const{ctx:De,color:He,opacity:lt,thickness:bt,parentScale:Et,scaleFactor:xt}=this;De.lineWidth=bt*Et/xt,De.lineCap="round",De.lineJoin="round",De.miterLimit=10,De.strokeStyle=`${He}${(0,oe.opacityToHex)(lt)}`},it=new WeakSet,Sr=function(De,He){this.isEditing=!0,Re(this,ve)||(_t(this,ve,!0),rt(this,je,Jt).call(this),this.thickness||(this.thickness=vt._defaultThickness),this.color||(this.color=vt._defaultColor||se.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=vt._defaultOpacity)),this.currentPath.push([De,He]),_t(this,Pe,null),rt(this,Qe,zn).call(this),this.ctx.beginPath(),this.ctx.moveTo(De,He),_t(this,Ne,()=>{Re(this,Ne)&&(Re(this,Pe)&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):rt(this,mt,qt).call(this),this.ctx.lineTo(...Re(this,Pe)),_t(this,Pe,null),this.ctx.stroke()),window.requestAnimationFrame(Re(this,Ne)))}),window.requestAnimationFrame(Re(this,Ne))},at=new WeakSet,vr=function(De,He){const[lt,bt]=this.currentPath.at(-1);De===lt&&He===bt||(this.currentPath.push([De,He]),_t(this,Pe,[De,He]))},dt=new WeakSet,Ar=function(De,He){var kt;this.ctx.closePath(),_t(this,Ne,null),De=Math.min(Math.max(De,0),this.canvas.width),He=Math.min(Math.max(He,0),this.canvas.height);const[lt,bt]=this.currentPath.at(-1);(De!==lt||He!==bt)&&this.currentPath.push([De,He]);let Et;if(this.currentPath.length!==1)Et=(0,ie.fitCurve)(this.currentPath,30,null);else{const Ct=[De,He];Et=[[Ct,Ct.slice(),Ct.slice(),Ct]]}const xt=rt(kt=vt,Fe,Yn).call(kt,Et);this.currentPath.length=0;const Rt=()=>{this.paths.push(Et),this.bezierPath2D.push(xt),this.rebuild()},Pt=()=>{this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(rt(this,Oe,$n).call(this),rt(this,Ve,Mn).call(this)),rt(this,At,Qt).call(this))};this.addCommands({cmd:Rt,undo:Pt,mustExec:!0})},mt=new WeakSet,qt=function(){if(this.isEmpty()){rt(this,be,kn).call(this);return}rt(this,Qe,zn).call(this);const{canvas:De,ctx:He}=this;He.setTransform(1,0,0,1,0,0),He.clearRect(0,0,De.width,De.height),rt(this,be,kn).call(this);for(const lt of this.bezierPath2D)He.stroke(lt)},Ee=new WeakSet,Xn=function(De){rt(this,dt,Ar).call(this,De.offsetX,De.offsetY),this.canvas.removeEventListener("pointerleave",Re(this,Se)),this.canvas.removeEventListener("pointermove",Re(this,Ae)),this.addToAnnotationStorage()},Oe=new WeakSet,$n=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",vt._l10nPromise.get("editor_ink_canvas_aria_label").then(De=>{var He;return(He=this.canvas)==null?void 0:He.setAttribute("aria-label",De)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},Ve=new WeakSet,Mn=function(){_t(this,we,new ResizeObserver(De=>{const He=De[0].contentRect;He.width&&He.height&&this.setDimensions(He.width,He.height)})),Re(this,we).observe(this.div)},je=new WeakSet,Jt=function(){if(!Re(this,ve))return;const[De,He]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*De),this.canvas.height=Math.ceil(this.height*He),rt(this,be,kn).call(this)},Be=new WeakSet,Kn=function(De,He){const lt=rt(this,pt,Fn).call(this),bt=(De-lt)/Re(this,de),Et=(He-lt)/Re(this,ue);this.scaleFactor=Math.min(bt,Et)},be=new WeakSet,kn=function(){const De=rt(this,pt,Fn).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+De,this.translationY*this.scaleFactor+De)},Fe=new WeakSet,Yn=function(De){const He=new Path2D;for(let lt=0,bt=De.length;lt<bt;lt++){const[Et,xt,Rt,Pt]=De[lt];lt===0&&He.moveTo(...Et),He.bezierCurveTo(xt[0],xt[1],Rt[0],Rt[1],Pt[0],Pt[1])}return He},Xe=new WeakSet,wr=function(De,He,lt,bt){const xt=[],Rt=this.thickness/2;let Pt,kt;for(const Ct of this.paths){Pt=[],kt=[];for(let It=0,Ft=Ct.length;It<Ft;It++){const[Ot,Mt,jt,Bt]=Ct[It],Ut=De*(Ot[0]+He)+Rt,Wt=bt-De*(Ot[1]+lt)-Rt,Dt=De*(Mt[0]+He)+Rt,Nt=bt-De*(Mt[1]+lt)-Rt,Vt=De*(jt[0]+He)+Rt,zt=bt-De*(jt[1]+lt)-Rt,Tn=De*(Bt[0]+He)+Rt,En=bt-De*(Bt[1]+lt)-Rt;It===0&&(Pt.push(Ut,Wt),kt.push(Ut,Wt)),Pt.push(Dt,Nt,Vt,zt,Tn,En),rt(this,Ze,Tr).call(this,Ut,Wt,Dt,Nt,Vt,zt,Tn,En,4,kt)}xt.push({bezier:Pt,points:kt})}return xt},Ze=new WeakSet,Tr=function(De,He,lt,bt,Et,xt,Rt,Pt,kt,Ct){if(rt(this,ot,Er).call(this,De,He,lt,bt,Et,xt,Rt,Pt)){Ct.push(Rt,Pt);return}for(let It=1;It<kt-1;It++){const Ft=It/kt,Ot=1-Ft;let Mt=Ft*De+Ot*lt,jt=Ft*He+Ot*bt,Bt=Ft*lt+Ot*Et,Ut=Ft*bt+Ot*xt;const Wt=Ft*Et+Ot*Rt,Dt=Ft*xt+Ot*Pt;Mt=Ft*Mt+Ot*Bt,jt=Ft*jt+Ot*Ut,Bt=Ft*Bt+Ot*Wt,Ut=Ft*Ut+Ot*Dt,Mt=Ft*Mt+Ot*Bt,jt=Ft*jt+Ot*Ut,Ct.push(Mt,jt)}Ct.push(Rt,Pt)},ot=new WeakSet,Er=function(De,He,lt,bt,Et,xt,Rt,Pt){const Ct=(3*lt-2*De-Rt)**2,It=(3*bt-2*He-Pt)**2,Ft=(3*Et-De-2*Rt)**2,Ot=(3*xt-He-2*Pt)**2;return Math.max(Ct,Ft)+Math.max(It,Ot)<=10},nt=new WeakSet,Zn=function(){let De=1/0,He=-1/0,lt=1/0,bt=-1/0;for(const Et of this.paths)for(const[xt,Rt,Pt,kt]of Et){const Ct=re.Util.bezierBoundingBox(...xt,...Rt,...Pt,...kt);De=Math.min(De,Ct[0]),lt=Math.min(lt,Ct[1]),He=Math.max(He,Ct[2]),bt=Math.max(bt,Ct[3])}return[De,lt,He,bt]},pt=new WeakSet,Fn=function(){return Re(this,ye)?Math.ceil(this.thickness*this.parentScale):0},At=new WeakSet,Qt=function(De=!1){if(this.isEmpty())return;if(!Re(this,ye)){rt(this,mt,qt).call(this);return}const He=rt(this,nt,Zn).call(this),lt=rt(this,pt,Fn).call(this);_t(this,de,Math.max(me,He[2]-He[0])),_t(this,ue,Math.max(me,He[3]-He[1]));const bt=Math.ceil(lt+Re(this,de)*this.scaleFactor),Et=Math.ceil(lt+Re(this,ue)*this.scaleFactor),[xt,Rt]=this.parentDimensions;this.width=bt/xt,this.height=Et/Rt,_t(this,he,bt/Et),rt(this,Ye,Jn).call(this);const Pt=this.translationX,kt=this.translationY;this.translationX=-He[0],this.translationY=-He[1],rt(this,je,Jt).call(this),rt(this,mt,qt).call(this),_t(this,Te,bt),_t(this,Le,Et),this.setDims(bt,Et);const Ct=De?lt/this.scaleFactor/2:0;this.translate(Pt-this.translationX-Ct,kt-this.translationY-Ct)},Ye=new WeakSet,Jn=function(){const{style:De}=this.div;Re(this,he)>=1?(De.minHeight=`${me}px`,De.minWidth=`${Math.round(Re(this,he)*me)}px`):(De.minWidth=`${me}px`,De.minHeight=`${Math.round(me/Re(this,he))}px`)},Je(vt,Fe),Lt(vt,"_defaultColor",null),Lt(vt,"_defaultOpacity",1),Lt(vt,"_defaultThickness",1),Lt(vt,"_l10nPromise"),Lt(vt,"_type","ink");let pe=vt;ee.InkEditor=pe},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.fitCurve=void 0;const re=ne(31);ee.fitCurve=re},te=>{function ee(ce,fe,ye){if(!Array.isArray(ce))throw new TypeError("First argument should be an array");if(ce.forEach(Te=>{if(!Array.isArray(Te)||Te.some(Le=>typeof Le!="number")||Te.length!==ce[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}),ce=ce.filter((Te,Le)=>Le===0||!Te.every((Ne,Me)=>Ne===ce[Le-1][Me])),ce.length<2)return[];const ve=ce.length,Pe=de(ce[1],ce[0]),we=de(ce[ve-2],ce[ve-1]);return ne(ce,Pe,we,fe,ye)}function ne(ce,fe,ye,ve,Pe){var Te,Le,Ne,Me,ae,ge,$e,_e,ke,We,ze,Qe,ct;if(ce.length===2)return Qe=Ae.vectorLen(Ae.subtract(ce[0],ce[1]))/3,Te=[ce[0],Ae.addArrays(ce[0],Ae.mulItems(fe,Qe)),Ae.addArrays(ce[1],Ae.mulItems(ye,Qe)),ce[1]],[Te];if(Le=me(ce),[Te,Me,ge]=re(ce,Le,Le,fe,ye,Pe),Me===0||Me<ve)return[Te];if(Me<ve*ve)for(Ne=Le,ae=Me,$e=ge,ct=0;ct<20;ct++){if(Ne=ie(Te,ce,Ne),[Te,Me,ge]=re(ce,Le,Ne,fe,ye,Pe),Me<ve)return[Te];if(ge===$e){let it=Me/ae;if(it>.9999&&it<1.0001)break}ae=Me,$e=ge}return ze=[],_e=Ae.subtract(ce[ge-1],ce[ge+1]),_e.every(it=>it===0)&&(_e=Ae.subtract(ce[ge-1],ce[ge]),[_e[0],_e[1]]=[-_e[1],_e[0]]),ke=Ae.normalize(_e),We=Ae.mulItems(ke,-1),ze=ze.concat(ne(ce.slice(0,ge+1),fe,ke,ve,Pe)),ze=ze.concat(ne(ce.slice(ge),We,ye,ve,Pe)),ze}function re(ce,fe,ye,ve,Pe,we){var Te,Le,Ne;return Te=se(ce,ye,ve,Pe),[Le,Ne]=pe(ce,Te,fe),we&&we({bez:Te,points:ce,params:fe,maxErr:Le,maxPoint:Ne}),[Te,Le,Ne]}function se(ce,fe,ye,ve){var Pe,we,Te,Le,Ne,Me,ae,ge,$e,_e,ke,We,ze,Qe,ct,it,ht,at=ce[0],gt=ce[ce.length-1];for(Pe=[at,null,null,gt],we=Ae.zeros_Xx2x2(fe.length),ze=0,Qe=fe.length;ze<Qe;ze++)it=fe[ze],ht=1-it,Te=we[ze],Te[0]=Ae.mulItems(ye,3*it*(ht*ht)),Te[1]=Ae.mulItems(ve,3*ht*(it*it));for(Le=[[0,0],[0,0]],Ne=[0,0],ze=0,Qe=ce.length;ze<Qe;ze++)it=fe[ze],Te=we[ze],Le[0][0]+=Ae.dot(Te[0],Te[0]),Le[0][1]+=Ae.dot(Te[0],Te[1]),Le[1][0]+=Ae.dot(Te[0],Te[1]),Le[1][1]+=Ae.dot(Te[1],Te[1]),ct=Ae.subtract(ce[ze],Se.q([at,at,gt,gt],it)),Ne[0]+=Ae.dot(Te[0],ct),Ne[1]+=Ae.dot(Te[1],ct);return Me=Le[0][0]*Le[1][1]-Le[1][0]*Le[0][1],ae=Le[0][0]*Ne[1]-Le[1][0]*Ne[0],ge=Ne[0]*Le[1][1]-Ne[1]*Le[0][1],$e=Me===0?0:ge/Me,_e=Me===0?0:ae/Me,We=Ae.vectorLen(Ae.subtract(at,gt)),ke=1e-6*We,$e<ke||_e<ke?(Pe[1]=Ae.addArrays(at,Ae.mulItems(ye,We/3)),Pe[2]=Ae.addArrays(gt,Ae.mulItems(ve,We/3))):(Pe[1]=Ae.addArrays(at,Ae.mulItems(ye,$e)),Pe[2]=Ae.addArrays(gt,Ae.mulItems(ve,_e))),Pe}function ie(ce,fe,ye){return ye.map((ve,Pe)=>oe(ce,fe[Pe],ve))}function oe(ce,fe,ye){var ve=Ae.subtract(Se.q(ce,ye),fe),Pe=Se.qprime(ce,ye),we=Ae.mulMatrix(ve,Pe),Te=Ae.sum(Ae.squareItems(Pe))+2*Ae.mulMatrix(ve,Se.qprimeprime(ce,ye));return Te===0?ye:ye-we/Te}function me(ce){var fe=[],ye,ve,Pe;return ce.forEach((we,Te)=>{ye=Te?ve+Ae.vectorLen(Ae.subtract(we,Pe)):0,fe.push(ye),ve=ye,Pe=we}),fe=fe.map(we=>we/ve),fe}function pe(ce,fe,ye){var ve,Pe,we,Te,Le,Ne,Me,ae;Pe=0,we=Math.floor(ce.length/2);const ge=he(fe,10);for(Le=0,Ne=ce.length;Le<Ne;Le++)Me=ce[Le],ae=ue(fe,ye[Le],ge,10),Te=Ae.subtract(Se.q(fe,ae),Me),ve=Te[0]*Te[0]+Te[1]*Te[1],ve>Pe&&(Pe=ve,we=Le);return[Pe,we]}var he=function(ce,fe){for(var ye,ve=[0],Pe=ce[0],we=0,Te=1;Te<=fe;Te++)ye=Se.q(ce,Te/fe),we+=Ae.vectorLen(Ae.subtract(ye,Pe)),ve.push(we),Pe=ye;return ve=ve.map(Le=>Le/we),ve};function ue(ce,fe,ye,ve){if(fe<0)return 0;if(fe>1)return 1;for(var Pe,we,Te,Le,Ne,Me=1;Me<=ve;Me++)if(fe<=ye[Me]){Le=(Me-1)/ve,Te=Me/ve,we=ye[Me-1],Pe=ye[Me],Ne=(fe-we)/(Pe-we)*(Te-Le)+Le;break}return Ne}function de(ce,fe){return Ae.normalize(Ae.subtract(ce,fe))}class Ae{static zeros_Xx2x2(fe){for(var ye=[];fe--;)ye.push([0,0]);return ye}static mulItems(fe,ye){return fe.map(ve=>ve*ye)}static mulMatrix(fe,ye){return fe.reduce((ve,Pe,we)=>ve+Pe*ye[we],0)}static subtract(fe,ye){return fe.map((ve,Pe)=>ve-ye[Pe])}static addArrays(fe,ye){return fe.map((ve,Pe)=>ve+ye[Pe])}static addItems(fe,ye){return fe.map(ve=>ve+ye)}static sum(fe){return fe.reduce((ye,ve)=>ye+ve)}static dot(fe,ye){return Ae.mulMatrix(fe,ye)}static vectorLen(fe){return Math.hypot(...fe)}static divItems(fe,ye){return fe.map(ve=>ve/ye)}static squareItems(fe){return fe.map(ye=>ye*ye)}static normalize(fe){return this.divItems(fe,this.vectorLen(fe))}}class Se{static q(fe,ye){var ve=1-ye,Pe=Ae.mulItems(fe[0],ve*ve*ve),we=Ae.mulItems(fe[1],3*ve*ve*ye),Te=Ae.mulItems(fe[2],3*ve*ye*ye),Le=Ae.mulItems(fe[3],ye*ye*ye);return Ae.addArrays(Ae.addArrays(Pe,we),Ae.addArrays(Te,Le))}static qprime(fe,ye){var ve=1-ye,Pe=Ae.mulItems(Ae.subtract(fe[1],fe[0]),3*ve*ve),we=Ae.mulItems(Ae.subtract(fe[2],fe[1]),6*ve*ye),Te=Ae.mulItems(Ae.subtract(fe[3],fe[2]),3*ye*ye);return Ae.addArrays(Ae.addArrays(Pe,we),Te)}static qprimeprime(fe,ye){return Ae.addArrays(Ae.mulItems(Ae.addArrays(Ae.subtract(fe[2],Ae.mulItems(fe[1],2)),fe[0]),6*(1-ye)),Ae.mulItems(Ae.addArrays(Ae.subtract(fe[3],Ae.mulItems(fe[2],2)),fe[1]),6*ye))}}te.exports=ee,te.exports.fitCubic=ne,te.exports.createTangent=de},(te,ee,ne)=>{var mt,Kt,Ee,Cr,Ge,Qn,Ke,er;Object.defineProperty(ee,"__esModule",{value:!0}),ee.AnnotationLayer=void 0;var re=ne(1),se=ne(6),ie=ne(3),oe=ne(33),me=ne(34);const pe=1e3,he=9,ue=new WeakSet;function de(Be){return{width:Be[2]-Be[0],height:Be[3]-Be[1]}}class Ae{static create(le){switch(le.data.annotationType){case re.AnnotationType.LINK:return new ce(le);case re.AnnotationType.TEXT:return new fe(le);case re.AnnotationType.WIDGET:switch(le.data.fieldType){case"Tx":return new ve(le);case"Btn":return le.data.radioButton?new we(le):le.data.checkBox?new Pe(le):new Te(le);case"Ch":return new Le(le)}return new ye(le);case re.AnnotationType.POPUP:return new Ne(le);case re.AnnotationType.FREETEXT:return new ae(le);case re.AnnotationType.LINE:return new ge(le);case re.AnnotationType.SQUARE:return new $e(le);case re.AnnotationType.CIRCLE:return new _e(le);case re.AnnotationType.POLYLINE:return new ke(le);case re.AnnotationType.CARET:return new ze(le);case re.AnnotationType.INK:return new Qe(le);case re.AnnotationType.POLYGON:return new We(le);case re.AnnotationType.HIGHLIGHT:return new ct(le);case re.AnnotationType.UNDERLINE:return new it(le);case re.AnnotationType.SQUIGGLY:return new ht(le);case re.AnnotationType.STRIKEOUT:return new at(le);case re.AnnotationType.STAMP:return new gt(le);case re.AnnotationType.FILEATTACHMENT:return new dt(le);default:return new Se(le)}}}class Se{constructor(le,{isRenderable:be=!1,ignoreBorder:Ce=!1,createQuadrilaterals:Fe=!1}={}){this.isRenderable=be,this.data=le.data,this.layer=le.layer,this.page=le.page,this.viewport=le.viewport,this.linkService=le.linkService,this.downloadManager=le.downloadManager,this.imageResourcesPath=le.imageResourcesPath,this.renderForms=le.renderForms,this.svgFactory=le.svgFactory,this.annotationStorage=le.annotationStorage,this.enableScripting=le.enableScripting,this.hasJSActions=le.hasJSActions,this._fieldObjects=le.fieldObjects,be&&(this.container=this._createContainer(Ce)),Fe&&(this.quadrilaterals=this._createQuadrilaterals(Ce))}_createContainer(le=!1){const{data:be,page:Ce,viewport:Fe}=this,Ie=document.createElement("section");Ie.setAttribute("data-annotation-id",be.id),be.noRotate&&Ie.classList.add("norotate");const{pageWidth:Xe,pageHeight:tt,pageX:Ze,pageY:st}=Fe.rawDims,{width:ot,height:et}=de(be.rect),nt=re.Util.normalizeRect([be.rect[0],Ce.view[3]-be.rect[1]+Ce.view[1],be.rect[2],Ce.view[3]-be.rect[3]+Ce.view[1]]);if(!le&&be.borderStyle.width>0){Ie.style.borderWidth=`${be.borderStyle.width}px`;const pt=be.borderStyle.horizontalCornerRadius,wt=be.borderStyle.verticalCornerRadius;if(pt>0||wt>0){const Tt=`calc(${pt}px * var(--scale-factor)) / calc(${wt}px * var(--scale-factor))`;Ie.style.borderRadius=Tt}else if(this instanceof we){const Tt=`calc(${ot}px * var(--scale-factor)) / calc(${et}px * var(--scale-factor))`;Ie.style.borderRadius=Tt}switch(be.borderStyle.style){case re.AnnotationBorderStyleType.SOLID:Ie.style.borderStyle="solid";break;case re.AnnotationBorderStyleType.DASHED:Ie.style.borderStyle="dashed";break;case re.AnnotationBorderStyleType.BEVELED:(0,re.warn)("Unimplemented border style: beveled");break;case re.AnnotationBorderStyleType.INSET:(0,re.warn)("Unimplemented border style: inset");break;case re.AnnotationBorderStyleType.UNDERLINE:Ie.style.borderBottomStyle="solid";break}const At=be.borderColor||null;At?Ie.style.borderColor=re.Util.makeHexColor(At[0]|0,At[1]|0,At[2]|0):Ie.style.borderWidth=0}Ie.style.left=`${100*(nt[0]-Ze)/Xe}%`,Ie.style.top=`${100*(nt[1]-st)/tt}%`;const{rotation:ft}=be;return be.hasOwnCanvas||ft===0?(Ie.style.width=`${100*ot/Xe}%`,Ie.style.height=`${100*et/tt}%`):this.setRotation(ft,Ie),Ie}setRotation(le,be=this.container){const{pageWidth:Ce,pageHeight:Fe}=this.viewport.rawDims,{width:Ie,height:Xe}=de(this.data.rect);let tt,Ze;le%180===0?(tt=100*Ie/Ce,Ze=100*Xe/Fe):(tt=100*Xe/Ce,Ze=100*Ie/Fe),be.style.width=`${tt}%`,be.style.height=`${Ze}%`,be.setAttribute("data-main-rotation",(360-le)%360)}get _commonActions(){const le=(be,Ce,Fe)=>{const Ie=Fe.detail[be];Fe.target.style[Ce]=oe.ColorConverters[`${Ie[0]}_HTML`](Ie.slice(1))};return(0,re.shadow)(this,"_commonActions",{display:be=>{const Ce=be.detail.display%2===1;this.container.style.visibility=Ce?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:Ce,print:be.detail.display===0||be.detail.display===3})},print:be=>{this.annotationStorage.setValue(this.data.id,{print:be.detail.print})},hidden:be=>{this.container.style.visibility=be.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:be.detail.hidden})},focus:be=>{setTimeout(()=>be.target.focus({preventScroll:!1}),0)},userName:be=>{be.target.title=be.detail.userName},readonly:be=>{be.detail.readonly?be.target.setAttribute("readonly",""):be.target.removeAttribute("readonly")},required:be=>{this._setRequired(be.target,be.detail.required)},bgColor:be=>{le("bgColor","backgroundColor",be)},fillColor:be=>{le("fillColor","backgroundColor",be)},fgColor:be=>{le("fgColor","color",be)},textColor:be=>{le("textColor","color",be)},borderColor:be=>{le("borderColor","borderColor",be)},strokeColor:be=>{le("strokeColor","borderColor",be)},rotation:be=>{const Ce=be.detail.rotation;this.setRotation(Ce),this.annotationStorage.setValue(this.data.id,{rotation:Ce})}})}_dispatchEventFromSandbox(le,be){const Ce=this._commonActions;for(const Fe of Object.keys(be.detail)){const Ie=le[Fe]||Ce[Fe];Ie==null||Ie(be)}}_setDefaultPropertiesFromJS(le){if(!this.enableScripting)return;const be=this.annotationStorage.getRawValue(this.data.id);if(!be)return;const Ce=this._commonActions;for(const[Fe,Ie]of Object.entries(be)){const Xe=Ce[Fe];if(Xe){const tt={detail:{[Fe]:Ie},target:le};Xe(tt),delete be[Fe]}}}_createQuadrilaterals(le=!1){if(!this.data.quadPoints)return null;const be=[],Ce=this.data.rect;for(const Fe of this.data.quadPoints)this.data.rect=[Fe[2].x,Fe[2].y,Fe[1].x,Fe[1].y],be.push(this._createContainer(le));return this.data.rect=Ce,be}_createPopup(le,be){let Ce=this.container;this.quadrilaterals&&(le||(le=this.quadrilaterals),Ce=this.quadrilaterals[0]),le||(le=document.createElement("div"),le.classList.add("popupTriggerArea"),Ce.append(le));const Ie=new Me({container:Ce,trigger:le,color:be.color,titleObj:be.titleObj,modificationDate:be.modificationDate,contentsObj:be.contentsObj,richText:be.richText,hideWrapper:!0}).render();Ie.style.left="100%",Ce.append(Ie)}_renderQuadrilaterals(le){for(const be of this.quadrilaterals)be.classList.add(le);return this.quadrilaterals}render(){(0,re.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(le,be=null){const Ce=[];if(this._fieldObjects){const Fe=this._fieldObjects[le];if(Fe)for(const{page:Ie,id:Xe,exportValues:tt}of Fe){if(Ie===-1||Xe===be)continue;const Ze=typeof tt=="string"?tt:null,st=document.querySelector(`[data-element-id="${Xe}"]`);if(st&&!ue.has(st)){(0,re.warn)(`_getElementsByName - element not allowed: ${Xe}`);continue}Ce.push({id:Xe,exportValue:Ze,domElement:st})}return Ce}for(const Fe of document.getElementsByName(le)){const{exportValue:Ie}=Fe,Xe=Fe.getAttribute("data-element-id");Xe!==be&&ue.has(Fe)&&Ce.push({id:Xe,exportValue:Ie,domElement:Fe})}return Ce}}class ce extends Se{constructor(be,Ce=null){super(be,{isRenderable:!0,ignoreBorder:!!(Ce!=null&&Ce.ignoreBorder),createQuadrilaterals:!0});Je(this,mt);Je(this,Ee);this.isTooltipOnly=be.data.isTooltipOnly}render(){const{data:be,linkService:Ce}=this,Fe=document.createElement("a");Fe.setAttribute("data-element-id",be.id);let Ie=!1;return be.url?(Ce.addLinkAttributes(Fe,be.url,be.newWindow),Ie=!0):be.action?(this._bindNamedAction(Fe,be.action),Ie=!0):be.attachment?(this._bindAttachment(Fe,be.attachment),Ie=!0):be.setOCGState?(rt(this,Ee,Cr).call(this,Fe,be.setOCGState),Ie=!0):be.dest?(this._bindLink(Fe,be.dest),Ie=!0):(be.actions&&(be.actions.Action||be.actions["Mouse Up"]||be.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(Fe,be),Ie=!0),be.resetForm?(this._bindResetFormAction(Fe,be.resetForm),Ie=!0):this.isTooltipOnly&&!Ie&&(this._bindLink(Fe,""),Ie=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map((Xe,tt)=>{const Ze=tt===0?Fe:Fe.cloneNode();return Xe.append(Ze),Xe}):(this.container.classList.add("linkAnnotation"),Ie&&this.container.append(Fe),this.container)}_bindLink(be,Ce){be.href=this.linkService.getDestinationHash(Ce),be.onclick=()=>(Ce&&this.linkService.goToDestination(Ce),!1),(Ce||Ce==="")&&rt(this,mt,Kt).call(this)}_bindNamedAction(be,Ce){be.href=this.linkService.getAnchorUrl(""),be.onclick=()=>(this.linkService.executeNamedAction(Ce),!1),rt(this,mt,Kt).call(this)}_bindAttachment(be,Ce){be.href=this.linkService.getAnchorUrl(""),be.onclick=()=>{var Fe;return(Fe=this.downloadManager)==null||Fe.openOrDownloadData(this.container,Ce.content,Ce.filename),!1},rt(this,mt,Kt).call(this)}_bindJSAction(be,Ce){be.href=this.linkService.getAnchorUrl("");const Fe=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const Ie of Object.keys(Ce.actions)){const Xe=Fe.get(Ie);Xe&&(be[Xe]=()=>{var tt;return(tt=this.linkService.eventBus)==null||tt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Ce.id,name:Ie}}),!1})}be.onclick||(be.onclick=()=>!1),rt(this,mt,Kt).call(this)}_bindResetFormAction(be,Ce){const Fe=be.onclick;if(Fe||(be.href=this.linkService.getAnchorUrl("")),rt(this,mt,Kt).call(this),!this._fieldObjects){(0,re.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),Fe||(be.onclick=()=>!1);return}be.onclick=()=>{var et;Fe==null||Fe();const{fields:Ie,refs:Xe,include:tt}=Ce,Ze=[];if(Ie.length!==0||Xe.length!==0){const nt=new Set(Xe);for(const ft of Ie){const pt=this._fieldObjects[ft]||[];for(const{id:wt}of pt)nt.add(wt)}for(const ft of Object.values(this._fieldObjects))for(const pt of ft)nt.has(pt.id)===tt&&Ze.push(pt)}else for(const nt of Object.values(this._fieldObjects))Ze.push(...nt);const st=this.annotationStorage,ot=[];for(const nt of Ze){const{id:ft}=nt;switch(ot.push(ft),nt.type){case"text":{const wt=nt.defaultValue||"";st.setValue(ft,{value:wt});break}case"checkbox":case"radiobutton":{const wt=nt.defaultValue===nt.exportValues;st.setValue(ft,{value:wt});break}case"combobox":case"listbox":{const wt=nt.defaultValue||"";st.setValue(ft,{value:wt});break}default:continue}const pt=document.querySelector(`[data-element-id="${ft}"]`);if(pt){if(!ue.has(pt)){(0,re.warn)(`_bindResetFormAction - element not allowed: ${ft}`);continue}}else continue;pt.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((et=this.linkService.eventBus)==null||et.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:ot,name:"ResetForm"}})),!1}}}mt=new WeakSet,Kt=function(){this.container.setAttribute("data-internal-link","")},Ee=new WeakSet,Cr=function(be,Ce){be.href=this.linkService.getAnchorUrl(""),be.onclick=()=>(this.linkService.executeSetOCGState(Ce),!1),rt(this,mt,Kt).call(this)};class fe extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be})}render(){this.container.classList.add("textAnnotation");const le=document.createElement("img");return le.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",le.alt="[{{type}} Annotation]",le.dataset.l10nId="text_annotation_type",le.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(le,this.data),this.container.append(le),this.container}}class ye extends Se{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(le){var be;this.data.hasOwnCanvas&&(((be=le.previousSibling)==null?void 0:be.nodeName)==="CANVAS"&&(le.previousSibling.hidden=!0),le.hidden=!1)}_getKeyModifier(le){const{isWin:be,isMac:Ce}=re.FeatureTest.platform;return be&&le.ctrlKey||Ce&&le.metaKey}_setEventListener(le,be,Ce,Fe){be.includes("mouse")?le.addEventListener(be,Ie=>{var Xe;(Xe=this.linkService.eventBus)==null||Xe.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:Ce,value:Fe(Ie),shift:Ie.shiftKey,modifier:this._getKeyModifier(Ie)}})}):le.addEventListener(be,Ie=>{var Xe;(Xe=this.linkService.eventBus)==null||Xe.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:Ce,value:Fe(Ie)}})})}_setEventListeners(le,be,Ce){var Fe;for(const[Ie,Xe]of be)(Xe==="Action"||(Fe=this.data.actions)!=null&&Fe[Xe])&&this._setEventListener(le,Ie,Xe,Ce)}_setBackgroundColor(le){const be=this.data.backgroundColor||null;le.style.backgroundColor=be===null?"transparent":re.Util.makeHexColor(be[0],be[1],be[2])}_setTextStyle(le){const be=["left","center","right"],{fontColor:Ce}=this.data.defaultAppearanceData,Fe=this.data.defaultAppearanceData.fontSize||he,Ie=le.style;let Xe;const tt=2,Ze=st=>Math.round(10*st)/10;if(this.data.multiLine){const st=Math.abs(this.data.rect[3]-this.data.rect[1]-tt),ot=Math.round(st/(re.LINE_FACTOR*Fe))||1,et=st/ot;Xe=Math.min(Fe,Ze(et/re.LINE_FACTOR))}else{const st=Math.abs(this.data.rect[3]-this.data.rect[1]-tt);Xe=Math.min(Fe,Ze(st/re.LINE_FACTOR))}Ie.fontSize=`calc(${Xe}px * var(--scale-factor))`,Ie.color=re.Util.makeHexColor(Ce[0],Ce[1],Ce[2]),this.data.textAlignment!==null&&(Ie.textAlign=be[this.data.textAlignment])}_setRequired(le,be){be?le.setAttribute("required",!0):le.removeAttribute("required"),le.setAttribute("aria-required",be)}}class ve extends ye{constructor(le){const be=le.renderForms||!le.data.hasAppearance&&!!le.data.fieldValue;super(le,{isRenderable:be})}setPropertyOnSiblings(le,be,Ce,Fe){const Ie=this.annotationStorage;for(const Xe of this._getElementsByName(le.name,le.id))Xe.domElement&&(Xe.domElement[be]=Ce),Ie.setValue(Xe.id,{[Fe]:Ce})}render(){var Fe;const le=this.annotationStorage,be=this.data.id;this.container.classList.add("textWidgetAnnotation");let Ce=null;if(this.renderForms){const Ie=le.getValue(be,{value:this.data.fieldValue});let Xe=Ie.formattedValue||Ie.value||"";const tt=le.getValue(be,{charLimit:this.data.maxLen}).charLimit;tt&&Xe.length>tt&&(Xe=Xe.slice(0,tt));const Ze={userValue:Xe,formattedValue:null,lastCommittedValue:null,commitKey:1};this.data.multiLine?(Ce=document.createElement("textarea"),Ce.textContent=Xe,this.data.doNotScroll&&(Ce.style.overflowY="hidden")):(Ce=document.createElement("input"),Ce.type="text",Ce.setAttribute("value",Xe),this.data.doNotScroll&&(Ce.style.overflowX="hidden")),this.data.hasOwnCanvas&&(Ce.hidden=!0),ue.add(Ce),Ce.setAttribute("data-element-id",be),Ce.disabled=this.data.readOnly,Ce.name=this.data.fieldName,Ce.tabIndex=pe,this._setRequired(Ce,this.data.required),tt&&(Ce.maxLength=tt),Ce.addEventListener("input",ot=>{le.setValue(be,{value:ot.target.value}),this.setPropertyOnSiblings(Ce,"value",ot.target.value,"value")}),Ce.addEventListener("resetform",ot=>{const et=this.data.defaultFieldValue??"";Ce.value=Ze.userValue=et,Ze.formattedValue=null});let st=ot=>{const{formattedValue:et}=Ze;et!=null&&(ot.target.value=et),ot.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){Ce.addEventListener("focus",et=>{const{target:nt}=et;Ze.userValue&&(nt.value=Ze.userValue),Ze.lastCommittedValue=nt.value,Ze.commitKey=1}),Ce.addEventListener("updatefromsandbox",et=>{this.showElementAndHideCanvas(et.target);const nt={value(ft){Ze.userValue=ft.detail.value??"",le.setValue(be,{value:Ze.userValue.toString()}),ft.target.value=Ze.userValue},formattedValue(ft){const{formattedValue:pt}=ft.detail;Ze.formattedValue=pt,pt!=null&&ft.target!==document.activeElement&&(ft.target.value=pt),le.setValue(be,{formattedValue:pt})},selRange(ft){ft.target.setSelectionRange(...ft.detail.selRange)},charLimit:ft=>{var Tt;const{charLimit:pt}=ft.detail,{target:wt}=ft;if(pt===0){wt.removeAttribute("maxLength");return}wt.setAttribute("maxLength",pt);let At=Ze.userValue;!At||At.length<=pt||(At=At.slice(0,pt),wt.value=Ze.userValue=At,le.setValue(be,{value:At}),(Tt=this.linkService.eventBus)==null||Tt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:be,name:"Keystroke",value:At,willCommit:!0,commitKey:1,selStart:wt.selectionStart,selEnd:wt.selectionEnd}}))}};this._dispatchEventFromSandbox(nt,et)}),Ce.addEventListener("keydown",et=>{var pt;Ze.commitKey=1;let nt=-1;if(et.key==="Escape"?nt=0:et.key==="Enter"&&!this.data.multiLine?nt=2:et.key==="Tab"&&(Ze.commitKey=3),nt===-1)return;const{value:ft}=et.target;Ze.lastCommittedValue!==ft&&(Ze.lastCommittedValue=ft,Ze.userValue=ft,(pt=this.linkService.eventBus)==null||pt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:be,name:"Keystroke",value:ft,willCommit:!0,commitKey:nt,selStart:et.target.selectionStart,selEnd:et.target.selectionEnd}}))});const ot=st;st=null,Ce.addEventListener("blur",et=>{var ft;if(!et.relatedTarget)return;const{value:nt}=et.target;Ze.userValue=nt,Ze.lastCommittedValue!==nt&&((ft=this.linkService.eventBus)==null||ft.dispatch("dispatcheventinsandbox",{source:this,detail:{id:be,name:"Keystroke",value:nt,willCommit:!0,commitKey:Ze.commitKey,selStart:et.target.selectionStart,selEnd:et.target.selectionEnd}})),ot(et)}),(Fe=this.data.actions)!=null&&Fe.Keystroke&&Ce.addEventListener("beforeinput",et=>{var St;Ze.lastCommittedValue=null;const{data:nt,target:ft}=et,{value:pt,selectionStart:wt,selectionEnd:At}=ft;let Tt=wt,Ye=At;switch(et.inputType){case"deleteWordBackward":{const vt=pt.substring(0,wt).match(/\w*[^\w]*$/);vt&&(Tt-=vt[0].length);break}case"deleteWordForward":{const vt=pt.substring(wt).match(/^[^\w]*\w*/);vt&&(Ye+=vt[0].length);break}case"deleteContentBackward":wt===At&&(Tt-=1);break;case"deleteContentForward":wt===At&&(Ye+=1);break}et.preventDefault(),(St=this.linkService.eventBus)==null||St.dispatch("dispatcheventinsandbox",{source:this,detail:{id:be,name:"Keystroke",value:pt,change:nt||"",willCommit:!1,selStart:Tt,selEnd:Ye}})}),this._setEventListeners(Ce,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],et=>et.target.value)}if(st&&Ce.addEventListener("blur",st),this.data.comb){const et=(this.data.rect[2]-this.data.rect[0])/tt;Ce.classList.add("comb"),Ce.style.letterSpacing=`calc(${et}px * var(--scale-factor) - 1ch)`}}else Ce=document.createElement("div"),Ce.textContent=this.data.fieldValue,Ce.style.verticalAlign="middle",Ce.style.display="table-cell";return this._setTextStyle(Ce),this._setBackgroundColor(Ce),this._setDefaultPropertiesFromJS(Ce),this.container.append(Ce),this.container}}class Pe extends ye{constructor(le){super(le,{isRenderable:le.renderForms})}render(){const le=this.annotationStorage,be=this.data,Ce=be.id;let Fe=le.getValue(Ce,{value:be.exportValue===be.fieldValue}).value;typeof Fe=="string"&&(Fe=Fe!=="Off",le.setValue(Ce,{value:Fe})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const Ie=document.createElement("input");return ue.add(Ie),Ie.setAttribute("data-element-id",Ce),Ie.disabled=be.readOnly,this._setRequired(Ie,this.data.required),Ie.type="checkbox",Ie.name=be.fieldName,Fe&&Ie.setAttribute("checked",!0),Ie.setAttribute("exportValue",be.exportValue),Ie.tabIndex=pe,Ie.addEventListener("change",Xe=>{const{name:tt,checked:Ze}=Xe.target;for(const st of this._getElementsByName(tt,Ce)){const ot=Ze&&st.exportValue===be.exportValue;st.domElement&&(st.domElement.checked=ot),le.setValue(st.id,{value:ot})}le.setValue(Ce,{value:Ze})}),Ie.addEventListener("resetform",Xe=>{const tt=be.defaultFieldValue||"Off";Xe.target.checked=tt===be.exportValue}),this.enableScripting&&this.hasJSActions&&(Ie.addEventListener("updatefromsandbox",Xe=>{const tt={value(Ze){Ze.target.checked=Ze.detail.value!=="Off",le.setValue(Ce,{value:Ze.target.checked})}};this._dispatchEventFromSandbox(tt,Xe)}),this._setEventListeners(Ie,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Xe=>Xe.target.checked)),this._setBackgroundColor(Ie),this._setDefaultPropertiesFromJS(Ie),this.container.append(Ie),this.container}}class we extends ye{constructor(le){super(le,{isRenderable:le.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const le=this.annotationStorage,be=this.data,Ce=be.id;let Fe=le.getValue(Ce,{value:be.fieldValue===be.buttonValue}).value;typeof Fe=="string"&&(Fe=Fe!==be.buttonValue,le.setValue(Ce,{value:Fe}));const Ie=document.createElement("input");if(ue.add(Ie),Ie.setAttribute("data-element-id",Ce),Ie.disabled=be.readOnly,this._setRequired(Ie,this.data.required),Ie.type="radio",Ie.name=be.fieldName,Fe&&Ie.setAttribute("checked",!0),Ie.tabIndex=pe,Ie.addEventListener("change",Xe=>{const{name:tt,checked:Ze}=Xe.target;for(const st of this._getElementsByName(tt,Ce))le.setValue(st.id,{value:!1});le.setValue(Ce,{value:Ze})}),Ie.addEventListener("resetform",Xe=>{const tt=be.defaultFieldValue;Xe.target.checked=tt!=null&&tt===be.buttonValue}),this.enableScripting&&this.hasJSActions){const Xe=be.buttonValue;Ie.addEventListener("updatefromsandbox",tt=>{const Ze={value:st=>{const ot=Xe===st.detail.value;for(const et of this._getElementsByName(st.target.name)){const nt=ot&&et.id===Ce;et.domElement&&(et.domElement.checked=nt),le.setValue(et.id,{value:nt})}}};this._dispatchEventFromSandbox(Ze,tt)}),this._setEventListeners(Ie,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],tt=>tt.target.checked)}return this._setBackgroundColor(Ie),this._setDefaultPropertiesFromJS(Ie),this.container.append(Ie),this.container}}class Te extends ce{constructor(le){super(le,{ignoreBorder:le.data.hasAppearance})}render(){const le=super.render();le.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(le.title=this.data.alternativeText);const be=le.lastChild;return this.enableScripting&&this.hasJSActions&&be&&(this._setDefaultPropertiesFromJS(be),be.addEventListener("updatefromsandbox",Ce=>{this._dispatchEventFromSandbox({},Ce)})),le}}class Le extends ye{constructor(le){super(le,{isRenderable:le.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const le=this.annotationStorage,be=this.data.id,Ce=le.getValue(be,{value:this.data.fieldValue}),Fe=document.createElement("select");ue.add(Fe),Fe.setAttribute("data-element-id",be),Fe.disabled=this.data.readOnly,this._setRequired(Fe,this.data.required),Fe.name=this.data.fieldName,Fe.tabIndex=pe;let Ie=this.data.combo&&this.data.options.length>0;this.data.combo||(Fe.size=this.data.options.length,this.data.multiSelect&&(Fe.multiple=!0)),Fe.addEventListener("resetform",ot=>{const et=this.data.defaultFieldValue;for(const nt of Fe.options)nt.selected=nt.value===et});for(const ot of this.data.options){const et=document.createElement("option");et.textContent=ot.displayValue,et.value=ot.exportValue,Ce.value.includes(ot.exportValue)&&(et.setAttribute("selected",!0),Ie=!1),Fe.append(et)}let Xe=null;if(Ie){const ot=document.createElement("option");ot.value=" ",ot.setAttribute("hidden",!0),ot.setAttribute("selected",!0),Fe.prepend(ot),Xe=()=>{ot.remove(),Fe.removeEventListener("input",Xe),Xe=null},Fe.addEventListener("input",Xe)}const tt=ot=>{const et=ot?"value":"textContent",{options:nt,multiple:ft}=Fe;return ft?Array.prototype.filter.call(nt,pt=>pt.selected).map(pt=>pt[et]):nt.selectedIndex===-1?null:nt[nt.selectedIndex][et]};let Ze=tt(!1);const st=ot=>{const et=ot.target.options;return Array.prototype.map.call(et,nt=>({displayValue:nt.textContent,exportValue:nt.value}))};return this.enableScripting&&this.hasJSActions?(Fe.addEventListener("updatefromsandbox",ot=>{const et={value(nt){Xe==null||Xe();const ft=nt.detail.value,pt=new Set(Array.isArray(ft)?ft:[ft]);for(const wt of Fe.options)wt.selected=pt.has(wt.value);le.setValue(be,{value:tt(!0)}),Ze=tt(!1)},multipleSelection(nt){Fe.multiple=!0},remove(nt){const ft=Fe.options,pt=nt.detail.remove;ft[pt].selected=!1,Fe.remove(pt),ft.length>0&&Array.prototype.findIndex.call(ft,At=>At.selected)===-1&&(ft[0].selected=!0),le.setValue(be,{value:tt(!0),items:st(nt)}),Ze=tt(!1)},clear(nt){for(;Fe.length!==0;)Fe.remove(0);le.setValue(be,{value:null,items:[]}),Ze=tt(!1)},insert(nt){const{index:ft,displayValue:pt,exportValue:wt}=nt.detail.insert,At=Fe.children[ft],Tt=document.createElement("option");Tt.textContent=pt,Tt.value=wt,At?At.before(Tt):Fe.append(Tt),le.setValue(be,{value:tt(!0),items:st(nt)}),Ze=tt(!1)},items(nt){const{items:ft}=nt.detail;for(;Fe.length!==0;)Fe.remove(0);for(const pt of ft){const{displayValue:wt,exportValue:At}=pt,Tt=document.createElement("option");Tt.textContent=wt,Tt.value=At,Fe.append(Tt)}Fe.options.length>0&&(Fe.options[0].selected=!0),le.setValue(be,{value:tt(!0),items:st(nt)}),Ze=tt(!1)},indices(nt){const ft=new Set(nt.detail.indices);for(const pt of nt.target.options)pt.selected=ft.has(pt.index);le.setValue(be,{value:tt(!0)}),Ze=tt(!1)},editable(nt){nt.target.disabled=!nt.detail.editable}};this._dispatchEventFromSandbox(et,ot)}),Fe.addEventListener("input",ot=>{var nt;const et=tt(!0);le.setValue(be,{value:et}),ot.preventDefault(),(nt=this.linkService.eventBus)==null||nt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:be,name:"Keystroke",value:Ze,changeEx:et,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(Fe,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],ot=>ot.target.value)):Fe.addEventListener("input",function(ot){le.setValue(be,{value:tt(!0)})}),this.data.combo&&this._setTextStyle(Fe),this._setBackgroundColor(Fe),this._setDefaultPropertiesFromJS(Fe),this.container.append(Fe),this.container}}const Oe=class Oe extends Se{constructor(le){var Fe,Ie,Xe;const{data:be}=le,Ce=!Oe.IGNORE_TYPES.has(be.parentType)&&!!((Fe=be.titleObj)!=null&&Fe.str||(Ie=be.contentsObj)!=null&&Ie.str||(Xe=be.richText)!=null&&Xe.str);super(le,{isRenderable:Ce})}render(){this.container.classList.add("popupAnnotation");const le=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(le.length===0)return this.container;const be=new Me({container:this.container,trigger:Array.from(le),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),Ce=this.page,Fe=re.Util.normalizeRect([this.data.parentRect[0],Ce.view[3]-this.data.parentRect[1]+Ce.view[1],this.data.parentRect[2],Ce.view[3]-this.data.parentRect[3]+Ce.view[1]]),Ie=Fe[0]+this.data.parentRect[2]-this.data.parentRect[0],Xe=Fe[1],{pageWidth:tt,pageHeight:Ze,pageX:st,pageY:ot}=this.viewport.rawDims;return this.container.style.left=`${100*(Ie-st)/tt}%`,this.container.style.top=`${100*(Xe-ot)/Ze}%`,this.container.append(be.render()),this.container}};Lt(Oe,"IGNORE_TYPES",new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]));let Ne=Oe;class Me{constructor(le){this.container=le.container,this.trigger=le.trigger,this.color=le.color,this.titleObj=le.titleObj,this.modificationDate=le.modificationDate,this.contentsObj=le.contentsObj,this.richText=le.richText,this.hideWrapper=le.hideWrapper||!1,this.pinned=!1}render(){var tt,Ze;const be=document.createElement("div");be.classList.add("popupWrapper"),this.hideElement=this.hideWrapper?be:this.container,this.hideElement.hidden=!0;const Ce=document.createElement("div");Ce.classList.add("popup");const Fe=this.color;if(Fe){const st=.7*(255-Fe[0])+Fe[0],ot=.7*(255-Fe[1])+Fe[1],et=.7*(255-Fe[2])+Fe[2];Ce.style.backgroundColor=re.Util.makeHexColor(st|0,ot|0,et|0)}const Ie=document.createElement("h1");Ie.dir=this.titleObj.dir,Ie.textContent=this.titleObj.str,Ce.append(Ie);const Xe=se.PDFDateString.toDateObject(this.modificationDate);if(Xe){const st=document.createElement("span");st.classList.add("popupDate"),st.textContent="{{date}}, {{time}}",st.dataset.l10nId="annotation_date_string",st.dataset.l10nArgs=JSON.stringify({date:Xe.toLocaleDateString(),time:Xe.toLocaleTimeString()}),Ce.append(st)}if((tt=this.richText)!=null&&tt.str&&(!((Ze=this.contentsObj)!=null&&Ze.str)||this.contentsObj.str===this.richText.str))me.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:Ce}),Ce.lastChild.classList.add("richText","popupContent");else{const st=this._formatContents(this.contentsObj);Ce.append(st)}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const st of this.trigger)st.addEventListener("click",this._toggle.bind(this)),st.addEventListener("mouseover",this._show.bind(this,!1)),st.addEventListener("mouseout",this._hide.bind(this,!1));return Ce.addEventListener("click",this._hide.bind(this,!0)),be.append(Ce),be}_formatContents({str:le,dir:be}){const Ce=document.createElement("p");Ce.classList.add("popupContent"),Ce.dir=be;const Fe=le.split(/(?:\r\n?|\n)/);for(let Ie=0,Xe=Fe.length;Ie<Xe;++Ie){const tt=Fe[Ie];Ce.append(document.createTextNode(tt)),Ie<Xe-1&&Ce.append(document.createElement("br"))}return Ce}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(le=!1){le&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3)}_hide(le=!0){le&&(this.pinned=!1),!this.hideElement.hidden&&!this.pinned&&(this.hideElement.hidden=!0,this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3)}}class ae extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0}),this.textContent=le.data.textContent}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const le=document.createElement("div");le.classList.add("annotationTextContent"),le.setAttribute("role","comment");for(const be of this.textContent){const Ce=document.createElement("span");Ce.textContent=be,le.append(Ce)}this.container.append(le)}return this.data.hasPopup||this._createPopup(null,this.data),this.container}}class ge extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const le=this.data,{width:be,height:Ce}=de(le.rect),Fe=this.svgFactory.create(be,Ce,!0),Ie=this.svgFactory.createElement("svg:line");return Ie.setAttribute("x1",le.rect[2]-le.lineCoordinates[0]),Ie.setAttribute("y1",le.rect[3]-le.lineCoordinates[1]),Ie.setAttribute("x2",le.rect[2]-le.lineCoordinates[2]),Ie.setAttribute("y2",le.rect[3]-le.lineCoordinates[3]),Ie.setAttribute("stroke-width",le.borderStyle.width||1),Ie.setAttribute("stroke","transparent"),Ie.setAttribute("fill","transparent"),Fe.append(Ie),this.container.append(Fe),this._createPopup(Ie,le),this.container}}class $e extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const le=this.data,{width:be,height:Ce}=de(le.rect),Fe=this.svgFactory.create(be,Ce,!0),Ie=le.borderStyle.width,Xe=this.svgFactory.createElement("svg:rect");return Xe.setAttribute("x",Ie/2),Xe.setAttribute("y",Ie/2),Xe.setAttribute("width",be-Ie),Xe.setAttribute("height",Ce-Ie),Xe.setAttribute("stroke-width",Ie||1),Xe.setAttribute("stroke","transparent"),Xe.setAttribute("fill","transparent"),Fe.append(Xe),this.container.append(Fe),this._createPopup(Xe,le),this.container}}class _e extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const le=this.data,{width:be,height:Ce}=de(le.rect),Fe=this.svgFactory.create(be,Ce,!0),Ie=le.borderStyle.width,Xe=this.svgFactory.createElement("svg:ellipse");return Xe.setAttribute("cx",be/2),Xe.setAttribute("cy",Ce/2),Xe.setAttribute("rx",be/2-Ie/2),Xe.setAttribute("ry",Ce/2-Ie/2),Xe.setAttribute("stroke-width",Ie||1),Xe.setAttribute("stroke","transparent"),Xe.setAttribute("fill","transparent"),Fe.append(Xe),this.container.append(Fe),this._createPopup(Xe,le),this.container}}class ke extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const le=this.data,{width:be,height:Ce}=de(le.rect),Fe=this.svgFactory.create(be,Ce,!0);let Ie=[];for(const tt of le.vertices){const Ze=tt.x-le.rect[0],st=le.rect[3]-tt.y;Ie.push(Ze+","+st)}Ie=Ie.join(" ");const Xe=this.svgFactory.createElement(this.svgElementName);return Xe.setAttribute("points",Ie),Xe.setAttribute("stroke-width",le.borderStyle.width||1),Xe.setAttribute("stroke","transparent"),Xe.setAttribute("fill","transparent"),Fe.append(Xe),this.container.append(Fe),this._createPopup(Xe,le),this.container}}class We extends ke{constructor(le){super(le),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class ze extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class Qe extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const le=this.data,{width:be,height:Ce}=de(le.rect),Fe=this.svgFactory.create(be,Ce,!0);for(const Ie of le.inkLists){let Xe=[];for(const Ze of Ie){const st=Ze.x-le.rect[0],ot=le.rect[3]-Ze.y;Xe.push(`${st},${ot}`)}Xe=Xe.join(" ");const tt=this.svgFactory.createElement(this.svgElementName);tt.setAttribute("points",Xe),tt.setAttribute("stroke-width",le.borderStyle.width||1),tt.setAttribute("stroke","transparent"),tt.setAttribute("fill","transparent"),this._createPopup(tt,le),Fe.append(tt)}return this.container.append(Fe),this.container}}class ct extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.classList.add("highlightAnnotation"),this.container)}}class it extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.classList.add("underlineAnnotation"),this.container)}}class ht extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.classList.add("squigglyAnnotation"),this.container)}}class at extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.classList.add("strikeoutAnnotation"),this.container)}}class gt extends Se{constructor(le){var Ce,Fe,Ie;const be=!!(le.data.hasPopup||(Ce=le.data.titleObj)!=null&&Ce.str||(Fe=le.data.contentsObj)!=null&&Fe.str||(Ie=le.data.richText)!=null&&Ie.str);super(le,{isRenderable:be,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class dt extends Se{constructor(le){var Fe;super(le,{isRenderable:!0});const{filename:be,content:Ce}=this.data.file;this.filename=(0,se.getFilenameFromUrl)(be,!0),this.content=Ce,(Fe=this.linkService.eventBus)==null||Fe.dispatch("fileattachmentannotation",{source:this,filename:be,content:Ce})}render(){var be,Ce;this.container.classList.add("fileAttachmentAnnotation");let le;return this.data.hasAppearance?le=document.createElement("div"):(le=document.createElement("img"),le.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`),le.classList.add("popupTriggerArea"),le.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&((be=this.data.titleObj)!=null&&be.str||(Ce=this.data.contentsObj)!=null&&Ce.str||this.data.richText)&&this._createPopup(le,this.data),this.container.append(le),this.container}_download(){var le;(le=this.downloadManager)==null||le.openOrDownloadData(this.container,this.content,this.filename)}}const Ue=class Ue{static render(le){var Ze,st;const{annotations:be,div:Ce,viewport:Fe,accessibilityManager:Ie}=le;(0,se.setLayerDimensions)(Ce,Fe);const Xe={data:null,layer:Ce,page:le.page,viewport:Fe,linkService:le.linkService,downloadManager:le.downloadManager,imageResourcesPath:le.imageResourcesPath||"",renderForms:le.renderForms!==!1,svgFactory:new se.DOMSVGFactory,annotationStorage:le.annotationStorage||new ie.AnnotationStorage,enableScripting:le.enableScripting===!0,hasJSActions:le.hasJSActions,fieldObjects:le.fieldObjects};let tt=0;for(const ot of be){if(ot.noHTML)continue;if(ot.annotationType!==re.AnnotationType.POPUP){const{width:ft,height:pt}=de(ot.rect);if(ft<=0||pt<=0)continue}Xe.data=ot;const et=Ae.create(Xe);if(!et.isRenderable)continue;const nt=et.render();if(ot.hidden&&(nt.style.visibility="hidden"),Array.isArray(nt))for(const ft of nt)ft.style.zIndex=tt++,rt(Ze=Ue,Ge,Qn).call(Ze,ft,ot.id,Ce,Ie);else nt.style.zIndex=tt++,et instanceof Ne?Ce.prepend(nt):rt(st=Ue,Ge,Qn).call(st,nt,ot.id,Ce,Ie)}rt(this,Ke,er).call(this,Ce,le.annotationCanvasMap)}static update(le){const{annotationCanvasMap:be,div:Ce,viewport:Fe}=le;(0,se.setLayerDimensions)(Ce,{rotation:Fe.rotation}),rt(this,Ke,er).call(this,Ce,be),Ce.hidden=!1}};Ge=new WeakSet,Qn=function(le,be,Ce,Fe){const Ie=le.firstChild||le;Ie.id=`${se.AnnotationPrefix}${be}`,Ce.append(le),Fe==null||Fe.moveElementInDOM(Ce,le,Ie,!1)},Ke=new WeakSet,er=function(le,be){if(be){for(const[Ce,Fe]of be){const Ie=le.querySelector(`[data-annotation-id="${Ce}"]`);if(!Ie)continue;const{firstChild:Xe}=Ie;Xe?Xe.nodeName==="CANVAS"?Xe.replaceWith(Fe):Xe.before(Fe):Ie.append(Fe)}be.clear()}},Je(Ue,Ge),Je(Ue,Ke);let yt=Ue;ee.AnnotationLayer=yt},(te,ee)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.ColorConverters=void 0;function ne(se){return Math.floor(Math.max(0,Math.min(1,se))*255).toString(16).padStart(2,"0")}class re{static CMYK_G([ie,oe,me,pe]){return["G",1-Math.min(1,.3*ie+.59*me+.11*oe+pe)]}static G_CMYK([ie]){return["CMYK",0,0,0,1-ie]}static G_RGB([ie]){return["RGB",ie,ie,ie]}static G_HTML([ie]){const oe=ne(ie);return`#${oe}${oe}${oe}`}static RGB_G([ie,oe,me]){return["G",.3*ie+.59*oe+.11*me]}static RGB_HTML([ie,oe,me]){const pe=ne(ie),he=ne(oe),ue=ne(me);return`#${pe}${he}${ue}`}static T_HTML(){return"#00000000"}static CMYK_RGB([ie,oe,me,pe]){return["RGB",1-Math.min(1,ie+pe),1-Math.min(1,me+pe),1-Math.min(1,oe+pe)]}static CMYK_HTML(ie){const oe=this.CMYK_RGB(ie).slice(1);return this.RGB_HTML(oe)}static RGB_CMYK([ie,oe,me]){const pe=1-ie,he=1-oe,ue=1-me,de=Math.min(pe,he,ue);return["CMYK",pe,he,ue,de]}}ee.ColorConverters=re},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.XfaLayer=void 0;var re=ne(19);class se{static setupStorage(oe,me,pe,he,ue){const de=he.getValue(me,{value:null});switch(pe.name){case"textarea":if(de.value!==null&&(oe.textContent=de.value),ue==="print")break;oe.addEventListener("input",Ae=>{he.setValue(me,{value:Ae.target.value})});break;case"input":if(pe.attributes.type==="radio"||pe.attributes.type==="checkbox"){if(de.value===pe.attributes.xfaOn?oe.setAttribute("checked",!0):de.value===pe.attributes.xfaOff&&oe.removeAttribute("checked"),ue==="print")break;oe.addEventListener("change",Ae=>{he.setValue(me,{value:Ae.target.checked?Ae.target.getAttribute("xfaOn"):Ae.target.getAttribute("xfaOff")})})}else{if(de.value!==null&&oe.setAttribute("value",de.value),ue==="print")break;oe.addEventListener("input",Ae=>{he.setValue(me,{value:Ae.target.value})})}break;case"select":if(de.value!==null)for(const Ae of pe.children)Ae.attributes.value===de.value&&(Ae.attributes.selected=!0);oe.addEventListener("input",Ae=>{const Se=Ae.target.options,ce=Se.selectedIndex===-1?"":Se[Se.selectedIndex].value;he.setValue(me,{value:ce})});break}}static setAttributes({html:oe,element:me,storage:pe=null,intent:he,linkService:ue}){const{attributes:de}=me,Ae=oe instanceof HTMLAnchorElement;de.type==="radio"&&(de.name=`${de.name}-${he}`);for(const[Se,ce]of Object.entries(de))if(ce!=null)switch(Se){case"class":ce.length&&oe.setAttribute(Se,ce.join(" "));break;case"dataId":break;case"id":oe.setAttribute("data-element-id",ce);break;case"style":Object.assign(oe.style,ce);break;case"textContent":oe.textContent=ce;break;default:(!Ae||Se!=="href"&&Se!=="newWindow")&&oe.setAttribute(Se,ce)}Ae&&ue.addLinkAttributes(oe,de.href,de.newWindow),pe&&de.dataId&&this.setupStorage(oe,de.dataId,me,pe)}static render(oe){var fe;const me=oe.annotationStorage,pe=oe.linkService,he=oe.xfaHtml,ue=oe.intent||"display",de=document.createElement(he.name);he.attributes&&this.setAttributes({html:de,element:he,intent:ue,linkService:pe});const Ae=[[he,-1,de]],Se=oe.div;if(Se.append(de),oe.viewport){const ye=`matrix(${oe.viewport.transform.join(",")})`;Se.style.transform=ye}ue!=="richText"&&Se.setAttribute("class","xfaLayer xfaFont");const ce=[];for(;Ae.length>0;){const[ye,ve,Pe]=Ae.at(-1);if(ve+1===ye.children.length){Ae.pop();continue}const we=ye.children[++Ae.at(-1)[1]];if(we===null)continue;const{name:Te}=we;if(Te==="#text"){const Ne=document.createTextNode(we.value);ce.push(Ne),Pe.append(Ne);continue}let Le;if((fe=we==null?void 0:we.attributes)!=null&&fe.xmlns?Le=document.createElementNS(we.attributes.xmlns,Te):Le=document.createElement(Te),Pe.append(Le),we.attributes&&this.setAttributes({html:Le,element:we,storage:me,intent:ue,linkService:pe}),we.children&&we.children.length>0)Ae.push([we,-1,Le]);else if(we.value){const Ne=document.createTextNode(we.value);re.XfaText.shouldBuildText(Te)&&ce.push(Ne),Le.append(Ne)}}for(const ye of Se.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))ye.setAttribute("readOnly",!0);return{textDivs:ce}}static update(oe){const me=`matrix(${oe.viewport.transform.join(",")})`;oe.div.style.transform=me,oe.div.hidden=!1}}ee.XfaLayer=se},(te,ee,ne)=>{Object.defineProperty(ee,"__esModule",{value:!0}),ee.SVGGraphics=void 0;var re=ne(6),se=ne(1),ie=ne(10);let oe=class{constructor(){(0,se.unreachable)("Not implemented: SVGGraphics")}};ee.SVGGraphics=oe;{let Pe=function(ae){let ge=[];const $e=[];for(const _e of ae){if(_e.fn==="save"){ge.push({fnId:92,fn:"group",items:[]}),$e.push(ge),ge=ge.at(-1).items;continue}_e.fn==="restore"?ge=$e.pop():ge.push(_e)}return ge},we=function(ae){if(Number.isInteger(ae))return ae.toString();const ge=ae.toFixed(10);let $e=ge.length-1;if(ge[$e]!=="0")return ge;do $e--;while(ge[$e]==="0");return ge.substring(0,ge[$e]==="."?$e:$e+1)},Te=function(ae){if(ae[4]===0&&ae[5]===0){if(ae[1]===0&&ae[2]===0)return ae[0]===1&&ae[3]===1?"":`scale(${we(ae[0])} ${we(ae[3])})`;if(ae[0]===ae[3]&&ae[1]===-ae[2]){const ge=Math.acos(ae[0])*180/Math.PI;return`rotate(${we(ge)})`}}else if(ae[0]===1&&ae[1]===0&&ae[2]===0&&ae[3]===1)return`translate(${we(ae[4])} ${we(ae[5])})`;return`matrix(${we(ae[0])} ${we(ae[1])} ${we(ae[2])} ${we(ae[3])} ${we(ae[4])} ${we(ae[5])})`};var me=Pe,pe=we,he=Te;const ue={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},de="http://www.w3.org/XML/1998/namespace",Ae="http://www.w3.org/1999/xlink",Se=["butt","round","square"],ce=["miter","round","bevel"],fe=function(ae,ge="",$e=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!$e)return URL.createObjectURL(new Blob([ae],{type:ge}));const _e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let ke=`data:${ge};base64,`;for(let We=0,ze=ae.length;We<ze;We+=3){const Qe=ae[We]&255,ct=ae[We+1]&255,it=ae[We+2]&255,ht=Qe>>2,at=(Qe&3)<<4|ct>>4,gt=We+1<ze?(ct&15)<<2|it>>6:64,dt=We+2<ze?it&63:64;ke+=_e[ht]+_e[at]+_e[gt]+_e[dt]}return ke},ye=function(){const ae=new Uint8Array([137,80,78,71,13,10,26,10]),ge=12,$e=new Int32Array(256);for(let it=0;it<256;it++){let ht=it;for(let at=0;at<8;at++)ht&1?ht=3988292384^ht>>1&2147483647:ht=ht>>1&2147483647;$e[it]=ht}function _e(it,ht,at){let gt=-1;for(let dt=ht;dt<at;dt++){const yt=(gt^it[dt])&255,mt=$e[yt];gt=gt>>>8^mt}return gt^-1}function ke(it,ht,at,gt){let dt=gt;const yt=ht.length;at[dt]=yt>>24&255,at[dt+1]=yt>>16&255,at[dt+2]=yt>>8&255,at[dt+3]=yt&255,dt+=4,at[dt]=it.charCodeAt(0)&255,at[dt+1]=it.charCodeAt(1)&255,at[dt+2]=it.charCodeAt(2)&255,at[dt+3]=it.charCodeAt(3)&255,dt+=4,at.set(ht,dt),dt+=ht.length;const mt=_e(at,gt+4,dt);at[dt]=mt>>24&255,at[dt+1]=mt>>16&255,at[dt+2]=mt>>8&255,at[dt+3]=mt&255}function We(it,ht,at){let gt=1,dt=0;for(let yt=ht;yt<at;++yt)gt=(gt+(it[yt]&255))%65521,dt=(dt+gt)%65521;return dt<<16|gt}function ze(it){if(!ie.isNodeJS)return Qe(it);try{let ht;parseInt(process.versions.node)>=8?ht=it:ht=Buffer.from(it);const at=require$$5.deflateSync(ht,{level:9});return at instanceof Uint8Array?at:new Uint8Array(at)}catch(ht){(0,se.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+ht)}return Qe(it)}function Qe(it){let ht=it.length;const at=65535,gt=Math.ceil(ht/at),dt=new Uint8Array(2+ht+gt*5+4);let yt=0;dt[yt++]=120,dt[yt++]=156;let mt=0;for(;ht>at;)dt[yt++]=0,dt[yt++]=255,dt[yt++]=255,dt[yt++]=0,dt[yt++]=0,dt.set(it.subarray(mt,mt+at),yt),yt+=at,mt+=at,ht-=at;dt[yt++]=1,dt[yt++]=ht&255,dt[yt++]=ht>>8&255,dt[yt++]=~ht&65535&255,dt[yt++]=(~ht&65535)>>8&255,dt.set(it.subarray(mt),yt),yt+=it.length-mt;const qe=We(it,0,it.length);return dt[yt++]=qe>>24&255,dt[yt++]=qe>>16&255,dt[yt++]=qe>>8&255,dt[yt++]=qe&255,dt}function ct(it,ht,at,gt){const dt=it.width,yt=it.height;let mt,qe,Ee;const xe=it.data;switch(ht){case se.ImageKind.GRAYSCALE_1BPP:qe=0,mt=1,Ee=dt+7>>3;break;case se.ImageKind.RGB_24BPP:qe=2,mt=8,Ee=dt*3;break;case se.ImageKind.RGBA_32BPP:qe=6,mt=8,Ee=dt*4;break;default:throw new Error("invalid format")}const Oe=new Uint8Array((1+Ee)*yt);let Ge=0,Ve=0;for(let be=0;be<yt;++be)Oe[Ge++]=0,Oe.set(xe.subarray(Ve,Ve+Ee),Ge),Ve+=Ee,Ge+=Ee;if(ht===se.ImageKind.GRAYSCALE_1BPP&>){Ge=0;for(let be=0;be<yt;be++){Ge++;for(let Ce=0;Ce<Ee;Ce++)Oe[Ge++]^=255}}const Ke=new Uint8Array([dt>>24&255,dt>>16&255,dt>>8&255,dt&255,yt>>24&255,yt>>16&255,yt>>8&255,yt&255,mt,qe,0,0,0]),je=ze(Oe),Ue=ae.length+ge*3+Ke.length+je.length,Be=new Uint8Array(Ue);let le=0;return Be.set(ae,le),le+=ae.length,ke("IHDR",Ke,Be,le),le+=ge+Ke.length,ke("IDATA",je,Be,le),le+=ge+je.length,ke("IEND",new Uint8Array(0),Be,le),fe(Be,"image/png",at)}return function(ht,at,gt){const dt=ht.kind===void 0?se.ImageKind.GRAYSCALE_1BPP:ht.kind;return ct(ht,dt,at,gt)}}();class ve{constructor(){this.fontSizeScale=1,this.fontWeight=ue.fontWeight,this.fontSize=0,this.textMatrix=se.IDENTITY_MATRIX,this.fontMatrix=se.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=se.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=ue.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(ge,$e){this.x=ge,this.y=$e}}let Le=0,Ne=0,Me=0;ee.SVGGraphics=oe=class{constructor(ae,ge,$e=!1){(0,re.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new re.DOMSVGFactory,this.current=new ve,this.transformMatrix=se.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=ae,this.objs=ge,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!$e,this._operatorIdMapping=[];for(const _e in se.OPS)this._operatorIdMapping[se.OPS[_e]]=_e}getObject(ae,ge=null){return typeof ae=="string"?ae.startsWith("g_")?this.commonObjs.get(ae):this.objs.get(ae):ge}save(){this.transformStack.push(this.transformMatrix);const ae=this.current;this.extraStack.push(ae),this.current=ae.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(ae){this.save(),this.executeOpTree(ae),this.restore()}loadDependencies(ae){const ge=ae.fnArray,$e=ae.argsArray;for(let _e=0,ke=ge.length;_e<ke;_e++)if(ge[_e]===se.OPS.dependency)for(const We of $e[_e]){const ze=We.startsWith("g_")?this.commonObjs:this.objs,Qe=new Promise(ct=>{ze.get(We,ct)});this.current.dependencies.push(Qe)}return Promise.all(this.current.dependencies)}transform(ae,ge,$e,_e,ke,We){const ze=[ae,ge,$e,_e,ke,We];this.transformMatrix=se.Util.transform(this.transformMatrix,ze),this.tgrp=null}getSVG(ae,ge){this.viewport=ge;const $e=this._initialize(ge);return this.loadDependencies(ae).then(()=>(this.transformMatrix=se.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(ae)),$e))}convertOpList(ae){const ge=this._operatorIdMapping,$e=ae.argsArray,_e=ae.fnArray,ke=[];for(let We=0,ze=_e.length;We<ze;We++){const Qe=_e[We];ke.push({fnId:Qe,fn:ge[Qe],args:$e[We]})}return Pe(ke)}executeOpTree(ae){for(const ge of ae){const $e=ge.fn,_e=ge.fnId,ke=ge.args;switch(_e|0){case se.OPS.beginText:this.beginText();break;case se.OPS.dependency:break;case se.OPS.setLeading:this.setLeading(ke);break;case se.OPS.setLeadingMoveText:this.setLeadingMoveText(ke[0],ke[1]);break;case se.OPS.setFont:this.setFont(ke);break;case se.OPS.showText:this.showText(ke[0]);break;case se.OPS.showSpacedText:this.showText(ke[0]);break;case se.OPS.endText:this.endText();break;case se.OPS.moveText:this.moveText(ke[0],ke[1]);break;case se.OPS.setCharSpacing:this.setCharSpacing(ke[0]);break;case se.OPS.setWordSpacing:this.setWordSpacing(ke[0]);break;case se.OPS.setHScale:this.setHScale(ke[0]);break;case se.OPS.setTextMatrix:this.setTextMatrix(ke[0],ke[1],ke[2],ke[3],ke[4],ke[5]);break;case se.OPS.setTextRise:this.setTextRise(ke[0]);break;case se.OPS.setTextRenderingMode:this.setTextRenderingMode(ke[0]);break;case se.OPS.setLineWidth:this.setLineWidth(ke[0]);break;case se.OPS.setLineJoin:this.setLineJoin(ke[0]);break;case se.OPS.setLineCap:this.setLineCap(ke[0]);break;case se.OPS.setMiterLimit:this.setMiterLimit(ke[0]);break;case se.OPS.setFillRGBColor:this.setFillRGBColor(ke[0],ke[1],ke[2]);break;case se.OPS.setStrokeRGBColor:this.setStrokeRGBColor(ke[0],ke[1],ke[2]);break;case se.OPS.setStrokeColorN:this.setStrokeColorN(ke);break;case se.OPS.setFillColorN:this.setFillColorN(ke);break;case se.OPS.shadingFill:this.shadingFill(ke[0]);break;case se.OPS.setDash:this.setDash(ke[0],ke[1]);break;case se.OPS.setRenderingIntent:this.setRenderingIntent(ke[0]);break;case se.OPS.setFlatness:this.setFlatness(ke[0]);break;case se.OPS.setGState:this.setGState(ke[0]);break;case se.OPS.fill:this.fill();break;case se.OPS.eoFill:this.eoFill();break;case se.OPS.stroke:this.stroke();break;case se.OPS.fillStroke:this.fillStroke();break;case se.OPS.eoFillStroke:this.eoFillStroke();break;case se.OPS.clip:this.clip("nonzero");break;case se.OPS.eoClip:this.clip("evenodd");break;case se.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case se.OPS.paintImageXObject:this.paintImageXObject(ke[0]);break;case se.OPS.paintInlineImageXObject:this.paintInlineImageXObject(ke[0]);break;case se.OPS.paintImageMaskXObject:this.paintImageMaskXObject(ke[0]);break;case se.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(ke[0],ke[1]);break;case se.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case se.OPS.closePath:this.closePath();break;case se.OPS.closeStroke:this.closeStroke();break;case se.OPS.closeFillStroke:this.closeFillStroke();break;case se.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case se.OPS.nextLine:this.nextLine();break;case se.OPS.transform:this.transform(ke[0],ke[1],ke[2],ke[3],ke[4],ke[5]);break;case se.OPS.constructPath:this.constructPath(ke[0],ke[1]);break;case se.OPS.endPath:this.endPath();break;case 92:this.group(ge.items);break;default:(0,se.warn)(`Unimplemented operator ${$e}`);break}}}setWordSpacing(ae){this.current.wordSpacing=ae}setCharSpacing(ae){this.current.charSpacing=ae}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(ae,ge,$e,_e,ke,We){const ze=this.current;ze.textMatrix=ze.lineMatrix=[ae,ge,$e,_e,ke,We],ze.textMatrixScale=Math.hypot(ae,ge),ze.x=ze.lineX=0,ze.y=ze.lineY=0,ze.xcoords=[],ze.ycoords=[],ze.tspan=this.svgFactory.createElement("svg:tspan"),ze.tspan.setAttributeNS(null,"font-family",ze.fontFamily),ze.tspan.setAttributeNS(null,"font-size",`${we(ze.fontSize)}px`),ze.tspan.setAttributeNS(null,"y",we(-ze.y)),ze.txtElement=this.svgFactory.createElement("svg:text"),ze.txtElement.append(ze.tspan)}beginText(){const ae=this.current;ae.x=ae.lineX=0,ae.y=ae.lineY=0,ae.textMatrix=se.IDENTITY_MATRIX,ae.lineMatrix=se.IDENTITY_MATRIX,ae.textMatrixScale=1,ae.tspan=this.svgFactory.createElement("svg:tspan"),ae.txtElement=this.svgFactory.createElement("svg:text"),ae.txtgrp=this.svgFactory.createElement("svg:g"),ae.xcoords=[],ae.ycoords=[]}moveText(ae,ge){const $e=this.current;$e.x=$e.lineX+=ae,$e.y=$e.lineY+=ge,$e.xcoords=[],$e.ycoords=[],$e.tspan=this.svgFactory.createElement("svg:tspan"),$e.tspan.setAttributeNS(null,"font-family",$e.fontFamily),$e.tspan.setAttributeNS(null,"font-size",`${we($e.fontSize)}px`),$e.tspan.setAttributeNS(null,"y",we(-$e.y))}showText(ae){const ge=this.current,$e=ge.font,_e=ge.fontSize;if(_e===0)return;const ke=ge.fontSizeScale,We=ge.charSpacing,ze=ge.wordSpacing,Qe=ge.fontDirection,ct=ge.textHScale*Qe,it=$e.vertical,ht=it?1:-1,at=$e.defaultVMetrics,gt=_e*ge.fontMatrix[0];let dt=0;for(const qe of ae){if(qe===null){dt+=Qe*ze;continue}else if(typeof qe=="number"){dt+=ht*qe*_e/1e3;continue}const Ee=(qe.isSpace?ze:0)+We,xe=qe.fontChar;let Oe,Ge,Ve=qe.width;if(it){let je;const Ue=qe.vmetric||at;je=qe.vmetric?Ue[1]:Ve*.5,je=-je*gt;const Be=Ue[2]*gt;Ve=Ue?-Ue[0]:Ve,Oe=je/ke,Ge=(dt+Be)/ke}else Oe=dt/ke,Ge=0;(qe.isInFont||$e.missingFile)&&(ge.xcoords.push(ge.x+Oe),it&&ge.ycoords.push(-ge.y+Ge),ge.tspan.textContent+=xe);let Ke;it?Ke=Ve*gt-Ee*Qe:Ke=Ve*gt+Ee*Qe,dt+=Ke}ge.tspan.setAttributeNS(null,"x",ge.xcoords.map(we).join(" ")),it?ge.tspan.setAttributeNS(null,"y",ge.ycoords.map(we).join(" ")):ge.tspan.setAttributeNS(null,"y",we(-ge.y)),it?ge.y-=dt:ge.x+=dt*ct,ge.tspan.setAttributeNS(null,"font-family",ge.fontFamily),ge.tspan.setAttributeNS(null,"font-size",`${we(ge.fontSize)}px`),ge.fontStyle!==ue.fontStyle&&ge.tspan.setAttributeNS(null,"font-style",ge.fontStyle),ge.fontWeight!==ue.fontWeight&&ge.tspan.setAttributeNS(null,"font-weight",ge.fontWeight);const yt=ge.textRenderingMode&se.TextRenderingMode.FILL_STROKE_MASK;if(yt===se.TextRenderingMode.FILL||yt===se.TextRenderingMode.FILL_STROKE?(ge.fillColor!==ue.fillColor&&ge.tspan.setAttributeNS(null,"fill",ge.fillColor),ge.fillAlpha<1&&ge.tspan.setAttributeNS(null,"fill-opacity",ge.fillAlpha)):ge.textRenderingMode===se.TextRenderingMode.ADD_TO_PATH?ge.tspan.setAttributeNS(null,"fill","transparent"):ge.tspan.setAttributeNS(null,"fill","none"),yt===se.TextRenderingMode.STROKE||yt===se.TextRenderingMode.FILL_STROKE){const qe=1/(ge.textMatrixScale||1);this._setStrokeAttributes(ge.tspan,qe)}let mt=ge.textMatrix;ge.textRise!==0&&(mt=mt.slice(),mt[5]+=ge.textRise),ge.txtElement.setAttributeNS(null,"transform",`${Te(mt)} scale(${we(ct)}, -1)`),ge.txtElement.setAttributeNS(de,"xml:space","preserve"),ge.txtElement.append(ge.tspan),ge.txtgrp.append(ge.txtElement),this._ensureTransformGroup().append(ge.txtElement)}setLeadingMoveText(ae,ge){this.setLeading(-ge),this.moveText(ae,ge)}addFontStyle(ae){if(!ae.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const ge=fe(ae.data,ae.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${ae.loadedName}"; src: url(${ge}); }
|
|
51
|
+
`}setFont(ae){const ge=this.current,$e=this.commonObjs.get(ae[0]);let _e=ae[1];ge.font=$e,this.embedFonts&&!$e.missingFile&&!this.embeddedFonts[$e.loadedName]&&(this.addFontStyle($e),this.embeddedFonts[$e.loadedName]=$e),ge.fontMatrix=$e.fontMatrix||se.FONT_IDENTITY_MATRIX;let ke="normal";$e.black?ke="900":$e.bold&&(ke="bold");const We=$e.italic?"italic":"normal";_e<0?(_e=-_e,ge.fontDirection=-1):ge.fontDirection=1,ge.fontSize=_e,ge.fontFamily=$e.loadedName,ge.fontWeight=ke,ge.fontStyle=We,ge.tspan=this.svgFactory.createElement("svg:tspan"),ge.tspan.setAttributeNS(null,"y",we(-ge.y)),ge.xcoords=[],ge.ycoords=[]}endText(){var ge;const ae=this.current;ae.textRenderingMode&se.TextRenderingMode.ADD_TO_PATH_FLAG&&((ge=ae.txtElement)!=null&&ge.hasChildNodes())&&(ae.element=ae.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(ae){ae>0&&(this.current.lineWidth=ae)}setLineCap(ae){this.current.lineCap=Se[ae]}setLineJoin(ae){this.current.lineJoin=ce[ae]}setMiterLimit(ae){this.current.miterLimit=ae}setStrokeAlpha(ae){this.current.strokeAlpha=ae}setStrokeRGBColor(ae,ge,$e){this.current.strokeColor=se.Util.makeHexColor(ae,ge,$e)}setFillAlpha(ae){this.current.fillAlpha=ae}setFillRGBColor(ae,ge,$e){this.current.fillColor=se.Util.makeHexColor(ae,ge,$e),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(ae){this.current.strokeColor=this._makeColorN_Pattern(ae)}setFillColorN(ae){this.current.fillColor=this._makeColorN_Pattern(ae)}shadingFill(ae){const ge=this.viewport.width,$e=this.viewport.height,_e=se.Util.inverseTransform(this.transformMatrix),ke=se.Util.applyTransform([0,0],_e),We=se.Util.applyTransform([0,$e],_e),ze=se.Util.applyTransform([ge,0],_e),Qe=se.Util.applyTransform([ge,$e],_e),ct=Math.min(ke[0],We[0],ze[0],Qe[0]),it=Math.min(ke[1],We[1],ze[1],Qe[1]),ht=Math.max(ke[0],We[0],ze[0],Qe[0]),at=Math.max(ke[1],We[1],ze[1],Qe[1]),gt=this.svgFactory.createElement("svg:rect");gt.setAttributeNS(null,"x",ct),gt.setAttributeNS(null,"y",it),gt.setAttributeNS(null,"width",ht-ct),gt.setAttributeNS(null,"height",at-it),gt.setAttributeNS(null,"fill",this._makeShadingPattern(ae)),this.current.fillAlpha<1&>.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(gt)}_makeColorN_Pattern(ae){return ae[0]==="TilingPattern"?this._makeTilingPattern(ae):this._makeShadingPattern(ae)}_makeTilingPattern(ae){const ge=ae[1],$e=ae[2],_e=ae[3]||se.IDENTITY_MATRIX,[ke,We,ze,Qe]=ae[4],ct=ae[5],it=ae[6],ht=ae[7],at=`shading${Me++}`,[gt,dt,yt,mt]=se.Util.normalizeRect([...se.Util.applyTransform([ke,We],_e),...se.Util.applyTransform([ze,Qe],_e)]),[qe,Ee]=se.Util.singularValueDecompose2dScale(_e),xe=ct*qe,Oe=it*Ee,Ge=this.svgFactory.createElement("svg:pattern");Ge.setAttributeNS(null,"id",at),Ge.setAttributeNS(null,"patternUnits","userSpaceOnUse"),Ge.setAttributeNS(null,"width",xe),Ge.setAttributeNS(null,"height",Oe),Ge.setAttributeNS(null,"x",`${gt}`),Ge.setAttributeNS(null,"y",`${dt}`);const Ve=this.svg,Ke=this.transformMatrix,je=this.current.fillColor,Ue=this.current.strokeColor,Be=this.svgFactory.create(yt-gt,mt-dt);if(this.svg=Be,this.transformMatrix=_e,ht===2){const le=se.Util.makeHexColor(...ge);this.current.fillColor=le,this.current.strokeColor=le}return this.executeOpTree(this.convertOpList($e)),this.svg=Ve,this.transformMatrix=Ke,this.current.fillColor=je,this.current.strokeColor=Ue,Ge.append(Be.childNodes[0]),this.defs.append(Ge),`url(#${at})`}_makeShadingPattern(ae){switch(typeof ae=="string"&&(ae=this.objs.get(ae)),ae[0]){case"RadialAxial":const ge=`shading${Me++}`,$e=ae[3];let _e;switch(ae[1]){case"axial":const ke=ae[4],We=ae[5];_e=this.svgFactory.createElement("svg:linearGradient"),_e.setAttributeNS(null,"id",ge),_e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),_e.setAttributeNS(null,"x1",ke[0]),_e.setAttributeNS(null,"y1",ke[1]),_e.setAttributeNS(null,"x2",We[0]),_e.setAttributeNS(null,"y2",We[1]);break;case"radial":const ze=ae[4],Qe=ae[5],ct=ae[6],it=ae[7];_e=this.svgFactory.createElement("svg:radialGradient"),_e.setAttributeNS(null,"id",ge),_e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),_e.setAttributeNS(null,"cx",Qe[0]),_e.setAttributeNS(null,"cy",Qe[1]),_e.setAttributeNS(null,"r",it),_e.setAttributeNS(null,"fx",ze[0]),_e.setAttributeNS(null,"fy",ze[1]),_e.setAttributeNS(null,"fr",ct);break;default:throw new Error(`Unknown RadialAxial type: ${ae[1]}`)}for(const ke of $e){const We=this.svgFactory.createElement("svg:stop");We.setAttributeNS(null,"offset",ke[0]),We.setAttributeNS(null,"stop-color",ke[1]),_e.append(We)}return this.defs.append(_e),`url(#${ge})`;case"Mesh":return(0,se.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${ae[0]}`)}}setDash(ae,ge){this.current.dashArray=ae,this.current.dashPhase=ge}constructPath(ae,ge){const $e=this.current;let _e=$e.x,ke=$e.y,We=[],ze=0;for(const Qe of ae)switch(Qe|0){case se.OPS.rectangle:_e=ge[ze++],ke=ge[ze++];const ct=ge[ze++],it=ge[ze++],ht=_e+ct,at=ke+it;We.push("M",we(_e),we(ke),"L",we(ht),we(ke),"L",we(ht),we(at),"L",we(_e),we(at),"Z");break;case se.OPS.moveTo:_e=ge[ze++],ke=ge[ze++],We.push("M",we(_e),we(ke));break;case se.OPS.lineTo:_e=ge[ze++],ke=ge[ze++],We.push("L",we(_e),we(ke));break;case se.OPS.curveTo:_e=ge[ze+4],ke=ge[ze+5],We.push("C",we(ge[ze]),we(ge[ze+1]),we(ge[ze+2]),we(ge[ze+3]),we(_e),we(ke)),ze+=6;break;case se.OPS.curveTo2:We.push("C",we(_e),we(ke),we(ge[ze]),we(ge[ze+1]),we(ge[ze+2]),we(ge[ze+3])),_e=ge[ze+2],ke=ge[ze+3],ze+=4;break;case se.OPS.curveTo3:_e=ge[ze+2],ke=ge[ze+3],We.push("C",we(ge[ze]),we(ge[ze+1]),we(_e),we(ke),we(_e),we(ke)),ze+=4;break;case se.OPS.closePath:We.push("Z");break}We=We.join(" "),$e.path&&ae.length>0&&ae[0]!==se.OPS.rectangle&&ae[0]!==se.OPS.moveTo?We=$e.path.getAttributeNS(null,"d")+We:($e.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append($e.path)),$e.path.setAttributeNS(null,"d",We),$e.path.setAttributeNS(null,"fill","none"),$e.element=$e.path,$e.setCurrentPoint(_e,ke)}endPath(){const ae=this.current;if(ae.path=null,!this.pendingClip)return;if(!ae.element){this.pendingClip=null;return}const ge=`clippath${Le++}`,$e=this.svgFactory.createElement("svg:clipPath");$e.setAttributeNS(null,"id",ge),$e.setAttributeNS(null,"transform",Te(this.transformMatrix));const _e=ae.element.cloneNode(!0);if(this.pendingClip==="evenodd"?_e.setAttributeNS(null,"clip-rule","evenodd"):_e.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,$e.append(_e),this.defs.append($e),ae.activeClipUrl){ae.clipGroup=null;for(const ke of this.extraStack)ke.clipGroup=null;$e.setAttributeNS(null,"clip-path",ae.activeClipUrl)}ae.activeClipUrl=`url(#${ge})`,this.tgrp=null}clip(ae){this.pendingClip=ae}closePath(){const ae=this.current;if(ae.path){const ge=`${ae.path.getAttributeNS(null,"d")}Z`;ae.path.setAttributeNS(null,"d",ge)}}setLeading(ae){this.current.leading=-ae}setTextRise(ae){this.current.textRise=ae}setTextRenderingMode(ae){this.current.textRenderingMode=ae}setHScale(ae){this.current.textHScale=ae/100}setRenderingIntent(ae){}setFlatness(ae){}setGState(ae){for(const[ge,$e]of ae)switch(ge){case"LW":this.setLineWidth($e);break;case"LC":this.setLineCap($e);break;case"LJ":this.setLineJoin($e);break;case"ML":this.setMiterLimit($e);break;case"D":this.setDash($e[0],$e[1]);break;case"RI":this.setRenderingIntent($e);break;case"FL":this.setFlatness($e);break;case"Font":this.setFont($e);break;case"CA":this.setStrokeAlpha($e);break;case"ca":this.setFillAlpha($e);break;default:(0,se.warn)(`Unimplemented graphic state operator ${ge}`);break}}fill(){const ae=this.current;ae.element&&(ae.element.setAttributeNS(null,"fill",ae.fillColor),ae.element.setAttributeNS(null,"fill-opacity",ae.fillAlpha),this.endPath())}stroke(){const ae=this.current;ae.element&&(this._setStrokeAttributes(ae.element),ae.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(ae,ge=1){const $e=this.current;let _e=$e.dashArray;ge!==1&&_e.length>0&&(_e=_e.map(function(ke){return ge*ke})),ae.setAttributeNS(null,"stroke",$e.strokeColor),ae.setAttributeNS(null,"stroke-opacity",$e.strokeAlpha),ae.setAttributeNS(null,"stroke-miterlimit",we($e.miterLimit)),ae.setAttributeNS(null,"stroke-linecap",$e.lineCap),ae.setAttributeNS(null,"stroke-linejoin",$e.lineJoin),ae.setAttributeNS(null,"stroke-width",we(ge*$e.lineWidth)+"px"),ae.setAttributeNS(null,"stroke-dasharray",_e.map(we).join(" ")),ae.setAttributeNS(null,"stroke-dashoffset",we(ge*$e.dashPhase)+"px")}eoFill(){var ae;(ae=this.current.element)==null||ae.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var ae;(ae=this.current.element)==null||ae.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const ae=this.svgFactory.createElement("svg:rect");ae.setAttributeNS(null,"x","0"),ae.setAttributeNS(null,"y","0"),ae.setAttributeNS(null,"width","1px"),ae.setAttributeNS(null,"height","1px"),ae.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(ae)}paintImageXObject(ae){const ge=this.getObject(ae);if(!ge){(0,se.warn)(`Dependent image with object ID ${ae} is not ready yet`);return}this.paintInlineImageXObject(ge)}paintInlineImageXObject(ae,ge){const $e=ae.width,_e=ae.height,ke=ye(ae,this.forceDataSchema,!!ge),We=this.svgFactory.createElement("svg:rect");We.setAttributeNS(null,"x","0"),We.setAttributeNS(null,"y","0"),We.setAttributeNS(null,"width",we($e)),We.setAttributeNS(null,"height",we(_e)),this.current.element=We,this.clip("nonzero");const ze=this.svgFactory.createElement("svg:image");ze.setAttributeNS(Ae,"xlink:href",ke),ze.setAttributeNS(null,"x","0"),ze.setAttributeNS(null,"y",we(-_e)),ze.setAttributeNS(null,"width",we($e)+"px"),ze.setAttributeNS(null,"height",we(_e)+"px"),ze.setAttributeNS(null,"transform",`scale(${we(1/$e)} ${we(-1/_e)})`),ge?ge.append(ze):this._ensureTransformGroup().append(ze)}paintImageMaskXObject(ae){const ge=this.getObject(ae.data,ae);if(ge.bitmap){(0,se.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const $e=this.current,_e=ge.width,ke=ge.height,We=$e.fillColor;$e.maskId=`mask${Ne++}`;const ze=this.svgFactory.createElement("svg:mask");ze.setAttributeNS(null,"id",$e.maskId);const Qe=this.svgFactory.createElement("svg:rect");Qe.setAttributeNS(null,"x","0"),Qe.setAttributeNS(null,"y","0"),Qe.setAttributeNS(null,"width",we(_e)),Qe.setAttributeNS(null,"height",we(ke)),Qe.setAttributeNS(null,"fill",We),Qe.setAttributeNS(null,"mask",`url(#${$e.maskId})`),this.defs.append(ze),this._ensureTransformGroup().append(Qe),this.paintInlineImageXObject(ge,ze)}paintFormXObjectBegin(ae,ge){if(Array.isArray(ae)&&ae.length===6&&this.transform(ae[0],ae[1],ae[2],ae[3],ae[4],ae[5]),ge){const $e=ge[2]-ge[0],_e=ge[3]-ge[1],ke=this.svgFactory.createElement("svg:rect");ke.setAttributeNS(null,"x",ge[0]),ke.setAttributeNS(null,"y",ge[1]),ke.setAttributeNS(null,"width",we($e)),ke.setAttributeNS(null,"height",we(_e)),this.current.element=ke,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(ae){const ge=this.svgFactory.create(ae.width,ae.height),$e=this.svgFactory.createElement("svg:defs");ge.append($e),this.defs=$e;const _e=this.svgFactory.createElement("svg:g");return _e.setAttributeNS(null,"transform",Te(ae.transform)),ge.append(_e),this.svg=_e,ge}_ensureClipGroup(){if(!this.current.clipGroup){const ae=this.svgFactory.createElement("svg:g");ae.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(ae),this.current.clipGroup=ae}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",Te(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(te){var ee=__webpack_module_cache__[te];if(ee!==void 0)return ee.exports;var ne=__webpack_module_cache__[te]={exports:{}};return __webpack_modules__[te](ne,ne.exports,__w_pdfjs_require__),ne.exports}var __webpack_exports__={};return(()=>{var te=__webpack_exports__;Object.defineProperty(te,"__esModule",{value:!0}),Object.defineProperty(te,"AbortException",{enumerable:!0,get:function(){return ee.AbortException}}),Object.defineProperty(te,"AnnotationEditorLayer",{enumerable:!0,get:function(){return ie.AnnotationEditorLayer}}),Object.defineProperty(te,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return ee.AnnotationEditorParamsType}}),Object.defineProperty(te,"AnnotationEditorType",{enumerable:!0,get:function(){return ee.AnnotationEditorType}}),Object.defineProperty(te,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return oe.AnnotationEditorUIManager}}),Object.defineProperty(te,"AnnotationLayer",{enumerable:!0,get:function(){return me.AnnotationLayer}}),Object.defineProperty(te,"AnnotationMode",{enumerable:!0,get:function(){return ee.AnnotationMode}}),Object.defineProperty(te,"CMapCompressionType",{enumerable:!0,get:function(){return ee.CMapCompressionType}}),Object.defineProperty(te,"FeatureTest",{enumerable:!0,get:function(){return ee.FeatureTest}}),Object.defineProperty(te,"GlobalWorkerOptions",{enumerable:!0,get:function(){return pe.GlobalWorkerOptions}}),Object.defineProperty(te,"InvalidPDFException",{enumerable:!0,get:function(){return ee.InvalidPDFException}}),Object.defineProperty(te,"MissingPDFException",{enumerable:!0,get:function(){return ee.MissingPDFException}}),Object.defineProperty(te,"OPS",{enumerable:!0,get:function(){return ee.OPS}}),Object.defineProperty(te,"PDFDataRangeTransport",{enumerable:!0,get:function(){return ne.PDFDataRangeTransport}}),Object.defineProperty(te,"PDFDateString",{enumerable:!0,get:function(){return re.PDFDateString}}),Object.defineProperty(te,"PDFWorker",{enumerable:!0,get:function(){return ne.PDFWorker}}),Object.defineProperty(te,"PasswordResponses",{enumerable:!0,get:function(){return ee.PasswordResponses}}),Object.defineProperty(te,"PermissionFlag",{enumerable:!0,get:function(){return ee.PermissionFlag}}),Object.defineProperty(te,"PixelsPerInch",{enumerable:!0,get:function(){return re.PixelsPerInch}}),Object.defineProperty(te,"PromiseCapability",{enumerable:!0,get:function(){return ee.PromiseCapability}}),Object.defineProperty(te,"RenderingCancelledException",{enumerable:!0,get:function(){return re.RenderingCancelledException}}),Object.defineProperty(te,"SVGGraphics",{enumerable:!0,get:function(){return he.SVGGraphics}}),Object.defineProperty(te,"UnexpectedResponseException",{enumerable:!0,get:function(){return ee.UnexpectedResponseException}}),Object.defineProperty(te,"Util",{enumerable:!0,get:function(){return ee.Util}}),Object.defineProperty(te,"VerbosityLevel",{enumerable:!0,get:function(){return ee.VerbosityLevel}}),Object.defineProperty(te,"XfaLayer",{enumerable:!0,get:function(){return ue.XfaLayer}}),Object.defineProperty(te,"build",{enumerable:!0,get:function(){return ne.build}}),Object.defineProperty(te,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return ee.createValidAbsoluteUrl}}),Object.defineProperty(te,"getDocument",{enumerable:!0,get:function(){return ne.getDocument}}),Object.defineProperty(te,"getFilenameFromUrl",{enumerable:!0,get:function(){return re.getFilenameFromUrl}}),Object.defineProperty(te,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return re.getPdfFilenameFromUrl}}),Object.defineProperty(te,"getXfaPageViewport",{enumerable:!0,get:function(){return re.getXfaPageViewport}}),Object.defineProperty(te,"isDataScheme",{enumerable:!0,get:function(){return re.isDataScheme}}),Object.defineProperty(te,"isPdfFile",{enumerable:!0,get:function(){return re.isPdfFile}}),Object.defineProperty(te,"loadScript",{enumerable:!0,get:function(){return re.loadScript}}),Object.defineProperty(te,"normalizeUnicode",{enumerable:!0,get:function(){return ee.normalizeUnicode}}),Object.defineProperty(te,"renderTextLayer",{enumerable:!0,get:function(){return se.renderTextLayer}}),Object.defineProperty(te,"setLayerDimensions",{enumerable:!0,get:function(){return re.setLayerDimensions}}),Object.defineProperty(te,"shadow",{enumerable:!0,get:function(){return ee.shadow}}),Object.defineProperty(te,"updateTextLayer",{enumerable:!0,get:function(){return se.updateTextLayer}}),Object.defineProperty(te,"version",{enumerable:!0,get:function(){return ne.version}});var ee=__w_pdfjs_require__(1),ne=__w_pdfjs_require__(2),re=__w_pdfjs_require__(6),se=__w_pdfjs_require__(26),ie=__w_pdfjs_require__(27),oe=__w_pdfjs_require__(5),me=__w_pdfjs_require__(32),pe=__w_pdfjs_require__(14),he=__w_pdfjs_require__(35),ue=__w_pdfjs_require__(34)})(),__webpack_exports__})())})(pdf$1);var pdfExports=pdf$1.exports;const pdf=getDefaultExportFromCjs(pdfExports),pdfjsModule=_mergeNamespaces({__proto__:null,default:pdf},[pdfExports]),pdfjs="default"in pdfjsModule?pdf:pdfjsModule,pdfjs$1=pdfjs;var propTypes={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function te(re,se,ie,oe,me,pe){if(pe!==ReactPropTypesSecret){var he=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw he.name="Invariant Violation",he}}te.isRequired=te;function ee(){return te}var ne={array:te,bigint:te,bool:te,func:te,number:te,object:te,string:te,symbol:te,any:te,arrayOf:ee,element:te,elementType:te,instanceOf:ee,node:te,objectOf:ee,oneOf:ee,oneOfType:ee,shape:ee,exact:ee,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return ne.PropTypes=ne,ne};propTypes.exports=factoryWithThrowingShims();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);var __spreadArray=globalThis&&globalThis.__spreadArray||function(te,ee,ne){if(ne||arguments.length===2)for(var re=0,se=ee.length,ie;re<se;re++)(ie||!(re in ee))&&(ie||(ie=Array.prototype.slice.call(ee,0,re)),ie[re]=ee[re]);return te.concat(ie||Array.prototype.slice.call(ee))},clipboardEvents=["onCopy","onCut","onPaste"],compositionEvents=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],focusEvents=["onFocus","onBlur"],formEvents=["onInput","onInvalid","onReset","onSubmit"],imageEvents=["onLoad","onError"],keyboardEvents=["onKeyDown","onKeyPress","onKeyUp"],mediaEvents=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],mouseEvents=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],dragEvents=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],selectionEvents=["onSelect"],touchEvents=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],pointerEvents=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],uiEvents=["onScroll"],wheelEvents=["onWheel"],animationEvents=["onAnimationStart","onAnimationEnd","onAnimationIteration"],transitionEvents=["onTransitionEnd"],otherEvents=["onToggle"],changeEvents=["onChange"],allEvents=__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],clipboardEvents,!0),compositionEvents,!0),focusEvents,!0),formEvents,!0),imageEvents,!0),keyboardEvents,!0),mediaEvents,!0),mouseEvents,!0),dragEvents,!0),selectionEvents,!0),touchEvents,!0),pointerEvents,!0),uiEvents,!0),wheelEvents,!0),animationEvents,!0),transitionEvents,!0),changeEvents,!0),otherEvents,!0);function makeEventProps(te,ee){var ne={};return allEvents.forEach(function(re){var se=te[re];se&&(ee?ne[re]=function(ie){return se(ie,ee(re))}:ne[re]=se)}),ne}function makeCancellablePromise(te){var ee=!1,ne=new Promise(function(re,se){te.then(function(ie){return!ee&&re(ie)}).catch(function(ie){return!ee&&se(ie)})});return{promise:ne,cancel:function(){ee=!0}}}function r$1(te){var ee,ne,re="";if(typeof te=="string"||typeof te=="number")re+=te;else if(typeof te=="object")if(Array.isArray(te))for(ee=0;ee<te.length;ee++)te[ee]&&(ne=r$1(te[ee]))&&(re&&(re+=" "),re+=ne);else for(ee in te)te[ee]&&(re&&(re+=" "),re+=ee);return re}function clsx(){for(var te,ee,ne=0,re="";ne<arguments.length;)(te=arguments[ne++])&&(ee=r$1(te))&&(re&&(re+=" "),re+=ee);return re}var isProduction=!0,prefix="Invariant failed";function invariant(te,ee){if(!te){if(isProduction)throw new Error(prefix);var ne=typeof ee=="function"?ee():ee,re=ne?"".concat(prefix,": ").concat(ne):prefix;throw new Error(re)}}function warning(te,ee){}const DocumentContext=G$1(null);function Message({children:te,type:ee}){return Cn.createElement("div",{className:`react-pdf__message react-pdf__message--${ee}`},te)}const DEFAULT_LINK_REL="noopener noreferrer nofollow";class LinkService{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(ee){this.pdfDocument=ee}setViewer(ee){this.pdfViewer=ee}setExternalLinkRel(ee){this.externalLinkRel=ee}setExternalLinkTarget(ee){this.externalLinkTarget=ee}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(ee){invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=ee}get rotation(){return 0}set rotation(ee){}goToDestination(ee){return new Promise(ne=>{invariant(this.pdfDocument,"PDF document not loaded."),invariant(ee,"Destination is not specified."),typeof ee=="string"?this.pdfDocument.getDestination(ee).then(ne):Array.isArray(ee)?ne(ee):ee.then(ne)}).then(ne=>{invariant(Array.isArray(ne),`"${ne}" is not a valid destination array.`);const re=ne[0];new Promise(se=>{invariant(this.pdfDocument,"PDF document not loaded."),re instanceof Object?this.pdfDocument.getPageIndex(re).then(ie=>{se(ie)}).catch(()=>{invariant(!1,`"${re}" is not a valid page reference.`)}):typeof re=="number"?se(re):invariant(!1,`"${re}" is not a valid destination reference.`)}).then(se=>{const ie=se+1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(ie>=1&&ie<=this.pagesCount,`"${ie}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:ne,pageIndex:se,pageNumber:ie})})})}navigateTo(ee){this.goToDestination(ee)}goToPage(ee){const ne=ee-1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(ee>=1&&ee<=this.pagesCount,`"${ee}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:ne,pageNumber:ee})}addLinkAttributes(ee,ne,re){ee.href=ne,ee.rel=this.externalLinkRel||DEFAULT_LINK_REL,ee.target=re?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PasswordResponses$1=PasswordResponses,isBrowser=typeof document<"u",isLocalFileSystem=isBrowser&&window.location.protocol==="file:";function isDefined(te){return typeof te<"u"}function isProvided(te){return isDefined(te)&&te!==null}function isString(te){return typeof te=="string"}function isArrayBuffer(te){return te instanceof ArrayBuffer}function isBlob(te){return invariant(isBrowser,"isBlob can only be used in a browser environment"),te instanceof Blob}function isDataURI(te){return isString(te)&&/^data:/.test(te)}function dataURItoByteString(te){invariant(isDataURI(te),"Invalid data URI.");const[ee="",ne=""]=te.split(",");return ee.split(";").indexOf("base64")!==-1?atob(ne):unescape(ne)}function getDevicePixelRatio(){return isBrowser&&window.devicePixelRatio||1}function displayWorkerWarning(){}function cancelRunningTask(te){te&&te.cancel&&te.cancel()}function makePageCallback(te,ee){return Object.defineProperty(te,"width",{get(){return this.view[2]*ee},configurable:!0}),Object.defineProperty(te,"height",{get(){return this.view[3]*ee},configurable:!0}),Object.defineProperty(te,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(te,"originalHeight",{get(){return this.view[3]},configurable:!0}),te}function isCancelException(te){return te.name==="RenderingCancelledException"}function loadFromFile(te){return new Promise((ee,ne)=>{const re=new FileReader;re.onload=()=>{if(!re.result)return ne(new Error("Error while reading a file."));ee(re.result)},re.onerror=se=>{if(!se.target)return ne(new Error("Error while reading a file."));const{error:ie}=se.target;if(!ie)return ne(new Error("Error while reading a file."));switch(ie.code){case ie.NOT_FOUND_ERR:return ne(new Error("Error while reading a file: File not found."));case ie.SECURITY_ERR:return ne(new Error("Error while reading a file: Security error."));case ie.ABORT_ERR:return ne(new Error("Error while reading a file: Aborted."));default:return ne(new Error("Error while reading a file."))}},re.readAsArrayBuffer(te)})}function reducer(te,ee){switch(ee.type){case"RESOLVE":return{value:ee.value,error:void 0};case"REJECT":return{value:!1,error:ee.error};case"RESET":return{value:void 0,error:void 0};default:return te}}function useResolver(){return s$1(reducer,{value:void 0,error:void 0})}const{PDFDataRangeTransport:PDFDataRangeTransport$1}=pdfjs$1,eventProps=(()=>{const te={};return allEvents.forEach(ee=>{te[ee]=PropTypes.func}),te})(),isTypedArray=PropTypes.oneOfType([PropTypes.instanceOf(Int8Array),PropTypes.instanceOf(Uint8Array),PropTypes.instanceOf(Uint8ClampedArray),PropTypes.instanceOf(Int16Array),PropTypes.instanceOf(Uint16Array),PropTypes.instanceOf(Int32Array),PropTypes.instanceOf(Uint32Array),PropTypes.instanceOf(Float32Array),PropTypes.instanceOf(Float64Array)]),fileTypes=[PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.shape({data:PropTypes.oneOfType([PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.arrayOf(PropTypes.number.isRequired),isTypedArray]).isRequired}),PropTypes.shape({range:PropTypes.instanceOf(PDFDataRangeTransport$1).isRequired}),PropTypes.shape({url:PropTypes.string.isRequired})];typeof Blob<"u"&&fileTypes.push(PropTypes.instanceOf(Blob));const isClassName=PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),isFile=PropTypes.oneOfType(fileTypes);PropTypes.instanceOf(LinkService);PropTypes.oneOf(["_self","_blank","_parent","_top"]);PropTypes.shape({commonObjs:PropTypes.shape({}).isRequired,getAnnotations:PropTypes.func.isRequired,getTextContent:PropTypes.func.isRequired,getViewport:PropTypes.func.isRequired,render:PropTypes.func.isRequired});const isPageIndex=function te(ee,ne,re){const{[ne]:se,pageNumber:ie,pdf:oe}=ee;if(!isDefined(oe))return null;if(isDefined(se)){if(typeof se!="number")return new Error(`\`${ne}\` of type \`${typeof se}\` supplied to \`${re}\`, expected \`number\`.`);if(se<0)return new Error(`Expected \`${ne}\` to be greater or equal to 0.`);const{numPages:me}=oe;if(se+1>me)return new Error(`Expected \`${ne}\` to be less or equal to ${me-1}.`)}else if(!isDefined(ie))return new Error(`\`${ne}\` not supplied. Either pageIndex or pageNumber must be supplied to \`${re}\`.`);return null},isPageNumber=function te(ee,ne,re){const{[ne]:se,pageIndex:ie,pdf:oe}=ee;if(!isDefined(oe))return null;if(isDefined(se)){if(typeof se!="number")return new Error(`\`${ne}\` of type \`${typeof se}\` supplied to \`${re}\`, expected \`number\`.`);if(se<1)return new Error(`Expected \`${ne}\` to be greater or equal to 1.`);const{numPages:me}=oe;if(se>me)return new Error(`Expected \`${ne}\` to be less or equal to ${me}.`)}else if(!isDefined(ie))return new Error(`\`${ne}\` not supplied. Either pageIndex or pageNumber must be supplied to \`${re}\`.`);return null},isPdf=PropTypes.oneOfType([PropTypes.any,PropTypes.oneOf([!1])]),isRef=PropTypes.oneOfType([PropTypes.func,PropTypes.exact({current:PropTypes.any})]),isRenderMode=PropTypes.oneOf(["canvas","custom","none","svg"]),isRotate=PropTypes.oneOf([0,90,180,270]);var __awaiter=globalThis&&globalThis.__awaiter||function(te,ee,ne,re){function se(ie){return ie instanceof ne?ie:new ne(function(oe){oe(ie)})}return new(ne||(ne=Promise))(function(ie,oe){function me(ue){try{he(re.next(ue))}catch(de){oe(de)}}function pe(ue){try{he(re.throw(ue))}catch(de){oe(de)}}function he(ue){ue.done?ie(ue.value):se(ue.value).then(me,pe)}he((re=re.apply(te,ee||[])).next())})},__rest$2=globalThis&&globalThis.__rest||function(te,ee){var ne={};for(var re in te)Object.prototype.hasOwnProperty.call(te,re)&&ee.indexOf(re)<0&&(ne[re]=te[re]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var se=0,re=Object.getOwnPropertySymbols(te);se<re.length;se++)ee.indexOf(re[se])<0&&Object.prototype.propertyIsEnumerable.call(te,re[se])&&(ne[re[se]]=te[re[se]]);return ne};const{PDFDataRangeTransport}=pdfjs$1,defaultOnPassword=(te,ee)=>{switch(ee){case PasswordResponses$1.NEED_PASSWORD:{const ne=prompt("Enter the password to open this PDF file.");te(ne);break}case PasswordResponses$1.INCORRECT_PASSWORD:{const ne=prompt("Invalid password. Please try again.");te(ne);break}}},Document=k$1(function te(ee,ne){var{children:re,className:se,error:ie="Failed to load PDF file.",externalLinkRel:oe,externalLinkTarget:me,file:pe,inputRef:he,imageResourcesPath:ue,loading:de="Loading PDF…",noData:Ae="No PDF file specified.",onItemClick:Se,onLoadError:ce,onLoadProgress:fe,onLoadSuccess:ye,onPassword:ve=defaultOnPassword,onSourceError:Pe,onSourceSuccess:we,options:Te,renderMode:Le,rotate:Ne}=ee,Me=__rest$2(ee,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[ae,ge]=useResolver(),{value:$e,error:_e}=ae,[ke,We]=useResolver(),{value:ze,error:Qe}=ke,ct=_(new LinkService),it=_([]),ht=_({scrollPageIntoView:le=>{const{dest:be,pageNumber:Ce,pageIndex:Fe=Ce-1}=le;if(Se){Se({dest:be,pageIndex:Fe,pageNumber:Ce});return}const Ie=it.current[Fe];if(Ie){Ie.scrollIntoView();return}}});A$1(ne,()=>({linkService:ct,pages:it,viewer:ht}),[]);function at(){we&&we()}function gt(){_e&&(_e.toString(),Pe&&Pe(_e))}function dt(){ge({type:"RESET"})}p$1(dt,[pe,ge]);const yt=T$1(()=>__awaiter(this,void 0,void 0,function*(){if(!pe)return null;if(typeof pe=="string")return isDataURI(pe)?{data:dataURItoByteString(pe)}:{url:pe};if(pe instanceof PDFDataRangeTransport)return{range:pe};if(isArrayBuffer(pe))return{data:pe};if(isBrowser&&isBlob(pe))return{data:yield loadFromFile(pe)};if(invariant(typeof pe=="object","Invalid parameter in file, need either Uint8Array, string or a parameter object"),invariant("data"in pe||"range"in pe||"url"in pe,"Invalid parameter object: need either .data, .range or .url"),"url"in pe&&typeof pe.url=="string"&&isDataURI(pe.url)){const{url:le}=pe,be=__rest$2(pe,["url"]),Ce=dataURItoByteString(le);return Object.assign({data:Ce},be)}return pe}),[pe]);p$1(()=>{const le=makeCancellablePromise(yt());return le.promise.then(be=>{ge({type:"RESOLVE",value:be})}).catch(be=>{ge({type:"REJECT",error:be})}),()=>{cancelRunningTask(le)}},[yt,ge]),p$1(()=>{if(!(typeof $e>"u")){if($e===!1){gt();return}at()}},[$e]);function mt(){ze&&(ye&&ye(ze),it.current=new Array(ze.numPages),ct.current.setDocument(ze))}function qe(){Qe&&(Qe.toString(),ce&&ce(Qe))}function Ee(){We({type:"RESET"})}p$1(Ee,[We,$e]);function xe(){if(!$e)return;const le=Te?Object.assign(Object.assign({},$e),Te):$e,be=pdfjs$1.getDocument(le);fe&&(be.onProgress=fe),ve&&(be.onPassword=ve);const Ce=be;return Ce.promise.then(Fe=>{We({type:"RESOLVE",value:Fe})}).catch(Fe=>{Ce.destroyed||We({type:"REJECT",error:Fe})}),()=>{Ce.destroy()}}p$1(xe,[Te,We,$e]),p$1(()=>{if(!(typeof ze>"u")){if(ze===!1){qe();return}mt()}},[ze]);function Oe(){ct.current.setViewer(ht.current),ct.current.setExternalLinkRel(oe),ct.current.setExternalLinkTarget(me)}p$1(Oe,[oe,me]);function Ge(le,be){it.current[le]=be}function Ve(le){delete it.current[le]}const Ke=F$1(()=>({imageResourcesPath:ue,linkService:ct.current,onItemClick:Se,pdf:ze,registerPage:Ge,renderMode:Le,rotate:Ne,unregisterPage:Ve}),[ue,Se,ze,Le,Ne]),je=F$1(()=>makeEventProps(Me,()=>ze),[Me,ze]);function Ue(){return Cn.createElement(DocumentContext.Provider,{value:Ke},re)}function Be(){return pe?ze==null?Cn.createElement(Message,{type:"loading"},typeof de=="function"?de():de):ze===!1?Cn.createElement(Message,{type:"error"},typeof ie=="function"?ie():ie):Ue():Cn.createElement(Message,{type:"no-data"},typeof Ae=="function"?Ae():Ae)}return Cn.createElement("div",Object.assign({className:clsx("react-pdf__Document",se),ref:he,style:{"--scale-factor":"1"}},je),Be())}),isFunctionOrNode$1=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Document.propTypes=Object.assign(Object.assign({},eventProps),{children:PropTypes.node,className:isClassName,error:isFunctionOrNode$1,externalLinkRel:PropTypes.string,externalLinkTarget:PropTypes.oneOf(["_self","_blank","_parent","_top"]),file:isFile,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode$1,noData:isFunctionOrNode$1,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadProgress:PropTypes.func,onLoadSuccess:PropTypes.func,onPassword:PropTypes.func,onSourceError:PropTypes.func,onSourceSuccess:PropTypes.func,options:PropTypes.shape({canvasFactory:PropTypes.any,canvasMaxAreaInBytes:PropTypes.number,cMapPacked:PropTypes.bool,CMapReaderFactory:PropTypes.any,cMapUrl:PropTypes.string,disableAutoFetch:PropTypes.bool,disableFontFace:PropTypes.bool,disableRange:PropTypes.bool,disableStream:PropTypes.bool,docBaseUrl:PropTypes.string,enableXfa:PropTypes.bool,filterFactory:PropTypes.any,fontExtraProperties:PropTypes.bool,httpHeaders:PropTypes.object,isEvalSupported:PropTypes.bool,isOffscreenCanvasSupported:PropTypes.bool,length:PropTypes.number,maxImageSize:PropTypes.number,ownerDocument:PropTypes.any,password:PropTypes.string,pdfBug:PropTypes.bool,rangeChunkSize:PropTypes.number,StandardFontDataFactory:PropTypes.any,standardFontDataUrl:PropTypes.string,stopAtErrors:PropTypes.bool,useSystemFonts:PropTypes.bool,useWorkerFetch:PropTypes.bool,verbosity:PropTypes.number,withCredentials:PropTypes.bool,worker:PropTypes.any}),rotate:PropTypes.number});const Document$=Document;function useDocumentContext(){return q$2(DocumentContext)}function mergeRefs(){for(var te=[],ee=0;ee<arguments.length;ee++)te[ee]=arguments[ee];var ne=te.filter(Boolean);if(ne.length<=1){var re=ne[0];return re||null}return function(ie){ne.forEach(function(oe){typeof oe=="function"?oe(ie):oe&&(oe.current=ie)})}}const PageContext=G$1(null),PDF_ROLE_TO_HTML_ROLE={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},HEADING_PATTERN=/^H(\d+)$/;function isPdfRole(te){return te in PDF_ROLE_TO_HTML_ROLE}function isStructTreeNode(te){return"children"in te}function isStructTreeNodeWithOnlyContentChild(te){return isStructTreeNode(te)?te.children.length===1&&0 in te.children&&"id"in te.children[0]:!1}function getRoleAttributes(te){const ee={};if(isStructTreeNode(te)){const{role:ne}=te,re=ne.match(HEADING_PATTERN);if(re)ee.role="heading",ee["aria-level"]=Number(re[1]);else if(isPdfRole(ne)){const se=PDF_ROLE_TO_HTML_ROLE[ne];se&&(ee.role=se)}}return ee}function getBaseAttributes(te){const ee={};if(isStructTreeNode(te)){if(te.alt!==void 0&&(ee["aria-label"]=te.alt),te.lang!==void 0&&(ee.lang=te.lang),isStructTreeNodeWithOnlyContentChild(te)){const[ne]=te.children;if(ne){const re=getBaseAttributes(ne);return Object.assign(Object.assign({},ee),re)}}}else"id"in te&&(ee["aria-owns"]=te.id);return ee}function getAttributes(te){return te?Object.assign(Object.assign({},getRoleAttributes(te)),getBaseAttributes(te)):null}function StructTreeItem({className:te,node:ee}){const ne=F$1(()=>getAttributes(ee),[ee]),re=F$1(()=>!isStructTreeNode(ee)||isStructTreeNodeWithOnlyContentChild(ee)?null:ee.children.map((se,ie)=>Cn.createElement(StructTreeItem,{key:ie,node:se})),[ee]);return Cn.createElement("span",Object.assign({className:te},ne),re)}function usePageContext(){return q$2(PageContext)}function StructTree(){const te=usePageContext();invariant(te,"Unable to find Page context.");const{onGetStructTreeError:ee,onGetStructTreeSuccess:ne}=te,[re,se]=useResolver(),{value:ie,error:oe}=re,{customTextRenderer:me,page:pe}=te;function he(){ie&&ne&&ne(ie)}function ue(){oe&&(oe.toString(),ee&&ee(oe))}function de(){se({type:"RESET"})}p$1(de,[se,pe]);function Ae(){if(me||!pe)return;const Se=makeCancellablePromise(pe.getStructTree()),ce=Se;return Se.promise.then(fe=>{se({type:"RESOLVE",value:fe})}).catch(fe=>{se({type:"REJECT",error:fe})}),()=>cancelRunningTask(ce)}return p$1(Ae,[me,pe,se]),p$1(()=>{if(ie!==void 0){if(ie===!1){ue();return}he()}},[ie]),ie?Cn.createElement(StructTreeItem,{className:"react-pdf__Page__structTree structTree",node:ie}):null}const ANNOTATION_MODE=pdfjs$1.AnnotationMode;function PageCanvas(te){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const ne=Object.assign(Object.assign({},ee),te),{_className:re,canvasBackground:se,devicePixelRatio:ie=getDevicePixelRatio(),onRenderError:oe,onRenderSuccess:me,page:pe,renderForms:he,renderTextLayer:ue,rotate:de,scale:Ae}=ne,{canvasRef:Se}=te;invariant(pe,"Attempted to render page canvas, but no page was specified.");const ce=_(null);function fe(){pe&&me&&me(makePageCallback(pe,Ae))}function ye(Le){isCancelException(Le)||(Le.toString(),oe&&oe(Le))}const ve=F$1(()=>pe.getViewport({scale:Ae*ie,rotation:de}),[ie,pe,de,Ae]),Pe=F$1(()=>pe.getViewport({scale:Ae,rotation:de}),[pe,de,Ae]);function we(){if(!pe)return;pe.cleanup();const{current:Le}=ce;if(!Le)return;Le.width=ve.width,Le.height=ve.height,Le.style.width=`${Math.floor(Pe.width)}px`,Le.style.height=`${Math.floor(Pe.height)}px`,Le.style.visibility="hidden";const Ne={annotationMode:he?ANNOTATION_MODE.ENABLE_FORMS:ANNOTATION_MODE.ENABLE,canvasContext:Le.getContext("2d",{alpha:!1}),viewport:ve};se&&(Ne.background=se);const Me=pe.render(Ne),ae=Me;return Me.promise.then(()=>{Le.style.visibility="",fe()}).catch(ye),()=>cancelRunningTask(ae)}p$1(we,[se,ce,ie,pe,he,ve,Pe]);const Te=T$1(()=>{const{current:Le}=ce;Le&&(Le.width=0,Le.height=0)},[ce]);return p$1(()=>Te,[Te]),Cn.createElement("canvas",{className:`${re}__canvas`,dir:"ltr",ref:mergeRefs(Se,ce),style:{display:"block",userSelect:"none"}},ue?Cn.createElement(StructTree,null):null)}function PageSVG(){const te=usePageContext();invariant(te,"Unable to find Page context.");const{_className:ee,onRenderSuccess:ne,onRenderError:re,page:se,rotate:ie,scale:oe}=te;invariant(se,"Attempted to render page SVG, but no page was specified.");const[me,pe]=useResolver(),{value:he,error:ue}=me;function de(){se&&ne&&ne(makePageCallback(se,oe))}function Ae(){ue&&(isCancelException(ue)||(ue.toString(),re&&re(ue)))}const Se=F$1(()=>se.getViewport({scale:oe,rotation:ie}),[se,ie,oe]);function ce(){pe({type:"RESET"})}p$1(ce,[se,pe,Se]);function fe(){if(!se)return;const we=makeCancellablePromise(se.getOperatorList());return we.promise.then(Te=>{new pdfjs$1.SVGGraphics(se.commonObjs,se.objs).getSVG(Te,Se).then(Ne=>{pe({type:"RESOLVE",value:Ne})}).catch(Ne=>{pe({type:"REJECT",error:Ne})})}).catch(Te=>{pe({type:"REJECT",error:Te})}),()=>cancelRunningTask(we)}p$1(fe,[se,pe,Se]),p$1(()=>{if(he!==void 0){if(he===!1){Ae();return}de()}},[he]);function ye(we){if(!we||!he)return;we.firstElementChild||we.appendChild(he);const{width:Te,height:Le}=Se;he.setAttribute("width",`${Te}`),he.setAttribute("height",`${Le}`)}const{width:ve,height:Pe}=Se;return Cn.createElement("div",{className:`${ee}__svg`,ref:we=>ye(we),style:{display:"block",backgroundColor:"white",overflow:"hidden",width:ve,height:Pe,userSelect:"none"}})}function isTextItem(te){return"str"in te}function TextLayer$1(){const te=usePageContext();invariant(te,"Unable to find Page context.");const{customTextRenderer:ee,onGetTextError:ne,onGetTextSuccess:re,onRenderTextLayerError:se,onRenderTextLayerSuccess:ie,page:oe,pageIndex:me,pageNumber:pe,rotate:he,scale:ue}=te;invariant(oe,"Attempted to load page text content, but no page was specified.");const[de,Ae]=useResolver(),{value:Se,error:ce}=de,fe=_(null),ye=_();parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10);function ve(){Se&&re&&re(Se)}function Pe(){ce&&(ce.toString(),ne&&ne(ce))}function we(){Ae({type:"RESET"})}p$1(we,[oe,Ae]);function Te(){if(!oe)return;const _e=makeCancellablePromise(oe.getTextContent()),ke=_e;return _e.promise.then(We=>{Ae({type:"RESOLVE",value:We})}).catch(We=>{Ae({type:"REJECT",error:We})}),()=>cancelRunningTask(ke)}p$1(Te,[oe,Ae]),p$1(()=>{if(Se!==void 0){if(Se===!1){Pe();return}ve()}},[Se]);const Le=T$1(()=>{ie&&ie()},[ie]),Ne=T$1(_e=>{_e.toString(),se&&se(_e)},[se]);function Me(){const _e=ye.current;_e&&_e.classList.add("active")}function ae(){const _e=ye.current;_e&&_e.classList.remove("active")}const ge=F$1(()=>oe.getViewport({scale:ue,rotation:he}),[oe,he,ue]);function $e(){if(!oe||!Se)return;const{current:_e}=fe;if(!_e)return;_e.innerHTML="";const ke=oe.streamTextContent({includeMarkedContent:!0}),We={container:_e,textContentSource:ke,viewport:ge},ze=pdfjs$1.renderTextLayer(We),Qe=ze;return ze.promise.then(()=>{const ct=document.createElement("div");ct.className="endOfContent",_e.append(ct),ye.current=ct;const ht=!!_e.querySelector(".markedContent")?_e.querySelectorAll(".markedContent > *:not(.markedContent"):_e.children;if(ee){let at=0;Se.items.forEach((gt,dt)=>{if(!isTextItem(gt))return;const yt=ht[at];if(!yt)return;const mt=ee(Object.assign({pageIndex:me,pageNumber:pe,itemIndex:dt},gt));yt.innerHTML=mt,at+=gt.str&>.hasEOL?2:1})}Le()}).catch(Ne),()=>cancelRunningTask(Qe)}return y($e,[ee,Ne,Le,oe,me,pe,Se,ge]),Cn.createElement("div",{className:clsx("react-pdf__Page__textContent","textLayer"),onMouseUp:ae,onMouseDown:Me,ref:fe})}function AnnotationLayer$1(){const te=useDocumentContext();invariant(te,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const ee=usePageContext();invariant(ee,"Unable to find Page context.");const ne=Object.assign(Object.assign({},te),ee),{imageResourcesPath:re,linkService:se,onGetAnnotationsError:ie,onGetAnnotationsSuccess:oe,onRenderAnnotationLayerError:me,onRenderAnnotationLayerSuccess:pe,page:he,pdf:ue,renderForms:de,rotate:Ae,scale:Se=1}=ne;invariant(he,"Attempted to load page annotations, but no page was specified.");const[ce,fe]=useResolver(),{value:ye,error:ve}=ce,Pe=_(null);parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10);function we(){ye&&oe&&oe(ye)}function Te(){ve&&(ve.toString(),ie&&ie(ve))}function Le(){fe({type:"RESET"})}p$1(Le,[fe,he]);function Ne(){if(!he)return;const _e=makeCancellablePromise(he.getAnnotations()),ke=_e;return _e.promise.then(We=>{fe({type:"RESOLVE",value:We})}).catch(We=>{fe({type:"REJECT",error:We})}),()=>{cancelRunningTask(ke)}}p$1(Ne,[fe,he,de]),p$1(()=>{if(ye!==void 0){if(ye===!1){Te();return}we()}},[ye]);function Me(){pe&&pe()}function ae(_e){me&&me(_e)}const ge=F$1(()=>he.getViewport({scale:Se,rotation:Ae}),[he,Ae,Se]);function $e(){if(!ue||!he||!ye)return;const{current:_e}=Pe;if(!_e)return;const ke=ge.clone({dontFlip:!0}),We={annotations:ye,annotationStorage:ue.annotationStorage,div:_e,downloadManager:null,imageResourcesPath:re,linkService:se,page:he,renderForms:de,viewport:ke};_e.innerHTML="";try{pdfjs$1.AnnotationLayer.render(We),Me()}catch(ze){ae(ze)}return()=>{}}return p$1($e,[ye,re,se,he,de,ge]),Cn.createElement("div",{className:clsx("react-pdf__Page__annotations","annotationLayer"),ref:Pe})}var __rest$1=globalThis&&globalThis.__rest||function(te,ee){var ne={};for(var re in te)Object.prototype.hasOwnProperty.call(te,re)&&ee.indexOf(re)<0&&(ne[re]=te[re]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var se=0,re=Object.getOwnPropertySymbols(te);se<re.length;se++)ee.indexOf(re[se])<0&&Object.prototype.propertyIsEnumerable.call(te,re[se])&&(ne[re[se]]=te[re[se]]);return ne};const defaultScale=1,Page=function te(ee){const ne=useDocumentContext();invariant(ne,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const re=Object.assign(Object.assign({},ne),ee),{_className:se="react-pdf__Page",_enableRegisterUnregisterPage:ie=!0,canvasBackground:oe,canvasRef:me,children:pe,className:he,customRenderer:ue,customTextRenderer:de,devicePixelRatio:Ae,error:Se="Failed to load the page.",height:ce,inputRef:fe,loading:ye="Loading page…",noData:ve="No page specified.",onGetAnnotationsError:Pe,onGetAnnotationsSuccess:we,onGetStructTreeError:Te,onGetStructTreeSuccess:Le,onGetTextError:Ne,onGetTextSuccess:Me,onLoadError:ae,onLoadSuccess:ge,onRenderAnnotationLayerError:$e,onRenderAnnotationLayerSuccess:_e,onRenderError:ke,onRenderSuccess:We,onRenderTextLayerError:ze,onRenderTextLayerSuccess:Qe,pageIndex:ct,pageNumber:it,pdf:ht,registerPage:at,renderAnnotationLayer:gt=!0,renderForms:dt=!1,renderMode:yt="canvas",renderTextLayer:mt=!0,rotate:qe,scale:Ee=defaultScale,unregisterPage:xe,width:Oe}=re,Ge=__rest$1(re,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[Ve,Ke]=useResolver(),{value:je,error:Ue}=Ve,Be=_(null);invariant(ht,"Attempted to load a page, but no document was specified.");const le=isProvided(it)?it-1:ct??null,be=it??(isProvided(ct)?ct+1:null),Ce=qe??(je?je.rotate:null),Fe=F$1(()=>{if(!je)return null;let St=1;const vt=Ee??defaultScale;if(Oe||ce){const $t=je.getViewport({scale:1,rotation:Ce});Oe?St=Oe/$t.width:ce&&(St=ce/$t.height)}return vt*St},[ce,je,Ce,Ee,Oe]);function Ie(){return()=>{isProvided(le)&&ie&&xe&&xe(le)}}p$1(Ie,[ie,ht,le,xe]);function Xe(){if(ge){if(!je||!Fe)return;ge(makePageCallback(je,Fe))}if(ie&&at){if(!isProvided(le)||!Be.current)return;at(le,Be.current)}}function tt(){Ue&&(Ue.toString(),ae&&ae(Ue))}function Ze(){Ke({type:"RESET"})}p$1(Ze,[Ke,ht,le]);function st(){if(!ht||!be)return;const St=makeCancellablePromise(ht.getPage(be)),vt=St;return St.promise.then($t=>{Ke({type:"RESOLVE",value:$t})}).catch($t=>{Ke({type:"REJECT",error:$t})}),()=>cancelRunningTask(vt)}p$1(st,[Ke,ht,le,be,at]),p$1(()=>{if(je!==void 0){if(je===!1){tt();return}Xe()}},[je,Fe]);const ot=F$1(()=>je&&isProvided(le)&&be&&isProvided(Ce)&&isProvided(Fe)?{_className:se,canvasBackground:oe,customTextRenderer:de,devicePixelRatio:Ae,onGetAnnotationsError:Pe,onGetAnnotationsSuccess:we,onGetStructTreeError:Te,onGetStructTreeSuccess:Le,onGetTextError:Ne,onGetTextSuccess:Me,onRenderAnnotationLayerError:$e,onRenderAnnotationLayerSuccess:_e,onRenderError:ke,onRenderSuccess:We,onRenderTextLayerError:ze,onRenderTextLayerSuccess:Qe,page:je,pageIndex:le,pageNumber:be,renderForms:dt,renderTextLayer:mt,rotate:Ce,scale:Fe}:null,[se,oe,de,Ae,Pe,we,Te,Le,Ne,Me,$e,_e,ke,We,ze,Qe,je,le,be,dt,mt,Ce,Fe]),et=F$1(()=>makeEventProps(Ge,()=>je&&(Fe?makePageCallback(je,Fe):void 0)),[Ge,je,Fe]),nt=`${le}@${Fe}/${Ce}`,ft=`${le}/${Ce}`;function pt(){switch(yt){case"custom":return invariant(ue,'renderMode was set to "custom", but no customRenderer was passed.'),Cn.createElement(ue,{key:`${nt}_custom`});case"none":return null;case"svg":return Cn.createElement(PageSVG,{key:`${ft}_svg`});case"canvas":default:return Cn.createElement(PageCanvas,{key:`${nt}_canvas`,canvasRef:me})}}function wt(){return mt?Cn.createElement(TextLayer$1,{key:`${nt}_text`}):null}function At(){return gt?Cn.createElement(AnnotationLayer$1,{key:`${nt}_annotations`}):null}function Tt(){return Cn.createElement(PageContext.Provider,{value:ot},pt(),wt(),At(),pe)}function Ye(){return be?ht===null||je===void 0||je===null?Cn.createElement(Message,{type:"loading"},typeof ye=="function"?ye():ye):ht===!1||je===!1?Cn.createElement(Message,{type:"error"},typeof Se=="function"?Se():Se):Tt():Cn.createElement(Message,{type:"no-data"},typeof ve=="function"?ve():ve)}return Cn.createElement("div",Object.assign({className:clsx(se,he),"data-page-number":be,ref:mergeRefs(fe,Be),style:{"--scale-factor":`${Fe}`,backgroundColor:oe||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},et),Ye())},isFunctionOrNode=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Page.propTypes=Object.assign(Object.assign({},eventProps),{canvasBackground:PropTypes.string,canvasRef:isRef,children:PropTypes.node,className:isClassName,customRenderer:PropTypes.func,customTextRenderer:PropTypes.func,devicePixelRatio:PropTypes.number,error:isFunctionOrNode,height:PropTypes.number,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode,noData:isFunctionOrNode,onGetTextError:PropTypes.func,onGetTextSuccess:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,onRenderError:PropTypes.func,onRenderSuccess:PropTypes.func,onRenderTextLayerError:PropTypes.func,onRenderTextLayerSuccess:PropTypes.func,pageIndex:isPageIndex,pageNumber:isPageNumber,pdf:isPdf,renderAnnotationLayer:PropTypes.bool,renderForms:PropTypes.bool,renderMode:isRenderMode,renderTextLayer:PropTypes.bool,rotate:isRotate,scale:PropTypes.number,width:PropTypes.number});const Page$1=Page;var __rest=globalThis&&globalThis.__rest||function(te,ee){var ne={};for(var re in te)Object.prototype.hasOwnProperty.call(te,re)&&ee.indexOf(re)<0&&(ne[re]=te[re]);if(te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var se=0,re=Object.getOwnPropertySymbols(te);se<re.length;se++)ee.indexOf(re[se])<0&&Object.prototype.propertyIsEnumerable.call(te,re[se])&&(ne[re[se]]=te[re[se]]);return ne};const Thumbnail=function te(ee){const ne=useDocumentContext();invariant(ne,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const re=Object.assign(Object.assign({},ne),ee),{className:se,linkService:ie,onItemClick:oe,pageIndex:me,pageNumber:pe}=re,he=isProvided(pe)?pe-1:me??null,ue=pe??(isProvided(me)?me+1:null);function de(Se){Se.preventDefault(),!(!isProvided(he)||!ue)&&(oe?oe({pageIndex:he,pageNumber:ue}):ie.goToPage(ue))}const Ae=__rest(ee,["className","onItemClick"]);return Cn.createElement("a",{className:clsx("react-pdf__Thumbnail",se),href:ue?"#":void 0,onClick:de},Cn.createElement(Page$1,Object.assign({},Ae,{_className:"react-pdf__Thumbnail__page",_enableRegisterUnregisterPage:!1,renderAnnotationLayer:!1,renderTextLayer:!1})))},Thumbnail$1=Thumbnail;displayWorkerWarning();pdfjs$1.GlobalWorkerOptions.workerSrc="pdf.worker.js";const TextLayer=`:root{--react-pdf-text-layer: 1;--highlight-bg-color: rgba(180, 0, 170, 1);--highlight-selected-bg-color: rgba(0, 100, 0, 1)}@media screen and (forced-colors: active){:root{--highlight-bg-color: Highlight;--highlight-selected-bg-color: ButtonText}}[data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}.textLayer{position:absolute;text-align:initial;top:0;right:0;bottom:0;left:0;overflow:hidden;line-height:1;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;z-index:2}.textLayer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;margin:0;transform-origin:0 0}.textLayer span.markedContent{top:0;height:0}.textLayer .highlight{margin:-1px;padding:1px;background-color:var(--highlight-bg-color);border-radius:4px}.textLayer .highlight.appended{position:initial}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:var(--highlight-selected-bg-color)}.textLayer br::-moz-selection{background:transparent}.textLayer br::selection{background:transparent}.textLayer .endOfContent{display:block;position:absolute;top:100%;right:0;bottom:0;left:0;z-index:-1;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer .endOfContent.active{top:0}
|
|
52
|
+
`,AnnotationLayer=`:root{--react-pdf-annotation-layer: 1;--annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");--input-focus-border-color: Highlight;--input-focus-outline: 1px solid Canvas;--input-unfocused-border-color: transparent;--input-disabled-border-color: transparent;--input-hover-border-color: black;--link-outline: none}@media screen and (forced-colors: active){:root{--input-focus-border-color: CanvasText;--input-unfocused-border-color: ActiveText;--input-disabled-border-color: GrayText;--input-hover-border-color: Highlight;--link-outline: 1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selectedItem}.annotationLayer .linkAnnotation:hover{-webkit-backdrop-filter:invert(100%);backdrop-filter:invert(100%)}}.annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0;z-index:3}.annotationLayer[data-main-rotation="90"] .norotate{transform:rotate(270deg) translate(-100%)}.annotationLayer[data-main-rotation="180"] .norotate{transform:rotate(180deg) translate(-100%,-100%)}.annotationLayer[data-main-rotation="270"] .norotate{transform:rotate(90deg) translateY(-100%)}.annotationLayer canvas{position:absolute;width:100%;height:100%}.annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;margin:0;transform-origin:0 0}.annotationLayer .linkAnnotation{outline:var(--link-outline)}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a:hover{opacity:.2;background:rgba(255,255,0,1);box-shadow:0 2px 10px #ff0}.annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation :is(input,textarea)[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{background:none;border:2px solid var(--input-disabled-border-color);cursor:not-allowed}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-image:none;background-color:transparent}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:"";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.annotationLayer .popupTriggerArea{height:100%;width:100%}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{position:absolute}.annotationLayer .popupWrapper{position:absolute;font-size:calc(9px * var(--scale-factor));width:100%;min-width:calc(180px * var(--scale-factor));pointer-events:none}.annotationLayer .popup{position:absolute;max-width:calc(180px * var(--scale-factor));background-color:#ff9;box-shadow:0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) #888;border-radius:calc(2px * var(--scale-factor));padding:calc(6px * var(--scale-factor));margin-left:calc(5px * var(--scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto}.annotationLayer .popup>*{font-size:calc(9px * var(--scale-factor))}.annotationLayer .popup h1{display:inline-block}.annotationLayer .popupDate{display:inline-block;margin-left:calc(5px * var(--scale-factor))}.annotationLayer .popupContent{border-top:1px solid rgba(51,51,51,1);margin-top:calc(2px * var(--scale-factor));padding-top:calc(2px * var(--scale-factor))}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--scale-factor))}.annotationLayer .highlightAnnotation,.annotationLayer .underlineAnnotation,.annotationLayer .squigglyAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .freeTextAnnotation,.annotationLayer .lineAnnotation svg line,.annotationLayer .squareAnnotation svg rect,.annotationLayer .circleAnnotation svg ellipse,.annotationLayer .polylineAnnotation svg polyline,.annotationLayer .polygonAnnotation svg polygon,.annotationLayer .caretAnnotation,.annotationLayer .inkAnnotation svg polyline,.annotationLayer .stampAnnotation,.annotationLayer .fileAttachmentAnnotation{cursor:pointer}.annotationLayer section svg{position:absolute;width:100%;height:100%;top:0;left:0}.annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.annotationLayer .annotationTextContent span{width:100%;display:inline-block}
|
|
53
|
+
`;function setUpWorker(){pdfjs$1.GlobalWorkerOptions.workerSrc=new URL(""+document.currentScript.src.replace("workplace-policies.js","")+"assets/pdf.worker.min-bc10fb5c.js",self.location).toString()}const PdfCss_textLayer=(()=>toString$3(TextLayer))(),PdfCss_annotationLayer=(()=>toString$3(AnnotationLayer))(),PdfCss_all=PdfCss_textLayer+PdfCss_annotationLayer;class Document_Prop extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["File","OnLoadSuccess","ClassName","OnItemClick","Children"]}}function Document_Component(te){return Interop_reactApi.createElement(Document$,keyValueList(te,1))}class Page_Prop extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["PageNumber","Width"]}}function Page_Component(te){return Interop_reactApi.createElement(Page$1,keyValueList(te,1))}class Thumbnail_Prop extends Union{constructor(ee,ne){super(),this.tag=ee,this.fields=ne}cases(){return["Key","PageNumber","Width"]}}function Thumbnail_Component(te){return Interop_reactApi.createElement(Thumbnail$1,keyValueList(te,1))}function Component$4(te){let ee,ne;const re=useFeliz_React__React_useState_Static_1505(!1),se=re[0],ie=useFeliz_React__React_useState_Static_1505(1),oe=ie[0]|0,me=useFeliz_React__React_useState_Static_1505(1),pe=me[1],he=me[0]|0,ue=useReact_useRef_1505(void 0);let de;const Ae=te.Path;if(Ae.tag===1)throw new Error("FilePath: Unused");return de=Ae.fields[0],y$1("div",createObj(ofArray$2([["ref",ue],["className","flex flex-col justify-center items-center"],(ee=[y$1("style",{children:[PdfCss_all]}),y$1("div",createObj(ofArray$2([["className","flex justify-center items-center space-x-4 mb-2"],(ne=[y$1("button",{className:"hidden lg:block py-1 px-2 bg-primary-base rounded-md text-white",type:"button",onClick:Se=>{re[1](!se)},children:"📄"}),y$1("div",{children:[`Page ${he} of ${oe}`]}),y$1("button",{className:"py-1 px-2 bg-primary-base rounded-md text-white",type:"button",disabled:he<=1,onClick:Se=>{pe(he-1)},children:"◀"}),y$1("button",{className:"py-1 px-2 bg-primary-base rounded-md text-white",type:"button",disabled:he>=oe,onClick:Se=>{pe(he+1)},children:"▶"}),y$1("a",{className:"py-1 px-2 bg-primary-base rounded-md text-white",href:de,download:te.Name,children:"💾"})],["children",Interop_reactApi.Children.toArray(Array.from(ne))])]))),Document_Component(ofArray$2([new Document_Prop(0,[de]),new Document_Prop(1,[Se=>{ie[1](Se.numPages),pe(1)}]),new Document_Prop(3,[Se=>{pe(Se.pageNumber)}]),new Document_Prop(2,["flex"]),new Document_Prop(4,[[y$1("div",createObj(toList(delay(()=>se?append(singleton(["className","flex flex-col space-y-4 p-4 bg-gray-100"]),delay(()=>{let Se;return singleton((Se=toList(delay(()=>map$2(ce=>{const fe=ofArray$2([y$1("div",createObj(toList(delay(()=>append(he===ce?singleton(["className","border-4 border-primary-base rounded"]):empty$2(),delay(()=>{let ye;return singleton((ye=[Thumbnail_Component(ofArray$2([new Thumbnail_Prop(0,[`thumbnail-${ce}`]),new Thumbnail_Prop(1,[ce]),new Thumbnail_Prop(2,[100])]))],["children",Interop_reactApi.Children.toArray(Array.from(ye))]))})))))),y$1("div",{className:"mt-1 text-center text-xs text-gray-600",children:ce})]);return y$1("div",{children:Interop_reactApi.Children.toArray(Array.from(fe))})},rangeDouble(1,1,oe)))),["children",Interop_reactApi.Children.toArray(Array.from(Se))]))})):empty$2())))),Page_Component(toList(delay(()=>append(singleton(new Page_Prop(0,[he])),delay(()=>ue.current!=null?singleton(new Page_Prop(1,[min(value(ue.current).clientWidth-20,768)])):empty$2())))))]])]))],["children",Interop_reactApi.Children.toArray(Array.from(ee))])])))}function Component$3(te){let ee,ne,re,se;const ie=te.dispatch,oe=te.acceptPolicyStatus,me=te.policyReviewItem,pe=useFeliz_React__React_useState_Static_1505(!1),he=pe[0];return y$1("div",createObj(ofArray$2([["className","w-full p-1 sm:p-5"],(ee=[y$1("div",createObj(ofArray$2([["className","flex justify-between items-center"],(ne=toList(delay(()=>{let ue,de;return append(singleton(y$1("div",createObj(ofArray$2([["className","flex items-start"],(ue=[y$1("div",createObj(ofArray$2([["onClick",Ae=>{ie(new Msg(1,[new Page$2(0,[])]))}],(de=[chevronLeft(singleton$1(new Prop(2,["cursor-pointer text-gray-900 hover:text-primary-base sm:mt-[1px]"])))],["children",Interop_reactApi.Children.toArray(Array.from(de))])]))),y$1("div",{className:"ml-1 mr-4 text-base sm:text-lg leading-6 sm:leading-7 font-semibold text-gray-900",children:me.Policy.Title})],["children",Interop_reactApi.Children.toArray(Array.from(ue))])])))),delay(()=>{let Ae,Se,ce;return me.Status.tag===2?singleton(y$1("div",createObj(ofArray$2([["className","flex items-center flex-col-reverse sm:flex-row"],(Ae=[y$1("span",{className:"mt-1 sm:mt-0 sm:mr-2.5 text-sm leading-5 font-medium text-gray-500",children:"Accepted"}),check(singleton$1(new Prop(2,["text-primary-base"])))],["children",Interop_reactApi.Children.toArray(Array.from(Ae))])])))):singleton(y$1("button",createObj(ofArray$2([["type","button"],["disabled",Deferred_inProgress(oe)],(Se=`
|
|
47
54
|
shadow-sm w-[4.75rem] h-10 px-3 py-2 rounded-md flex justify-center items-center text-white
|
|
48
55
|
text-sm font-semibold leading-5 cursor-pointer disabled:cursor-progress bg-primary-base
|
|
49
56
|
focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base
|
|
50
|
-
`,["className",
|
|
57
|
+
`,["className",Se]),["onClick",fe=>{ie(new Msg(4,[me,new AsyncOperationStatus$1(0,[])]))}],(ce=toList(delay(()=>oe.tag===1?singleton(loader(singleton$1(new Prop(2,["animate-spin"])))):singleton("Accept"))),["children",Interop_reactApi.Children.toArray(Array.from(ce))])]))))}))})),["children",Interop_reactApi.Children.toArray(Array.from(ne))])]))),y$1("div",createObj(ofArray$2([["className","mt-4 sm:mt-6 mb-6"],(re=[y$1(Component$4,me.Policy.File)],["children",Interop_reactApi.Children.toArray(Array.from(re))])]))),y$1("div",createObj(ofArray$2([["className","p-4 sm:p-6 rounded-lg shadow-sm border border-gray-300"],(se=toList(delay(()=>{let ue;return append(singleton(y$1("div",createObj(ofArray$2([["className","flex justify-between"],["onClick",de=>{pe[1](!he)}],(ue=toList(delay(()=>append(singleton(y$1("div",{className:"text-sm mr-4 sm:text-base leading-5 sm:leading-6 font-semibold text-gray-900",children:`About the ${me.Policy.Title}`})),delay(()=>{const de=singleton$1(new Prop(2,["cursor-pointer text-gray-400 hover:text-primary-base"]));return singleton(he?minus(de):plus(de))})))),["children",Interop_reactApi.Children.toArray(Array.from(ue))])])))),delay(()=>{let de,Ae,Se,ce;return he?singleton(y$1("div",createObj(ofArray$2([["className","mt-2 space-y-3 sm:max-w-[57rem]"],(de=[y$1("div",{className:"text-sm font-normal leading-6 text-gray-900",children:me.Policy.About.Copy}),y$1("div",createObj(ofArray$2([(Ae="flex text-sm font-medium leading-5 text-primary-base cursor-pointer hover:underline underline-offset-2",["className",Ae]),(Se=[y$1("a",{target:"_blank",rel:"noopener",href:me.Policy.About.Link,children:me.Policy.About.Link}),(ce=singleton$1(launch(empty$3())),y$1("span",{children:Interop_reactApi.Children.toArray(Array.from(ce))}))],["children",Interop_reactApi.Children.toArray(Array.from(Se))])])))],["children",Interop_reactApi.Children.toArray(Array.from(de))])])))):empty$2()}))})),["children",Interop_reactApi.Children.toArray(Array.from(se))])])))],["children",Interop_reactApi.Children.toArray(Array.from(ee))])])))}function Component$2(te){let ee,ne,re;const se=te.item,ie=te.dispatch,oe=useFeliz_React__React_useState_Static_1505(!1),me=oe[1],pe=equals$1(se.Status,new PolicyReviewItemStatusDto(2,[]));return y$1("div",createObj(ofArray$2([["key",se.Policy.Identifier.PolicyId],["onMouseEnter",he=>{me(!0)}],["onMouseLeave",he=>{me(!1)}],["onClick",he=>{ie(new Msg(1,[new Page$2(1,[se])]))}],["className",join(" ",toList(delay(()=>append(singleton("py-6 px-4 sm:px-6 shadow-sm rounded-lg text-left cursor-pointer"),delay(()=>singleton(pe?"border-2 border-primary-base":"border border-gray-300 hover:border-2 hover:border-primary-base hover:-my-[1.5px]"))))))],(ee=[y$1("div",createObj(ofArray$2([["className","flex justify-between"],(ne=[y$1("div",{className:"text-base leading-6 font-semibold text-gray-900 mr-4",children:se.Policy.Title}),y$1("div",createObj(ofArray$2([["className",join(" ",toList(delay(()=>append(singleton("ml-2"),delay(()=>singleton(pe?"text-primary-base":"text-gray-400"))))))],(re=toList(delay(()=>singleton(pe?check(empty$3()):chevronRight(singleton$1(new Prop(2,[oe[0]?"text-primary-base":""])))))),["children",Interop_reactApi.Children.toArray(Array.from(re))])])))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])]))),y$1("div",{className:"text-sm leading-5 font-normal text-gray-500 mt-2",children:se.Policy.Description}),y$1("div",{className:"text-sm leading-5 font-medium mt-3 text-primary-base hover:underline underline-offset-2",children:"View document (PDF)"})],["children",Interop_reactApi.Children.toArray(Array.from(ee))])])))}function canContinue(te){return forAll(ee=>equals$1(ee.Status,new PolicyReviewItemStatusDto(2,[])),te)}function Component$1(te,ee,ne){let re,se;return y$1("div",createObj(ofArray$2([["className","w-full sm:w-[35rem] text-center bg-white mx-auto px-1 py-5 sm:py-16"],(re=[y$1("div",{className:"text-gray-900 text-2xl sm:text-3xl leading-8 sm:leading-9 font-bold",children:"Employment information statements"}),y$1("div",{className:"text-gray-600 text-base sm:text-lg font-normal leading-7 sm:leading-8 mt-4",children:"Please read and accept the below information statements provided by the Fair Work Ombudsman."}),y$1("div",createObj(ofArray$2([["className","space-y-4 mt-8 sm:mt-10"],(se=toList(delay(()=>map$3(ie=>y$1(Component$2,{dispatch:ne,item:ie}),te))),["children",Interop_reactApi.Children.toArray(Array.from(se))])]))),y$1("button",createObj(toList(delay(()=>{const ie=ee.tag===1?!0:!canContinue(te);return append(singleton(["disabled",ie]),delay(()=>append(singleton(["type","button"]),delay(()=>append(singleton(["className",join(" ",toList(delay(()=>append(singleton(`mt-8 sm:mt-10 mx-auto shadow-sm w-full sm:w-[12.5rem] h-10 px-4 py-2
|
|
51
58
|
rounded-md flex justify-center items-center text-white text-base
|
|
52
59
|
font-semibold leading-6 cursor-pointer bg-primary-base
|
|
53
|
-
focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base`)
|
|
54
|
-
disabled:border disabled:border-gray-300 disabled:bg-gray-100`):
|
|
60
|
+
focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base`),delay(()=>append(Deferred_inProgress(ee)?singleton("cursor-progress"):empty$2(),delay(()=>!Deferred_inProgress(ee)&&ie?singleton(`disabled:text-gray-400 disabled:cursor-not-allowed
|
|
61
|
+
disabled:border disabled:border-gray-300 disabled:bg-gray-100`):empty$2())))))))]),delay(()=>append(singleton(["onClick",oe=>{ne(new Msg(5,[te,new AsyncOperationStatus$1(0,[])]))}]),delay(()=>{let oe;return singleton((oe=toList(delay(()=>ee.tag===1?singleton(loader(singleton$1(new Prop(2,["animate-spin"])))):singleton("Continue"))),["children",Interop_reactApi.Children.toArray(Array.from(oe))]))}))))))))}))))],["children",Interop_reactApi.Children.toArray(Array.from(re))])])))}function r(){return(r=Object.assign||function(te){for(var ee=1;ee<arguments.length;ee++){var ne=arguments[ee];for(var re in ne)Object.prototype.hasOwnProperty.call(ne,re)&&(te[re]=ne[re])}return te}).apply(this,arguments)}function i(te){this.getChildContext=function(){return te.context};var ee=te.children,ne=function(re,se){if(re==null)return{};var ie,oe,me={},pe=Object.keys(re);for(oe=0;oe<pe.length;oe++)se.indexOf(ie=pe[oe])>=0||(me[ie]=re[ie]);return me}(te,["context","children"]);return F$2(ee,ne)}function a(){var te=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(te),this._vdom=y$1(i,r({},this._props,{context:te.detail.context}),function ee(ne,re){if(ne.nodeType===3)return ne.data;if(ne.nodeType!==1)return null;var se=[],ie={},oe=0,me=ne.attributes,pe=ne.childNodes;for(oe=me.length;oe--;)me[oe].name!=="slot"&&(ie[me[oe].name]=me[oe].value,ie[s(me[oe].name)]=me[oe].value);for(oe=pe.length;oe--;){var he=ee(pe[oe],null),ue=pe[oe].slot;ue?ie[ue]=y$1(u,{name:ue},he):se[oe]=he}var de=re?y$1(u,null,se):se;return y$1(re||ne.nodeName.toLowerCase(),ie,de)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?E$1:D$1)(this._vdom,this._root)}function s(te){return te.replace(/-(\w)/g,function(ee,ne){return ne?ne.toUpperCase():""})}function c(te,ee,ne){if(this._vdom){var re={};re[te]=ne=ne??void 0,re[s(te)]=ne,this._vdom=F$2(this._vdom,re),D$1(this._vdom,this._root)}}function l(){D$1(this._vdom=null,this._root)}function u(te,ee){var ne=this;return y$1("slot",r({},te,{ref:function(re){re?(ne.ref=re,ne._listener||(ne._listener=function(se){se.stopPropagation(),se.detail.context=ee},re.addEventListener("_preact",ne._listener))):ne.ref.removeEventListener("_preact",ne._listener)}}))}function preact_custom_element(te,ee,ne,re){function se(){var ie=Reflect.construct(HTMLElement,[],se);return ie._vdomComponent=te,ie._root=re&&re.shadow?ie.attachShadow({mode:"open"}):ie,ie}return(se.prototype=Object.create(HTMLElement.prototype)).constructor=se,se.prototype.connectedCallback=a,se.prototype.attributeChangedCallback=c,se.prototype.disconnectedCallback=l,ne=ne||te.observedAttributes||Object.keys(te.propTypes||{}),se.observedAttributes=ne,ne.forEach(function(ie){Object.defineProperty(se.prototype,ie,{get:function(){return this._vdom.props[ie]},set:function(oe){this._vdom?this.attributeChangedCallback(ie,null,oe):(this._props||(this._props={}),this._props[ie]=oe,this.connectedCallback());var me=typeof oe;oe!=null&&me!=="string"&&me!=="boolean"&&me!=="number"||this.setAttribute(ie,oe)}})}),customElements.define(ee||te.tagName||te.displayName||te.name,se)}function register(te,ee){preact_custom_element(te,ee,void 0,{shadow:!0})}function Component(te){let ee,ne;const re=BackendService_$ctor_Z384F8060(te.backendUrl,te.accessToken);ne=React_useElmish_Z6C327F2E(()=>ProgramModule_mkProgram(StateModule_init,(me,pe)=>StateModule_update(re,me,pe),(me,pe)=>{}),void 0,void 0);const se=ne[0],ie=ne[1],oe=[y$1("style",{children:[css]}),y$1("div",createObj(ofArray$2([["className","font-inter"],(ee=toList(delay(()=>{const me=se.ReviewItemList,pe=se.PresentPoliciesStatus;let he,ue;switch(me.tag){case 1:{he=0;break}case 2:{switch(pe.tag){case 2:{me.fields[0].tag===0&&pe.fields[0].tag===0?(he=2,ue=me.fields[0].fields[0]):he=1;break}case 3:{me.fields[0].tag,he=1;break}default:he=0}break}case 3:{switch(pe.tag){case 2:{pe.fields[0].tag,he=1;break}case 3:{he=1;break}default:he=0}break}default:he=0}switch(he){case 0:return singleton(defaultOf());case 1:return singleton(y$1("div",{children:["Oops, we've encountered an error"]}));default:{const de=se.Page;return de.tag===1?singleton(y$1(Component$3,{policyReviewItem:de.fields[0],acceptPolicyStatus:se.AcceptPolicyStatus,dispatch:ie})):singleton(Component$1(ue,se.ContinueStatus,ie))}}})),["children",Interop_reactApi.Children.toArray(Array.from(ee))])])))];return y$1(k$3,{},...oe)}setUpWorker();register(te=>y$1(Component,te),"apollo-workplace-policies-app");
|