Files
chinese-family-tree-2/.next/static/chunks/b7a844310dc7e06d.js
T
freedakgmail e44dd0bd95 0.0.8.0
2025-11-23 18:03:04 +08:00

160 lines
534 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,85398,t=>{"use strict";let e,n,r,i,a,o;var s=t.i(36792),l=t.i(82772),h=t.i(69744),u=t.i(34346),c=t.i(76584);let f=new Map;var d=t.i(74665),p=t.i(8204),g=t.i(27706);let m=(0,g.default)("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);function v(t){return t?t.split("-")[0]:""}function b({member:t,isRoot:e,isSpouse:n,onSelect:r,isHighlighted:i,relationMode:a,isSelected:o}){let{avatarUrl:l}=function(t){let[e,n]=(0,u.useState)(t?f.get(t):void 0),[r,i]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if(!t)return void n(void 0);let e=f.get(t);if(e)return void n(e);let r=!0;return i(!0),c.db.images.get(t).then(e=>{if(e&&r){let r=URL.createObjectURL(e.blob);f.set(t,r),n(r)}}).catch(t=>{console.error("Failed to load avatar:",t)}).finally(()=>{r&&i(!1)}),()=>{r=!1}},[t]),{avatarUrl:e,isLoading:r}}(t?.avatarImageId),g=v(t.birthDate),m=v(t.deathDate),b=function(t,e){if(!t)return null;let n=new Date(t),r=e?new Date(e):new Date,i=r.getFullYear()-n.getFullYear(),a=r.getMonth()-n.getMonth();return(a<0||0===a&&r.getDate()<n.getDate())&&i--,i}(t.birthDate,t.deathDate),y=g?m?`${g}-${m}`:`${g}-`:"",w=null!==b?t.deathDate?`享年${b}`:`${b}`:"";return(0,s.jsxs)("div",{className:(0,h.cn)("family-node-card relative flex flex-col items-center gap-2 p-3 rounded-lg transition-all cursor-pointer hover:scale-105 shadow-sm w-32",o?"border-4 border-blue-500 bg-blue-50 dark:bg-blue-900/20 ring-4 ring-blue-200 dark:ring-blue-800":i?"border-4 border-yellow-400 bg-yellow-50 dark:bg-yellow-900/20 ring-4 ring-yellow-200 dark:ring-yellow-800 animate-pulse":e?"border-2 border-primary bg-primary/5":n?"border-2 border-dashed border-border/60 bg-muted/30":"border-2 border-border bg-card",a&&"hover:border-blue-400 hover:shadow-lg"),onClick:()=>r?.(t),children:[(0,s.jsxs)("div",{className:"absolute -top-3 bg-background border border-border px-2 py-0.5 rounded-full text-[10px] text-muted-foreground font-mono",children:[t.generation,"世"]}),(0,s.jsx)("div",{className:"h-12 w-12 rounded-full bg-muted flex items-center justify-center text-muted-foreground overflow-hidden border border-border/50",children:l?(0,s.jsx)("img",{src:l,alt:t.fullName,className:"h-full w-full object-cover"}):"FEMALE"===t.gender?(0,s.jsx)(p.CircleUserRound,{className:"h-8 w-8 text-pink-400"}):(0,s.jsx)(d.CircleUser,{className:"h-8 w-8 text-blue-400"})}),(0,s.jsxs)("div",{className:"text-center w-full",children:[(0,s.jsxs)("div",{className:"font-serif font-bold text-foreground leading-tight",children:[t.surname," ",t.givenName]}),t.courtesyName&&(0,s.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-0.5",children:["字 ",t.courtesyName]}),y&&(0,s.jsx)("div",{className:"text-[9px] text-muted-foreground/70 mt-1 font-mono",children:y}),w&&(0,s.jsx)("div",{className:"text-[9px] text-muted-foreground/60 font-mono",children:w}),t.phone&&(0,s.jsxs)("div",{className:"text-[9px] text-muted-foreground/60 font-mono truncate",children:["📱 ",t.phone]})]}),t.deathDate&&(0,s.jsx)("div",{className:"absolute -top-1 -right-1 h-2 w-2 rounded-full bg-neutral-400 ring-2 ring-background"})]})}function y({member:t,spouse:e,spouses:n,isRoot:r,onSelect:i,isHighlighted:a,relationMode:o,isSelected:l}){let h=n||(e?[e]:[]);return 0===h.length?(0,s.jsx)(b,{member:t,isRoot:r,onSelect:i,isHighlighted:a,relationMode:o,isSelected:l}):(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(b,{member:t,isRoot:r,onSelect:i,isHighlighted:a,relationMode:o,isSelected:l}),h.map((t,e)=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(m,{className:"h-4 w-4 text-red-400 flex-shrink-0"}),(0,s.jsx)(b,{member:t,isSpouse:!0,onSelect:i,relationMode:o})]},t.id))]})}var w=t.i(92879),_=t.i(69074);function x({rootId:t,onSelectMember:e,relationMode:n=!1,selectedMembers:r=[],onMemberClick:i}){let{getMember:a,treeData:o,highlightedMemberId:l}=(0,w.useFamily)(),h=a(t),c=(0,_.useRouter)(),f=(0,u.useRef)(null),[d,p]=(0,u.useState)([]),g=(0,u.useRef)(new Map),m=(0,u.useCallback)(t=>{n&&i?i(t.id):c.push(`/members/${t.id}`)},[n,i,c]),v=(0,u.useCallback)(()=>{let t=[],e=f.current?.getBoundingClientRect();e&&0!==g.current.size&&(g.current.forEach((n,r)=>{let i=a(r);if(!i||!i.childrenIds||0===i.childrenIds.length)return;let o=n.getBoundingClientRect(),s=o.left+o.width/2-e.left,l=o.bottom-e.top,h=l+24;t.push({from:{x:s,y:l},to:{x:s,y:h},type:"vertical"});let u=i.childrenIds.map(t=>{let n=g.current.get(t);if(!n)return null;let r=n.getBoundingClientRect();return{id:t,centerX:r.left+r.width/2-e.left,topY:r.top-e.top}}).filter(Boolean);if(0!==u.length){if(u.length>1){let e=Math.min(...u.map(t=>t.centerX)),n=Math.max(...u.map(t=>t.centerX));t.push({from:{x:e,y:h},to:{x:n,y:h},type:"horizontal"})}u.forEach(e=>{t.push({from:{x:e.centerX,y:h},to:{x:e.centerX,y:e.topY},type:"vertical"})})}}),p(t))},[a]);if((0,u.useEffect)(()=>{let t=[];return t.push(setTimeout(v,50)),t.push(setTimeout(v,150)),t.push(setTimeout(v,300)),t.push(setTimeout(v,500)),window.addEventListener("resize",v),()=>{t.forEach(t=>clearTimeout(t)),window.removeEventListener("resize",v)}},[v,o]),!h)return null;let b=({memberId:t,isRoot:e=!1})=>{let i=a(t);if(!i)return null;let o=i.childrenIds&&i.childrenIds.length>0,h=i.spouseIds&&i.spouseIds.length>0?i.spouseIds.map(t=>a(t)).filter(Boolean):[];return(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("div",{ref:e=>{e?g.current.set(t,e):g.current.delete(t)},className:"relative z-10",children:(0,s.jsx)(y,{member:i,spouses:h,onSelect:m,isRoot:e,isHighlighted:i.id===l,relationMode:n,isSelected:r.includes(i.id)})}),o&&(0,s.jsx)("div",{className:"flex items-start relative",style:{marginTop:"48px",gap:"32px"},children:[...i.childrenIds].sort((t,e)=>{let n=a(t),r=a(e);if(!n||!r)return 0;let i=n.tags?.includes("始祖")||1===n.generation,o=r.tags?.includes("始祖")||1===r.generation;return i&&!o?-1:!i&&o?1:(n.birthDate||"").localeCompare(r.birthDate||"")}).map(t=>(0,s.jsx)(b,{memberId:t},t))})]})};return(0,s.jsx)("div",{className:"relative",children:(0,s.jsxs)("div",{ref:f,className:"p-12 min-w-fit relative",style:{minHeight:"100%"},children:[(0,s.jsx)("div",{className:"absolute inset-0 pointer-events-none",style:{zIndex:1},children:d.map((t,e)=>{let n="horizontal"===t.type,r=n?Math.abs(t.to.x-t.from.x):1,i=n?1:Math.abs(t.to.y-t.from.y),a=Math.min(t.from.x,t.to.x),o=Math.min(t.from.y,t.to.y);return r<=0||i<=0?null:(0,s.jsx)("div",{className:"absolute bg-black",style:{left:`${a}px`,top:`${o}px`,width:`${r}px`,height:`${i}px`,transform:n?"scaleY(0.5)":"scaleX(0.5)",transformOrigin:"top left"}},e)})}),(0,s.jsx)("div",{className:"relative",style:{zIndex:10},children:(0,s.jsx)(b,{memberId:t,isRoot:!0})})]})})}var N={value:()=>{}};function A(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw Error("illegal type: "+t);r[t]=[]}return new L(r)}function L(t){this._=t}function k(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=N,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}function S(){}function C(t){return null==t?S:function(){return this.querySelector(t)}}function P(){return[]}function E(t){return null==t?P:function(){return this.querySelectorAll(t)}}function I(t){return function(){return this.matches(t)}}function j(t){return function(e){return e.matches(t)}}L.prototype=A.prototype={constructor:L,on:function(t,e){var n,r=this._,i=(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw Error("unknown type: "+t);return{type:t,name:e}}),a=-1,o=i.length;if(arguments.length<2){for(;++a<o;)if((n=(t=i[a]).type)&&(n=function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(r[n],t.name)))return n;return}if(null!=e&&"function"!=typeof e)throw Error("invalid callback: "+e);for(;++a<o;)if(n=(t=i[a]).type)r[n]=k(r[n],t.name,e);else if(null==e)for(n in r)r[n]=k(r[n],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new L(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw Error("unknown type: "+t);for(r=this._[t],a=0,n=r.length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var M=Array.prototype.find;function F(){return this.firstElementChild}var B=Array.prototype.filter;function O(){return Array.from(this.children)}function T(t){return Array(t.length)}function R(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function D(t,e,n,r,i,a){for(var o,s=0,l=e.length,h=a.length;s<h;++s)(o=e[s])?(o.__data__=a[s],r[s]=o):n[s]=new R(t,a[s]);for(;s<l;++s)(o=e[s])&&(i[s]=o)}function z(t,e,n,r,i,a,o){var s,l,h,u=new Map,c=e.length,f=a.length,d=Array(c);for(s=0;s<c;++s)(l=e[s])&&(d[s]=h=o.call(l,l.__data__,s,e)+"",u.has(h)?i[s]=l:u.set(h,l));for(s=0;s<f;++s)h=o.call(t,a[s],s,a)+"",(l=u.get(h))?(r[s]=l,l.__data__=a[s],u.delete(h)):n[s]=new R(t,a[s]);for(s=0;s<c;++s)(l=e[s])&&u.get(d[s])===l&&(i[s]=l)}function q(t){return t.__data__}function U(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}R.prototype={constructor:R,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var $="http://www.w3.org/1999/xhtml";let H={svg:"http://www.w3.org/2000/svg",xhtml:$,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function W(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),H.hasOwnProperty(e)?{space:H[e],local:t}:t}function X(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Y(t,e){return t.style.getPropertyValue(e)||X(t).getComputedStyle(t,null).getPropertyValue(e)}function V(t){return t.trim().split(/^|\s+/)}function G(t){return t.classList||new J(t)}function J(t){this._node=t,this._names=V(t.getAttribute("class")||"")}function Z(t,e){for(var n=G(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function K(t,e){for(var n=G(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Q(){this.textContent=""}function tt(){this.innerHTML=""}function te(){this.nextSibling&&this.parentNode.appendChild(this)}function tn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function tr(t){var e=W(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===$&&e.documentElement.namespaceURI===$?e.createElement(t):e.createElementNS(n,t)}})(e)}function ti(){return null}function ta(){var t=this.parentNode;t&&t.removeChild(this)}function to(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ts(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function tl(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r<a;++r)(n=e[r],t.type&&n.type!==t.type||n.name!==t.name)?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function th(t,e,n){return function(){var r,i=this.__on,a=function(t){e.call(this,t,this.__data__)};if(i){for(var o=0,s=i.length;o<s;++o)if((r=i[o]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),r.value=e;return}}this.addEventListener(t.type,a,n),r={type:t.type,name:t.name,value:e,listener:a,options:n},i?i.push(r):this.__on=[r]}}function tu(t,e,n){var r=X(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}J.prototype={add:function(t){0>this._names.indexOf(t)&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var tc=[null];function tf(t,e){this._groups=t,this._parents=e}function td(){return new tf([[document.documentElement]],tc)}function tp(t){return"string"==typeof t?new tf([[document.querySelector(t)]],[document.documentElement]):new tf([[t]],tc)}tf.prototype=td.prototype={constructor:tf,select:function(t){"function"!=typeof t&&(t=C(t));for(var e=this._groups,n=e.length,r=Array(n),i=0;i<n;++i)for(var a,o,s=e[i],l=s.length,h=r[i]=Array(l),u=0;u<l;++u)(a=s[u])&&(o=t.call(a,a.__data__,u,s))&&("__data__"in a&&(o.__data__=a.__data__),h[u]=o);return new tf(r,this._parents)},selectAll:function(t){if("function"==typeof t){var e;e=t,t=function(){var t;return t=e.apply(this,arguments),null==t?[]:Array.isArray(t)?t:Array.from(t)}}else t=E(t);for(var n=this._groups,r=n.length,i=[],a=[],o=0;o<r;++o)for(var s,l=n[o],h=l.length,u=0;u<h;++u)(s=l[u])&&(i.push(t.call(s,s.__data__,u,l)),a.push(s));return new tf(i,a)},selectChild:function(t){var e;return this.select(null==t?F:(e="function"==typeof t?t:j(t),function(){return M.call(this.children,e)}))},selectChildren:function(t){var e;return this.selectAll(null==t?O:(e="function"==typeof t?t:j(t),function(){return B.call(this.children,e)}))},filter:function(t){"function"!=typeof t&&(t=I(t));for(var e=this._groups,n=e.length,r=Array(n),i=0;i<n;++i)for(var a,o=e[i],s=o.length,l=r[i]=[],h=0;h<s;++h)(a=o[h])&&t.call(a,a.__data__,h,o)&&l.push(a);return new tf(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,q);var n=e?z:D,r=this._parents,i=this._groups;"function"!=typeof t&&(b=t,t=function(){return b});for(var a=i.length,o=Array(a),s=Array(a),l=Array(a),h=0;h<a;++h){var u=r[h],c=i[h],f=c.length,d="object"==typeof(v=t.call(u,u&&u.__data__,h,r))&&"length"in v?v:Array.from(v),p=d.length,g=s[h]=Array(p),m=o[h]=Array(p);n(u,c,g,m,l[h]=Array(f),d,e);for(var v,b,y,w,_=0,x=0;_<p;++_)if(y=g[_]){for(_>=x&&(x=_+1);!(w=m[x])&&++x<p;);y._next=w||null}}return(o=new tf(o,r))._enter=s,o._exit=l,o},enter:function(){return new tf(this._enter||this._groups.map(T),this._parents)},exit:function(){return new tf(this._exit||this._groups.map(T),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,a=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==n?a.remove():n(a),r&&i?r.merge(i).order():i},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),l=0;l<o;++l)for(var h,u=n[l],c=r[l],f=u.length,d=s[l]=Array(f),p=0;p<f;++p)(h=u[p]||c[p])&&(d[p]=h);for(;l<i;++l)s[l]=n[l];return new tf(s,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],a=i.length-1,o=i[a];--a>=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=U);for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o,s=n[a],l=s.length,h=i[a]=Array(l),u=0;u<l;++u)(o=s[u])&&(h[u]=o);h.sort(e)}return new tf(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null},size:function(){let t=0;for(let e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,a=e[n],o=0,s=a.length;o<s;++o)(i=a[o])&&t.call(i,i.__data__,o,a);return this},attr:function(t,e){var n=W(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof e?n.local?function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}:function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}:n.local?function(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}:function(t,e){return function(){this.setAttribute(t,e)}})(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}:function(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):Y(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]},classed:function(t,e){var n=V(t+"");if(arguments.length<2){for(var r=G(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?function(t,e){return function(){(e.apply(this,arguments)?Z:K)(this,t)}}:e?function(t){return function(){Z(this,t)}}:function(t){return function(){K(this,t)}})(n,e))},text:function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(te)},lower:function(){return this.each(tn)},append:function(t){var e="function"==typeof t?t:tr(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:tr(t),r=null==e?ti:"function"==typeof e?e:C(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(ta)},clone:function(t){return this.select(t?ts:to)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,a=(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}),o=a.length;if(arguments.length<2){var s=this.node().__on;if(s){for(var l,h=0,u=s.length;h<u;++h)for(r=0,l=s[h];r<o;++r)if((i=a[r]).type===l.type&&i.name===l.name)return l.value}return}for(r=0,s=e?th:tl;r<o;++r)this.each(s(a[r],e,n));return this},dispatch:function(t,e){return this.each(("function"==typeof e?function(t,e){return function(){return tu(this,t,e.apply(this,arguments))}}:function(t,e){return function(){return tu(this,t,e)}})(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],a=0,o=i.length;a<o;++a)(r=i[a])&&(yield r)}};let tg={capture:!0,passive:!1};function tm(t){t.preventDefault(),t.stopImmediatePropagation()}function tv(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function tb(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ty(){}var tw="\\s*([+-]?\\d+)\\s*",t_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tx="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tN=/^#([0-9a-f]{3,8})$/,tA=RegExp(`^rgb\\(${tw},${tw},${tw}\\)$`),tL=RegExp(`^rgb\\(${tx},${tx},${tx}\\)$`),tk=RegExp(`^rgba\\(${tw},${tw},${tw},${t_}\\)$`),tS=RegExp(`^rgba\\(${tx},${tx},${tx},${t_}\\)$`),tC=RegExp(`^hsl\\(${t_},${tx},${tx}\\)$`),tP=RegExp(`^hsla\\(${t_},${tx},${tx},${t_}\\)$`),tE={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function tI(){return this.rgb().formatHex()}function tj(){return this.rgb().formatRgb()}function tM(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=tN.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?tF(e):3===n?new tT(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?tB(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?tB(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=tA.exec(t))?new tT(e[1],e[2],e[3],1):(e=tL.exec(t))?new tT(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=tk.exec(t))?tB(e[1],e[2],e[3],e[4]):(e=tS.exec(t))?tB(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=tC.exec(t))?t$(e[1],e[2]/100,e[3]/100,1):(e=tP.exec(t))?t$(e[1],e[2]/100,e[3]/100,e[4]):tE.hasOwnProperty(t)?tF(tE[t]):"transparent"===t?new tT(NaN,NaN,NaN,0):null}function tF(t){return new tT(t>>16&255,t>>8&255,255&t,1)}function tB(t,e,n,r){return r<=0&&(t=e=n=NaN),new tT(t,e,n,r)}function tO(t,e,n,r){var i;return 1==arguments.length?((i=t)instanceof ty||(i=tM(i)),i)?new tT((i=i.rgb()).r,i.g,i.b,i.opacity):new tT:new tT(t,e,n,null==r?1:r)}function tT(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function tR(){return`#${tU(this.r)}${tU(this.g)}${tU(this.b)}`}function tD(){let t=tz(this.opacity);return`${1===t?"rgb(":"rgba("}${tq(this.r)}, ${tq(this.g)}, ${tq(this.b)}${1===t?")":`, ${t})`}`}function tz(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function tq(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function tU(t){return((t=tq(t))<16?"0":"")+t.toString(16)}function t$(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new tW(t,e,n,r)}function tH(t){if(t instanceof tW)return new tW(t.h,t.s,t.l,t.opacity);if(t instanceof ty||(t=tM(t)),!t)return new tW;if(t instanceof tW)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(n-r)/s+(n<r)*6:n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new tW(o,s,l,t.opacity)}function tW(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function tX(t){return(t=(t||0)%360)<0?t+360:t}function tY(t){return Math.max(0,Math.min(1,t||0))}function tV(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function tG(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}tv(ty,tM,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:tI,formatHex:tI,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return tH(this).formatHsl()},formatRgb:tj,toString:tj}),tv(tT,tO,tb(ty,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new tT(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new tT(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new tT(tq(this.r),tq(this.g),tq(this.b),tz(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tR,formatHex:tR,formatHex8:function(){return`#${tU(this.r)}${tU(this.g)}${tU(this.b)}${tU((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:tD,toString:tD})),tv(tW,function(t,e,n,r){return 1==arguments.length?tH(t):new tW(t,e,n,null==r?1:r)},tb(ty,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new tW(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new tW(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new tT(tV(t>=240?t-240:t+120,i,r),tV(t,i,r),tV(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new tW(tX(this.h),tY(this.s),tY(this.l),tz(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=tz(this.opacity);return`${1===t?"hsl(":"hsla("}${tX(this.h)}, ${100*tY(this.s)}%, ${100*tY(this.l)}%${1===t?")":`, ${t})`}`}}));let tJ=t=>()=>t;function tZ(t,e){var n=e-t;return n?function(e){return t+e*n}:tJ(isNaN(t)?e:t)}let tK=function t(e){var n,r=1==(n=+e)?tZ:function(t,e){var r,i,a;return e-t?(r=t,i=e,r=Math.pow(r,a=n),i=Math.pow(i,a)-r,a=1/a,function(t){return Math.pow(r+t*i,a)}):tJ(isNaN(t)?e:t)};function i(t,e){var n=r((t=tO(t)).r,(e=tO(e)).r),i=r(t.g,e.g),a=r(t.b,e.b),o=tZ(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return i.gamma=t,i}(1);function tQ(t){return function(e){var n,r,i=e.length,a=Array(i),o=Array(i),s=Array(i);for(n=0;n<i;++n)r=tO(e[n]),a[n]=r.r||0,o[n]=r.g||0,s[n]=r.b||0;return a=t(a),o=t(o),s=t(s),r.opacity=1,function(t){return r.r=a(t),r.g=o(t),r.b=s(t),r+""}}}function t1(t,e){return t*=1,e*=1,function(n){return t*(1-n)+e*n}}tQ(function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r<e-1?t[r+2]:2*a-i;return tG((n-r/e)*e,o,i,a,s)}}),tQ(function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],a=t[r%e],o=t[(r+1)%e],s=t[(r+2)%e];return tG((n-r/e)*e,i,a,o,s)}});var t0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,t2=RegExp(t0.source,"g");function t5(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var t3,t4,t6=0,t8=0,t7=0,t9=0,et=0,ee=0,en="object"==typeof performance&&performance.now?performance:Date,er="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ei(){return et||(er(ea),et=en.now()+ee)}function ea(){et=0}function eo(){this._call=this._time=this._next=null}function es(t,e,n){var r=new eo;return r.restart(t,e,n),r}function el(){et=(t9=en.now())+ee,t6=t8=0;try{ei(),++t6;for(var t,e=t3;e;)(t=et-e._time)>=0&&e._call.call(void 0,t),e=e._next;--t6}finally{t6=0,function(){for(var t,e,n=t3,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:t3=e);t4=t,eu(r)}(),et=0}}function eh(){var t=en.now(),e=t-t9;e>1e3&&(ee-=e,t9=t)}function eu(t){!t6&&(t8&&(t8=clearTimeout(t8)),t-et>24?(t<1/0&&(t8=setTimeout(el,t-en.now()-ee)),t7&&(t7=clearInterval(t7))):(t7||(t9=en.now(),t7=setInterval(eh,1e3)),t6=1,er(el)))}function ec(t,e,n){var r=new eo;return e=null==e?0:+e,r.restart(n=>{r.stop(),t(n+e)},e,n),r}eo.prototype=es.prototype={constructor:eo,restart:function(t,e,n){if("function"!=typeof t)throw TypeError("callback is not a function");n=(null==n?ei():+n)+(null==e?0:+e),this._next||t4===this||(t4?t4._next=this:t3=this,t4=this),this._call=t,this._time=n,eu()},stop:function(){this._call&&(this._call=null,this._time=1/0,eu())}};var ef=A("start","end","cancel","interrupt"),ed=[];function ep(t,e,n,r,i,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(l){var h,u,c,f;if(1!==n.state)return s();for(h in i)if((f=i[h]).name===n.name){if(3===f.state)return ec(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[h]):+h<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[h])}if(ec(function(){3===n.state&&(n.state=4,n.timer.restart(o,n.delay,n.time),o(l))}),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(h=0,n.state=3,r=Array(c=n.tween.length),u=-1;h<c;++h)(f=n.tween[h].value.call(t,t.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function o(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(s),n.state=5,1),a=-1,o=r.length;++a<o;)r[a].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=es(function(t){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)},0,n.time)}(t,n,{name:e,index:r,group:i,on:ef,tween:ed,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function eg(t,e){var n=ev(t,e);if(n.state>0)throw Error("too late; already scheduled");return n}function em(t,e){var n=ev(t,e);if(n.state>3)throw Error("too late; already running");return n}function ev(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw Error("transition not found");return n}function eb(t,e){var n,r,i,a=t.__transition,o=!0;if(a){for(i in e=null==e?null:e+"",a){if((n=a[i]).name!==e){o=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]}o&&delete t.__transition}}var ey=180/Math.PI,ew={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function e_(t,e,n,r,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),t*r<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*ey,skewX:Math.atan(l)*ey,scaleX:o,scaleY:s}}function ex(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(a,o){var s,l,h,u,c=[],f=[];return a=t(a),o=t(o),!function(t,r,i,a,o,s){if(t!==i||r!==a){var l=o.push("translate(",null,e,null,n);s.push({i:l-4,x:t1(t,i)},{i:l-2,x:t1(r,a)})}else(i||a)&&o.push("translate("+i+e+a+n)}(a.translateX,a.translateY,o.translateX,o.translateY,c,f),s=a.rotate,l=o.rotate,s!==l?(s-l>180?l+=360:l-s>180&&(s+=360),f.push({i:c.push(i(c)+"rotate(",null,r)-2,x:t1(s,l)})):l&&c.push(i(c)+"rotate("+l+r),h=a.skewX,u=o.skewX,h!==u?f.push({i:c.push(i(c)+"skewX(",null,r)-2,x:t1(h,u)}):u&&c.push(i(c)+"skewX("+u+r),!function(t,e,n,r,a,o){if(t!==n||e!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:t1(t,n)},{i:s-2,x:t1(e,r)})}else(1!==n||1!==r)&&a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,c,f),a=o=null,function(t){for(var e,n=-1,r=f.length;++n<r;)c[(e=f[n]).i]=e.x(t);return c.join("")}}}var eN=ex(function(t){let e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ew:e_(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),eA=ex(function(t){return null==t?ew:(hm||(hm=document.createElementNS("http://www.w3.org/2000/svg","g")),hm.setAttribute("transform",t),t=hm.transform.baseVal.consolidate())?e_((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):ew},", ",")",")");function eL(t,e,n){var r=t._id;return t.each(function(){var t=em(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return ev(t,r).value[e]}}function ek(t,e){var n;return("number"==typeof e?t1:e instanceof tM?tK:(n=tM(e))?(e=n,tK):function(t,e){var n,r,i,a,o,s=t0.lastIndex=t2.lastIndex=0,l=-1,h=[],u=[];for(t+="",e+="";(i=t0.exec(t))&&(a=t2.exec(e));)(o=a.index)>s&&(o=e.slice(s,o),h[l]?h[l]+=o:h[++l]=o),(i=i[0])===(a=a[0])?h[l]?h[l]+=a:h[++l]=a:(h[++l]=null,u.push({i:l,x:t1(i,a)})),s=t2.lastIndex;return s<e.length&&(o=e.slice(s),h[l]?h[l]+=o:h[++l]=o),h.length<2?u[0]?(n=u[0].x,function(t){return n(t)+""}):(r=e,function(){return r}):(e=u.length,function(t){for(var n,r=0;r<e;++r)h[(n=u[r]).i]=n.x(t);return h.join("")})})(t,e)}var eS=td.prototype.constructor;function eC(t){return function(){this.style.removeProperty(t)}}var eP=0;function eE(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}var eI=td.prototype;eE.prototype=(function(t){return td().transition(t)}).prototype={constructor:eE,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=C(t));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s,l,h=r[o],u=h.length,c=a[o]=Array(u),f=0;f<u;++f)(s=h[f])&&(l=t.call(s,s.__data__,f,h))&&("__data__"in s&&(l.__data__=s.__data__),c[f]=l,ep(c[f],e,n,f,c,ev(s,n)));return new eE(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=E(t));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var l,h=r[s],u=h.length,c=0;c<u;++c)if(l=h[c]){for(var f,d=t.call(l,l.__data__,c,h),p=ev(l,n),g=0,m=d.length;g<m;++g)(f=d[g])&&ep(f,e,n,g,d,p);a.push(d),o.push(l)}return new eE(a,o,e,n)},selectChild:eI.selectChild,selectChildren:eI.selectChildren,filter:function(t){"function"!=typeof t&&(t=I(t));for(var e=this._groups,n=e.length,r=Array(n),i=0;i<n;++i)for(var a,o=e[i],s=o.length,l=r[i]=[],h=0;h<s;++h)(a=o[h])&&t.call(a,a.__data__,h,o)&&l.push(a);return new eE(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw Error();for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var l,h=e[s],u=n[s],c=h.length,f=o[s]=Array(c),d=0;d<c;++d)(l=h[d]||u[d])&&(f[d]=l);for(;s<r;++s)o[s]=e[s];return new eE(o,this._parents,this._name,this._id)},selection:function(){return new eS(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=++eP,r=this._groups,i=r.length,a=0;a<i;++a)for(var o,s=r[a],l=s.length,h=0;h<l;++h)if(o=s[h]){var u=ev(o,e);ep(o,t,n,h,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new eE(r,this._parents,t,n)},call:eI.call,nodes:eI.nodes,node:eI.node,size:eI.size,empty:eI.empty,each:eI.each,on:function(t,e){var n,r,i,a,o,s,l=this._id;return arguments.length<2?ev(this.node(),l).on.on(t):this.each((n=l,r=t,i=e,s=(r+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})?eg:em,function(){var t=s(this,n),e=t.on;e!==a&&(o=(a=e).copy()).on(r,i),t.on=o}))},attr:function(t,e){var n=W(t),r="transform"===n?eA:ek;return this.attrTween(t,"function"==typeof e?(n.local?function(t,e,n){var r,i,a;return function(){var o,s,l=n(this);return null==l?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local))===(s=l+"")?null:o===r&&s===i?a:(i=s,a=e(r=o,l))}}:function(t,e,n){var r,i,a;return function(){var o,s,l=n(this);return null==l?void this.removeAttribute(t):(o=this.getAttribute(t))===(s=l+"")?null:o===r&&s===i?a:(i=s,a=e(r=o,l))}})(n,r,eL(this,"attr."+t,e)):null==e?(n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(n):(n.local?function(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===a?null:o===r?i:i=e(r=o,n)}}:function(t,e,n){var r,i,a=n+"";return function(){var o=this.getAttribute(t);return o===a?null:o===r?i:i=e(r=o,n)}})(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw Error();var r=W(t);return this.tween(n,(r.local?function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e){this.setAttributeNS(t.space,t.local,i.call(this,e))}),n}return i._value=e,i}:function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e){this.setAttribute(t,i.call(this,e))}),n}return i._value=e,i})(r,e))},style:function(t,e,n){var r,i,a,o,s,l,h,u,c,f,d,p,g,m,v,b,y,w,_,x,N,A="transform"==(t+="")?eN:ek;return null==e?this.styleTween(t,(r=t,function(){var t=Y(this,r),e=(this.style.removeProperty(r),Y(this,r));return t===e?null:t===i&&e===a?o:o=A(i=t,a=e)})).on("end.style."+t,eC(t)):"function"==typeof e?this.styleTween(t,(s=t,l=eL(this,"style."+t,e),function(){var t=Y(this,s),e=l(this),n=e+"";return null==e&&(this.style.removeProperty(s),n=e=Y(this,s)),t===n?null:t===h&&n===u?c:(u=n,c=A(h=t,e))})).each((f=this._id,y="end."+(b="style."+(d=t)),function(){var t=em(this,f),e=t.on,n=null==t.value[b]?v||(v=eC(d)):void 0;(e!==p||m!==n)&&(g=(p=e).copy()).on(y,m=n),t.on=g})):this.styleTween(t,(w=t,N=e+"",function(){var t=Y(this,w);return t===N?null:t===_?x:x=A(_=t,e)}),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw Error();return this.tween(r,function(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&function(e){this.style.setProperty(t,a.call(this,e),n)}),r}return a._value=e,a}(t,e,null==n?"":n))},text:function(t){var e,n;return this.tween("text","function"==typeof t?(e=eL(this,"text",t),function(){var t=e(this);this.textContent=null==t?"":t}):(n=null==t?"":t+"",function(){this.textContent=n}))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw Error();return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){this.textContent=r.call(this,t)}),e}return r._value=t,r}(t))},remove:function(){var t;return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=ev(this.node(),n).tween,a=0,o=i.length;a<o;++a)if((r=i[a]).name===t)return r.value;return null}return this.each((null==e?function(t,e){var n,r;return function(){var i=em(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===e){(r=r.slice()).splice(o,1);break}}i.tween=r}}:function(t,e,n){var r,i;if("function"!=typeof n)throw Error();return function(){var a=em(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:e,value:n},l=0,h=i.length;l<h;++l)if(i[l].name===e){i[l]=s;break}l===h&&i.push(s)}a.tween=i}})(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){eg(this,t).delay=+e.apply(this,arguments)}}:function(t,e){return e*=1,function(){eg(this,t).delay=e}})(e,t)):ev(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){em(this,t).duration=+e.apply(this,arguments)}}:function(t,e){return e*=1,function(){em(this,t).duration=e}})(e,t)):ev(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw Error();return function(){em(this,t).ease=e}}(e,t)):ev(this.node(),e).ease},easeVarying:function(t){var e;if("function"!=typeof t)throw Error();return this.each((e=this._id,function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw Error();em(this,e).ease=n}))},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},l={value:function(){0==--i&&a()}};n.each(function(){var n=em(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),n.on=e}),0===i&&a()})},[Symbol.iterator]:eI[Symbol.iterator]};var ej={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};td.prototype.interrupt=function(t){return this.each(function(){eb(this,t)})},td.prototype.transition=function(t){var e,n;t instanceof eE?(e=t._id,t=t._name):(e=++eP,(n=ej).time=ei(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o,s=r[a],l=s.length,h=0;h<l;++h)(o=s[h])&&ep(o,t,e,h,s,n||function(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw Error(`transition ${e} not found`);return n}(o,e));return new eE(r,this._parents,t,e)};let{abs:eM,max:eF,min:eB}=Math;function eO(t){return{type:t}}function eT(t){return((t=Math.exp(t))+1/t)/2}["w","e"].map(eO),["n","s"].map(eO),["n","w","e","s","nw","ne","sw","se"].map(eO);let eR=function t(e,n,r){function i(t,i){var a,o,s=t[0],l=t[1],h=t[2],u=i[0],c=i[1],f=i[2],d=u-s,p=c-l,g=d*d+p*p;if(g<1e-12)o=Math.log(f/h)/e,a=function(t){return[s+t*d,l+t*p,h*Math.exp(e*t*o)]};else{var m=Math.sqrt(g),v=(f*f-h*h+r*g)/(2*h*n*m),b=(f*f-h*h-r*g)/(2*f*n*m),y=Math.log(Math.sqrt(v*v+1)-v);o=(Math.log(Math.sqrt(b*b+1)-b)-y)/e,a=function(t){var r,i,a=t*o,u=eT(y),c=h/(n*m)*(u*(((r=Math.exp(2*(r=e*a+y)))-1)/(r+1))-((i=Math.exp(i=y))-1/i)/2);return[s+c*d,l+c*p,h*u/eT(e*a+y)]}}return a.duration=1e3*o*e/Math.SQRT2,a}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4),eD=t=>()=>t;function ez(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function eq(t,e,n){this.k=t,this.x=e,this.y=n}eq.prototype={constructor:eq,scale:function(t){return 1===t?this:new eq(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new eq(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var eU=new eq(1,0,0);function e$(t){t.stopImmediatePropagation()}function eH(t){t.preventDefault(),t.stopImmediatePropagation()}function eW(t){return(!t.ctrlKey||"wheel"===t.type)&&!t.button}function eX(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function eY(){return this.__zoom||eU}function eV(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function eG(){return navigator.maxTouchPoints||"ontouchstart"in this}function eJ(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],a=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function eZ(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function eK(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=e1)):void 0===e&&(e=eQ);for(var n,r,i,a,o,s=new e5(t),l=[s];n=l.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;a>=0;--a)l.push(r=i[a]=new e5(i[a])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(e2)}function eQ(t){return t.children}function e1(t){return Array.isArray(t)?t[1]:null}function e0(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function e2(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function e5(t){this.data=t,this.depth=this.height=0,this.parent=null}function e3(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function e4(t){return null==t?null:function(t){if("function"!=typeof t)throw Error();return t}(t)}eq.prototype,e5.prototype=eK.prototype={constructor:e5,count:function(){return this.eachAfter(eZ)},each:function(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,a=this,o=[a],s=[],l=-1;a=o.pop();)if(s.push(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r]);for(;a=s.pop();)t.call(e,a,++l,this);return this},eachBefore:function(t,e){for(var n,r,i=this,a=[i],o=-1;i=a.pop();)if(t.call(e,i,++o,this),n=i.children)for(r=n.length-1;r>=0;--r)a.push(n[r]);return this},find:function(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)r.push(e=e.parent);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return eK(this).eachBefore(e0)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,a=[i];do for(t=a.reverse(),a=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)a.push(e[n]);while(a.length)}},e3.prototype=Object.create(e5.prototype);var e6={depth:-1},e8={},e7={};function e9(t){return t.id}function nt(t){return t.parentId}function ne(t){let e=t.length;if(e<2)return"";for(;--e>1&&!nn(t,e););return t.slice(0,e)}function nn(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if((1&n)==0)return!0}return!1}function nr(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function ni(t,e){var n,r,i,a,o,s=new nl(t),l=+t.value&&(s.value=t.value),h=[s];for(null==e&&(e=na);n=h.pop();)if(l&&(n.value=+n.data.value),(i=e(n.data))&&(o=i.length))for(n.children=Array(o),a=o-1;a>=0;--a)h.push(r=n.children[a]=new nl(i[a])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(ns)}function na(t){return t.children}function no(t){t.data=t.data.data}function ns(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function nl(t){this.data=t,this.depth=this.height=0,this.parent=null}nl.prototype=ni.prototype={constructor:nl,count:function(){return this.eachAfter(nr)},each:function(t){var e,n,r,i,a=this,o=[a];do for(e=o.reverse(),o=[];a=e.pop();)if(t(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r]);while(o.length)return this},eachAfter:function(t){for(var e,n,r,i=this,a=[i],o=[];i=a.pop();)if(o.push(i),e=i.children)for(n=0,r=e.length;n<r;++n)a.push(e[n]);for(;i=o.pop();)t(i);return this},eachBefore:function(t){for(var e,n,r=this,i=[r];r=i.pop();)if(t(r),e=r.children)for(n=e.length-1;n>=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)r.push(e=e.parent);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each(function(e){t.push(e)}),t},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return ni(this).eachBefore(no)}};let{version:nh}=t.i(5938).default,nu=Object.freeze({children:t=>t.children,nodeSize:t=>t.data.size,spacing:0});function nc(t){let e=Object.assign({},nu,t);function n(t){let n=e[t];return"function"==typeof n?n:()=>n}function r(t){let e,r,o,s=a((e=i(),r=n("nodeSize"),o=n("spacing"),class extends e{constructor(t){super(t),Object.assign(this,{x:0,y:0,relX:0,prelim:0,shift:0,change:0,lExt:this,lExtRelX:0,lThr:null,rExt:this,rExtRelX:0,rThr:null})}get size(){return r(this.data)}spacing(t){return o(this.data,t.data)}get x(){return this.data.x}set x(t){this.data.x=t}get y(){return this.data.y}set y(t){this.data.y=t}update(){return nf(this),nd(this),this}}),t,t=>t.children);return s.update(),s.data}function i(){let t=n("nodeSize"),e=n("spacing");return class n extends ni.prototype.constructor{constructor(t){super(t)}copy(){let t=a(this.constructor,this,t=>t.children);return t.each(t=>t.data=t.data.data),t}get size(){return t(this)}spacing(t){return e(this,t)}get nodes(){return this.descendants()}get xSize(){return this.size[0]}get ySize(){return this.size[1]}get top(){return this.y}get bottom(){return this.y+this.ySize}get left(){return this.x-this.xSize/2}get right(){return this.x+this.xSize/2}get root(){let t=this.ancestors();return t[t.length-1]}get numChildren(){return this.hasChildren?this.children.length:0}get hasChildren(){return!this.noChildren}get noChildren(){return null===this.children}get firstChild(){return this.hasChildren?this.children[0]:null}get lastChild(){return this.hasChildren?this.children[this.numChildren-1]:null}get extents(){return(this.children||[]).reduce((t,e)=>n.maxExtents(t,e.extents),this.nodeExtents)}get nodeExtents(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}static maxExtents(t,e){return{top:Math.min(t.top,e.top),bottom:Math.max(t.bottom,e.bottom),left:Math.min(t.left,e.left),right:Math.max(t.right,e.right)}}}}function a(t,e,n){let r=(e,i)=>{let a=new t(e);Object.assign(a,{parent:i,depth:null===i?0:i.depth+1,height:0,length:1});let o=n(e)||[];return a.children=0===o.length?null:o.map(t=>r(t,a)),a.children&&Object.assign(a,a.children.reduce((t,e)=>({height:Math.max(t.height,e.height+1),length:t.length+e.length}),a)),a};return r(e,null)}return Object.assign(r,{nodeSize(t){return arguments.length?(e.nodeSize=t,r):e.nodeSize},spacing(t){return arguments.length?(e.spacing=t,r):e.spacing},children(t){return arguments.length?(e.children=t,r):e.children},hierarchy(t,n){let r=void 0===n?e.children:n;return a(i(),t,r)},dump(t){let e=n("nodeSize"),r=t=>n=>{let i=t+" ",a=t+" ",{x:o,y:s}=n,l=e(n),h=n.children||[],u=0===h.length?" ":`,${i}children: [${a}${h.map(r(a)).join(a)}${i}],${t}`;return`{ size: [${l.join(", ")}],${i}x: ${o}, y: ${s}${u}},`};return r("\n")(t)}}),r}nc.version=nh;let nf=(t,e=0)=>(t.y=e,(t.children||[]).reduce((e,n)=>{let[r,i]=e;nf(n,t.y+t.ySize);let a=(0===r?n.lExt:n.rExt).bottom;0!==r&&ng(t,r,i);let o=nN(a,r,i);return[r+1,o]},[0,null]),np(t),nx(t),t),nd=(t,e,n)=>{void 0===e&&(e=-t.relX-t.prelim,n=0);let r=e+t.relX;return t.relX=r+t.prelim-n,t.prelim=0,t.x=n+t.relX,(t.children||[]).forEach(e=>nd(e,r,t.x)),t},np=t=>{(t.children||[]).reduce((t,e)=>{let[n,r]=t,i=n+e.shift,a=r+i+e.change;return e.relX+=a,[i,a]},[0,0])},ng=(t,e,n)=>{let r=t.children[e-1],i=t.children[e],a=r,o=r.relX,s=i,l=i.relX,h=!0;for(;a&&s;){a.bottom>n.lowY&&(n=n.next);let r=o+a.prelim-(l+s.prelim)+a.xSize/2+s.xSize/2+a.spacing(s);(r>0||r<0&&h)&&(l+=r,nm(i,r),nv(t,e,n.index,r)),h=!1;let u=a.bottom,c=s.bottom;u<=c&&(a=ny(a))&&(o+=a.relX),u>=c&&(s=nb(s))&&(l+=s.relX)}!a&&s?nw(t,e,s,l):a&&!s&&n_(t,e,a,o)},nm=(t,e)=>{t.relX+=e,t.lExtRelX+=e,t.rExtRelX+=e},nv=(t,e,n,r)=>{let i=t.children[e],a=e-n;if(a>1){let e=r/a;t.children[n+1].shift+=e,i.shift-=e,i.change-=r-e}},nb=t=>t.hasChildren?t.firstChild:t.lThr,ny=t=>t.hasChildren?t.lastChild:t.rThr,nw=(t,e,n,r)=>{let i=t.firstChild,a=i.lExt,o=t.children[e];a.lThr=n;let s=r-n.relX-i.lExtRelX;a.relX+=s,a.prelim-=s,i.lExt=o.lExt,i.lExtRelX=o.lExtRelX},n_=(t,e,n,r)=>{let i=t.children[e],a=i.rExt,o=t.children[e-1];a.rThr=n;let s=r-n.relX-i.rExtRelX;a.relX+=s,a.prelim-=s,i.rExt=o.rExt,i.rExtRelX=o.rExtRelX},nx=t=>{if(t.hasChildren){let e=t.firstChild,n=t.lastChild;Object.assign(t,{prelim:(e.prelim+e.relX-e.xSize/2+n.relX+n.prelim+n.xSize/2)/2,lExt:e.lExt,lExtRelX:e.lExtRelX,rExt:n.rExt,rExtRelX:n.rExtRelX})}},nN=(t,e,n)=>{for(;null!==n&&t>=n.lowY;)n=n.next;return{lowY:t,index:e,next:n}};var nA=Array.prototype.slice;function nL(t){return function(){return t}}class nk{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t*=1,e*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function nS(t){return new nk(t,!0)}let nC=Math.PI,nP=2*nC,nE=nP-1e-6;function nI(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class nj{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?nI:function(t){let e=Math.floor(t);if(!(e>=0))throw Error(`invalid digits: ${t}`);if(e>15)return nI;let n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t*=1,e*=1,n*=1,r*=1,(i*=1)<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-t,l=r-e,h=a-t,u=o-e,c=h*h+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(c>1e-6)if(Math.abs(u*s-l*h)>1e-6&&i){let f=n-a,d=r-o,p=s*s+l*l,g=Math.sqrt(p),m=Math.sqrt(c),v=i*Math.tan((nC-Math.acos((p+c-(f*f+d*d))/(2*g*m)))/2),b=v/m,y=v/g;Math.abs(b-1)>1e-6&&this._append`L${t+b*h},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*f>h*d)},${this._x1=t+y*s},${this._y1=e+y*l}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,r,i,a){if(t*=1,e*=1,n*=1,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),l=t+o,h=e+s,u=1^a,c=a?r-i:i-r;null===this._x1?this._append`M${l},${h}`:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-h)>1e-6)&&this._append`L${l},${h}`,n&&(c<0&&(c=c%nP+nP),c>nE?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=h}`:c>1e-6&&this._append`A${n},${n},0,${+(c>=nC)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n*=1}v${+r}h${-n}Z`}toString(){return this._}}function nM(t){return t[0]}function nF(t){return t[1]}function nB(t){return t.source}function nO(t){return t.target}nj.prototype;let nT=function(t,e){let n;if(void 0===e)for(let e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n},nR=function(t,e){let n;if(void 0===e)for(let e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n},nD=function(t,e){let n=0;if(void 0===e)for(let e of t)(e*=1)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n},nz=function(t,e){var n=0,r=0;return Float64Array.from(t,void 0===e?t=>n+=+t||0:i=>n+=+e(i,r++,t)||0)},nq=function(){var t,e=e9,n=nt;function r(r){var i,a,o,s,l,h,u,c,f=Array.from(r),d=e,p=n,g=new Map;if(null!=t){let e=f.map((e,n)=>{var i;let a;return i=t(e,n,r),a=(i=`${i}`).length,nn(i,a-1)&&!nn(i,a-2)&&(i=i.slice(0,-1)),"/"===i[0]?i:`/${i}`}),n=e.map(ne),i=new Set(e).add("");for(let t of n)i.has(t)||(i.add(t),e.push(t),n.push(ne(t)),f.push(e7));d=(t,n)=>e[n],p=(t,e)=>n[e]}for(o=0,i=f.length;o<i;++o)a=f[o],h=f[o]=new e5(a),null!=(u=d(a,o,r))&&(u+="")&&(c=h.id=u,g.set(c,g.has(c)?e8:h)),null!=(u=p(a,o,r))&&(u+="")&&(h.parent=u);for(o=0;o<i;++o)if(u=(h=f[o]).parent){if(!(l=g.get(u)))throw Error("missing: "+u);if(l===e8)throw Error("ambiguous: "+u);l.children?l.children.push(h):l.children=[h],h.parent=l}else{if(s)throw Error("multiple roots");s=h}if(!s)throw Error("no root");if(null!=t){for(;s.data===e7&&1===s.children.length;)s=s.children[0],--i;for(let t=f.length-1;t>=0&&(h=f[t]).data===e7;--t)h.data=null}if(s.parent=e6,s.eachBefore(function(t){t.depth=t.parent.depth+1,--i}).eachBefore(e2),s.parent=null,i>0)throw Error("cycle");return s}return r.id=function(t){return arguments.length?(e=e4(t),r):e},r.parentId=function(t){return arguments.length?(n=e4(t),r):n},r.path=function(e){return arguments.length?(t=e4(e),r):t},r},nU=function(){var t,e,n,r=eW,i=eX,a=eJ,o=eV,s=eG,l=[0,1/0],h=[[-1/0,-1/0],[1/0,1/0]],u=250,c=eR,f=A("start","zoom","end"),d=0,p=10;function g(t){t.property("__zoom",eY).on("wheel.zoom",x,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",L).filter(s).on("touchstart.zoom",k).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new eq(e,t.x,t.y)}function v(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new eq(t.k,r,i)}function b(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function y(t,e,n,r){t.on("start.zoom",function(){w(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(r).end()}).tween("zoom",function(){var t=arguments,a=w(this,t).event(r),o=i.apply(this,t),s=null==n?b(o):"function"==typeof n?n.apply(this,t):n,l=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),h=this.__zoom,u="function"==typeof e?e.apply(this,t):e,f=c(h.invert(s).concat(l/h.k),u.invert(s).concat(l/u.k));return function(t){if(1===t)t=u;else{var e=f(t),n=l/e[2];t=new eq(n,s[0]-e[0]*n,s[1]-e[1]*n)}a.zoom(null,t)}})}function w(t,e,n){return!n&&t.__zooming||new _(t,e)}function _(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function x(t,...e){if(r.apply(this,arguments)){var n=w(this,e).event(t),i=this.__zoom,s=Math.max(l[0],Math.min(l[1],i.k*Math.pow(2,o.apply(this,arguments)))),u=t5(t);if(n.wheel)(n.mouse[0][0]!==u[0]||n.mouse[0][1]!==u[1])&&(n.mouse[1]=i.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(i.k===s)return;n.mouse=[u,i.invert(u)],eb(this),n.start()}eH(t),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(v(m(i,s),n.mouse[0],n.mouse[1]),n.extent,h))}}function N(t,...e){if(!n&&r.apply(this,arguments)){var i,o,s,l=t.currentTarget,u=w(this,e,!0).event(t),c=tp(t.view).on("mousemove.zoom",function(t){if(eH(t),!u.moved){var e=t.clientX-p,n=t.clientY-g;u.moved=e*e+n*n>d}u.event(t).zoom("mouse",a(v(u.that.__zoom,u.mouse[0]=t5(t,l),u.mouse[1]),u.extent,h))},!0).on("mouseup.zoom",function(t){var e,n,r,i;c.on("mousemove.zoom mouseup.zoom",null),e=t.view,n=u.moved,r=e.document.documentElement,i=tp(e).on("dragstart.drag",null),n&&(i.on("click.drag",tm,tg),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect),eH(t),u.event(t).end()},!0),f=t5(t,l),p=t.clientX,g=t.clientY;o=(i=t.view).document.documentElement,s=tp(i).on("dragstart.drag",tm,tg),"onselectstart"in o?s.on("selectstart.drag",tm,tg):(o.__noselect=o.style.MozUserSelect,o.style.MozUserSelect="none"),e$(t),u.mouse=[f,this.__zoom.invert(f)],eb(this),u.start()}}function L(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,o=t5(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(o),l=n.k*(t.shiftKey?.5:2),c=a(v(m(n,l),o,s),i.apply(this,e),h);eH(t),u>0?tp(this).transition().duration(u).call(y,c,o,t):tp(this).call(g.transform,c,o,t)}}function k(n,...i){if(r.apply(this,arguments)){var a,o,s,l,h=n.touches,u=h.length,c=w(this,i,n.changedTouches.length===u).event(n);for(e$(n),o=0;o<u;++o)l=[l=t5(s=h[o],this),this.__zoom.invert(l),s.identifier],c.touch0?c.touch1||c.touch0[2]===l[2]||(c.touch1=l,c.taps=0):(c.touch0=l,a=!0,c.taps=1+!!t);t&&(t=clearTimeout(t)),a&&(c.taps<2&&(e=l[0],t=setTimeout(function(){t=null},500)),eb(this),c.start())}}function S(t,...e){if(this.__zooming){var n,r,i,o,s=w(this,e).event(t),l=t.changedTouches,u=l.length;for(eH(t),n=0;n<u;++n)i=t5(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=i:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=i);if(r=s.that.__zoom,s.touch1){var c=s.touch0[0],f=s.touch0[1],d=s.touch1[0],p=s.touch1[1],g=(g=d[0]-c[0])*g+(g=d[1]-c[1])*g,b=(b=p[0]-f[0])*b+(b=p[1]-f[1])*b;r=m(r,Math.sqrt(g/b)),i=[(c[0]+d[0])/2,(c[1]+d[1])/2],o=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!s.touch0)return;i=s.touch0[0],o=s.touch0[1]}s.zoom("touch",a(v(r,i,o),s.extent,h))}}function C(t,...r){if(this.__zooming){var i,a,o=w(this,r).event(t),s=t.changedTouches,l=s.length;for(e$(t),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),i=0;i<l;++i)a=s[i],o.touch0&&o.touch0[2]===a.identifier?delete o.touch0:o.touch1&&o.touch1[2]===a.identifier&&delete o.touch1;if(o.touch1&&!o.touch0&&(o.touch0=o.touch1,delete o.touch1),o.touch0)o.touch0[1]=this.__zoom.invert(o.touch0[0]);else if(o.end(),2===o.taps&&(a=t5(a,this),Math.hypot(e[0]-a[0],e[1]-a[1])<p)){var h=tp(this).on("dblclick.zoom");h&&h.apply(this,arguments)}}}return g.transform=function(t,e,n,r){var i=t.selection?t.selection():t;i.property("__zoom",eY),t!==i?y(t,e,n,r):i.interrupt().each(function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},g.scaleBy=function(t,e,n,r){g.scaleTo(t,function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n},n,r)},g.scaleTo=function(t,e,n,r){g.transform(t,function(){var t=i.apply(this,arguments),r=this.__zoom,o=null==n?b(t):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(o),l="function"==typeof e?e.apply(this,arguments):e;return a(v(m(r,l),o,s),t,h)},n,r)},g.translateBy=function(t,e,n,r){g.transform(t,function(){return a(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),i.apply(this,arguments),h)},null,r)},g.translateTo=function(t,e,n,r,o){g.transform(t,function(){var t=i.apply(this,arguments),o=this.__zoom,s=null==r?b(t):"function"==typeof r?r.apply(this,arguments):r;return a(eU.translate(s[0],s[1]).scale(o.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,h)},r,o)},_.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=tp(this.that).datum();f.call(t,this.that,new ez(t,{sourceEvent:this.sourceEvent,target:g,type:t,transform:this.that.__zoom,dispatch:f}),e)}},g.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:eD(+t),g):o},g.filter=function(t){return arguments.length?(r="function"==typeof t?t:eD(!!t),g):r},g.touchable=function(t){return arguments.length?(s="function"==typeof t?t:eD(!!t),g):s},g.extent=function(t){return arguments.length?(i="function"==typeof t?t:eD([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):i},g.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],g):[l[0],l[1]]},g.translateExtent=function(t){return arguments.length?(h[0][0]=+t[0][0],h[1][0]=+t[1][0],h[0][1]=+t[0][1],h[1][1]=+t[1][1],g):[[h[0][0],h[0][1]],[h[1][0],h[1][1]]]},g.constrain=function(t){return arguments.length?(a=t,g):a},g.duration=function(t){return arguments.length?(u=+t,g):u},g.interpolate=function(t){return arguments.length?(c=t,g):c},g.on=function(){var t=f.on.apply(f,arguments);return t===f?g:t},g.clickDistance=function(t){return arguments.length?(d=(t*=1)*t,g):Math.sqrt(d)},g.tapDistance=function(t){return arguments.length?(p=+t,g):p},g};class n${constructor(){const t={id:`ID${Math.floor(1e6*Math.random())}`,firstDraw:!0,ctx:document.createElement("canvas").getContext("2d"),initialExpandLevel:1,nodeDefaultBackground:"none",lastTransform:{x:0,y:0,k:1},allowedNodesCount:{},zoomBehavior:null,generateRoot:null,svgWidth:800,svgHeight:window.innerHeight-100,container:"body",data:null,connections:[],defaultFont:"Helvetica",nodeId:t=>t.nodeId||t.id,parentNodeId:t=>t.parentNodeId||t.parentId,rootMargin:40,nodeWidth:t=>250,nodeHeight:t=>150,neighbourMargin:(t,e)=>80,siblingsMargin:t=>20,childrenMargin:t=>60,compactMarginPair:t=>100,compactMarginBetween:t=>20,nodeButtonWidth:t=>40,nodeButtonHeight:t=>40,nodeButtonX:t=>-20,nodeButtonY:t=>-20,linkYOffset:30,pagingStep:t=>5,minPagingVisibleNodes:t=>2e3,scaleExtent:[.001,20],duration:400,imageName:"Chart",setActiveNodeCentered:!0,layout:"top",compact:!0,createZoom:t=>nU(),onZoomStart:t=>{},onZoom:t=>{},onZoomEnd:t=>{},onNodeClick:t=>t,onExpandOrCollapse:t=>t,nodeContent:t=>`<div style="padding:5px;font-size:10px;">Sample Node(id=${t.id}), override using <br/>
<code>chart.nodeContent({data}=>{ <br/>
&nbsp;&nbsp;&nbsp;&nbsp;return '' // Custom HTML <br/>
})</code>
<br/>
Or check different <a href="https://github.com/bumbeishvili/org-chart#jump-to-examples" target="_blank">layout examples</a>
</div>`,buttonContent:({node:t,state:e})=>`<div style="border:1px solid #E4E2E9;border-radius:3px;padding:3px;font-size:9px;margin:auto auto;background-color:white"> ${({left:e=>e?`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.283 3.50094L6.51 11.4749C6.37348 11.615 6.29707 11.8029 6.29707 11.9984C6.29707 12.194 6.37348 12.3819 6.51 12.5219L14.283 20.4989C14.3466 20.5643 14.4226 20.6162 14.5066 20.6516C14.5906 20.6871 14.6808 20.7053 14.772 20.7053C14.8632 20.7053 14.9534 20.6871 15.0374 20.6516C15.1214 20.6162 15.1974 20.5643 15.261 20.4989C15.3918 20.365 15.4651 20.1852 15.4651 19.9979C15.4651 19.8107 15.3918 19.6309 15.261 19.4969L7.9515 11.9984L15.261 4.50144C15.3914 4.36756 15.4643 4.18807 15.4643 4.00119C15.4643 3.81431 15.3914 3.63482 15.261 3.50094C15.1974 3.43563 15.1214 3.38371 15.0374 3.34827C14.9534 3.31282 14.8632 3.29456 14.772 3.29456C14.6808 3.29456 14.5906 3.31282 14.5066 3.34827C14.4226 3.38371 14.3466 3.43563 14.283 3.50094V3.50094Z" fill="#716E7B" stroke="#716E7B"/>
</svg></span><span style="color:#716E7B">${t.data._directSubordinatesPaging} </span></div>`:`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.989 3.49944C7.85817 3.63339 7.78492 3.8132 7.78492 4.00044C7.78492 4.18768 7.85817 4.36749 7.989 4.50144L15.2985 11.9999L7.989 19.4969C7.85817 19.6309 7.78492 19.8107 7.78492 19.9979C7.78492 20.1852 7.85817 20.365 7.989 20.4989C8.05259 20.5643 8.12863 20.6162 8.21261 20.6516C8.2966 20.6871 8.38684 20.7053 8.478 20.7053C8.56916 20.7053 8.6594 20.6871 8.74338 20.6516C8.82737 20.6162 8.90341 20.5643 8.967 20.4989L16.74 12.5234C16.8765 12.3834 16.9529 12.1955 16.9529 11.9999C16.9529 11.8044 16.8765 11.6165 16.74 11.4764L8.967 3.50094C8.90341 3.43563 8.82737 3.38371 8.74338 3.34827C8.6594 3.31282 8.56916 3.29456 8.478 3.29456C8.38684 3.29456 8.2966 3.31282 8.21261 3.34827C8.12863 3.38371 8.05259 3.43563 7.989 3.50094V3.49944Z" fill="#716E7B" stroke="#716E7B"/>
</svg></span><span style="color:#716E7B">${t.data._directSubordinatesPaging} </span></div>`,bottom:e=>e?`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.497 7.98903L12 15.297L4.503 7.98903C4.36905 7.85819 4.18924 7.78495 4.002 7.78495C3.81476 7.78495 3.63495 7.85819 3.501 7.98903C3.43614 8.05257 3.38462 8.12842 3.34944 8.21213C3.31427 8.29584 3.29615 8.38573 3.29615 8.47653C3.29615 8.56733 3.31427 8.65721 3.34944 8.74092C3.38462 8.82463 3.43614 8.90048 3.501 8.96403L11.4765 16.74C11.6166 16.8765 11.8044 16.953 12 16.953C12.1956 16.953 12.3834 16.8765 12.5235 16.74L20.499 8.96553C20.5643 8.90193 20.6162 8.8259 20.6517 8.74191C20.6871 8.65792 20.7054 8.56769 20.7054 8.47653C20.7054 8.38537 20.6871 8.29513 20.6517 8.21114C20.6162 8.12715 20.5643 8.05112 20.499 7.98753C20.3651 7.85669 20.1852 7.78345 19.998 7.78345C19.8108 7.78345 19.6309 7.85669 19.497 7.98753V7.98903Z" fill="#716E7B" stroke="#716E7B"/>
</svg></span><span style="margin-left:1px;color:#716E7B" >${t.data._directSubordinatesPaging} </span></div>
`:`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.457 8.07005L3.49199 16.4296C3.35903 16.569 3.28485 16.7543 3.28485 16.9471C3.28485 17.1398 3.35903 17.3251 3.49199 17.4646L3.50099 17.4736C3.56545 17.5414 3.64304 17.5954 3.72904 17.6324C3.81504 17.6693 3.90765 17.6883 4.00124 17.6883C4.09483 17.6883 4.18745 17.6693 4.27344 17.6324C4.35944 17.5954 4.43703 17.5414 4.50149 17.4736L12.0015 9.60155L19.4985 17.4736C19.563 17.5414 19.6405 17.5954 19.7265 17.6324C19.8125 17.6693 19.9052 17.6883 19.9987 17.6883C20.0923 17.6883 20.1849 17.6693 20.2709 17.6324C20.3569 17.5954 20.4345 17.5414 20.499 17.4736L20.508 17.4646C20.641 17.3251 20.7151 17.1398 20.7151 16.9471C20.7151 16.7543 20.641 16.569 20.508 16.4296L12.543 8.07005C12.4729 7.99653 12.3887 7.93801 12.2954 7.89801C12.202 7.85802 12.1015 7.8374 12 7.8374C11.8984 7.8374 11.798 7.85802 11.7046 7.89801C11.6113 7.93801 11.527 7.99653 11.457 8.07005Z" fill="#716E7B" stroke="#716E7B"/>
</svg></span><span style="margin-left:1px;color:#716E7B" >${t.data._directSubordinatesPaging} </span></div>
`,right:e=>e?`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.989 3.49944C7.85817 3.63339 7.78492 3.8132 7.78492 4.00044C7.78492 4.18768 7.85817 4.36749 7.989 4.50144L15.2985 11.9999L7.989 19.4969C7.85817 19.6309 7.78492 19.8107 7.78492 19.9979C7.78492 20.1852 7.85817 20.365 7.989 20.4989C8.05259 20.5643 8.12863 20.6162 8.21261 20.6516C8.2966 20.6871 8.38684 20.7053 8.478 20.7053C8.56916 20.7053 8.6594 20.6871 8.74338 20.6516C8.82737 20.6162 8.90341 20.5643 8.967 20.4989L16.74 12.5234C16.8765 12.3834 16.9529 12.1955 16.9529 11.9999C16.9529 11.8044 16.8765 11.6165 16.74 11.4764L8.967 3.50094C8.90341 3.43563 8.82737 3.38371 8.74338 3.34827C8.6594 3.31282 8.56916 3.29456 8.478 3.29456C8.38684 3.29456 8.2966 3.31282 8.21261 3.34827C8.12863 3.38371 8.05259 3.43563 7.989 3.50094V3.49944Z" fill="#716E7B" stroke="#716E7B"/>
</svg></span><span style="color:#716E7B">${t.data._directSubordinatesPaging} </span></div>`:`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.283 3.50094L6.51 11.4749C6.37348 11.615 6.29707 11.8029 6.29707 11.9984C6.29707 12.194 6.37348 12.3819 6.51 12.5219L14.283 20.4989C14.3466 20.5643 14.4226 20.6162 14.5066 20.6516C14.5906 20.6871 14.6808 20.7053 14.772 20.7053C14.8632 20.7053 14.9534 20.6871 15.0374 20.6516C15.1214 20.6162 15.1974 20.5643 15.261 20.4989C15.3918 20.365 15.4651 20.1852 15.4651 19.9979C15.4651 19.8107 15.3918 19.6309 15.261 19.4969L7.9515 11.9984L15.261 4.50144C15.3914 4.36756 15.4643 4.18807 15.4643 4.00119C15.4643 3.81431 15.3914 3.63482 15.261 3.50094C15.1974 3.43563 15.1214 3.38371 15.0374 3.34827C14.9534 3.31282 14.8632 3.29456 14.772 3.29456C14.6808 3.29456 14.5906 3.31282 14.5066 3.34827C14.4226 3.38371 14.3466 3.43563 14.283 3.50094V3.50094Z" fill="#716E7B" stroke="#716E7B"/>
</svg></span><span style="color:#716E7B">${t.data._directSubordinatesPaging} </span></div>`,top:e=>e?`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.457 8.07005L3.49199 16.4296C3.35903 16.569 3.28485 16.7543 3.28485 16.9471C3.28485 17.1398 3.35903 17.3251 3.49199 17.4646L3.50099 17.4736C3.56545 17.5414 3.64304 17.5954 3.72904 17.6324C3.81504 17.6693 3.90765 17.6883 4.00124 17.6883C4.09483 17.6883 4.18745 17.6693 4.27344 17.6324C4.35944 17.5954 4.43703 17.5414 4.50149 17.4736L12.0015 9.60155L19.4985 17.4736C19.563 17.5414 19.6405 17.5954 19.7265 17.6324C19.8125 17.6693 19.9052 17.6883 19.9987 17.6883C20.0923 17.6883 20.1849 17.6693 20.2709 17.6324C20.3569 17.5954 20.4345 17.5414 20.499 17.4736L20.508 17.4646C20.641 17.3251 20.7151 17.1398 20.7151 16.9471C20.7151 16.7543 20.641 16.569 20.508 16.4296L12.543 8.07005C12.4729 7.99653 12.3887 7.93801 12.2954 7.89801C12.202 7.85802 12.1015 7.8374 12 7.8374C11.8984 7.8374 11.798 7.85802 11.7046 7.89801C11.6113 7.93801 11.527 7.99653 11.457 8.07005Z" fill="#716E7B" stroke="#716E7B"/>
</svg></span><span style="margin-left:1px;color:#716E7B">${t.data._directSubordinatesPaging} </span></div>
`:`<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.497 7.98903L12 15.297L4.503 7.98903C4.36905 7.85819 4.18924 7.78495 4.002 7.78495C3.81476 7.78495 3.63495 7.85819 3.501 7.98903C3.43614 8.05257 3.38462 8.12842 3.34944 8.21213C3.31427 8.29584 3.29615 8.38573 3.29615 8.47653C3.29615 8.56733 3.31427 8.65721 3.34944 8.74092C3.38462 8.82463 3.43614 8.90048 3.501 8.96403L11.4765 16.74C11.6166 16.8765 11.8044 16.953 12 16.953C12.1956 16.953 12.3834 16.8765 12.5235 16.74L20.499 8.96553C20.5643 8.90193 20.6162 8.8259 20.6517 8.74191C20.6871 8.65792 20.7054 8.56769 20.7054 8.47653C20.7054 8.38537 20.6871 8.29513 20.6517 8.21114C20.6162 8.12715 20.5643 8.05112 20.499 7.98753C20.3651 7.85669 20.1852 7.78345 19.998 7.78345C19.8108 7.78345 19.6309 7.85669 19.497 7.98753V7.98903Z" fill="#716E7B" stroke="#716E7B"/>
</svg></span><span style="margin-left:1px;color:#716E7B">${t.data._directSubordinatesPaging} </span></div>
`})[e.layout](t.children)} </div>`,pagingButton:(t,e,n,r)=>{let i=r.pagingStep(t.parent),a=t.parent.data._pagingStep,o=Math.min(t.parent.data._directSubordinatesPaging-a,i);return`
<div style="margin-top:90px;">
<div style="display:flex;width:170px;border-radius:20px;padding:5px 15px; padding-bottom:4px;;background-color:#E5E9F2">
<div><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.59 7.41L10.18 12L5.59 16.59L7 18L13 12L7 6L5.59 7.41ZM16 6H18V18H16V6Z" fill="#716E7B" stroke="#716E7B"/>
</svg>
</div><div style="line-height:2"> Show next ${o} nodes </div></div>
</div>
`},nodeUpdate:function(t,e,n){tp(this).select(".node-rect").attr("stroke",t=>t.data._highlighted||t.data._upToTheRootHighlighted?"#E27396":"none").attr("stroke-width",t.data._highlighted||t.data._upToTheRootHighlighted?10:1)},nodeEnter:t=>t,nodeExit:t=>t,linkUpdate:function(t,e,n){tp(this).attr("stroke",t=>t.data._upToTheRootHighlighted?"#E27396":"#E4E2E9").attr("stroke-width",t=>t.data._upToTheRootHighlighted?5:1),t.data._upToTheRootHighlighted&&tp(this).raise()},hdiagonal:function(t,e,n){let r=t.x,i=t.y,a=e.x,o=e.y,s=n&&null!=n.x?n.x:r,l=n&&null!=n.y?n.y:i,h=a-r<0?-1:1,u=o-i<0?-1:1,c=Math.abs(a-r)/2<35?Math.abs(a-r)/2:35,f=Math.abs(a-r)/2-(c=Math.abs(o-i)/2<c?Math.abs(o-i)/2:c);return`
M ${s} ${l}
L ${s} ${i}
L ${r} ${i}
L ${r+f*h} ${i}
C ${r+f*h+c*h} ${i}
${r+f*h+c*h} ${i}
${r+f*h+c*h} ${i+c*u}
L ${r+f*h+c*h} ${o-c*u}
C ${r+f*h+c*h} ${o}
${r+f*h+c*h} ${o}
${a-f*h} ${o}
L ${a} ${o}
`},diagonal:function(t,e,n,r={sy:0}){let i=t.x,a=t.y,o=e.x,s=e.y,l=n&&null!=n.x?n.x:i,h=n&&null!=n.y?n.y:a,u=o-i<0?-1:1,c=s-a<0?-1:1;a+=r.sy;let f=Math.abs(o-i)/2<35?Math.abs(o-i)/2:35;f=Math.abs(s-a)/2<f?Math.abs(s-a)/2:f;let d=Math.abs(s-a)/2-f,p=Math.abs(o-i)-2*f;return`
M ${l} ${h}
L ${i} ${h}
L ${i} ${a}
L ${i} ${a+d*c}
C ${i} ${a+d*c+f*c} ${i} ${a+d*c+f*c} ${i+f*u} ${a+d*c+f*c}
L ${i+p*u+f*u} ${a+d*c+f*c}
C ${o} ${a+d*c+f*c} ${o} ${a+d*c+f*c} ${o} ${s-d*c}
L ${o} ${s}
`},defs:function(t,e){return`<defs>
${e.map(e=>{let n=this.getTextWidth(e.label,{ctx:t.ctx,fontSize:2,defaultFont:t.defaultFont});return`
<marker id="${e.from+"_"+e.to}" refX="${e._source.x<e._target.x?-7:7}" refY="5" markerWidth="500" markerHeight="500" orient="${e._source.x<e._target.x?"auto":"auto-start-reverse"}" >
<rect rx=0.5 width=${e.label?n+3:0} height=3 y=1 fill="#E27396"></rect>
<text font-size="2px" x=1 fill="white" y=3>${e.label||""}</text>
</marker>
<marker id="arrow-${e.from+"_"+e.to}" markerWidth="500" markerHeight="500" refY="2" refX="1" orient="${e._source.x<e._target.x?"auto":"auto-start-reverse"}" >
<path transform="translate(0)" d='M0,0 V4 L2,2 Z' fill='#E27396' />
</marker>
`}).join("")}
</defs>
`},connectionsUpdate:function(t,e,n){tp(this).attr("stroke",t=>"#E27396").attr("stroke-linecap","round").attr("stroke-width",t=>"5").attr("pointer-events","none").attr("marker-start",t=>`url(#${t.from+"_"+t.to})`).attr("marker-end",t=>`url(#arrow-${t.from+"_"+t.to})`)},linkGroupArc:(function(t){let e,n=nB,r=nO,i=nM,a=nF,o=null,s=null,l=(e=3,h.digits=function(t){if(!arguments.length)return e;if(null==t)e=null;else{let n=Math.floor(t);if(!(n>=0))throw RangeError(`invalid digits: ${t}`);e=n}return h},()=>new nj(e));function h(){let e,h=nA.call(arguments),u=n.apply(this,h),c=r.apply(this,h);if(null==o&&(s=t(e=l())),s.lineStart(),h[0]=u,s.point(+i.apply(this,h),+a.apply(this,h)),h[0]=c,s.point(+i.apply(this,h),+a.apply(this,h)),s.lineEnd(),e)return s=null,e+""||null}return h.source=function(t){return arguments.length?(n=t,h):n},h.target=function(t){return arguments.length?(r=t,h):r},h.x=function(t){return arguments.length?(i="function"==typeof t?t:nL(+t),h):i},h.y=function(t){return arguments.length?(a="function"==typeof t?t:nL(+t),h):a},h.context=function(e){return arguments.length?(null==e?o=s=null:s=t(o=e),h):o},h})(nS).x(t=>t.x).y(t=>t.y),layoutBindings:{left:{nodeLeftX:t=>0,nodeRightX:t=>t.width,nodeTopY:t=>-t.height/2,nodeBottomY:t=>t.height/2,nodeJoinX:t=>t.x+t.width,nodeJoinY:t=>t.y-t.height/2,linkJoinX:t=>t.x+t.width,linkJoinY:t=>t.y,linkX:t=>t.x,linkY:t=>t.y,linkCompactXStart:t=>t.x+t.width/2,linkCompactYStart:t=>t.y+(t.compactEven?t.height/2:-t.height/2),compactLinkMidX:(t,e)=>t.firstCompactNode.x,compactLinkMidY:(t,e)=>t.firstCompactNode.y+t.firstCompactNode.flexCompactDim[0]/4+e.compactMarginPair(t)/4,linkParentX:t=>t.parent.x+t.parent.width,linkParentY:t=>t.parent.y,buttonX:t=>t.width,buttonY:t=>t.height/2,centerTransform:({root:t,rootMargin:e,centerY:n,scale:r,centerX:i})=>`translate(${e},${n}) scale(${r})`,compactDimension:{sizeColumn:t=>t.height,sizeRow:t=>t.width,reverse:t=>t.slice().reverse()},nodeFlexSize:({height:t,width:e,siblingsMargin:n,childrenMargin:r,state:i,node:a})=>i.compact&&a.flexCompactDim?[a.flexCompactDim[0],a.flexCompactDim[1]]:[t+n,e+r],zoomTransform:({centerY:t,scale:e})=>`translate(0,${t}) scale(${e})`,diagonal:this.hdiagonal.bind(this),swap:t=>{let e=t.x;t.x=t.y,t.y=e},nodeUpdateTransform:({x:t,y:e,width:n,height:r})=>`translate(${t},${e-r/2})`},top:{nodeLeftX:t=>-t.width/2,nodeRightX:t=>t.width/2,nodeTopY:t=>0,nodeBottomY:t=>t.height,nodeJoinX:t=>t.x-t.width/2,nodeJoinY:t=>t.y+t.height,linkJoinX:t=>t.x,linkJoinY:t=>t.y+t.height,linkCompactXStart:t=>t.x+(t.compactEven?t.width/2:-t.width/2),linkCompactYStart:t=>t.y+t.height/2,compactLinkMidX:(t,e)=>t.firstCompactNode.x+t.firstCompactNode.flexCompactDim[0]/4+e.compactMarginPair(t)/4,compactLinkMidY:t=>t.firstCompactNode.y,compactDimension:{sizeColumn:t=>t.width,sizeRow:t=>t.height,reverse:t=>t},linkX:t=>t.x,linkY:t=>t.y,linkParentX:t=>t.parent.x,linkParentY:t=>t.parent.y+t.parent.height,buttonX:t=>t.width/2,buttonY:t=>t.height,centerTransform:({root:t,rootMargin:e,centerY:n,scale:r,centerX:i})=>`translate(${i},${e}) scale(${r})`,nodeFlexSize:({height:t,width:e,siblingsMargin:n,childrenMargin:r,state:i,node:a,compactViewIndex:o})=>i.compact&&a.flexCompactDim?[a.flexCompactDim[0],a.flexCompactDim[1]]:[e+n,t+r],zoomTransform:({centerX:t,scale:e})=>`translate(${t},0}) scale(${e})`,diagonal:this.diagonal.bind(this),swap:t=>{},nodeUpdateTransform:({x:t,y:e,width:n,height:r})=>`translate(${t-n/2},${e})`},bottom:{nodeLeftX:t=>-t.width/2,nodeRightX:t=>t.width/2,nodeTopY:t=>-t.height,nodeBottomY:t=>0,nodeJoinX:t=>t.x-t.width/2,nodeJoinY:t=>t.y-t.height-t.height,linkJoinX:t=>t.x,linkJoinY:t=>t.y-t.height,linkCompactXStart:t=>t.x+(t.compactEven?t.width/2:-t.width/2),linkCompactYStart:t=>t.y-t.height/2,compactLinkMidX:(t,e)=>t.firstCompactNode.x+t.firstCompactNode.flexCompactDim[0]/4+e.compactMarginPair(t)/4,compactLinkMidY:t=>t.firstCompactNode.y,linkX:t=>t.x,linkY:t=>t.y,compactDimension:{sizeColumn:t=>t.width,sizeRow:t=>t.height,reverse:t=>t},linkParentX:t=>t.parent.x,linkParentY:t=>t.parent.y-t.parent.height,buttonX:t=>t.width/2,buttonY:t=>0,centerTransform:({root:t,rootMargin:e,centerY:n,scale:r,centerX:i,chartHeight:a})=>`translate(${i},${a-e}) scale(${r})`,nodeFlexSize:({height:t,width:e,siblingsMargin:n,childrenMargin:r,state:i,node:a})=>i.compact&&a.flexCompactDim?[a.flexCompactDim[0],a.flexCompactDim[1]]:[e+n,t+r],zoomTransform:({centerX:t,scale:e})=>`translate(${t},0}) scale(${e})`,diagonal:this.diagonal.bind(this),swap:t=>{t.y=-t.y},nodeUpdateTransform:({x:t,y:e,width:n,height:r})=>`translate(${t-n/2},${e-r})`},right:{nodeLeftX:t=>-t.width,nodeRightX:t=>0,nodeTopY:t=>-t.height/2,nodeBottomY:t=>t.height/2,nodeJoinX:t=>t.x-t.width-t.width,nodeJoinY:t=>t.y-t.height/2,linkJoinX:t=>t.x-t.width,linkJoinY:t=>t.y,linkX:t=>t.x,linkY:t=>t.y,linkParentX:t=>t.parent.x-t.parent.width,linkParentY:t=>t.parent.y,buttonX:t=>0,buttonY:t=>t.height/2,linkCompactXStart:t=>t.x-t.width/2,linkCompactYStart:t=>t.y+(t.compactEven?t.height/2:-t.height/2),compactLinkMidX:(t,e)=>t.firstCompactNode.x,compactLinkMidY:(t,e)=>t.firstCompactNode.y+t.firstCompactNode.flexCompactDim[0]/4+e.compactMarginPair(t)/4,centerTransform:({root:t,rootMargin:e,centerY:n,scale:r,centerX:i,chartWidth:a})=>`translate(${a-e},${n}) scale(${r})`,nodeFlexSize:({height:t,width:e,siblingsMargin:n,childrenMargin:r,state:i,node:a})=>i.compact&&a.flexCompactDim?[a.flexCompactDim[0],a.flexCompactDim[1]]:[t+n,e+r],compactDimension:{sizeColumn:t=>t.height,sizeRow:t=>t.width,reverse:t=>t.slice().reverse()},zoomTransform:({centerY:t,scale:e})=>`translate(0,${t}) scale(${e})`,diagonal:this.hdiagonal.bind(this),swap:t=>{let e=t.x;t.x=-t.y,t.y=e},nodeUpdateTransform:({x:t,y:e,width:n,height:r})=>`translate(${t-n},${e-r/2})`}}};this.getChartState=()=>t,Object.keys(t).forEach(e=>{this[e]=function(n){return arguments.length?(t[e]=n,this):t[e]}}),this.initializeEnterExitUpdatePattern()}initializeEnterExitUpdatePattern(){td.prototype.patternify=function(t){var e=t.selector,n=t.tag,r=t.data||[e],i=this.selectAll("."+e).data(r,(t,e)=>"object"==typeof t&&t.id?t.id:e);return i.exit().remove(),(i=i.enter().append(n).merge(i)).attr("class",e),i}}getNodeChildren({data:t,children:e,_children:n},r){return r.push(t),e&&e.forEach(t=>{this.getNodeChildren(t,r)}),n&&n.forEach(t=>{this.getNodeChildren(t,r)}),r}initialZoom(t){return this.getChartState().lastTransform.k=t,this}render(){let t=this.getChartState();if(!t.data||0==t.data.length)return console.log("ORG CHART - Data is empty"),t.container&&(tp(t.container).select(".nodes-wrapper").remove(),tp(t.container).select(".links-wrapper").remove(),tp(t.container).select(".connections-wrapper").remove()),this;let e=tp(t.container),n=e.node().getBoundingClientRect();n.width>0&&(t.svgWidth=n.width);let r={id:`ID${Math.floor(1e6*Math.random())}`,chartWidth:t.svgWidth,chartHeight:t.svgHeight};if(t.calc=r,r.centerX=r.chartWidth/2,r.centerY=r.chartHeight/2,t.firstDraw){let e={zoom:null};e.zoom=t.createZoom().clickDistance(10).on("start",(e,n)=>t.onZoomStart(e)).on("end",(e,n)=>t.onZoomEnd(e)).on("zoom",(e,n)=>{t.onZoom(e),this.zoomed(e,n)}).scaleExtent(t.scaleExtent),t.zoomBehavior=e.zoom}t.flexTreeLayout=nc({nodeSize:e=>{let n=t.nodeWidth(e),r=t.nodeHeight(e),i=t.siblingsMargin(e),a=t.childrenMargin(e);return t.layoutBindings[t.layout].nodeFlexSize({state:t,node:e,width:n,height:r,siblingsMargin:i,childrenMargin:a})}}).spacing((e,n)=>e.parent==n.parent?0:t.neighbourMargin(e,n)),this.setLayouts({expandNodesFirst:!1});let i=e.patternify({tag:"svg",selector:"svg-chart-container"}).attr("width",t.svgWidth).attr("height",t.svgHeight).attr("font-family",t.defaultFont);t.firstDraw&&i.call(t.zoomBehavior).on("dblclick.zoom",null).attr("cursor","move"),t.svg=i;let a=i.patternify({tag:"g",selector:"chart"});return t.centerG=a.patternify({tag:"g",selector:"center-group"}),t.linksWrapper=t.centerG.patternify({tag:"g",selector:"links-wrapper"}),t.nodesWrapper=t.centerG.patternify({tag:"g",selector:"nodes-wrapper"}),t.connectionsWrapper=t.centerG.patternify({tag:"g",selector:"connections-wrapper"}),t.defsWrapper=i.patternify({tag:"g",selector:"defs-wrapper"}),t.firstDraw&&t.centerG.attr("transform",()=>t.layoutBindings[t.layout].centerTransform({centerX:r.centerX,centerY:r.centerY,scale:t.lastTransform.k,rootMargin:t.rootMargin,root:t.root,chartHeight:r.chartHeight,chartWidth:r.chartWidth})),t.chart=a,this.update(t.root),tp(window).on(`resize.${t.id}`,()=>{let e=tp(t.container).node().getBoundingClientRect();t.svg.attr("width",e.width)}),t.firstDraw&&(t.firstDraw=!1),this}addNode(t){let e=this.getChartState();if(t&&(null==e.parentNodeId(t)||e.parentNodeId(t)==e.nodeId(t))&&0==e.data.length)return e.data.push(t),this.render(),this;let n=e.generateRoot(e.data).descendants(),r=n.filter(({data:n})=>e.nodeId(n).toString()===e.nodeId(t).toString())[0];return(n.filter(({data:n})=>e.nodeId(n).toString()===e.parentNodeId(t).toString())[0],r)?console.log(`ORG CHART - ADD - Node with id "${e.nodeId(t)}" already exists in tree`):(t._centered&&!t._expanded&&(t._expanded=!0),e.data.push(t),this.updateNodesState()),this}removeNode(t){let e=this.getChartState(),n=e.generateRoot(e.data).descendants().filter(({data:n})=>e.nodeId(n)==t)[0];return n?(n.descendants().forEach(t=>t.data._filteredOut=!0),e.data=e.data.filter(t=>!t._filteredOut),0==e.data.length?this.render():this.updateNodesState.bind(this)()):console.log(`ORG CHART - REMOVE - Node with id "${t}" not found in the tree`),this}groupBy(t,e,n){let r={};return t.forEach(t=>{let n=e(t);r[n]||(r[n]=[]),r[n].push(t)}),Object.keys(r).forEach(t=>{r[t]=n(r[t])}),Object.entries(r)}calculateCompactFlexDimensions(t){let e=this.getChartState();t.eachBefore(t=>{t.firstCompact=null,t.compactEven=null,t.flexCompactDim=null,t.firstCompactNode=null}),t.eachBefore(t=>{if(t.children&&t.children.length>1){let n=t.children.filter(t=>!t.children);if(n.length<2)return;n.forEach((t,e)=>{e||(t.firstCompact=!0),e%2?t.compactEven=!1:t.compactEven=!0,t.row=Math.floor(e/2)});let r=2*Math.max(nT(n.filter(t=>t.compactEven),e.layoutBindings[e.layout].compactDimension.sizeColumn),nT(n.filter(t=>!t.compactEven),e.layoutBindings[e.layout].compactDimension.sizeColumn)),i=nD(this.groupBy(n,t=>t.row,t=>nT(t,t=>e.layoutBindings[e.layout].compactDimension.sizeRow(t)+e.compactMarginBetween(t))).map(t=>t[1]));n.forEach(t=>{t.firstCompactNode=n[0],t.firstCompact?t.flexCompactDim=[r+e.compactMarginPair(t),i-e.compactMarginBetween(t)]:t.flexCompactDim=[0,0]}),t.flexCompactDim=null}})}calculateCompactFlexPositions(t){let e=this.getChartState();t.eachBefore(t=>{if(t.children){let n=t.children.filter(t=>t.flexCompactDim),r=n[0];if(!r)return;n.forEach((t,n,i)=>{0==n&&(r.x-=r.flexCompactDim[0]/2),n&n%2-1?t.x=r.x+.25*r.flexCompactDim[0]-e.compactMarginPair(t)/4:n&&(t.x=r.x+.75*r.flexCompactDim[0]+e.compactMarginPair(t)/4)});let i=r.x+.5*r.flexCompactDim[0];r.x=r.x+.25*r.flexCompactDim[0]-e.compactMarginPair(r)/4;let a=t.x-i;10>Math.abs(a)&&n.forEach(t=>t.x+=a);let o=nz(this.groupBy(n,t=>t.row,t=>nT(t,t=>e.layoutBindings[e.layout].compactDimension.sizeRow(t))).map(t=>t[1]+e.compactMarginBetween(t)));n.forEach((t,e)=>{t.row?t.y=r.y+o[t.row-1]:t.y=r.y})}})}update({x0:t,y0:e,x:n=0,y:r=0,width:i,height:a}){let o=this.getChartState();o.calc,o.compact&&this.calculateCompactFlexDimensions(o.root);let s=o.flexTreeLayout(o.root);o.compact&&this.calculateCompactFlexPositions(o.root);let l=s.descendants(),h=s.descendants().slice(1);l.forEach(o.layoutBindings[o.layout].swap);let u=o.connections,c={};o.allNodes.forEach(t=>c[o.nodeId(t.data)]=t);let f={};l.forEach(t=>f[o.nodeId(t.data)]=t),u.forEach(t=>{let e=c[t.from],n=c[t.to];t._source=e,t._target=n});let d=u.filter(t=>f[t.from]&&f[t.to]),p=o.defs.bind(this)(o,d);p!==o.defsWrapper.html()&&o.defsWrapper.html(p);let g=o.linksWrapper.selectAll("path.link").data(h,t=>o.nodeId(t.data)),m=g.enter().insert("path","g").attr("class","link").attr("d",n=>{let r={x:o.layoutBindings[o.layout].linkJoinX({x:t,y:e,width:i,height:a}),y:o.layoutBindings[o.layout].linkJoinY({x:t,y:e,width:i,height:a})};return o.layoutBindings[o.layout].diagonal(r,r,r)}).merge(g);m.attr("fill","none"),this.isEdge()?m.style("display",t=>t.data._pagingButton?"none":"auto"):m.attr("display",t=>t.data._pagingButton?"none":"auto"),m.each(o.linkUpdate),m.transition().duration(o.duration).attr("d",t=>{let e=o.compact&&t.flexCompactDim?{x:o.layoutBindings[o.layout].compactLinkMidX(t,o),y:o.layoutBindings[o.layout].compactLinkMidY(t,o)}:{x:o.layoutBindings[o.layout].linkX(t),y:o.layoutBindings[o.layout].linkY(t)},n={x:o.layoutBindings[o.layout].linkParentX(t),y:o.layoutBindings[o.layout].linkParentY(t)},r=o.compact&&t.flexCompactDim?{x:o.layoutBindings[o.layout].linkCompactXStart(t),y:o.layoutBindings[o.layout].linkCompactYStart(t)}:e;return o.layoutBindings[o.layout].diagonal(e,n,r,{sy:o.linkYOffset})}),g.exit().transition().duration(o.duration).attr("d",t=>{let e={x:o.layoutBindings[o.layout].linkJoinX({x:n,y:r,width:i,height:a}),y:o.layoutBindings[o.layout].linkJoinY({x:n,y:r,width:i,height:a})};return o.layoutBindings[o.layout].diagonal(e,e,null,{sy:o.linkYOffset})}).remove();let v=o.connectionsWrapper.selectAll("path.connection").data(d),b=v.enter().insert("path","g").attr("class","connection").attr("d",n=>{let r={x:o.layoutBindings[o.layout].linkJoinX({x:t,y:e,width:i,height:a}),y:o.layoutBindings[o.layout].linkJoinY({x:t,y:e,width:i,height:a})};return o.layoutBindings[o.layout].diagonal(r,r,null,{sy:o.linkYOffset})}).merge(v);b.attr("fill","none"),b.transition().duration(o.duration).attr("d",t=>{let e=o.layoutBindings[o.layout].linkX({x:t._source.x,y:t._source.y,width:t._source.width,height:t._source.height}),n=o.layoutBindings[o.layout].linkY({x:t._source.x,y:t._source.y,width:t._source.width,height:t._source.height}),r=o.layoutBindings[o.layout].linkJoinX({x:t._target.x,y:t._target.y,width:t._target.width,height:t._target.height}),i=o.layoutBindings[o.layout].linkJoinY({x:t._target.x,y:t._target.y,width:t._target.width,height:t._target.height});return o.linkGroupArc({source:{x:e,y:n},target:{x:r,y:i}})}),b.each(o.connectionsUpdate),v.exit().transition().duration(o.duration).attr("opacity",0).remove();let y=o.nodesWrapper.selectAll("g.node").data(l,({data:t})=>o.nodeId(t)),w=y.enter().append("g").attr("class","node").attr("transform",n=>{if(n==o.root)return`translate(${t},${e})`;let r=o.layoutBindings[o.layout].nodeJoinX({x:t,y:e,width:i,height:a}),s=o.layoutBindings[o.layout].nodeJoinY({x:t,y:e,width:i,height:a});return`translate(${r},${s})`}).attr("cursor","pointer").on("click.node",(t,e)=>{let{data:n}=e;if(![...t.srcElement.classList].includes("node-button-foreign-object")){if([...t.srcElement.classList].includes("paging-button-wrapper"))return void this.loadPagingNodes(e);if(!n._pagingButton)return void o.onNodeClick(e);console.log("event fired, no handlers")}}).on("keydown.node",(t,e)=>{let{data:n}=e;if("Enter"===t.key||" "===t.key||"Spacebar"===t.key){if([...t.srcElement.classList].includes("node-button-foreign-object"))return;if([...t.srcElement.classList].includes("paging-button-wrapper"))return void this.loadPagingNodes(e);("Enter"===t.key||" "===t.key||"Spacebar"===t.key)&&this.onButtonClick(t,e)}});w.each(o.nodeEnter),w.patternify({tag:"rect",selector:"node-rect",data:t=>[t]});let _=w.merge(y).style("font","12px sans-serif");_.patternify({tag:"foreignObject",selector:"node-foreign-object",data:t=>[t]}).style("overflow","visible").patternify({tag:"xhtml:div",selector:"node-foreign-object-div",data:t=>[t]}),this.restyleForeignObjectElements();let x=w.patternify({tag:"g",selector:"node-button-g",data:t=>[t]}).on("click",(t,e)=>this.onButtonClick(t,e)).on("keydown",(t,e)=>{("Enter"===t.key||" "===t.key||"Spacebar"===t.key)&&this.onButtonClick(t,e)});x.patternify({tag:"rect",selector:"node-button-rect",data:t=>[t]}).attr("opacity",0).attr("pointer-events","all").attr("width",t=>o.nodeButtonWidth(t)).attr("height",t=>o.nodeButtonHeight(t)).attr("x",t=>o.nodeButtonX(t)).attr("y",t=>o.nodeButtonY(t)),x.patternify({tag:"foreignObject",selector:"node-button-foreign-object",data:t=>[t]}).attr("width",t=>o.nodeButtonWidth(t)).attr("height",t=>o.nodeButtonHeight(t)).attr("x",t=>o.nodeButtonX(t)).attr("y",t=>o.nodeButtonY(t)).style("overflow","visible").patternify({tag:"xhtml:div",selector:"node-button-div",data:t=>[t]}).style("pointer-events","none").style("display","flex").style("width","100%").style("height","100%"),_.transition().attr("opacity",0).duration(o.duration).attr("transform",({x:t,y:e,width:n,height:r})=>o.layoutBindings[o.layout].nodeUpdateTransform({x:t,y:e,width:n,height:r})).attr("opacity",1),_.select(".node-rect").attr("width",({width:t})=>t).attr("height",({height:t})=>t).attr("x",({width:t})=>0).attr("y",({height:t})=>0).attr("cursor","pointer").attr("rx",3).attr("fill",o.nodeDefaultBackground),_.select(".node-button-g").attr("transform",({data:t,width:e,height:n})=>{let r=o.layoutBindings[o.layout].buttonX({width:e,height:n}),i=o.layoutBindings[o.layout].buttonY({width:e,height:n});return`translate(${r},${i})`}).attr("display",({data:t})=>t._directSubordinates>0?null:"none").attr("opacity",({data:t,children:e,_children:n})=>t._pagingButton?0:e||n?1:0),_.select(".node-button-foreign-object .node-button-div").html(t=>o.buttonContent({node:t,state:o})),_.select(".node-button-text").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("font-size",({children:t})=>t?40:26).text(({children:t})=>t?"-":"+").attr("y",10*!!this.isEdge()),_.each(o.nodeUpdate);let N=y.exit();N.each(o.nodeExit);let A=N.data().reduce((t,e)=>t.depth<e.depth?t:e,{depth:1/0});N.attr("opacity",1).transition().duration(o.duration).attr("transform",t=>{let{x:e,y:n,width:r,height:i}=A.parent||{},a=o.layoutBindings[o.layout].nodeJoinX({x:e,y:n,width:r,height:i}),s=o.layoutBindings[o.layout].nodeJoinY({x:e,y:n,width:r,height:i});return`translate(${a},${s})`}).on("end",function(){tp(this).remove()}).attr("opacity",0),l.forEach(t=>{t.x0=t.x,t.y0=t.y});let L=o.allNodes.filter(t=>t.data._centered)[0];if(L){let t=[L];L.data._centeredWithDescendants&&(t=o.compact?L.descendants().filter((t,e)=>e<7):L.descendants().filter((t,e,n)=>{let r=Math.round(n.length/2);return n.length%2?e>r-2&&e<r+2-1:e>r-2&&e<r+2})),L.data._centeredWithDescendants=null,L.data._centered=null,this.fit({animate:!0,scale:!1,nodes:t})}}isEdge(){return window.navigator.userAgent.includes("Edge")}hdiagonal(t,e,n,r){return this.getChartState().hdiagonal(t,e,n,r)}diagonal(t,e,n,r){return this.getChartState().diagonal(t,e,n,r)}restyleForeignObjectElements(){let t=this.getChartState();t.svg.selectAll(".node-foreign-object").attr("width",({width:t})=>t).attr("height",({height:t})=>t).attr("x",({width:t})=>0).attr("y",({height:t})=>0),t.svg.selectAll(".node-foreign-object-div").style("width",({width:t})=>`${t}px`).style("height",({height:t})=>`${t}px`).html(function(e,n,r){return e.data._pagingButton?`<div class="paging-button-wrapper"><div style="pointer-events:none">${t.pagingButton(e,n,r,t)}</div></div>`:t.nodeContent.bind(this)(e,n,r,t)})}onButtonClick(t,e){let n=this.getChartState();e.data._pagingButton||(n.setActiveNodeCentered&&(e.data._centered=!0,e.data._centeredWithDescendants=!0),e.children?(e._children=e.children,e.children=null,this.setExpansionFlagToChildren(e,!1)):(e.children=e._children,e._children=null,e.children&&e.children.forEach(({data:t})=>t._expanded=!0)),this.update(e),t.stopPropagation(),n.onExpandOrCollapse(e))}setExpansionFlagToChildren({data:t,children:e,_children:n},r){t._expanded=r,e&&e.forEach(t=>{this.setExpansionFlagToChildren(t,r)}),n&&n.forEach(t=>{this.setExpansionFlagToChildren(t,r)})}expandSomeNodes(t){if(t.data._expanded){let e=t.parent;for(;e&&e._children;)e.children=e._children,e._children=null,e=e.parent}t._children&&t._children.forEach(t=>this.expandSomeNodes(t)),t.children&&t.children.forEach(t=>this.expandSomeNodes(t))}updateNodesState(){let t=this.getChartState();this.setLayouts({expandNodesFirst:!0}),this.update(t.root)}setLayouts({expandNodesFirst:t=!0}){let e=this.getChartState();e.generateRoot=nq().id(t=>e.nodeId(t)).parentId(t=>e.parentNodeId(t)),e.root=e.generateRoot(e.data);let n=e.root.descendants();e.initialExpandLevel>1&&n.length>0&&(n.forEach(t=>{t.depth<=e.initialExpandLevel&&(t.data._expanded=!0)}),e.initialExpandLevel=1);let r={};e.root.descendants().filter(t=>t.children).filter(t=>!t.data._pagingStep).forEach(t=>{t.data._pagingStep=e.minPagingVisibleNodes(t)}),e.root.eachBefore((t,e)=>{t.data._directSubordinatesPaging=t.children?t.children.length:0,t.children&&t.children.forEach((e,n)=>{if(e.data._pagingButton=!1,n>t.data._pagingStep&&(r[e.id]=!0),n===t.data._pagingStep&&t.children.length-1>t.data._pagingStep&&(e.data._pagingButton=!0),r[e.parent.id]&&(r[e.id]=!0),e.data._expanded||e.data._centered||e.data._highlighted||e.data._upToTheRootHighlighted){let t=e;for(;t&&(r[t.id]||t.data._pagingButton);)r[t.id]=!1,t.data._pagingButton&&(t.data._pagingButton=!1,t.parent.children.forEach(t=>{t.data._expanded=!0,r[t.id]=!1})),t=t.parent}})}),e.root=nq().id(t=>e.nodeId(t)).parentId(t=>e.parentNodeId(t))(e.data.filter(t=>!0!==r[t.id])),e.root.each((t,n,r)=>{let i=t._hierarchyHeight||t.height,a=e.nodeWidth(t),o=e.nodeHeight(t);Object.assign(t,{width:a,height:o,_hierarchyHeight:i})}),e.root.x0=0,e.root.y0=0,e.allNodes=e.root.descendants(),e.allNodes.forEach(t=>{Object.assign(t.data,{_directSubordinates:t.children?t.children.length:0,_totalSubordinates:t.descendants().length-1})}),e.root.children&&(t&&e.root.children.forEach(this.expand),e.root.children.forEach(t=>this.collapse(t)),0==e.initialExpandLevel&&(e.root._children=e.root.children,e.root.children=null),[e.root].forEach(t=>this.expandSomeNodes(t)))}collapse(t){t.children&&(t._children=t.children,t._children.forEach(t=>this.collapse(t)),t.children=null)}expand(t){t._children&&(t.children=t._children,t.children.forEach(t=>this.expand(t)),t._children=null)}zoomed(t,e){let n=this.getChartState(),r=n.chart,i=t.transform;n.lastTransform=i,r.attr("transform",i),this.isEdge()&&this.restyleForeignObjectElements()}zoomTreeBounds({x0:t,x1:e,y0:n,y1:r,params:i={animate:!0,scale:!0,onCompleted:()=>{}}}){let{centerG:a,svgWidth:o,svgHeight:s,svg:l,zoomBehavior:h,duration:u,lastTransform:c}=this.getChartState(),f=Math.min(8,.9/Math.max((e-t)/o,(r-n)/s)),d=eU.translate(o/2,s/2);d=(d=d.scale(i.scale?f:c.k)).translate(-(t+e)/2,-(n+r)/2),l.transition().duration(i.animate?u:0).call(h.transform,d),a.transition().duration(i.animate?u:0).attr("transform","translate(0,0)").on("end",function(){i.onCompleted&&i.onCompleted()})}fit({animate:t=!0,nodes:e,scale:n=!0,onCompleted:r=()=>{}}={}){let i=this.getChartState(),{root:a}=i,o=e||a.descendants(),s=nR(o,t=>t.x+i.layoutBindings[i.layout].nodeLeftX(t)),l=nT(o,t=>t.x+i.layoutBindings[i.layout].nodeRightX(t)),h=nR(o,t=>t.y+i.layoutBindings[i.layout].nodeTopY(t)),u=nT(o,t=>t.y+i.layoutBindings[i.layout].nodeBottomY(t));return this.zoomTreeBounds({params:{animate:t,scale:n,onCompleted:r},x0:s-50,x1:l+50,y0:h-50,y1:u+50}),this}loadPagingNodes(t){let e=this.getChartState();t.data._pagingButton=!1;let n=t.parent.data._pagingStep,r=e.pagingStep(t.parent);t.parent.data._pagingStep=n+r,this.updateNodesState()}setExpanded(t,e=!0){let n=this.getChartState(),r=n.allNodes.filter(({data:e})=>n.nodeId(e)==t)[0];if(!r)return console.log(`ORG CHART - ${e?"EXPAND":"COLLAPSE"} - Node with id (${t}) not found in the tree`),this;if(r.data._expanded=e,!1==e){let t=r.parent||{descendants:()=>[]};t.descendants().filter(e=>e!=t).forEach(t=>t.data._expanded=!1)}return this}setCentered(t){let e=this.getChartState(),n=e.generateRoot(e.data).descendants().filter(({data:n})=>e.nodeId(n).toString()==t.toString())[0];return n?(n.ancestors().forEach(t=>t.data._expanded=!0),n.data._centered=!0,n.data._expanded=!0):console.log(`ORG CHART - CENTER - Node with id (${t}) not found in the tree`),this}setHighlighted(t){let e=this.getChartState(),n=e.generateRoot(e.data).descendants().filter(n=>e.nodeId(n.data).toString()===t.toString())[0];return n?(n.ancestors().forEach(t=>t.data._expanded=!0),n.data._highlighted=!0,n.data._expanded=!0,n.data._centered=!0):console.log(`ORG CHART - HIGHLIGHT - Node with id (${t}) not found in the tree`),this}setUpToTheRootHighlighted(t){let e=this.getChartState(),n=e.generateRoot(e.data).descendants().filter(n=>e.nodeId(n.data).toString()===t.toString())[0];return n?(n.ancestors().forEach(t=>t.data._expanded=!0),n.data._upToTheRootHighlighted=!0,n.data._expanded=!0,n.ancestors().forEach(t=>t.data._upToTheRootHighlighted=!0)):console.log(`ORG CHART - HIGHLIGHTROOT - Node with id (${t}) not found in the tree`),this}clearHighlighting(){let t=this.getChartState();return t.allNodes.forEach(t=>{t.data._highlighted=!1,t.data._upToTheRootHighlighted=!1}),this.update(t.root),this}fullscreen(t){let e=this.getChartState(),n=tp(t||e.container).node();tp(document).on("fullscreenchange."+e.id,function(t){(document.fullscreenElement||document.mozFullscreenElement||document.webkitFullscreenElement)==n?setTimeout(t=>{e.svg.attr("height",window.innerHeight-40)},500):e.svg.attr("height",e.svgHeight)}),n.requestFullscreen?n.requestFullscreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen():n.msRequestFullscreen&&n.msRequestFullscreen()}zoomIn(){let{svg:t,zoomBehavior:e}=this.getChartState();t.transition().call(e.scaleBy,1.3)}zoomOut(){let{svg:t,zoomBehavior:e}=this.getChartState();t.transition().call(e.scaleBy,.78)}toDataURL(t,e){var n=new XMLHttpRequest;n.onload=function(){var t=new FileReader;t.onloadend=function(){e(t.result)},t.readAsDataURL(n.response)},n.open("GET",t),n.responseType="blob",n.send()}exportImg({full:t=!1,scale:e=3,onLoad:n=t=>t,save:r=!0,backgroundColor:i="#FAFAFA"}={}){let a=this,o=this.getChartState(),{svg:s,root:l}=o,h=0,u=s.selectAll("img"),c=u.size(),f=()=>{JSON.parse(JSON.stringify(a.lastTransform()));let s=a.duration();t&&a.fit();let{svg:h}=a.getChartState();setTimeout(t=>{a.downloadImage({node:h.node(),scale:e,isSvg:!1,backgroundColor:i,onAlreadySerialized:t=>{a.update(l)},imageName:o.imageName,onLoad:n,save:r})},t?s+10:0)};c>0?u.each(function(){a.toDataURL(this.src,t=>{this.src=t,++h==c&&f()})}):f()}exportSvg(){let{svg:t,imageName:e}=this.getChartState();return this.downloadImage({imageName:e,node:t.node(),scale:3,isSvg:!0}),this}expandAll(){let{allNodes:t,root:e,data:n}=this.getChartState();return n.forEach(t=>t._expanded=!0),this.render(),this}collapseAll(){let{allNodes:t,root:e}=this.getChartState();return t.forEach(t=>t.data._expanded=!1),this.initialExpandLevel(0),this.render(),this}downloadImage({node:t,scale:e=2,imageName:n="graph",isSvg:r=!1,save:i=!0,backgroundColor:a="#FAFAFA",onAlreadySerialized:o=t=>{},onLoad:s=t=>{}}){function l(t,e){var n=document.createElement("a");"string"==typeof n.download?(document.body.appendChild(n),n.download=e,n.href=t,n.click(),document.body.removeChild(n)):location.replace(t)}function h(t){let e="http://www.w3.org/2000/xmlns/";t=t.cloneNode(!0);let n=window.location.href+"#",r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null,!1);for(;r.nextNode();)for(let t of r.currentNode.attributes)t.value.includes(n)&&(t.value=t.value.replace(n,"#"));return t.setAttributeNS(e,"xmlns","http://www.w3.org/2000/svg"),t.setAttributeNS(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),new XMLSerializer().serializeToString(t)}if(r){let e=h(t);var u="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e='<?xml version="1.0" standalone="no"?>\r\n'+e);l(u,n+".svg"),o();return}let c=document.createElement("img");c.onload=function(){let r=document.createElement("canvas"),o=t.getBoundingClientRect();r.width=o.width*e,r.height=o.height*e;let h=r.getContext("2d");h.fillStyle=a,h.fillRect(0,0,o.width*e,o.height*e),h.drawImage(c,0,0,o.width*e,o.height*e);let u=r.toDataURL("image/png");s&&s(u),i&&l(u,n+".png")};var u="data:image/svg+xml; charset=utf8, "+encodeURIComponent(h(t));o(),c.src=u}getTextWidth(t,{fontSize:e=14,fontWeight:n=400,defaultFont:r="Helvetice",ctx:i}={}){return i.font=`${n||""} ${e}px ${r} `,i.measureText(t).width}clear(){let t=this.getChartState();tp(window).on(`resize.${t.id}`,null),t.svg&&t.svg.selectAll("*").remove()}}var nH=t.i(97083),nW={},nX=function(t,e,n,r,i){var a=new Worker(nW[e]||(nW[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var r=Error(n[0]);r.code=n[1],r.stack=n[2],i(r,null)}else i(null,e)},a.postMessage(n,r),a},nY=Uint8Array,nV=Uint16Array,nG=Int32Array,nJ=new nY([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),nZ=new nY([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),nK=new nY([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nQ=function(t,e){for(var n=new nV(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var i=new nG(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},n1=nQ(nJ,2),n0=n1.b,n2=n1.r;n0[28]=258,n2[258]=28;for(var n5=nQ(nZ,0),n3=n5.b,n4=n5.r,n6=new nV(32768),n8=0;n8<32768;++n8){var n7=(43690&n8)>>1|(21845&n8)<<1;n7=(61680&(n7=(52428&n7)>>2|(13107&n7)<<2))>>4|(3855&n7)<<4,n6[n8]=((65280&n7)>>8|(255&n7)<<8)>>1}for(var n9=function(t,e,n){for(var r,i=t.length,a=0,o=new nV(e);a<i;++a)t[a]&&++o[t[a]-1];var s=new nV(e);for(a=1;a<e;++a)s[a]=s[a-1]+o[a-1]<<1;if(n){r=new nV(1<<e);var l=15-e;for(a=0;a<i;++a)if(t[a])for(var h=a<<4|t[a],u=e-t[a],c=s[t[a]-1]++<<u,f=c|(1<<u)-1;c<=f;++c)r[n6[c]>>l]=h}else for(a=0,r=new nV(i);a<i;++a)t[a]&&(r[a]=n6[s[t[a]-1]++]>>15-t[a]);return r},rt=new nY(288),n8=0;n8<144;++n8)rt[n8]=8;for(var n8=144;n8<256;++n8)rt[n8]=9;for(var n8=256;n8<280;++n8)rt[n8]=7;for(var n8=280;n8<288;++n8)rt[n8]=8;for(var re=new nY(32),n8=0;n8<32;++n8)re[n8]=5;var rn=n9(rt,9,0),rr=n9(rt,9,1),ri=n9(re,5,0),ra=n9(re,5,1),ro=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},rs=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},rl=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},rh=function(t){return(t+7)/8|0},ru=function(t,e,n){return(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length),new nY(t.subarray(e,n))},rc=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],rf=function(t,e,n){var r=Error(e||rc[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,rf),!n)throw r;return r},rd=function(t,e,n,r){var i=t.length,a=r?r.length:0;if(!i||e.f&&!e.l)return n||new nY(0);var o=!n,s=o||2!=e.i,l=e.i;o&&(n=new nY(3*i));var h=function(t){var e=n.length;if(t>e){var r=new nY(Math.max(2*e,t));r.set(n),n=r}},u=e.f||0,c=e.p||0,f=e.b||0,d=e.l,p=e.d,g=e.m,m=e.n,v=8*i;do{if(!d){u=rs(t,c,1);var b=rs(t,c+1,3);if(c+=3,b)if(1==b)d=rr,p=ra,g=9,m=5;else if(2==b){var y=rs(t,c,31)+257,w=rs(t,c+10,15)+4,_=y+rs(t,c+5,31)+1;c+=14;for(var x=new nY(_),N=new nY(19),A=0;A<w;++A)N[nK[A]]=rs(t,c+3*A,7);c+=3*w;for(var L=ro(N),k=(1<<L)-1,S=n9(N,L,1),A=0;A<_;){var C=S[rs(t,c,k)];c+=15&C;var P=C>>4;if(P<16)x[A++]=P;else{var E=0,I=0;for(16==P?(I=3+rs(t,c,3),c+=2,E=x[A-1]):17==P?(I=3+rs(t,c,7),c+=3):18==P&&(I=11+rs(t,c,127),c+=7);I--;)x[A++]=E}}var j=x.subarray(0,y),M=x.subarray(y);g=ro(j),m=ro(M),d=n9(j,g,1),p=n9(M,m,1)}else rf(1);else{var P=rh(c)+4,F=t[P-4]|t[P-3]<<8,B=P+F;if(B>i){l&&rf(0);break}s&&h(f+F),n.set(t.subarray(P,B),f),e.b=f+=F,e.p=c=8*B,e.f=u;continue}if(c>v){l&&rf(0);break}}s&&h(f+131072);for(var O=(1<<g)-1,T=(1<<m)-1,R=c;;R=c){var E=d[rl(t,c)&O],D=E>>4;if((c+=15&E)>v){l&&rf(0);break}if(E||rf(2),D<256)n[f++]=D;else if(256==D){R=c,d=null;break}else{var z=D-254;if(D>264){var A=D-257,q=nJ[A];z=rs(t,c,(1<<q)-1)+n0[A],c+=q}var U=p[rl(t,c)&T],$=U>>4;U||rf(3),c+=15&U;var M=n3[$];if($>3){var q=nZ[$];M+=rl(t,c)&(1<<q)-1,c+=q}if(c>v){l&&rf(0);break}s&&h(f+131072);var H=f+z;if(f<M){var W=a-M,X=Math.min(M,H);for(W+f<0&&rf(3);f<X;++f)n[f]=r[W+f]}for(;f<H;++f)n[f]=n[f-M]}}e.l=d,e.p=R,e.b=f,e.f=u,d&&(u=1,e.m=g,e.d=p,e.n=m)}while(!u)return f!=n.length&&o?ru(n,0,f):n.subarray(0,f)},rp=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},rg=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},rm=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,a=n.slice();if(!i)return{t:rN,l:0};if(1==i){var o=new nY(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var s=n[0],l=n[1],h=0,u=1,c=2;for(n[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=i-1;)s=n[n[h].f<n[c].f?h++:c++],l=n[h!=u&&n[h].f<n[c].f?h++:c++],n[u++]={s:-1,f:s.f+l.f,l:s,r:l};for(var f=a[0].s,r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var d=new nV(f+1),p=rv(n[u-1],d,0);if(p>e){var r=0,g=0,m=p-e,v=1<<m;for(a.sort(function(t,e){return d[e.s]-d[t.s]||t.f-e.f});r<i;++r){var b=a[r].s;if(d[b]>e)g+=v-(1<<p-d[b]),d[b]=e;else break}for(g>>=m;g>0;){var y=a[r].s;d[y]<e?g-=1<<e-d[y]++-1:++r}for(;r>=0&&g;--r){var w=a[r].s;d[w]==e&&(--d[w],++g)}p=e}return{t:new nY(d),l:p}},rv=function(t,e,n){return -1==t.s?Math.max(rv(t.l,e,n+1),rv(t.r,e,n+1)):e[t.s]=n},rb=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new nV(++e),r=0,i=t[0],a=1,o=function(t){n[r++]=t},s=1;s<=e;++s)if(t[s]==i&&s!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=t[s]}return{c:n.subarray(0,r),n:e}},ry=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},rw=function(t,e,n){var r=n.length,i=rh(e+2);t[i]=255&r,t[i+1]=r>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<r;++a)t[i+a+4]=n[a];return(i+4+r)*8},r_=function(t,e,n,r,i,a,o,s,l,h,u){rp(e,u++,n),++i[256];for(var c,f,d,p,g=rm(i,15),m=g.t,v=g.l,b=rm(a,15),y=b.t,w=b.l,_=rb(m),x=_.c,N=_.n,A=rb(y),L=A.c,k=A.n,S=new nV(19),C=0;C<x.length;++C)++S[31&x[C]];for(var C=0;C<L.length;++C)++S[31&L[C]];for(var P=rm(S,7),E=P.t,I=P.l,j=19;j>4&&!E[nK[j-1]];--j);var M=h+5<<3,F=ry(i,rt)+ry(a,re)+o,B=ry(i,m)+ry(a,y)+o+14+3*j+ry(S,E)+2*S[16]+3*S[17]+7*S[18];if(l>=0&&M<=F&&M<=B)return rw(e,u,t.subarray(l,l+h));if(rp(e,u,1+(B<F)),u+=2,B<F){c=n9(m,v,0),f=m,d=n9(y,w,0),p=y;var O=n9(E,I,0);rp(e,u,N-257),rp(e,u+5,k-1),rp(e,u+10,j-4),u+=14;for(var C=0;C<j;++C)rp(e,u+3*C,E[nK[C]]);u+=3*j;for(var T=[x,L],R=0;R<2;++R)for(var D=T[R],C=0;C<D.length;++C){var z=31&D[C];rp(e,u,O[z]),u+=E[z],z>15&&(rp(e,u,D[C]>>5&127),u+=D[C]>>12)}}else c=rn,f=rt,d=ri,p=re;for(var C=0;C<s;++C){var q=r[C];if(q>255){var z=q>>18&31;rg(e,u,c[z+257]),u+=f[z+257],z>7&&(rp(e,u,q>>23&31),u+=nJ[z]);var U=31&q;rg(e,u,d[U]),u+=p[U],U>3&&(rg(e,u,q>>5&8191),u+=nZ[U])}else rg(e,u,c[q]),u+=f[q]}return rg(e,u,c[256]),u+f[256]},rx=new nG([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rN=new nY(0),rA=function(t,e,n,r,i,a){var o=a.z||t.length,s=new nY(r+o+5*(1+Math.ceil(o/7e3))+i),l=s.subarray(r,s.length-i),h=a.l,u=7&(a.r||0);if(e){u&&(l[0]=a.r>>3);for(var c=rx[e-1],f=c>>13,d=8191&c,p=(1<<n)-1,g=a.p||new nV(32768),m=a.h||new nV(p+1),v=Math.ceil(n/3),b=2*v,y=function(e){return(t[e]^t[e+1]<<v^t[e+2]<<b)&p},w=new nG(25e3),_=new nV(288),x=new nV(32),N=0,A=0,L=a.i||0,k=0,S=a.w||0,C=0;L+2<o;++L){var P=y(L),E=32767&L,I=m[P];if(g[E]=I,m[P]=E,S<=L){var j=o-L;if((N>7e3||k>24576)&&(j>423||!h)){u=r_(t,l,0,w,_,x,A,k,C,L-C,u),k=N=A=0,C=L;for(var M=0;M<286;++M)_[M]=0;for(var M=0;M<30;++M)x[M]=0}var F=2,B=0,O=d,T=E-I&32767;if(j>2&&P==y(L-T))for(var R=Math.min(f,j)-1,D=Math.min(32767,L),z=Math.min(258,j);T<=D&&--O&&E!=I;){if(t[L+F]==t[L+F-T]){for(var q=0;q<z&&t[L+q]==t[L+q-T];++q);if(q>F){if(F=q,B=T,q>R)break;for(var U=Math.min(T,q-2),$=0,M=0;M<U;++M){var H=L-T+M&32767,W=g[H],X=H-W&32767;X>$&&($=X,I=H)}}}I=g[E=I],T+=E-I&32767}if(B){w[k++]=0x10000000|n2[F]<<18|n4[B];var Y=31&n2[F],V=31&n4[B];A+=nJ[Y]+nZ[V],++_[257+Y],++x[V],S=L+F,++N}else w[k++]=t[L],++_[t[L]]}}for(L=Math.max(L,S);L<o;++L)w[k++]=t[L],++_[t[L]];u=r_(t,l,h,w,_,x,A,k,C,L-C,u),h||(a.r=7&u|l[u/8|0]<<3,u-=7,a.h=m,a.p=g,a.i=L,a.w=S)}else{for(var L=a.w||0;L<o+h;L+=65535){var G=L+65535;G>=o&&(l[u/8|0]=h,G=o),u=rw(l,u+1,t.subarray(L,G))}a.i=o}return ru(s,0,r+rh(u)+i)},rL=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&-0x12477ce0)^n>>>1;t[e]=n}return t}(),rk=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=rL[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},rS=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,a=0|n.length,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=r+=n[o];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}t=r,e=i},d:function(){return t%=65521,e%=65521,(255&t)<<24|(65280&t)<<8|(255&e)<<8|e>>8}}},rC=function(t,e,n,r,i){if(!i&&(i={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),o=new nY(a.length+t.length);o.set(a),o.set(t,a.length),t=o,i.w=a.length}return rA(t,null==e.level?6:e.level,null==e.mem?i.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,r,i)},rP=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},rE=function(t,e,n){for(var r=t(),i=t.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<r.length;++o){var s=r[o],l=a[o];if("function"==typeof s){e+=";"+l+"=";var h=s.toString();if(s.prototype)if(-1!=h.indexOf("[native code]")){var u=h.indexOf(" ",8)+1;e+=h.slice(u,h.indexOf("(",u))}else for(var c in e+=h,s.prototype)e+=";"+l+".prototype."+c+"="+s.prototype[c].toString();else e+=h}else n[l]=s}return e},rI=[],rj=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},rM=function(t,e,n,r){if(!rI[n]){for(var i="",a={},o=t.length-1,s=0;s<o;++s)i=rE(t[s],i,a);rI[n]={c:rE(t[o],i,a),e:a}}var l=rP({},rI[n].e);return nX(rI[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,l,rj(l),r)},rF=function(){return[nY,nV,nG,nJ,nZ,nK,n0,n3,rr,ra,n6,rc,n9,ro,rs,rl,rh,ru,rf,rd,r3,rR,rD]},rB=function(){return[nY,nV,nG,nJ,nZ,nK,n2,n4,rn,rt,ri,re,n6,rx,rN,n9,rp,rg,rm,rv,rb,ry,rw,r_,rh,ru,rA,rC,r0,rR]},rO=function(){return[rY,rV]},rT=function(){return[rZ]},rR=function(t){return postMessage(t,[t.buffer])},rD=function(t){return t&&{out:t.size&&new nY(t.size),dictionary:t.dictionary}},rz=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){e.data.length?(t.push(e.data[0],e.data[1]),postMessage([e.data[0].length])):t.flush()}},rq=function(t,e,n,r,i,a,o){var s,l=rM(t,r,i,function(t,n){t?(l.terminate(),e.ondata.call(e,t)):Array.isArray(n)?1==n.length?(e.queuedSize-=n[0],e.ondrain&&e.ondrain(n[0])):(n[1]&&l.terminate(),e.ondata.call(e,t,n[0],n[1])):o(n)});l.postMessage(n),e.queuedSize=0,e.push=function(t,n){e.ondata||rf(5),s&&e.ondata(rf(4,0,1),null,!!n),e.queuedSize+=t.length,l.postMessage([t,s=n],[t.buffer])},e.terminate=function(){l.terminate()},a&&(e.flush=function(){l.postMessage([])})},rU=function(t,e){return t[e]|t[e+1]<<8},r$=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},rH=function(t,e){return r$(t,e)+0x100000000*r$(t,e+4)},rW=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},rX=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:2*(9==e.level),t[9]=3,0!=e.mtime&&rW(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},rY=function(t){(31!=t[0]||139!=t[1]||8!=t[2])&&rf(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=(t[10]|t[11]<<8)+2);for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(2&e)},rV=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},rG=function(t){return 10+(t.filename?t.filename.length+1:0)},rJ=function(t,e){var n=e.level;if(t[0]=120,t[1]=(0==n?0:n<6?1:9==n?3:2)<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var r=rS();r.p(e.dictionary),rW(t,2,r.d())}},rZ=function(t,e){return((15&t[0])!=8||t[0]>>4>7||(t[0]<<8|t[1])%31)&&rf(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&rf(6,"invalid zlib data: "+(32&t[1]?"need":"unexpected")+" dictionary"),(t[1]>>3&4)+2};function rK(t,e){return"function"==typeof t&&(e=t,t={}),this.ondata=e,t}var rQ=function(){function t(t,e){if("function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new nY(98304),this.o.dictionary){var n=this.o.dictionary.subarray(-32768);this.b.set(n,32768-n.length),this.s.i=32768-n.length}}return t.prototype.p=function(t,e){this.ondata(rC(t,this.o,0,0,this.s),e)},t.prototype.push=function(t,e){this.ondata||rf(5),this.s.l&&rf(4);var n=t.length+this.s.z;if(n>this.b.length){if(n>2*this.b.length-32768){var r=new nY(-32768&n);r.set(this.b.subarray(0,this.s.z)),this.b=r}var i=this.b.length-this.s.z;this.b.set(t.subarray(0,i),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(t.subarray(i),32768),this.s.z=t.length-i+32768,this.s.i=32766,this.s.w=32768}else this.b.set(t,this.s.z),this.s.z+=t.length;this.s.l=1&e,(this.s.z>this.s.w+8191||e)&&(this.p(this.b,e||!1),this.s.w=this.s.i,this.s.i-=2)},t.prototype.flush=function(){this.ondata||rf(5),this.s.l&&rf(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},t}(),r1=function(t,e){rq([rB,function(){return[rz,rQ]}],this,rK.call(this,t,e),function(t){onmessage=rz(new rQ(t.data))},6,1)};function r0(t,e){return rC(t,e||{},0,0)}var r2=function(){function t(t,e){"function"==typeof t&&(e=t,t={}),this.ondata=e;var n=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new nY(32768),this.p=new nY(0),n&&this.o.set(n)}return t.prototype.e=function(t){if(this.ondata||rf(5),this.d&&rf(4),this.p.length){if(t.length){var e=new nY(this.p.length+t.length);e.set(this.p),e.set(t,this.p.length),this.p=e}}else this.p=t},t.prototype.c=function(t){this.s.i=+(this.d=t||!1);var e=this.s.b,n=rd(this.p,this.s,this.o);this.ondata(ru(n,e,this.s.b),this.d),this.o=ru(n,this.s.b-32768),this.s.b=this.o.length,this.p=ru(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),r5=function(t,e){rq([rF,function(){return[rz,r2]}],this,rK.call(this,t,e),function(t){onmessage=rz(new r2(t.data))},7,0)};function r3(t,e){return rd(t,{i:2},e&&e.out,e&&e.dictionary)}(function(){function t(t,e){this.c=rk(),this.l=0,this.v=1,rQ.call(this,t,e)}t.prototype.push=function(t,e){this.c.p(t),this.l+=t.length,rQ.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=rC(t,this.o,this.v&&rG(this.o),e&&8,this.s);this.v&&(rX(n,this.o),this.v=0),e&&(rW(n,n.length-8,this.c.d()),rW(n,n.length-4,this.l)),this.ondata(n,e)},t.prototype.flush=function(){rQ.prototype.flush.call(this)}})();var r4=function(){function t(t,e){this.v=1,this.r=0,r2.call(this,t,e)}return t.prototype.push=function(t,e){if(r2.prototype.e.call(this,t),this.r+=t.length,this.v){var n=this.p.subarray(this.v-1),r=n.length>3?rY(n):4;if(r>n.length){if(!e)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(r),this.v=0}r2.prototype.c.call(this,e),!this.s.f||this.s.l||e||(this.v=rh(this.s.p)+9,this.s={i:0},this.o=new nY(0),this.push(new nY(0),e))},t}(),r6=function(t,e){var n=this;rq([rF,rO,function(){return[rz,r2,r4]}],this,rK.call(this,t,e),function(t){var e=new r4(t.data);e.onmember=function(t){return postMessage(t)},onmessage=rz(e)},9,0,function(t){return n.onmember&&n.onmember(t)})};function r8(t,e){e||(e={});var n=rS();n.p(t);var r=rC(t,e,e.dictionary?6:2,4);return rJ(r,e),rW(r,r.length-4,n.d()),r}(function(){function t(t,e){this.c=rS(),this.v=1,rQ.call(this,t,e)}t.prototype.push=function(t,e){this.c.p(t),rQ.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=rC(t,this.o,this.v&&(this.o.dictionary?6:2),e&&4,this.s);this.v&&(rJ(n,this.o),this.v=0),e&&rW(n,n.length-4,this.c.d()),this.ondata(n,e)},t.prototype.flush=function(){rQ.prototype.flush.call(this)}})();var r7=function(){function t(t,e){r2.call(this,t,e),this.v=t&&t.dictionary?2:1}return t.prototype.push=function(t,e){if(r2.prototype.e.call(this,t),this.v){if(this.p.length<6&&!e)return;this.p=this.p.subarray(rZ(this.p,this.v-1)),this.v=0}e&&(this.p.length<4&&rf(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),r2.prototype.c.call(this,e)},t}(),r9=function(t,e){rq([rF,rT,function(){return[rz,r2,r7]}],this,rK.call(this,t,e),function(t){onmessage=rz(new r7(t.data))},11,0)},it=function(){function t(t,e){this.o=rK.call(this,t,e)||{},this.G=r4,this.I=r2,this.Z=r7}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n){t.ondata(e,n)}},t.prototype.push=function(t,e){if(this.ondata||rf(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new nY(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):(15&this.p[0])!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,e),this.p=null)}},t}();function ie(t,e){it.call(this,t,e),this.queuedSize=0,this.G=r6,this.I=r5,this.Z=r9}ie.prototype.i=function(){var t=this;this.s.ondata=function(e,n,r){t.ondata(e,n,r)},this.s.ondrain=function(e){t.queuedSize-=e,t.ondrain&&t.ondrain(e)}},ie.prototype.push=function(t,e){this.queuedSize+=t.length,it.prototype.push.call(this,t,e)};var ir="undefined"!=typeof TextEncoder&&new TextEncoder,ii="undefined"!=typeof TextDecoder&&new TextDecoder,ia=0;try{ii.decode(rN,{stream:!0}),ia=1}catch(t){}var io=function(t){for(var e="",n=0;;){var r=t[n++],i=(r>127)+(r>223)+(r>239);if(n+i>t.length)return{s:e,r:ru(t,n-1)};i?3==i?e+=String.fromCharCode(55296|(r=((15&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536)>>10,56320|1023&r):1&i?e+=String.fromCharCode((31&r)<<6|63&t[n++]):e+=String.fromCharCode((15&r)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(r)}};function is(t,e){if(e){for(var n=new nY(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(ir)return ir.encode(t);for(var i=t.length,a=new nY(t.length+(t.length>>1)),o=0,s=function(t){a[o++]=t},r=0;r<i;++r){if(o+5>a.length){var l=new nY(o+8+(i-r<<1));l.set(a),a=l}var h=t.charCodeAt(r);h<128||e?s(h):(h<2048?s(192|h>>6):(h>55295&&h<57344?(s(240|(h=65536+(1047552&h)|1023&t.charCodeAt(++r))>>18),s(128|h>>12&63)):s(224|h>>12),s(128|h>>6&63)),s(128|63&h))}return ru(a,0,o)}(function(t){this.ondata=t,ia?this.t=new TextDecoder:this.p=rN}).prototype.push=function(t,e){if(this.ondata||rf(5),e=!!e,this.t){this.ondata(this.t.decode(t,{stream:!0}),e),e&&(this.t.decode().length&&rf(8),this.t=null);return}this.p||rf(4);var n=new nY(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=io(n),i=r.s,a=r.r;e?(a.length&&rf(8),this.p=null):this.p=a,this.ondata(i,e)},(function(t){this.ondata=t}).prototype.push=function(t,e){this.ondata||rf(5),this.d&&rf(4),this.ondata(is(t),this.d=e||!1)};var il=function(t){return 1==t?3:t<6?2:+(9==t)},ih=function(t,e){for(;1!=rU(t,e);e+=4+rU(t,e+2));return[rH(t,e+12),rH(t,e+4),rH(t,e+20)]},iu=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&rf(9),e+=r+4}return e},ic=function(t,e,n,r,i,a,o,s){var l=r.length,h=n.extra,u=s&&s.length,c=iu(h);rW(t,e,null!=o?0x2014b50:0x4034b50),e+=4,null!=o&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(a<0&&8),t[e++]=i&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var f=new Date(null==n.mtime?Date.now():n.mtime),d=f.getFullYear()-1980;if((d<0||d>119)&&rf(10),rW(t,e,d<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),e+=4,-1!=a&&(rW(t,e,n.crc),rW(t,e+4,a<0?-a-2:a),rW(t,e+8,n.size)),rW(t,e+12,l),rW(t,e+14,c),e+=16,null!=o&&(rW(t,e,u),rW(t,e+6,n.attrs),rW(t,e+10,o),e+=14),t.set(r,e),e+=l,c)for(var p in h){var g=h[p],m=g.length;rW(t,e,+p),rW(t,e+2,m),t.set(g,e+4),e+=4+m}return u&&(t.set(s,e),e+=u),e},id=function(t,e,n,r,i){rW(t,e,0x6054b50),rW(t,e+8,n),rW(t,e+10,n),rW(t,e+12,r),rW(t,e+16,i)},ip=function(){function t(t){this.filename=t,this.c=rk(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||rf(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}();function ig(t,e){var n=this;e||(e={}),ip.call(this,t),this.d=new rQ(e,function(t,e){n.ondata(null,t,e)}),this.compression=8,this.flag=il(e.level)}function im(t,e){var n=this;e||(e={}),ip.call(this,t),this.d=new r1(e,function(t,e,r){n.ondata(t,e,r)}),this.compression=8,this.flag=il(e.level),this.terminate=this.d.terminate}function iv(t){this.ondata=t,this.u=[],this.d=1}ig.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},ig.prototype.push=function(t,e){ip.prototype.push.call(this,t,e)},im.prototype.process=function(t,e){this.d.push(t,e)},im.prototype.push=function(t,e){ip.prototype.push.call(this,t,e)},iv.prototype.add=function(t){var e=this;if(this.ondata||rf(5),2&this.d)this.ondata(rf(4+(1&this.d)*8,0,1),null,!1);else{var n=is(t.filename),r=n.length,i=t.comment,a=i&&is(i),o=r!=t.filename.length||a&&i.length!=a.length,s=r+iu(t.extra)+30;r>65535&&this.ondata(rf(11,0,1),null,!1);var l=new nY(s);ic(l,0,t,n,o,-1);var h=[l],u=function(){for(var t=0,n=h;t<n.length;t++){var r=n[t];e.ondata(null,r,!1)}h=[]},c=this.d;this.d=0;var f=this.u.length,d=rP(t,{f:n,u:o,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(u(),c){var t=e.u[f+1];t?t.r():e.d=1}c=1}}),p=0;t.ondata=function(n,r,i){if(n)e.ondata(n,r,i),e.terminate();else if(p+=r.length,h.push(r),i){var a=new nY(16);rW(a,0,0x8074b50),rW(a,4,t.crc),rW(a,8,p),rW(a,12,t.size),h.push(a),d.c=p,d.b=s+p+16,d.crc=t.crc,d.size=t.size,c&&d.r(),c=1}else c&&u()},this.u.push(d)}},iv.prototype.end=function(){var t=this;2&this.d?this.ondata(rf(4+(1&this.d)*8,0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},iv.prototype.e=function(){for(var t=0,e=0,n=0,r=0,i=this.u;r<i.length;r++){var a=i[r];n+=46+a.f.length+iu(a.extra)+(a.o?a.o.length:0)}for(var o=new nY(n+22),s=0,l=this.u;s<l.length;s++){var a=l[s];ic(o,t,a,a.f,a.u,-a.c-2,e,a.o),t+=46+a.f.length+iu(a.extra)+(a.o?a.o.length:0),e+=a.b}id(o,t,this.u.length,n,e),this.ondata(null,o,!0),this.d=2},iv.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++)e[t].t();this.d=2};var ib=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}();function iy(){var t=this;this.i=new r2(function(e,n){t.ondata(null,e,n)})}function iw(t,e){var n=this;e<32e4?this.i=new r2(function(t,e){n.ondata(null,t,e)}):(this.i=new r5(function(t,e,r){n.ondata(t,e,r)}),this.terminate=this.i.terminate)}function i_(t){this.onfile=t,this.k=[],this.o={0:ib},this.p=rN}function ix(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function iN(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,h=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){h=!0,i=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(h)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ix(t,e);var n=({}).toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ix(t,e):void 0}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iA(t,e="utf8"){return new TextDecoder(e).decode(t)}iy.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},iy.compression=8,iw.prototype.push=function(t,e){this.i.terminate&&(t=ru(t,0)),this.i.push(t,e)},iw.compression=8,i_.prototype.push=function(t,e){var n=this;if(this.onfile||rf(5),this.p||rf(4),this.c>0){var r=Math.min(this.c,t.length),i=t.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),(t=t.subarray(r)).length)return this.push(t,e)}else{var a=0,o=0,s=void 0,l=void 0;this.p.length?t.length?((l=new nY(this.p.length+t.length)).set(this.p),l.set(t,this.p.length)):l=this.p:l=t;for(var h=l.length,u=this.c,c=u&&this.d,f=this;o<h-4&&"break"!==function(){var t=r$(l,o);if(0x4034b50==t){a=1,s=o,f.d=null,f.c=0;var e=rU(l,o+6),r=rU(l,o+8),i=8&e,c=rU(l,o+26),d=rU(l,o+28);if(h>o+30+c+d){var p,g,m=[];f.k.unshift(m),a=2;var v=r$(l,o+18),b=r$(l,o+22),y=function(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}if(ii)return ii.decode(t);var i=io(t),a=i.s,n=i.r;return n.length&&rf(8),a}(l.subarray(o+30,o+=30+c),!(2048&e));0xffffffff==v?(v=(p=i?[-2]:ih(l,o))[0],b=p[1]):i&&(v=-1),o+=d,f.c=v;var w={name:y,compression:r,start:function(){if(w.ondata||rf(5),v){var t=n.o[r];t||w.ondata(rf(14,"unknown compression type "+r,1),null,!1),(g=v<0?new t(y):new t(y,v,b)).ondata=function(t,e,n){w.ondata(t,e,n)};for(var e=0;e<m.length;e++){var i=m[e];g.push(i,!1)}n.k[0]==m&&n.c?n.d=g:g.push(rN,!0)}else w.ondata(null,rN,!0)},terminate:function(){g&&g.terminate&&g.terminate()}};v>=0&&(w.size=v,w.originalSize=b),f.onfile(w)}return"break"}if(u){if(0x8074b50==t)return s=o+=12+(-2==u&&8),a=3,f.c=0,"break";else if(0x2014b50==t)return s=o-=4,a=3,f.c=0,"break"}}();++o);if(this.p=rN,u<0){var d=a?l.subarray(0,s-12-(-2==u&&8)-(0x8074b50==r$(l,s-16)&&4)):l.subarray(0,o);c?c.push(d,!!a):this.k[+(2==a)].push(d)}if(2&a)return this.push(l.subarray(o),e);this.p=l.subarray(o)}e&&(this.c&&rf(13),this.p=null)},i_.prototype.register=function(t){this.o[t.compression]=t},"function"==typeof queueMicrotask&&queueMicrotask;let iL=new TextEncoder,ik=!((new Uint32Array((o=new Uint8Array(4)).buffer)[0]=1)&o[0]),iS={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class iC{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=8192,e={}){let n=!1;"number"==typeof t?t=new ArrayBuffer(t):(n=!0,this.lastWrittenByte=t.byteLength);const r=e.offset?e.offset>>>0:0,i=t.byteLength-r;let a=r;(ArrayBuffer.isView(t)||t instanceof iC)&&(t.byteLength!==t.buffer.byteLength&&(a=t.byteOffset+r),t=t.buffer),n?this.lastWrittenByte=i:this.lastWrittenByte=0,this.buffer=t,this.length=i,this.byteLength=i,this.byteOffset=a,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,a,i),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){let t=this._marks.pop();if(void 0===t)throw Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){let e=2*(this.offset+t),n=new Uint8Array(e);n.set(new Uint8Array(this.buffer)),this.buffer=n.buffer,this.length=e,this.byteLength=e,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,e){let n=iS[e].BYTES_PER_ELEMENT*t,r=this.byteOffset+this.offset,i=this.buffer.slice(r,r+n);if(this.littleEndian===ik&&"uint8"!==e&&"int8"!==e){let t=new Uint8Array(this.buffer.slice(r,r+n));t.reverse();let i=new iS[e](t.buffer);return this.offset+=n,i.reverse(),i}let a=new iS[e](i);return this.offset+=n,a}readInt16(){let t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){let t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){let t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){let t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){let t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){let t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){let t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){let t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let e="";for(let n=0;n<t;n++)e+=this.readChar();return e}readUtf8(t=1){return iA(this.readBytes(t))}decodeText(t=1,e="utf8"){return iA(this.readBytes(t),e)}writeBoolean(t){return this.writeUint8(255*!!t),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let e=0;e<t.length;e++)this._data.setUint8(this.offset++,t[e]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let e=0;e<t.length;e++)this.writeUint8(t.charCodeAt(e));return this}writeUtf8(t){return this.writeBytes(iL.encode(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function iP(t){let e=t.length;for(;--e>=0;)t[e]=0}let iE=573,iI=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ij=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),iM=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),iF=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iB=Array(576);iP(iB);let iO=Array(60);iP(iO);let iT=Array(512);iP(iT);let iR=Array(256);iP(iR);let iD=Array(29);iP(iD);let iz=Array(30);function iq(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}function iU(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}iP(iz);let i$=t=>t<256?iT[t]:iT[256+(t>>>7)],iH=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},iW=(t,e,n)=>{t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,iH(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},iX=(t,e,n)=>{iW(t,n[2*e],n[2*e+1])},iY=(t,e)=>{let n=0;do n|=1&t,t>>>=1,n<<=1;while(--e>0)return n>>>1},iV=(t,e,n)=>{let r,i,a=Array(16),o=0;for(r=1;r<=15;r++)o=o+n[r-1]<<1,a[r]=o;for(i=0;i<=e;i++){let e=t[2*i+1];0!==e&&(t[2*i]=iY(a[e]++,e))}},iG=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},iJ=t=>{t.bi_valid>8?iH(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},iZ=(t,e,n,r)=>{let i=2*e,a=2*n;return t[i]<t[a]||t[i]===t[a]&&r[e]<=r[n]},iK=(t,e,n)=>{let r=t.heap[n],i=n<<1;for(;i<=t.heap_len&&(i<t.heap_len&&iZ(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!iZ(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r},iQ=(t,e,n)=>{let r,i,a,o,s=0;if(0!==t.sym_next)do r=(255&t.pending_buf[t.sym_buf+s++])+((255&t.pending_buf[t.sym_buf+s++])<<8),i=t.pending_buf[t.sym_buf+s++],0===r?iX(t,i,e):(iX(t,(a=iR[i])+256+1,e),0!==(o=iI[a])&&iW(t,i-=iD[a],o),iX(t,a=i$(--r),n),0!==(o=ij[a])&&iW(t,r-=iz[a],o));while(s<t.sym_next)iX(t,256,e)},i1=(t,e)=>{let n,r,i,a=e.dyn_tree,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,l=e.stat_desc.elems,h=-1;for(n=0,t.heap_len=0,t.heap_max=iE;n<l;n++)0!==a[2*n]?(t.heap[++t.heap_len]=h=n,t.depth[n]=0):a[2*n+1]=0;for(;t.heap_len<2;)a[2*(i=t.heap[++t.heap_len]=h<2?++h:0)]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=o[2*i+1]);for(e.max_code=h,n=t.heap_len>>1;n>=1;n--)iK(t,a,n);i=l;do n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],iK(t,a,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,a[2*i]=a[2*n]+a[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,a[2*n+1]=a[2*r+1]=i,t.heap[1]=i++,iK(t,a,1);while(t.heap_len>=2)t.heap[--t.heap_max]=t.heap[1],((t,e)=>{let n,r,i,a,o,s,l=e.dyn_tree,h=e.max_code,u=e.stat_desc.static_tree,c=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(a=0;a<=15;a++)t.bl_count[a]=0;for(l[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<iE;n++)(a=l[2*l[2*(r=t.heap[n])+1]+1]+1)>p&&(a=p,g++),l[2*r+1]=a,!(r>h)&&(t.bl_count[a]++,o=0,r>=d&&(o=f[r-d]),s=l[2*r],t.opt_len+=s*(a+o),c&&(t.static_len+=s*(u[2*r+1]+o)));if(0!==g){do{for(a=p-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[p]--,g-=2}while(g>0)for(a=p;0!==a;a--)for(r=t.bl_count[a];0!==r;)!((i=t.heap[--n])>h)&&(l[2*i+1]!==a&&(t.opt_len+=(a-l[2*i+1])*l[2*i],l[2*i+1]=a),r--)}})(t,e),iV(a,h,t.bl_count)},i0=(t,e,n)=>{let r,i,a=-1,o=e[1],s=0,l=7,h=4;for(0===o&&(l=138,h=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)i=o,o=e[(r+1)*2+1],++s<l&&i===o||(s<h?t.bl_tree[2*i]+=s:0!==i?(i!==a&&t.bl_tree[2*i]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,a=i,0===o?(l=138,h=3):i===o?(l=6,h=3):(l=7,h=4))},i2=(t,e,n)=>{let r,i,a=-1,o=e[1],s=0,l=7,h=4;for(0===o&&(l=138,h=3),r=0;r<=n;r++)if(i=o,o=e[(r+1)*2+1],!(++s<l)||i!==o){if(s<h)do iX(t,i,t.bl_tree);while(0!=--s)else 0!==i?(i!==a&&(iX(t,i,t.bl_tree),s--),iX(t,16,t.bl_tree),iW(t,s-3,2)):s<=10?(iX(t,17,t.bl_tree),iW(t,s-3,3)):(iX(t,18,t.bl_tree),iW(t,s-11,7));s=0,a=i,0===o?(l=138,h=3):i===o?(l=6,h=3):(l=7,h=4)}},i5=!1,i3=(t,e,n,r)=>{iW(t,0+ +!!r,3),iJ(t),iH(t,n),iH(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n};var i4={_tr_init:t=>{i5||((()=>{let t,i,a,o,s,l=Array(16);for(o=0,a=0;o<28;o++)for(t=0,iD[o]=a;t<1<<iI[o];t++)iR[a++]=o;for(iR[a-1]=o,s=0,o=0;o<16;o++)for(t=0,iz[o]=s;t<1<<ij[o];t++)iT[s++]=o;for(s>>=7;o<30;o++)for(t=0,iz[o]=s<<7;t<1<<ij[o]-7;t++)iT[256+s++]=o;for(i=0;i<=15;i++)l[i]=0;for(t=0;t<=143;)iB[2*t+1]=8,t++,l[8]++;for(;t<=255;)iB[2*t+1]=9,t++,l[9]++;for(;t<=279;)iB[2*t+1]=7,t++,l[7]++;for(;t<=287;)iB[2*t+1]=8,t++,l[8]++;for(iV(iB,287,l),t=0;t<30;t++)iO[2*t+1]=5,iO[2*t]=iY(t,5);e=new iq(iB,iI,257,286,15),n=new iq(iO,ij,0,30,15),r=new iq([],iM,0,19,7)})(),i5=!0),t.l_desc=new iU(t.dyn_ltree,e),t.d_desc=new iU(t.dyn_dtree,n),t.bl_desc=new iU(t.bl_tree,r),t.bi_buf=0,t.bi_valid=0,iG(t)},_tr_stored_block:i3,_tr_flush_block:(t,e,n,r)=>{let i,a,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,n=0xf3ffc07f;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),i1(t,t.l_desc),i1(t,t.d_desc),o=(t=>{let e;for(i0(t,t.dyn_ltree,t.l_desc.max_code),i0(t,t.dyn_dtree,t.d_desc.max_code),i1(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*iF[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=i&&(i=a)):i=a=n+5,n+4<=i&&-1!==e?i3(t,e,n,r):4===t.strategy||a===i?(iW(t,2+ +!!r,3),iQ(t,iB,iO)):(iW(t,4+ +!!r,3),((t,e,n,r)=>{let i;for(iW(t,e-257,5),iW(t,n-1,5),iW(t,r-4,4),i=0;i<r;i++)iW(t,t.bl_tree[2*iF[i]+1],3);i2(t,t.dyn_ltree,e-1),i2(t,t.dyn_dtree,n-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),iQ(t,t.dyn_ltree,t.dyn_dtree)),iG(t),r&&iJ(t)},_tr_tally:(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[(iR[n]+256+1)*2]++,t.dyn_dtree[2*i$(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{iW(t,2,3),iX(t,256,iB),16===t.bi_valid?(iH(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},i6=(t,e,n,r)=>{let i=65535&t,a=t>>>16&65535,o=0;for(;0!==n;){o=n>2e3?2e3:n,n-=o;do a=a+(i=i+e[r++]|0)|0;while(--o)i%=65521,a%=65521}return i|a<<16};let i8=new Uint32Array((()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?0xedb88320^t>>>1:t>>>1;e[n]=t}return e})());var i7=(t,e,n,r)=>{let i=r+n;t^=-1;for(let n=r;n<i;n++)t=t>>>8^i8[(t^e[n])&255];return -1^t},i9={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},at={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};let{_tr_init:ae,_tr_stored_block:an,_tr_flush_block:ar,_tr_tally:ai,_tr_align:aa}=i4,{Z_NO_FLUSH:ao,Z_PARTIAL_FLUSH:as,Z_FULL_FLUSH:al,Z_FINISH:ah,Z_BLOCK:au,Z_OK:ac,Z_STREAM_END:af,Z_STREAM_ERROR:ad,Z_DATA_ERROR:ap,Z_BUF_ERROR:ag,Z_DEFAULT_COMPRESSION:am,Z_FILTERED:av,Z_HUFFMAN_ONLY:ab,Z_RLE:ay,Z_FIXED:aw,Z_DEFAULT_STRATEGY:a_,Z_UNKNOWN:ax,Z_DEFLATED:aN}=at,aA=573,aL=(t,e)=>(t.msg=i9[e],e),ak=t=>2*t-9*(t>4),aS=t=>{let e=t.length;for(;--e>=0;)t[e]=0},aC=t=>{let e,n,r,i=t.w_size;r=e=t.hash_size;do n=t.head[--r],t.head[r]=n>=i?n-i:0;while(--e)r=e=i;do n=t.prev[--r],t.prev[r]=n>=i?n-i:0;while(--e)},aP=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask,aE=t=>{let e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))},aI=(t,e)=>{ar(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,aE(t.strm)},aj=(t,e)=>{t.pending_buf[t.pending++]=e},aM=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},aF=(t,e,n,r)=>{let i=t.avail_in;return(i>r&&(i=r),0===i)?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),1===t.state.wrap?t.adler=i6(t.adler,e,i,n):2===t.state.wrap&&(t.adler=i7(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},aB=(t,e)=>{let n,r,i=t.max_chain_length,a=t.strstart,o=t.prev_length,s=t.nice_match,l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,u=t.w_mask,c=t.prev,f=t.strstart+258,d=h[a+o-1],p=h[a+o];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(h[(n=e)+o]!==p||h[n+o-1]!==d||h[n]!==h[a]||h[++n]!==h[a+1])continue;a+=2,n++;do;while(h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&h[++a]===h[++n]&&a<f)if(r=258-(f-a),a=f-258,r>o){if(t.match_start=e,o=r,r>=s)break;d=h[a+o-1],p=h[a+o]}}while((e=c[e&u])>l&&0!=--i)return o<=t.lookahead?o:t.lookahead},aO=t=>{let e,n,r,i=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=i+(i-262)&&(t.window.set(t.window.subarray(i,i+i-n),0),t.match_start-=i,t.strstart-=i,t.block_start-=i,t.insert>t.strstart&&(t.insert=t.strstart),aC(t),n+=i),0===t.strm.avail_in)break;if(e=aF(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=e,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=aP(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=aP(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},aT=(t,e)=>{let n=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r,i,a,o=0,s=t.strm.avail_in;do{if(r=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,r>(i=t.strstart-t.block_start)+t.strm.avail_in&&(r=i+t.strm.avail_in),r>a&&(r=a),r<n&&(0===r&&e!==ah||e===ao||r!==i+t.strm.avail_in)))break;o=+(e===ah&&r===i+t.strm.avail_in),an(t,0,0,o),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,aE(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(aF(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===o)return((s-=t.strm.avail_in)&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o)?4:e!==ao&&e!==ah&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(aF(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,n=(a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a)>t.w_size?t.w_size:a,((i=t.strstart-t.block_start)>=n||(i||e===ah)&&e!==ao&&0===t.strm.avail_in&&i<=a)&&(r=i>a?a:i,o=+(e===ah&&0===t.strm.avail_in&&r===i),an(t,t.block_start,r,o),t.block_start+=r,aE(t.strm)),o?3:1)},aR=(t,e)=>{let n,r;for(;;){if(t.lookahead<262){if(aO(t),t.lookahead<262&&e===ao)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=aP(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-262&&(t.match_length=aB(t,n)),t.match_length>=3)if(r=ai(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do t.strstart++,t.ins_h=aP(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(0!=--t.match_length)t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=aP(t,t.ins_h,t.window[t.strstart+1]);else r=ai(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(aI(t,!1),0===t.strm.avail_out))return 1}return(t.insert=t.strstart<2?t.strstart:2,e===ah)?(aI(t,!0),0===t.strm.avail_out)?3:4:t.sym_next&&(aI(t,!1),0===t.strm.avail_out)?1:2},aD=(t,e)=>{let n,r,i;for(;;){if(t.lookahead<262){if(aO(t),t.lookahead<262&&e===ao)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=aP(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-262&&(t.match_length=aB(t,n),t.match_length<=5&&(t.strategy===av||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,r=ai(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=aP(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(0!=--t.prev_length)if(t.match_available=0,t.match_length=2,t.strstart++,r&&(aI(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=ai(t,0,t.window[t.strstart-1]))&&aI(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return(t.match_available&&(r=ai(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===ah)?(aI(t,!0),0===t.strm.avail_out)?3:4:t.sym_next&&(aI(t,!1),0===t.strm.avail_out)?1:2};function az(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}let aq=[new az(0,0,0,0,aT),new az(4,4,8,4,aR),new az(4,5,16,8,aR),new az(4,6,32,32,aR),new az(4,4,16,16,aD),new az(8,16,32,32,aD),new az(8,16,128,128,aD),new az(8,32,128,256,aD),new az(32,128,258,1024,aD),new az(32,258,258,4096,aD)];function aU(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=aN,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*aA),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),aS(this.dyn_ltree),aS(this.dyn_dtree),aS(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),aS(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),aS(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}let a$=t=>{if(!t)return 1;let e=t.state;return e&&e.strm===t&&(42===e.status||57===e.status||69===e.status||73===e.status||91===e.status||103===e.status||113===e.status||666===e.status)?0:1};var aH=(t,e)=>{if(a$(t)||e>au||e<0)return t?aL(t,ad):ad;let n=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===n.status&&e!==ah)return aL(t,0===t.avail_out?ag:ad);let r=n.last_flush;if(n.last_flush=e,0!==n.pending){if(aE(t),0===t.avail_out)return n.last_flush=-1,ac}else if(0===t.avail_in&&ak(e)<=ak(r)&&e!==ah)return aL(t,ag);if(666===n.status&&0!==t.avail_in)return aL(t,ag);if(42===n.status&&0===n.wrap&&(n.status=113),42===n.status){let e=aN+(n.w_bits-8<<4)<<8;if(e|=(n.strategy>=ab||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(e|=32),aM(n,e+=31-e%31),0!==n.strstart&&(aM(n,t.adler>>>16),aM(n,65535&t.adler)),t.adler=1,n.status=113,aE(t),0!==n.pending)return n.last_flush=-1,ac}if(57===n.status){if(t.adler=0,aj(n,31),aj(n,139),aj(n,8),n.gzhead)aj(n,+!!n.gzhead.text+2*!!n.gzhead.hcrc+4*!!n.gzhead.extra+8*!!n.gzhead.name+16*!!n.gzhead.comment),aj(n,255&n.gzhead.time),aj(n,n.gzhead.time>>8&255),aj(n,n.gzhead.time>>16&255),aj(n,n.gzhead.time>>24&255),aj(n,9===n.level?2:4*(n.strategy>=ab||n.level<2)),aj(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(aj(n,255&n.gzhead.extra.length),aj(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=i7(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(aj(n,0),aj(n,0),aj(n,0),aj(n,0),aj(n,0),aj(n,9===n.level?2:4*(n.strategy>=ab||n.level<2)),aj(n,3),n.status=113,aE(t),0!==n.pending)return n.last_flush=-1,ac}if(69===n.status){if(n.gzhead.extra){let e=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>e&&(t.adler=i7(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex+=i,aE(t),0!==n.pending)return n.last_flush=-1,ac;e=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>e&&(t.adler=i7(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let e,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=i7(t.adler,n.pending_buf,n.pending-r,r)),aE(t),0!==n.pending)return n.last_flush=-1,ac;r=0}e=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,aj(n,e)}while(0!==e)n.gzhead.hcrc&&n.pending>r&&(t.adler=i7(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let e,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=i7(t.adler,n.pending_buf,n.pending-r,r)),aE(t),0!==n.pending)return n.last_flush=-1,ac;r=0}e=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,aj(n,e)}while(0!==e)n.gzhead.hcrc&&n.pending>r&&(t.adler=i7(t.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(aE(t),0!==n.pending))return n.last_flush=-1,ac;aj(n,255&t.adler),aj(n,t.adler>>8&255),t.adler=0}if(n.status=113,aE(t),0!==n.pending)return n.last_flush=-1,ac}if(0!==t.avail_in||0!==n.lookahead||e!==ao&&666!==n.status){let r=0===n.level?aT(n,e):n.strategy===ab?((t,e)=>{let n;for(;;){if(0===t.lookahead&&(aO(t),0===t.lookahead)){if(e===ao)return 1;break}if(t.match_length=0,n=ai(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(aI(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,e===ah)?(aI(t,!0),0===t.strm.avail_out)?3:4:t.sym_next&&(aI(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===ay?((t,e)=>{let n,r,i,a,o=t.window;for(;;){if(t.lookahead<=258){if(aO(t),t.lookahead<=258&&e===ao)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=o[i=t.strstart-1])===o[++i]&&r===o[++i]&&r===o[++i]){a=t.strstart+258;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a)t.match_length=258-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=ai(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=ai(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(aI(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,e===ah)?(aI(t,!0),0===t.strm.avail_out)?3:4:t.sym_next&&(aI(t,!1),0===t.strm.avail_out)?1:2})(n,e):aq[n.level].func(n,e);if((3===r||4===r)&&(n.status=666),1===r||3===r)return 0===t.avail_out&&(n.last_flush=-1),ac;if(2===r&&(e===as?aa(n):e!==au&&(an(n,0,0,!1),e===al&&(aS(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),aE(t),0===t.avail_out))return n.last_flush=-1,ac}return e!==ah?ac:n.wrap<=0?af:(2===n.wrap?(aj(n,255&t.adler),aj(n,t.adler>>8&255),aj(n,t.adler>>16&255),aj(n,t.adler>>24&255),aj(n,255&t.total_in),aj(n,t.total_in>>8&255),aj(n,t.total_in>>16&255),aj(n,t.total_in>>24&255)):(aM(n,t.adler>>>16),aM(n,65535&t.adler)),aE(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?ac:af)},aW=t=>{if(a$(t))return ad;let e=t.state.status;return t.state=null,113===e?aL(t,ap):ac};let aX=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var aY=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let n=e.shift();if(n){if("object"!=typeof n)throw TypeError(n+"must be non-object");for(let e in n)aX(n,e)&&(t[e]=n[e])}}return t},aV=t=>{let e=0;for(let n=0,r=t.length;n<r;n++)e+=t[n].length;let n=new Uint8Array(e);for(let e=0,r=0,i=t.length;e<i;e++){let i=t[e];n.set(i,r),r+=i.length}return n};let aG=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){aG=!1}let aJ=new Uint8Array(256);for(let t=0;t<256;t++)aJ[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;aJ[254]=aJ[254]=1;var aZ=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,i,a,o=t.length,s=0;for(i=0;i<o;i++)(64512&(n=t.charCodeAt(i)))==55296&&i+1<o&&(64512&(r=t.charCodeAt(i+1)))==56320&&(n=65536+(n-55296<<10)+(r-56320),i++),s+=n<128?1:n<2048?2:n<65536?3:4;for(a=0,e=new Uint8Array(s),i=0;a<s;i++)(64512&(n=t.charCodeAt(i)))==55296&&i+1<o&&(64512&(r=t.charCodeAt(i+1)))==56320&&(n=65536+(n-55296<<10)+(r-56320),i++),n<128?e[a++]=n:(n<2048?e[a++]=192|n>>>6:(n<65536?e[a++]=224|n>>>12:(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63),e[a++]=128|n>>>6&63),e[a++]=128|63&n);return e},aK=(t,e)=>{let n,r,i=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let a=Array(2*i);for(r=0,n=0;n<i;){let e=t[n++];if(e<128){a[r++]=e;continue}let o=aJ[e];if(o>4){a[r++]=65533,n+=o-1;continue}for(e&=2===o?31:3===o?15:7;o>1&&n<i;)e=e<<6|63&t[n++],o--;if(o>1){a[r++]=65533;continue}e<65536?a[r++]=e:(e-=65536,a[r++]=55296|e>>10&1023,a[r++]=56320|1023&e)}var o=r;if(o<65534&&a.subarray&&aG)return String.fromCharCode.apply(null,a.length===o?a:a.subarray(0,o));let s="";for(let t=0;t<o;t++)s+=String.fromCharCode(a[t]);return s},aQ=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(192&t[n])==128;)n--;return n<0||0===n?e:n+aJ[t[n]]>e?n:e},a1=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};let a0=Object.prototype.toString,{Z_NO_FLUSH:a2,Z_SYNC_FLUSH:a5,Z_FULL_FLUSH:a3,Z_FINISH:a4,Z_OK:a6,Z_STREAM_END:a8,Z_DEFAULT_COMPRESSION:a7,Z_DEFAULT_STRATEGY:a9,Z_DEFLATED:ot}=at;function oe(t){let e,n;this.options=aY({level:a7,method:ot,chunkSize:16384,windowBits:15,memLevel:8,strategy:a9},t||{});let r=this.options;r.raw&&r.windowBits>0?r.windowBits=-r.windowBits:r.gzip&&r.windowBits>0&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a1,this.strm.avail_out=0;let i=((t,e,n,r,i,a)=>{var o,s;let l;if(!t)return ad;let h=1;if(e===am&&(e=6),r<0?(h=0,r=-r):r>15&&(h=2,r-=16),i<1||i>9||n!==aN||r<8||r>15||e<0||e>9||a<0||a>aw||8===r&&1!==h)return aL(t,ad);8===r&&(r=9);let u=new aU;return t.state=u,u.strm=t,u.status=42,u.wrap=h,u.gzhead=null,u.w_bits=r,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=i+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new Uint8Array(2*u.w_size),u.head=new Uint16Array(u.hash_size),u.prev=new Uint16Array(u.w_size),u.lit_bufsize=1<<i+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new Uint8Array(u.pending_buf_size),u.sym_buf=u.lit_bufsize,u.sym_end=(u.lit_bufsize-1)*3,u.level=e,u.strategy=a,u.method=n,(l=(t=>{if(a$(t))return aL(t,ad);t.total_in=t.total_out=0,t.data_type=ax;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=+(2!==e.wrap),e.last_flush=-2,ae(e),ac})(o=t))===ac&&((s=o.state).window_size=2*s.w_size,aS(s.head),s.max_lazy_match=aq[s.level].max_lazy,s.good_match=aq[s.level].good_length,s.nice_match=aq[s.level].nice_length,s.max_chain_length=aq[s.level].max_chain,s.strstart=0,s.block_start=0,s.lookahead=0,s.insert=0,s.match_length=s.prev_length=2,s.match_available=0,s.ins_h=0),l})(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy);if(i!==a6)throw Error(i9[i]);if(r.header&&(e=this.strm,n=r.header,a$(e)||2!==e.state.wrap||(e.state.gzhead=n)),r.dictionary){let t;if(t="string"==typeof r.dictionary?aZ(r.dictionary):"[object ArrayBuffer]"===a0.call(r.dictionary)?new Uint8Array(r.dictionary):r.dictionary,(i=((t,e)=>{let n=e.length;if(a$(t))return ad;let r=t.state,i=r.wrap;if(2===i||1===i&&42!==r.status||r.lookahead)return ad;if(1===i&&(t.adler=i6(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){0===i&&(aS(r.head),r.strstart=0,r.block_start=0,r.insert=0);let t=new Uint8Array(r.w_size);t.set(e.subarray(n-r.w_size,n),0),e=t,n=r.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,aO(r);r.lookahead>=3;){let t=r.strstart,e=r.lookahead-2;do r.ins_h=aP(r,r.ins_h,r.window[t+3-1]),r.prev[t&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=t,t++;while(--e)r.strstart=t,r.lookahead=2,aO(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,r.wrap=i,ac})(this.strm,t))!==a6)throw Error(i9[i]);this._dict_set=!0}}function on(t,e){let n=new oe(e);if(n.push(t,!0),n.err)throw n.msg||i9[n.err];return n.result}oe.prototype.push=function(t,e){let n,r,i=this.strm,a=this.options.chunkSize;if(this.ended)return!1;for(r=e===~~e?e:!0===e?a4:a2,"string"==typeof t?i.input=aZ(t):"[object ArrayBuffer]"===a0.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;){if(0===i.avail_out&&(i.output=new Uint8Array(a),i.next_out=0,i.avail_out=a),(r===a5||r===a3)&&i.avail_out<=6){this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;continue}if((n=aH(i,r))===a8)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),n=aW(this.strm),this.onEnd(n),this.ended=!0,n===a6;if(0===i.avail_out){this.onData(i.output);continue}if(r>0&&i.next_out>0){this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;continue}if(0===i.avail_in)break}return!0},oe.prototype.onData=function(t){this.chunks.push(t)},oe.prototype.onEnd=function(t){t===a6&&(this.result=aV(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var or=function(t,e){let n,r,i,a,o,s,l,h,u,c,f,d,p,g,m,v,b,y,w,_,x,N,A,L,k=t.state;n=t.next_in,A=t.input,r=n+(t.avail_in-5),i=t.next_out,L=t.output,a=i-(e-t.avail_out),o=i+(t.avail_out-257),s=k.dmax,l=k.wsize,h=k.whave,u=k.wnext,c=k.window,f=k.hold,d=k.bits,p=k.lencode,g=k.distcode,m=(1<<k.lenbits)-1,v=(1<<k.distbits)-1;t:do for(d<15&&(f+=A[n++]<<d,d+=8,f+=A[n++]<<d,d+=8),b=p[f&m];;){if(f>>>=y=b>>>24,d-=y,0==(y=b>>>16&255))L[i++]=65535&b;else if(16&y)for(w=65535&b,(y&=15)&&(d<y&&(f+=A[n++]<<d,d+=8),w+=f&(1<<y)-1,f>>>=y,d-=y),d<15&&(f+=A[n++]<<d,d+=8,f+=A[n++]<<d,d+=8),b=g[f&v];;){if(f>>>=y=b>>>24,d-=y,16&(y=b>>>16&255)){if(_=65535&b,d<(y&=15)&&(f+=A[n++]<<d,(d+=8)<y&&(f+=A[n++]<<d,d+=8)),(_+=f&(1<<y)-1)>s){t.msg="invalid distance too far back",k.mode=16209;break t}if(f>>>=y,d-=y,_>(y=i-a)){if((y=_-y)>h&&k.sane){t.msg="invalid distance too far back",k.mode=16209;break t}if(x=0,N=c,0===u){if(x+=l-y,y<w){w-=y;do L[i++]=c[x++];while(--y)x=i-_,N=L}}else if(u<y){if(x+=l+u-y,(y-=u)<w){w-=y;do L[i++]=c[x++];while(--y)if(x=0,u<w){w-=y=u;do L[i++]=c[x++];while(--y)x=i-_,N=L}}}else if(x+=u-y,y<w){w-=y;do L[i++]=c[x++];while(--y)x=i-_,N=L}for(;w>2;)L[i++]=N[x++],L[i++]=N[x++],L[i++]=N[x++],w-=3;w&&(L[i++]=N[x++],w>1&&(L[i++]=N[x++]))}else{x=i-_;do L[i++]=L[x++],L[i++]=L[x++],L[i++]=L[x++],w-=3;while(w>2)w&&(L[i++]=L[x++],w>1&&(L[i++]=L[x++]))}}else if((64&y)==0){b=g[(65535&b)+(f&(1<<y)-1)];continue}else{t.msg="invalid distance code",k.mode=16209;break t}break}else if((64&y)==0){b=p[(65535&b)+(f&(1<<y)-1)];continue}else if(32&y){k.mode=16191;break t}else{t.msg="invalid literal/length code",k.mode=16209;break t}break}while(n<r&&i<o)n-=w=d>>3,d-=w<<3,f&=(1<<d)-1,t.next_in=n,t.next_out=i,t.avail_in=n<r?5+(r-n):5-(n-r),t.avail_out=i<o?257+(o-i):257-(i-o),k.hold=f,k.bits=d};let oi=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),oa=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),oo=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),os=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ol=(t,e,n,r,i,a,o,s)=>{let l,h,u,c,f,d,p,g,m,v=s.bits,b=0,y=0,w=0,_=0,x=0,N=0,A=0,L=0,k=0,S=0,C=null,P=new Uint16Array(16),E=new Uint16Array(16),I=null;for(b=0;b<=15;b++)P[b]=0;for(y=0;y<r;y++)P[e[n+y]]++;for(_=15,x=v;_>=1&&0===P[_];_--);if(x>_&&(x=_),0===_)return i[a++]=0x1400000,i[a++]=0x1400000,s.bits=1,0;for(w=1;w<_&&0===P[w];w++);for(x<w&&(x=w),L=1,b=1;b<=15;b++)if(L<<=1,(L-=P[b])<0)return -1;if(L>0&&(0===t||1!==_))return -1;for(b=1,E[1]=0;b<15;b++)E[b+1]=E[b]+P[b];for(y=0;y<r;y++)0!==e[n+y]&&(o[E[e[n+y]]++]=y);if(0===t?(C=I=o,d=20):1===t?(C=oi,I=oa,d=257):(C=oo,I=os,d=0),S=0,y=0,b=w,f=a,N=x,A=0,u=-1,c=(k=1<<x)-1,1===t&&k>852||2===t&&k>592)return 1;for(;;){p=b-A,o[y]+1<d?(g=0,m=o[y]):o[y]>=d?(g=I[o[y]-d],m=C[o[y]-d]):(g=96,m=0),l=1<<b-A,w=h=1<<N;do i[f+(S>>A)+(h-=l)]=p<<24|g<<16|m;while(0!==h)for(l=1<<b-1;S&l;)l>>=1;if(0!==l?(S&=l-1,S+=l):S=0,y++,0==--P[b]){if(b===_)break;b=e[n+o[y]]}if(b>x&&(S&c)!==u){for(0===A&&(A=x),f+=w,L=1<<(N=b-A);N+A<_&&!((L-=P[N+A])<=0);)N++,L<<=1;if(k+=1<<N,1===t&&k>852||2===t&&k>592)return 1;i[u=S&c]=x<<24|N<<16|f-a}}return 0!==S&&(i[f+S]=b-A<<24|4194304),s.bits=x,0};let{Z_FINISH:oh,Z_BLOCK:ou,Z_TREES:oc,Z_OK:of,Z_STREAM_END:od,Z_NEED_DICT:op,Z_STREAM_ERROR:og,Z_DATA_ERROR:om,Z_MEM_ERROR:ov,Z_BUF_ERROR:ob,Z_DEFLATED:oy}=at,ow=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function o_(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}let ox=t=>{if(!t)return 1;let e=t.state;return+(!e||e.strm!==t||e.mode<16180||e.mode>16211)},oN=t=>{if(ox(t))return og;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,(t=>{if(ox(t))return og;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,of})(t)},oA=!0,oL=t=>{if(oA){i=new Int32Array(512),a=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ol(1,t.lens,0,288,i,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ol(2,t.lens,0,32,a,0,t.work,{bits:5}),oA=!1}t.lencode=i,t.lenbits=9,t.distcode=a,t.distbits=5},ok=(t,e,n,r)=>{let i,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(e.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>r&&(i=r),a.window.set(e.subarray(n-r,n-r+i),a.wnext),(r-=i)?(a.window.set(e.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0};var oS=(t,e)=>{let n,r,i,a,o,s,l,h,u,c,f,d,p,g,m,v,b,y,w,_,x,N,A,L,k=0,S=new Uint8Array(4),C=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ox(t)||!t.output||!t.input&&0!==t.avail_in)return og;16191===(n=t.state).mode&&(n.mode=16192),o=t.next_out,i=t.output,l=t.avail_out,a=t.next_in,r=t.input,s=t.avail_in,h=n.hold,u=n.bits,c=s,f=l,N=of;e:for(;;)switch(n.mode){case 16180:if(0===n.wrap){n.mode=16192;break}for(;u<16;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}if(2&n.wrap&&35615===h){0===n.wbits&&(n.wbits=15),n.check=0,S[0]=255&h,S[1]=h>>>8&255,n.check=i7(n.check,S,2,0),h=0,u=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",n.mode=16209;break}if((15&h)!==oy){t.msg="unknown compression method",n.mode=16209;break}if(h>>>=4,u-=4,x=(15&h)+8,0===n.wbits&&(n.wbits=x),x>15||x>n.wbits){t.msg="invalid window size",n.mode=16209;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=512&h?16189:16191,h=0,u=0;break;case 16181:for(;u<16;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}if(n.flags=h,(255&n.flags)!==oy){t.msg="unknown compression method",n.mode=16209;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=16209;break}n.head&&(n.head.text=h>>8&1),512&n.flags&&4&n.wrap&&(S[0]=255&h,S[1]=h>>>8&255,n.check=i7(n.check,S,2,0)),h=0,u=0,n.mode=16182;case 16182:for(;u<32;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}n.head&&(n.head.time=h),512&n.flags&&4&n.wrap&&(S[0]=255&h,S[1]=h>>>8&255,S[2]=h>>>16&255,S[3]=h>>>24&255,n.check=i7(n.check,S,4,0)),h=0,u=0,n.mode=16183;case 16183:for(;u<16;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=255&h,n.head.os=h>>8),512&n.flags&&4&n.wrap&&(S[0]=255&h,S[1]=h>>>8&255,n.check=i7(n.check,S,2,0)),h=0,u=0,n.mode=16184;case 16184:if(1024&n.flags){for(;u<16;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}n.length=h,n.head&&(n.head.extra_len=h),512&n.flags&&4&n.wrap&&(S[0]=255&h,S[1]=h>>>8&255,n.check=i7(n.check,S,2,0)),h=0,u=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&((d=n.length)>s&&(d=s),d&&(n.head&&(x=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+d),x)),512&n.flags&&4&n.wrap&&(n.check=i7(n.check,r,d,a)),s-=d,a+=d,n.length-=d),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;d=0;do x=r[a+d++],n.head&&x&&n.length<65536&&(n.head.name+=String.fromCharCode(x));while(x&&d<s)if(512&n.flags&&4&n.wrap&&(n.check=i7(n.check,r,d,a)),s-=d,a+=d,x)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===s)break e;d=0;do x=r[a+d++],n.head&&x&&n.length<65536&&(n.head.comment+=String.fromCharCode(x));while(x&&d<s)if(512&n.flags&&4&n.wrap&&(n.check=i7(n.check,r,d,a)),s-=d,a+=d,x)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;u<16;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}if(4&n.wrap&&h!==(65535&n.check)){t.msg="header crc mismatch",n.mode=16209;break}h=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=16191;break;case 16189:for(;u<32;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}t.adler=n.check=ow(h),h=0,u=0,n.mode=16190;case 16190:if(0===n.havedict)return t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=h,n.bits=u,op;t.adler=n.check=1,n.mode=16191;case 16191:if(e===ou||e===oc)break e;case 16192:if(n.last){h>>>=7&u,u-=7&u,n.mode=16206;break}for(;u<3;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}switch(n.last=1&h,u-=1,3&(h>>>=1)){case 0:n.mode=16193;break;case 1:if(oL(n),n.mode=16199,e===oc){h>>>=2,u-=2;break e}break;case 2:n.mode=16196;break;case 3:t.msg="invalid block type",n.mode=16209}h>>>=2,u-=2;break;case 16193:for(h>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",n.mode=16209;break}if(n.length=65535&h,h=0,u=0,n.mode=16194,e===oc)break e;case 16194:n.mode=16195;case 16195:if(d=n.length){if(d>s&&(d=s),d>l&&(d=l),0===d)break e;i.set(r.subarray(a,a+d),o),s-=d,a+=d,l-=d,o+=d,n.length-=d;break}n.mode=16191;break;case 16196:for(;u<14;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}if(n.nlen=(31&h)+257,u-=5,n.ndist=(31&(h>>>=5))+1,u-=5,n.ncode=(15&(h>>>=5))+4,h>>>=4,u-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=16209;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;u<3;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}n.lens[C[n.have++]]=7&h,h>>>=3,u-=3}for(;n.have<19;)n.lens[C[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,A={bits:n.lenbits},N=ol(0,n.lens,0,19,n.lencode,0,n.work,A),n.lenbits=A.bits,N){t.msg="invalid code lengths set",n.mode=16209;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;m=(k=n.lencode[h&(1<<n.lenbits)-1])>>>24,v=k>>>16&255,b=65535&k,!(m<=u);){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}if(b<16)h>>>=m,u-=m,n.lens[n.have++]=b;else{if(16===b){for(L=m+2;u<L;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}if(h>>>=m,u-=m,0===n.have){t.msg="invalid bit length repeat",n.mode=16209;break}x=n.lens[n.have-1],d=3+(3&h),h>>>=2,u-=2}else if(17===b){for(L=m+3;u<L;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}h>>>=m,u-=m,x=0,d=3+(7&h),h>>>=3,u-=3}else{for(L=m+7;u<L;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}h>>>=m,u-=m,x=0,d=11+(127&h),h>>>=7,u-=7}if(n.have+d>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=16209;break}for(;d--;)n.lens[n.have++]=x}}if(16209===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=16209;break}if(n.lenbits=9,A={bits:n.lenbits},N=ol(1,n.lens,0,n.nlen,n.lencode,0,n.work,A),n.lenbits=A.bits,N){t.msg="invalid literal/lengths set",n.mode=16209;break}if(n.distbits=6,n.distcode=n.distdyn,A={bits:n.distbits},N=ol(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,A),n.distbits=A.bits,N){t.msg="invalid distances set",n.mode=16209;break}if(n.mode=16199,e===oc)break e;case 16199:n.mode=16200;case 16200:if(s>=6&&l>=258){t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=h,n.bits=u,or(t,f),o=t.next_out,i=t.output,l=t.avail_out,a=t.next_in,r=t.input,s=t.avail_in,h=n.hold,u=n.bits,16191===n.mode&&(n.back=-1);break}for(n.back=0;m=(k=n.lencode[h&(1<<n.lenbits)-1])>>>24,v=k>>>16&255,b=65535&k,!(m<=u);){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}if(v&&(240&v)==0){for(y=m,w=v,_=b;m=(k=n.lencode[_+((h&(1<<y+w)-1)>>y)])>>>24,v=k>>>16&255,b=65535&k,!(y+m<=u);){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}h>>>=y,u-=y,n.back+=y}if(h>>>=m,u-=m,n.back+=m,n.length=b,0===v){n.mode=16205;break}if(32&v){n.back=-1,n.mode=16191;break}if(64&v){t.msg="invalid literal/length code",n.mode=16209;break}n.extra=15&v,n.mode=16201;case 16201:if(n.extra){for(L=n.extra;u<L;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;m=(k=n.distcode[h&(1<<n.distbits)-1])>>>24,v=k>>>16&255,b=65535&k,!(m<=u);){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}if((240&v)==0){for(y=m,w=v,_=b;m=(k=n.distcode[_+((h&(1<<y+w)-1)>>y)])>>>24,v=k>>>16&255,b=65535&k,!(y+m<=u);){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}h>>>=y,u-=y,n.back+=y}if(h>>>=m,u-=m,n.back+=m,64&v){t.msg="invalid distance code",n.mode=16209;break}n.offset=b,n.extra=15&v,n.mode=16203;case 16203:if(n.extra){for(L=n.extra;u<L;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=16209;break}n.mode=16204;case 16204:if(0===l)break e;if(d=f-l,n.offset>d){if((d=n.offset-d)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=16209;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),g=n.window}else g=i,p=o-n.offset,d=n.length;d>l&&(d=l),l-=d,n.length-=d;do i[o++]=g[p++];while(--d)0===n.length&&(n.mode=16200);break;case 16205:if(0===l)break e;i[o++]=n.length,l--,n.mode=16200;break;case 16206:if(n.wrap){for(;u<32;){if(0===s)break e;s--,h|=r[a++]<<u,u+=8}if(f-=l,t.total_out+=f,n.total+=f,4&n.wrap&&f&&(t.adler=n.check=n.flags?i7(n.check,i,f,o-f):i6(n.check,i,f,o-f)),f=l,4&n.wrap&&(n.flags?h:ow(h))!==n.check){t.msg="incorrect data check",n.mode=16209;break}h=0,u=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;u<32;){if(0===s)break e;s--,h+=r[a++]<<u,u+=8}if(4&n.wrap&&h!==(0|n.total)){t.msg="incorrect length check",n.mode=16209;break}h=0,u=0}n.mode=16208;case 16208:N=od;break e;case 16209:N=om;break e;case 16210:return ov;default:return og}return t.next_out=o,t.avail_out=l,t.next_in=a,t.avail_in=s,n.hold=h,n.bits=u,(n.wsize||f!==t.avail_out&&n.mode<16209&&(n.mode<16206||e!==oh))&&ok(t,t.output,t.next_out,f-t.avail_out),c-=t.avail_in,f-=t.avail_out,t.total_in+=c,t.total_out+=f,n.total+=f,4&n.wrap&&f&&(t.adler=n.check=n.flags?i7(n.check,i,f,t.next_out-f):i6(n.check,i,f,t.next_out-f)),t.data_type=n.bits+64*!!n.last+128*(16191===n.mode)+256*(16199===n.mode||16194===n.mode),(0===c&&0===f||e===oh)&&N===of&&(N=ob),N},oC=t=>{if(ox(t))return og;let e=t.state;return e.window&&(e.window=null),t.state=null,of},oP=(t,e)=>{let n,r=e.length;return ox(t)||0!==(n=t.state).wrap&&16190!==n.mode?og:16190===n.mode&&i6(1,e,r,0)!==n.check?om:ok(t,e,r,r)?(n.mode=16210,ov):(n.havedict=1,of)},oE=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};let oI=Object.prototype.toString,{Z_NO_FLUSH:oj,Z_FINISH:oM,Z_OK:oF,Z_STREAM_END:oB,Z_NEED_DICT:oO,Z_STREAM_ERROR:oT,Z_DATA_ERROR:oR,Z_MEM_ERROR:oD}=at;function oz(t){this.options=aY({chunkSize:65536,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits)==0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a1,this.strm.avail_out=0;let n=((t,e)=>{if(!t)return og;let n=new o_;t.state=n,n.strm=t,n.window=null,n.mode=16180;let r=((t,e)=>{let n;if(ox(t))return og;let r=t.state;return(e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15))?og:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,oN(t))})(t,e);return r!==of&&(t.state=null),r})(this.strm,e.windowBits);if(n!==oF||(this.header=new oE,((t,e)=>{if(ox(t))return;let n=t.state;return(2&n.wrap)==0||(n.head=e,e.done=!1)})(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=aZ(e.dictionary):"[object ArrayBuffer]"===oI.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw)&&(n=oP(this.strm,e.dictionary))!==oF))throw Error(i9[n])}function oq(t,e){let n=new oz(e);if(n.push(t),n.err)throw n.msg||i9[n.err];return n.result}oz.prototype.push=function(t,e){let n,r,i,a=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(r=e===~~e?e:!0===e?oM:oj,"[object ArrayBuffer]"===oI.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(o),a.next_out=0,a.avail_out=o),(n=oS(a,r))===oO&&s&&((n=oP(a,s))===oF?n=oS(a,r):n===oR&&(n=oO));a.avail_in>0&&n===oB&&a.state.wrap>0&&0!==t[a.next_in];)oN(a),n=oS(a,r);switch(n){case oT:case oR:case oO:case oD:return this.onEnd(n),this.ended=!0,!1}if(i=a.avail_out,a.next_out&&(0===a.avail_out||n===oB))if("string"===this.options.to){let t=aQ(a.output,a.next_out),e=a.next_out-t,n=aK(a.output,t);a.next_out=e,a.avail_out=o-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(n!==oF||0!==i){if(n===oB)return n=oC(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},oz.prototype.onData=function(t){this.chunks.push(t)},oz.prototype.onEnd=function(t){t===oF&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=aV(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};let{Deflate:oU,deflate:o$,deflateRaw:oH,gzip:oW}={Deflate:oe,deflate:on,deflateRaw:function(t,e){return(e=e||{}).raw=!0,on(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,on(t,e)},constants:at},{Inflate:oX,inflate:oY,inflateRaw:oV,ungzip:oG}={Inflate:oz,inflate:oq,inflateRaw:function(t,e){return(e=e||{}).raw=!0,oq(t,e)},ungzip:oq,constants:at},oJ=[];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)1&e?e=0xedb88320^e>>>1:e>>>=1;oJ[t]=e}function oZ(t,e,n){let r=t.readUint32(),i=(0xffffffff^function(t,e,n){let r=0xffffffff;for(let t=0;t<n;t++)r=oJ[(r^e[t])&255]^r>>>8;return r}(0,new Uint8Array(t.buffer,t.byteOffset+t.offset-e-4,e),e))>>>0;if(i!==r)throw Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${i}`)}function oK(t,e,n){for(let r=0;r<n;r++)e[r]=t[r]}function oQ(t,e,n,r){let i=0;for(;i<r;i++)e[i]=t[i];for(;i<n;i++)e[i]=t[i]+e[i-r]&255}function o1(t,e,n,r){let i=0;if(0===n.length)for(;i<r;i++)e[i]=t[i];else for(;i<r;i++)e[i]=t[i]+n[i]&255}function o0(t,e,n,r,i){let a=0;if(0===n.length){for(;a<i;a++)e[a]=t[a];for(;a<r;a++)e[a]=t[a]+(e[a-i]>>1)&255}else{for(;a<i;a++)e[a]=t[a]+(n[a]>>1)&255;for(;a<r;a++)e[a]=t[a]+(e[a-i]+n[a]>>1)&255}}function o2(t,e,n,r,i){let a=0;if(0===n.length){for(;a<i;a++)e[a]=t[a];for(;a<r;a++)e[a]=t[a]+e[a-i]&255}else{for(;a<i;a++)e[a]=t[a]+n[a]&255;for(;a<r;a++)e[a]=t[a]+function(t,e,n){let r=t+e-n,i=Math.abs(r-t),a=Math.abs(r-e),o=Math.abs(r-n);return i<=a&&i<=o?t:a<=o?e:n}(e[a-i],n[a],n[a-i])&255}}let o5=255===new Uint8Array(new Uint16Array([255]).buffer)[0],o3=255===new Uint8Array(new Uint16Array([255]).buffer)[0],o4=new Uint8Array(0);function o6(t){let e,n,{data:r,width:i,height:a,channels:o,depth:s}=t,l=Math.ceil(s/8)*o,h=Math.ceil(s/8*o*i),u=new Uint8Array(a*h),c=o4,f=0;for(let t=0;t<a;t++){switch(e=r.subarray(f+1,f+1+h),n=u.subarray(t*h,(t+1)*h),r[f]){case 0:oK(e,n,h);break;case 1:oQ(e,n,h,l);break;case 2:o1(e,n,c,h);break;case 3:o0(e,n,c,h,l);break;case 4:o2(e,n,c,h,l);break;default:throw Error(`Unsupported filter: ${r[f]}`)}c=n,f+=h+1}if(16!==s)return u;{let t=new Uint16Array(u.buffer);if(o3)for(let e=0;e<t.length;e++){var d;t[e]=(255&(d=t[e]))<<8|d>>8&255}return t}}let o8=Uint8Array.of(137,80,78,71,13,10,26,10);function o7(t){if(!function(t){if(t.length<o8.length)return!1;for(let e=0;e<o8.length;e++)if(t[e]!==o8[e])return!1;return!0}(t.readBytes(o8.length)))throw Error("wrong PNG signature")}let o9=new TextDecoder("latin1"),st=/^[\u0000-\u00FF]*$/;function se(t){for(t.mark();0!==t.readByte(););let e=t.offset;t.reset();let n=o9.decode(t.readBytes(e-t.offset-1));t.skip(1);if(function(t){if(!st.test(t))throw Error("invalid latin1 text")}(n),0===n.length||n.length>79)throw Error("keyword length must be between 1 and 79");return n}class sn extends iC{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(t,e={}){super(t);const{checkCrc:n=!1}=e;this._checkCrc=n,this._inflator=new oX,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=-1,this._filterMethod=-1,this._interlaceMethod=-1,this._colorType=-1,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(o7(this);!this._end;){let t=this.readUint32(),e=this.readChars(4);this.decodeChunk(t,e)}return this.decodeImage(),this._png}decodeApng(){for(o7(this);!this._end;){let t=this.readUint32(),e=this.readChars(4);this.decodeApngChunk(t,e)}return this.decodeApngImage(),this._apng}decodeChunk(t,e){let n=this.offset;switch(e){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case"tEXt":var r,i,a;let o;r=this._png.text,r[o=se(this)]=(i=this,a=t-o.length-1,o9.decode(i.readBytes(a)));break;case"pHYs":this.decodepHYs();break;default:this.skip(t)}if(this.offset-n!==t)throw Error(`Length mismatch while decoding chunk ${e}`);this._checkCrc?oZ(this,t+4,e):this.skip(4)}decodeApngChunk(t,e){let n=this.offset;switch("fdAT"!==e&&"IDAT"!==e&&this._writingDataChunks&&this.pushDataToFrame(),e){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,e),this.offset=n+t}if(this.offset-n!==t)throw Error(`Length mismatch while decoding chunk ${e}`);this._checkCrc?oZ(this,t+4,e):this.skip(4)}decodeIHDR(){let t,e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=function(t){if(1!==t&&2!==t&&4!==t&&8!==t&&16!==t)throw Error(`invalid bit depth: ${t}`);return t}(this.readUint8());let n=this.readUint8();switch(this._colorType=n,n){case 0:case 3:t=1;break;case 2:t=3;break;case 4:t=2;break;case 6:t=4;break;default:throw Error(`Unknown color type: ${n}`)}if(this._png.channels=t,this._compressionMethod=this.readUint8(),0!==this._compressionMethod)throw Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){let t={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(t)}decodePLTE(t){if(t%3!=0)throw RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);let e=t/3;this._hasPalette=!0;let n=[];this._palette=n;for(let t=0;t<e;t++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._writingDataChunks=!0;let e=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,e,t)),this._inflator.err)throw Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodeFDAT(t){this._writingDataChunks=!0;let e=t,n=this.offset+this.byteOffset;if(n+=4,e-=4,this._inflator.push(new Uint8Array(this.buffer,n,e)),this._inflator.err)throw Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodetRNS(t){switch(this._colorType){case 0:case 2:if(t%2!=0)throw RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);if(t/2>this._png.width*this._png.height)throw Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let e=0;e<t/2;e++)this._transparency[e]=this.readUint16();break;case 3:{if(t>this._palette.length)throw Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let e=0;for(;e<t;e++){let t=this.readByte();this._palette[e].push(t)}for(;e<this._palette.length;e++)this._palette[e].push(255);break}default:throw Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(t){let e=se(this),n=this.readUint8();if(0!==n)throw Error(`Unsupported iCCP compression method: ${n}`);let r=this.readBytes(t-e.length-2);this._png.iccEmbeddedProfile={name:e,profile:oY(r)}}decodepHYs(){let t=this.readUint32(),e=this.readUint32(),n=this.readByte();this._png.resolution={x:t,y:e,unit:n}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let t=0;t<this._numberOfFrames;t++){let e={sequenceNumber:this._frames[t].sequenceNumber,delayNumber:this._frames[t].delayNumber,delayDenominator:this._frames[t].delayDenominator,data:8===this._apng.depth?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},n=this._frames.at(t);if(n){if(n.data=o6({data:n.data,width:n.width,height:n.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),0===t||0===n.xOffset&&0===n.yOffset&&n.width===this._png.width&&n.height===this._png.height)e.data=n.data;else{let r=this._apng.frames.at(t-1);this.disposeFrame(n,r,e),this.addFrameDataToCanvas(e,n)}this._apng.frames.push(e)}}return this._apng}disposeFrame(t,e,n){switch(t.disposeOp){case 0:break;case 1:for(let e=0;e<this._png.height;e++)for(let r=0;r<this._png.width;r++){let i=(e*t.width+r)*this._png.channels;for(let t=0;t<this._png.channels;t++)n.data[i+t]=0}break;case 2:n.data.set(e.data);break;default:throw Error("Unknown disposeOp")}}addFrameDataToCanvas(t,e){let n=1<<this._png.depth,r=(t,n)=>({index:((t+e.yOffset)*this._png.width+e.xOffset+n)*this._png.channels,frameIndex:(t*e.width+n)*this._png.channels});switch(e.blendOp){case 0:for(let n=0;n<e.height;n++)for(let i=0;i<e.width;i++){let{index:a,frameIndex:o}=r(n,i);for(let n=0;n<this._png.channels;n++)t.data[a+n]=e.data[o+n]}break;case 1:for(let i=0;i<e.height;i++)for(let a=0;a<e.width;a++){let{index:o,frameIndex:s}=r(i,a);for(let r=0;r<this._png.channels;r++){let i=e.data[s+this._png.channels-1]/n,a=Math.floor(i*(r%(this._png.channels-1)==0?1:e.data[s+r])+(1-i)*t.data[o+r]);t.data[o+r]+=a}}break;default:throw Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw Error(`Error while decompressing the data: ${this._inflator.err}`);let t=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(0!==this._filterMethod)throw Error(`Filter method ${this._filterMethod} not supported`);if(0===this._interlaceMethod)this._png.data=o6({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(1===this._interlaceMethod)this._png.data=function(t){let{data:e,width:n,height:r,channels:i,depth:a}=t,o=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],s=Math.ceil(a/8)*i,l=new Uint8Array(r*n*s),h=0;for(let t=0;t<7;t++){let i=o[t],a=Math.ceil((n-i.x)/i.xStep),u=Math.ceil((r-i.y)/i.yStep);if(a<=0||u<=0)continue;let c=a*s,f=new Uint8Array(c);for(let t=0;t<u;t++){let o=e[h++],u=e.subarray(h,h+c);h+=c;let d=new Uint8Array(c);switch(o){case 0:oK(u,d,c);break;case 1:oQ(u,d,c,s);break;case 2:o1(u,d,f,c);break;case 3:o0(u,d,f,c,s);break;case 4:o2(u,d,f,c,s);break;default:throw Error(`Unsupported filter: ${o}`)}f.set(d);for(let e=0;e<a;e++){let a=i.x+e*i.xStep,o=i.y+t*i.yStep;if(!(a>=n)&&!(o>=r))for(let t=0;t<s;t++)l[(o*n+a)*s+t]=d[e*s+t]}}}if(16!==a)return l;{let t=new Uint16Array(l.buffer);if(o5)for(let e=0;e<t.length;e++){var u;t[e]=(255&(u=t[e]))<<8|u>>8&255}return t}}({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){let t=this._inflator.result,e=this._frames.at(-1);e?e.data=t:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:0,blendOp:0,data:t}),this._inflator=new oX,this._writingDataChunks=!1}}(lL=hv||(hv={}))[lL.UNKNOWN=0]="UNKNOWN",lL[lL.METRE=1]="METRE";var sr="undefined"!=typeof window?window:t.g;function si(){sr.console&&"function"==typeof sr.console.log&&sr.console.log.apply(sr.console,arguments)}var sa=function(t){sr.console&&("function"==typeof sr.console.warn?sr.console.warn.apply(sr.console,arguments):si.call(null,arguments))},so=function(t){sr.console&&("function"==typeof sr.console.error?sr.console.error.apply(sr.console,arguments):si(t))};function ss(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){su(r.response,e,n)},r.onerror=function(){so("could not download file")},r.send()}function sl(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function sh(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var su=sr.saveAs||("object"!==("undefined"==typeof window?"undefined":(0,nH.default)(window))||window!==sr?function(){}:"undefined"!=typeof HTMLAnchorElement&&"download"in HTMLAnchorElement.prototype?function(t,e,n){var r=sr.URL||sr.webkitURL,i=document.createElement("a");i.download=e=e||t.name||"download",i.rel="noopener","string"==typeof t?(i.href=t,i.origin!==location.origin?sl(i.href)?ss(t,e,n):sh(i,i.target="_blank"):sh(i)):(i.href=r.createObjectURL(t),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){sh(i)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download","string"==typeof t)if(sl(t))ss(t,e,n);else{var r,i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){sh(i)})}else navigator.msSaveOrOpenBlob((void 0===(r=n)?r={autoBom:!1}:"object"!==(0,nH.default)(r)&&(sa("Deprecated: Expected third argument to be a object"),r={autoBom:!r}),r.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t),e)}:function(t,e,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof t)return ss(t,e,n);var i="application/octet-stream"===t.type,a=/constructor/i.test(sr.HTMLElement)||sr.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a)&&"object"===("undefined"==typeof FileReader?"undefined":(0,nH.default)(FileReader))){var s=new FileReader;s.onloadend=function(){var t=s.result;t=o?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=t:location=t,r=null},s.readAsDataURL(t)}else{var l=sr.URL||sr.webkitURL,h=l.createObjectURL(t);r?r.location=h:location.href=h,r=null,setTimeout(function(){l.revokeObjectURL(h)},4e4)}});function sc(t){var e;t=t||"",this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"})[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,a=n[r].process,o=i.exec(t);o&&(e=a(o),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==n.length&&(n="0"+n),"#"+t+e+n}}var sf=sr.atob.bind(sr),sd=sr.btoa.bind(sr);function sp(t,e){var n=t[0],r=t[1],i=t[2],a=t[3];n=sm(n,r,i,a,e[0],7,-0x28955b88),a=sm(a,n,r,i,e[1],12,-0x173848aa),i=sm(i,a,n,r,e[2],17,0x242070db),r=sm(r,i,a,n,e[3],22,-0x3e423112),n=sm(n,r,i,a,e[4],7,-0xa83f051),a=sm(a,n,r,i,e[5],12,0x4787c62a),i=sm(i,a,n,r,e[6],17,-0x57cfb9ed),r=sm(r,i,a,n,e[7],22,-0x2b96aff),n=sm(n,r,i,a,e[8],7,0x698098d8),a=sm(a,n,r,i,e[9],12,-0x74bb0851),i=sm(i,a,n,r,e[10],17,-42063),r=sm(r,i,a,n,e[11],22,-0x76a32842),n=sm(n,r,i,a,e[12],7,0x6b901122),a=sm(a,n,r,i,e[13],12,-0x2678e6d),i=sm(i,a,n,r,e[14],17,-0x5986bc72),n=sv(n,r=sm(r,i,a,n,e[15],22,0x49b40821),i,a,e[1],5,-0x9e1da9e),a=sv(a,n,r,i,e[6],9,-0x3fbf4cc0),i=sv(i,a,n,r,e[11],14,0x265e5a51),r=sv(r,i,a,n,e[0],20,-0x16493856),n=sv(n,r,i,a,e[5],5,-0x29d0efa3),a=sv(a,n,r,i,e[10],9,0x2441453),i=sv(i,a,n,r,e[15],14,-0x275e197f),r=sv(r,i,a,n,e[4],20,-0x182c0438),n=sv(n,r,i,a,e[9],5,0x21e1cde6),a=sv(a,n,r,i,e[14],9,-0x3cc8f82a),i=sv(i,a,n,r,e[3],14,-0xb2af279),r=sv(r,i,a,n,e[8],20,0x455a14ed),n=sv(n,r,i,a,e[13],5,-0x561c16fb),a=sv(a,n,r,i,e[2],9,-0x3105c08),i=sv(i,a,n,r,e[7],14,0x676f02d9),n=sb(n,r=sv(r,i,a,n,e[12],20,-0x72d5b376),i,a,e[5],4,-378558),a=sb(a,n,r,i,e[8],11,-0x788e097f),i=sb(i,a,n,r,e[11],16,0x6d9d6122),r=sb(r,i,a,n,e[14],23,-0x21ac7f4),n=sb(n,r,i,a,e[1],4,-0x5b4115bc),a=sb(a,n,r,i,e[4],11,0x4bdecfa9),i=sb(i,a,n,r,e[7],16,-0x944b4a0),r=sb(r,i,a,n,e[10],23,-0x41404390),n=sb(n,r,i,a,e[13],4,0x289b7ec6),a=sb(a,n,r,i,e[0],11,-0x155ed806),i=sb(i,a,n,r,e[3],16,-0x2b10cf7b),r=sb(r,i,a,n,e[6],23,0x4881d05),n=sb(n,r,i,a,e[9],4,-0x262b2fc7),a=sb(a,n,r,i,e[12],11,-0x1924661b),i=sb(i,a,n,r,e[15],16,0x1fa27cf8),n=sy(n,r=sb(r,i,a,n,e[2],23,-0x3b53a99b),i,a,e[0],6,-0xbd6ddbc),a=sy(a,n,r,i,e[7],10,0x432aff97),i=sy(i,a,n,r,e[14],15,-0x546bdc59),r=sy(r,i,a,n,e[5],21,-0x36c5fc7),n=sy(n,r,i,a,e[12],6,0x655b59c3),a=sy(a,n,r,i,e[3],10,-0x70f3336e),i=sy(i,a,n,r,e[10],15,-1051523),r=sy(r,i,a,n,e[1],21,-0x7a7ba22f),n=sy(n,r,i,a,e[8],6,0x6fa87e4f),a=sy(a,n,r,i,e[15],10,-0x1d31920),i=sy(i,a,n,r,e[6],15,-0x5cfebcec),r=sy(r,i,a,n,e[13],21,0x4e0811a1),n=sy(n,r,i,a,e[4],6,-0x8ac817e),a=sy(a,n,r,i,e[11],10,-0x42c50dcb),i=sy(i,a,n,r,e[2],15,0x2ad7d2bb),r=sy(r,i,a,n,e[9],21,-0x14792c6f),t[0]=sL(n,t[0]),t[1]=sL(r,t[1]),t[2]=sL(i,t[2]),t[3]=sL(a,t[3])}function sg(t,e,n,r,i,a){return e=sL(sL(e,t),sL(r,a)),sL(e<<i|e>>>32-i,n)}function sm(t,e,n,r,i,a,o){return sg(e&n|~e&r,t,e,i,a,o)}function sv(t,e,n,r,i,a,o){return sg(e&r|n&~r,t,e,i,a,o)}function sb(t,e,n,r,i,a,o){return sg(e^n^r,t,e,i,a,o)}function sy(t,e,n,r,i,a,o){return sg(n^(e|~r),t,e,i,a,o)}function sw(t){var e,n=t.length,r=[0x67452301,-0x10325477,-0x67452302,0x10325476];for(e=64;e<=t.length;e+=64)sp(r,function(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)i[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(sp(r,i),e=0;e<16;e++)i[e]=0;return i[14]=8*n,sp(r,i),r}var s_="0123456789abcdef".split("");function sx(t){return String.fromCharCode(255&t,(65280&t)>>8,(0xff0000&t)>>16,(0xff000000&t)>>24)}function sN(t){return sw(t).map(sx).join("")}var sA="5d41402abc4b2a76b9719d911017c592"!=function(t){for(var e=0;e<t.length;e++)t[e]=function(t){for(var e="",n=0;n<4;n++)e+=s_[t>>8*n+4&15]+s_[t>>8*n&15];return e}(t[e]);return t.join("")}(sw("hello"));function sL(t,e){if(sA){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}return t+e|0}function sk(t,e){if(t!==n){for(var n,r,i=Array(1+(256/t.length|0)+1).join(t),a=[],o=0;o<256;o++)a[o]=o;var s=0;for(o=0;o<256;o++){var l=a[o];s=(s+l+i.charCodeAt(o))%256,a[o]=a[s],a[s]=l}n=t,r=a}else a=r;var h=e.length,u=0,c=0,f="";for(o=0;o<h;o++)c=(c+(l=a[u=(u+1)%256]))%256,a[u]=a[c],a[c]=l,i=a[(a[u]+a[c])%256],f+=String.fromCharCode(e.charCodeAt(o)^i);return f}var sS={print:4,modify:8,copy:16,"annot-forms":32};function sC(t,e,n,r){this.v=1,this.r=2;var i=192;t.forEach(function(t){if(void 0!==sS.perm)throw Error("Invalid permission: "+t);i+=sS[t]}),this.padding="(¿N^NuŠAd\0NVÿú\x01\b..\0¶Ðh>€/\f©þdSiz";var a=(e+this.padding).substr(0,32),o=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,o),this.P=-(1+(255^i)),this.encryptionKey=sN(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=sk(this.encryptionKey,this.padding)}function sP(t){if(/[^\u0000-\u00ff]/.test(t))throw Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",n=t.length,r=0;r<n;r++){var i=t.charCodeAt(r);e+=i<33||35===i||37===i||40===i||41===i||47===i||60===i||62===i||91===i||93===i||123===i||125===i||i>126?"#"+("0"+i.toString(16)).slice(-2):t[r]}return e}function sE(t){if("object"!==(0,nH.default)(t))throw Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,n,r){if(r=r||!1,"string"!=typeof t||"function"!=typeof n||"boolean"!=typeof r)throw Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(t)||(e[t]={});var i=Math.random().toString(35);return e[t][i]=[n,!!r],i},this.unsubscribe=function(t){for(var n in e)if(e[n][t])return delete e[n][t],0===Object.keys(e[n]).length&&delete e[n],!0;return!1},this.publish=function(n){if(e.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var a in e[n]){var o=e[n][a];try{o[0].apply(t,r)}catch(t){sr.console&&so("jsPDF PubSub Error",t.message,t)}o[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function sI(t){if(!(this instanceof sI))return new sI(t);var e="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&e.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function sj(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function sM(t,e,n,r,i){if(!(this instanceof sM))return new sM(t,e,n,r,i);this.type="axial"===t?2:3,this.coords=e,this.colors=n,sj.call(this,r,i)}function sF(t,e,n,r,i){if(!(this instanceof sF))return new sF(t,e,n,r,i);this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,sj.call(this,r,i)}function sB(t){var e,n="string"==typeof arguments[0]?arguments[0]:"p",r=arguments[1],i=arguments[2],a=arguments[3],o=[],s=1,l=16,h="S",u=null;"object"===(0,nH.default)(t=t||{})&&(n=t.orientation,r=t.unit||r,i=t.format||i,a=t.compress||t.compressPdf||a,null!==(u=t.encryption||null)&&(u.userPassword=u.userPassword||"",u.ownerPassword=u.ownerPassword||"",u.userPermissions=u.userPermissions||[]),s="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(e=t.precision),void 0!==t.floatPrecision&&(l=t.floatPrecision),h=t.defaultPathOperation||"S"),o=t.filters||(!0===a?["FlateEncode"]:o),r=r||"mm",n=(""+(n||"P")).toLowerCase();var c=t.putOnlyUsedFonts||!1,f={},d={internal:{},__private__:{}};d.__private__.PubSub=sE;var p="1.3",g=d.__private__.getPdfVersion=function(){return p};d.__private__.setPdfVersion=function(t){p=t};var m={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};d.__private__.getPageFormats=function(){return m};var v=d.__private__.getPageFormat=function(t){return m[t]};i=i||"a4";var b="compat",y="advanced",w=b;function _(){this.saveGraphicsState(),Z(new tI(tf,0,0,-tf,0,e2()*tf).toString()+" cm"),this.setFontSize(this.getFontSize()/tf),h="n",w=y}function x(){this.restoreGraphicsState(),h="S",w=b}var N=d.__private__.combineFontStyleAndFontWeight=function(t,e){if("bold"==t&&"normal"==e||"bold"==t&&400==e||"normal"==t&&"italic"==e||"bold"==t&&"italic"==e)throw Error("Invalid Combination of fontweight and fontstyle");return e&&(t=400==e||"normal"===e?"italic"===t?"italic":"normal":700!=e&&"bold"!==e||"normal"!==t?(700==e?"bold":e)+""+t:"bold"),t};d.advancedAPI=function(t){var e=w===b;return e&&_.call(this),"function"!=typeof t||(t(this),e&&x.call(this)),this},d.compatAPI=function(t){var e=w===y;return e&&x.call(this),"function"!=typeof t||(t(this),e&&_.call(this)),this},d.isAdvancedAPI=function(){return w===y};var A,L=function(t){if(w!==y)throw Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},k=d.roundToPrecision=d.__private__.roundToPrecision=function(t,n){var r=e||n;if(isNaN(t)||isNaN(r))throw Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(r).replace(/0+$/,"")};A=d.hpf=d.__private__.hpf="number"==typeof l?function(t){if(isNaN(t))throw Error("Invalid argument passed to jsPDF.hpf");return k(t,l)}:"smart"===l?function(t){if(isNaN(t))throw Error("Invalid argument passed to jsPDF.hpf");return k(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw Error("Invalid argument passed to jsPDF.hpf");return k(t,16)};var S=d.f2=d.__private__.f2=function(t){if(isNaN(t))throw Error("Invalid argument passed to jsPDF.f2");return k(t,2)},C=d.__private__.f3=function(t){if(isNaN(t))throw Error("Invalid argument passed to jsPDF.f3");return k(t,3)},P=d.scale=d.__private__.scale=function(t){if(isNaN(t))throw Error("Invalid argument passed to jsPDF.scale");return w===b?t*tf:w===y?t:void 0},E=function(t){return P(w===b?e2()-t:w===y?t:void 0)};d.__private__.setPrecision=d.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(e=parseInt(t,10))};var I,j="00000000000000000000000000000000",M=d.__private__.getFileId=function(){return j},F=d.__private__.setFileId=function(t){return j=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():j.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),null!==u&&(el=new sC(u.userPermissions,u.userPassword,u.ownerPassword,j)),j};d.setFileId=function(t){return F(t),this},d.getFileId=function(){return M()};var B=d.__private__.convertDateToPDFDate=function(t){var e=t.getTimezoneOffset(),n=Math.floor(Math.abs(e/60)),r=Math.abs(e%60),i=(e<0?"+":"-")+z(n)+"'"+z(r)+"'";return"D:"+t.getFullYear()+z(t.getMonth()+1)+z(t.getDate())+z(t.getHours())+z(t.getMinutes())+z(t.getSeconds())+i},O=d.__private__.convertPDFDateToDate=function(t){return new Date(parseInt(t.substr(2,4),10),parseInt(t.substr(6,2),10)-1,parseInt(t.substr(8,2),10),parseInt(t.substr(10,2),10),parseInt(t.substr(12,2),10),parseInt(t.substr(14,2),10),0)},T=d.__private__.setCreationDate=function(t){var e;if(void 0===t&&(t=new Date),t instanceof Date)e=B(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t))throw Error("Invalid argument passed to jsPDF.setCreationDate");e=t}return I=e},R=d.__private__.getCreationDate=function(t){var e=I;return"jsDate"===t&&(e=O(I)),e};d.setCreationDate=function(t){return T(t),this},d.getCreationDate=function(t){return R(t)};var D,z=d.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},q=d.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},U=0,$=[],H=[],W=0,X=[],Y=[],V=!1,G=H;d.__private__.setCustomOutputDestination=function(t){V=!0,G=t};var J=function(t){V||(G=t)};d.__private__.resetCustomOutputDestination=function(){V=!1,G=H};var Z=d.__private__.out=function(t){return t=t.toString(),W+=t.length+1,G.push(t),G},K=d.__private__.write=function(t){return Z(1==arguments.length?t.toString():Array.prototype.join.call(arguments," "))},Q=d.__private__.getArrayBuffer=function(t){for(var e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},tt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];d.__private__.getStandardFonts=function(){return tt};var te=t.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(t){return te=w===y?t/tf:t,this};var tn,tr=d.__private__.getFontSize=d.getFontSize=function(){return w===b?te:te*tf},ti=t.R2L||!1;d.__private__.setR2L=d.setR2L=function(t){return ti=t,this},d.__private__.getR2L=d.getR2L=function(){return ti};var ta,to=d.__private__.setZoomMode=function(t){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(t))tn=t;else if(isNaN(t)){if(-1===[void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(t))throw Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+t+'" is not recognized.');tn=t}else tn=parseInt(t,10)};d.__private__.getZoomMode=function(){return tn};var ts,tl=d.__private__.setPageMode=function(t){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(t))throw Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+t+'" is not recognized.');ta=t};d.__private__.getPageMode=function(){return ta};var th=d.__private__.setLayoutMode=function(t){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(t))throw Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+t+'" is not recognized.');ts=t};d.__private__.getLayoutMode=function(){return ts},d.__private__.setDisplayMode=d.setDisplayMode=function(t,e,n){return to(t),th(e),tl(n),this};var tu={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(t){if(-1===Object.keys(tu).indexOf(t))throw Error("Invalid argument passed to jsPDF.getDocumentProperty");return tu[t]},d.__private__.getDocumentProperties=function(){return tu},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(t){for(var e in tu)tu.hasOwnProperty(e)&&t[e]&&(tu[e]=t[e]);return this},d.__private__.setDocumentProperty=function(t,e){if(-1===Object.keys(tu).indexOf(t))throw Error("Invalid arguments passed to jsPDF.setDocumentProperty");return tu[t]=e};var tc,tf,td,tp,tg,tm={},tv={},tb=[],ty={},tw={},t_={},tx={},tN=null,tA=0,tL=[],tk=new sE(d),tS=t.hotfixes||[],tC={},tP={},tE=[],tI=function t(e,n,r,i,a,o){if(!(this instanceof t))return new t(e,n,r,i,a,o);isNaN(e)&&(e=1),isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(i)&&(i=1),isNaN(a)&&(a=0),isNaN(o)&&(o=0),this._matrix=[e,n,r,i,a,o]};Object.defineProperty(tI.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(tI.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(tI.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(tI.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(tI.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(tI.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(tI.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(tI.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(tI.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(tI.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(tI.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(tI.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(tI.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(tI.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(tI.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(tI.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),tI.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(A).join(t)},tI.prototype.multiply=function(t){return new tI(t.sx*this.sx+t.shy*this.shx,t.sx*this.shy+t.shy*this.sy,t.shx*this.sx+t.sy*this.shx,t.shx*this.shy+t.sy*this.sy,t.tx*this.sx+t.ty*this.shx+this.tx,t.tx*this.shy+t.ty*this.sy+this.ty)},tI.prototype.decompose=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,a=this.ty,o=Math.sqrt(t*t+e*e),s=(t/=o)*n+(e/=o)*r,l=Math.sqrt((n-=t*s)*n+(r-=e*s)*r);return s/=l,t*(r/=l)<e*(n/=l)&&(t=-t,e=-e,s=-s,o=-o),{scale:new tI(o,0,0,l,0,0),translate:new tI(1,0,0,1,i,a),rotate:new tI(t,e,-e,t,0,0),skew:new tI(1,0,s,1,0,0)}},tI.prototype.toString=function(t){return this.join(" ")},tI.prototype.inversed=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,a=this.ty,o=1/(t*r-e*n),s=r*o,l=-e*o,h=-n*o,u=t*o;return new tI(s,l,h,u,-s*i-h*a,-l*i-u*a)},tI.prototype.applyToPoint=function(t){return new eW(t.x*this.sx+t.y*this.shx+this.tx,t.x*this.shy+t.y*this.sy+this.ty)},tI.prototype.applyToRectangle=function(t){var e=this.applyToPoint(t),n=this.applyToPoint(new eW(t.x+t.w,t.y+t.h));return new eX(e.x,e.y,n.x-e.x,n.y-e.y)},tI.prototype.clone=function(){return new tI(this.sx,this.shy,this.shx,this.sy,this.tx,this.ty)},d.Matrix=tI;var tj=d.matrixMult=function(t,e){return e.multiply(t)},tM=new tI(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=tM;var tF=function(t,e){if(!tw[t]){var n=(e instanceof sM?"Sh":"P")+(Object.keys(ty).length+1).toString(10);e.id=n,tw[t]=n,ty[n]=e,tk.publish("addPattern",e)}};d.ShadingPattern=sM,d.TilingPattern=sF,d.addShadingPattern=function(t,e){return L("addShadingPattern()"),tF(t,e),this},d.beginTilingPattern=function(t){L("beginTilingPattern()"),eV(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},d.endTilingPattern=function(t,e){L("endTilingPattern()"),e.stream=Y[D].join("\n"),tF(t,e),tk.publish("endTilingPattern",e),tE.pop().restore()};var tB,tO=d.__private__.newObject=function(){var t=tT();return tR(t,!0),t},tT=d.__private__.newObjectDeferred=function(){return $[++U]=function(){return W},U},tR=function(t,e){return e="boolean"==typeof e&&e,$[t]=W,e&&Z(t+" 0 obj"),t},tD=d.__private__.newAdditionalObject=function(){var t={objId:tT(),content:""};return X.push(t),t},tz=tT(),tq=tT(),tU=d.__private__.decodeColorString=function(t){var e=t.split(" ");if(2!==e.length||"g"!==e[1]&&"G"!==e[1])5!==e.length||"k"!==e[4]&&"K"!==e[4]||(e=[(1-e[0])*(1-e[3]),(1-e[1])*(1-e[3]),(1-e[2])*(1-e[3]),"r"]);else{var n=parseFloat(e[0]);e=[n,n,n,"r"]}for(var r="#",i=0;i<3;i++)r+=("0"+Math.floor(255*parseFloat(e[i])).toString(16)).slice(-2);return r},t$=d.__private__.encodeColorString=function(t){"string"==typeof t&&(t={ch1:t});var e,n=t.ch1,r=t.ch2,i=t.ch3,a=t.ch4,o="draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof n&&"#"!==n.charAt(0)){var s=new sc(n);if(s.ok)n=s.toHex();else if(!/^\d*\.?\d*$/.test(n))throw Error('Invalid color "'+n+'" passed to jsPDF.encodeColorString.')}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),"string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var l=parseInt(n.substr(1),16);n=l>>16&255,r=l>>8&255,i=255&l}if(void 0===r||void 0===a&&n===r&&r===i)e="string"==typeof n?n+" "+o[0]:2===t.precision?S(n/255)+" "+o[0]:C(n/255)+" "+o[0];else if(void 0===a||"object"===(0,nH.default)(a)){if(a&&!isNaN(a.a)&&0===a.a)return["1. 1. 1.",o[1]].join(" ");e="string"==typeof n?[n,r,i,o[1]].join(" "):2===t.precision?[S(n/255),S(r/255),S(i/255),o[1]].join(" "):[C(n/255),C(r/255),C(i/255),o[1]].join(" ")}else e="string"==typeof n?[n,r,i,a,o[2]].join(" "):2===t.precision?[S(n),S(r),S(i),S(a),o[2]].join(" "):[C(n),C(r),C(i),C(a),o[2]].join(" ");return e},tH=d.__private__.getFilters=function(){return o},tW=d.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||tH(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,a=e.length,o=t.objectId,s=function(t){return t};if(null!==u&&void 0===o)throw Error("ObjectId must be passed to putStream for file encryption");null!==u&&(s=el.encryptor(o,0));var l={};!0===n&&(n=["FlateEncode"]);var h=t.additionalKeyValues||[],c=(l=void 0!==sB.API.processDataByFilters?sB.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==l.data.length&&(h.push({key:"Length",value:l.data.length}),!0===i&&h.push({key:"Length1",value:a})),0!=c.length)if(c.split("/").length-1==1)h.push({key:"Filter",value:c});else{h.push({key:"Filter",value:"["+c+"]"});for(var f=0;f<h.length;f+=1)if("DecodeParms"===h[f].key){for(var d=[],p=0;p<l.reverseChain.split("/").length-1;p+=1)d.push("null");d.push(h[f].value),h[f].value="["+d.join(" ")+"]"}}Z("<<");for(var g=0;g<h.length;g++)Z("/"+h[g].key+" "+h[g].value);Z(">>"),0!==l.data.length&&(Z("stream"),Z(s(l.data)),Z("endstream"))},tX=d.__private__.putPage=function(t){var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;tR(r,!0),Z("<</Type /Page"),Z("/Parent "+t.rootDictionaryObjId+" 0 R"),Z("/Resources "+t.resourceDictionaryObjId+" 0 R"),Z("/MediaBox ["+parseFloat(A(t.mediaBox.bottomLeftX))+" "+parseFloat(A(t.mediaBox.bottomLeftY))+" "+A(t.mediaBox.topRightX)+" "+A(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&Z("/CropBox ["+A(t.cropBox.bottomLeftX)+" "+A(t.cropBox.bottomLeftY)+" "+A(t.cropBox.topRightX)+" "+A(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&Z("/BleedBox ["+A(t.bleedBox.bottomLeftX)+" "+A(t.bleedBox.bottomLeftY)+" "+A(t.bleedBox.topRightX)+" "+A(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&Z("/TrimBox ["+A(t.trimBox.bottomLeftX)+" "+A(t.trimBox.bottomLeftY)+" "+A(t.trimBox.topRightX)+" "+A(t.trimBox.topRightY)+"]"),null!==t.artBox&&Z("/ArtBox ["+A(t.artBox.bottomLeftX)+" "+A(t.artBox.bottomLeftY)+" "+A(t.artBox.topRightX)+" "+A(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&Z("/UserUnit "+t.userUnit),tk.publish("putPage",{objId:r,pageContext:tL[e],pageNumber:e,page:n}),Z("/Contents "+i+" 0 R"),Z(">>"),Z("endobj");var a=n.join("\n");return w===y&&(a+="\nQ"),tR(i,!0),tW({data:a,filters:tH(),objectId:i}),Z("endobj"),r},tY=d.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=tA;t++)tL[t].objId=tT(),tL[t].contentsObjId=tT();for(t=1;t<=tA;t++)n.push(tX({number:t,data:Y[t],objId:tL[t].objId,contentsObjId:tL[t].contentsObjId,mediaBox:tL[t].mediaBox,cropBox:tL[t].cropBox,bleedBox:tL[t].bleedBox,trimBox:tL[t].trimBox,artBox:tL[t].artBox,userUnit:tL[t].userUnit,rootDictionaryObjId:tz,resourceDictionaryObjId:tq}));tR(tz,!0),Z("<</Type /Pages");var r="/Kids [";for(e=0;e<tA;e++)r+=n[e]+" 0 R ";Z(r+"]"),Z("/Count "+tA),Z(">>"),Z("endobj"),tk.publish("postPutPages")},tV=function(t){tk.publish("putFont",{font:t,out:Z,newObject:tO,putStream:tW}),!0!==t.isAlreadyPutted&&(t.objectNumber=tO(),Z("<<"),Z("/Type /Font"),Z("/BaseFont /"+sP(t.postScriptName)),Z("/Subtype /Type1"),"string"==typeof t.encoding&&Z("/Encoding /"+t.encoding),Z("/FirstChar 32"),Z("/LastChar 255"),Z(">>"),Z("endobj"))},tG=function(t){t.objectNumber=tO();var e=[];e.push({key:"Type",value:"/XObject"}),e.push({key:"Subtype",value:"/Form"}),e.push({key:"BBox",value:"["+[A(t.x),A(t.y),A(t.x+t.width),A(t.y+t.height)].join(" ")+"]"}),e.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),tW({data:t.pages[1].join("\n"),additionalKeyValues:e,objectId:t.objectNumber}),Z("endobj")},tJ=function(t,e){e||(e=21);var n=tO(),r=function(t,e){var n,r=[],i=1/(e-1);for(n=0;n<1;n+=i)r.push(n);if(r.push(1),0!=t[0].offset){var a={offset:0,color:t[0].color};t.unshift(a)}if(1!=t[t.length-1].offset){var o={offset:1,color:t[t.length-1].color};t.push(o)}for(var s="",l=0,h=0;h<r.length;h++){for(n=r[h];n>t[l+1].offset;)l++;var u=t[l].offset,c=(n-u)/(t[l+1].offset-u),f=t[l].color,d=t[l+1].color;s+=q(Math.round((1-c)*f[0]+c*d[0]).toString(16))+q(Math.round((1-c)*f[1]+c*d[1]).toString(16))+q(Math.round((1-c)*f[2]+c*d[2]).toString(16))}return s.trim()}(t.colors,e),i=[];i.push({key:"FunctionType",value:"0"}),i.push({key:"Domain",value:"[0.0 1.0]"}),i.push({key:"Size",value:"["+e+"]"}),i.push({key:"BitsPerSample",value:"8"}),i.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),i.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),tW({data:r,additionalKeyValues:i,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:n}),Z("endobj"),t.objectNumber=tO(),Z("<< /ShadingType "+t.type),Z("/ColorSpace /DeviceRGB");var a="/Coords ["+A(parseFloat(t.coords[0]))+" "+A(parseFloat(t.coords[1]))+" ";2===t.type?a+=A(parseFloat(t.coords[2]))+" "+A(parseFloat(t.coords[3])):a+=A(parseFloat(t.coords[2]))+" "+A(parseFloat(t.coords[3]))+" "+A(parseFloat(t.coords[4]))+" "+A(parseFloat(t.coords[5])),Z(a+="]"),t.matrix&&Z("/Matrix ["+t.matrix.toString()+"]"),Z("/Function "+n+" 0 R"),Z("/Extend [true true]"),Z(">>"),Z("endobj")},tZ=function(t,e){var n=tT(),r=tO();e.push({resourcesOid:n,objectOid:r}),t.objectNumber=r;var i=[];i.push({key:"Type",value:"/Pattern"}),i.push({key:"PatternType",value:"1"}),i.push({key:"PaintType",value:"1"}),i.push({key:"TilingType",value:"1"}),i.push({key:"BBox",value:"["+t.boundingBox.map(A).join(" ")+"]"}),i.push({key:"XStep",value:A(t.xStep)}),i.push({key:"YStep",value:A(t.yStep)}),i.push({key:"Resources",value:n+" 0 R"}),t.matrix&&i.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),tW({data:t.stream,additionalKeyValues:i,objectId:t.objectNumber}),Z("endobj")},tK=function(t){for(var e in t.objectNumber=tO(),Z("<<"),t)switch(e){case"opacity":Z("/ca "+S(t[e]));break;case"stroke-opacity":Z("/CA "+S(t[e]))}Z(">>"),Z("endobj")},tQ=function(t){tR(t.resourcesOid,!0),Z("<<"),Z("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var t in Z("/Font <<"),tm)tm.hasOwnProperty(t)&&(!1===c||!0===c&&f.hasOwnProperty(t))&&Z("/"+t+" "+tm[t].objectNumber+" 0 R");Z(">>")}(),function(){if(Object.keys(ty).length>0){for(var t in Z("/Shading <<"),ty)ty.hasOwnProperty(t)&&ty[t]instanceof sM&&ty[t].objectNumber>=0&&Z("/"+t+" "+ty[t].objectNumber+" 0 R");tk.publish("putShadingPatternDict"),Z(">>")}}(),function(t){if(Object.keys(ty).length>0){for(var e in Z("/Pattern <<"),ty)ty.hasOwnProperty(e)&&ty[e]instanceof d.TilingPattern&&ty[e].objectNumber>=0&&ty[e].objectNumber<t&&Z("/"+e+" "+ty[e].objectNumber+" 0 R");tk.publish("putTilingPatternDict"),Z(">>")}}(t.objectOid),function(){if(Object.keys(t_).length>0){var t;for(t in Z("/ExtGState <<"),t_)t_.hasOwnProperty(t)&&t_[t].objectNumber>=0&&Z("/"+t+" "+t_[t].objectNumber+" 0 R");tk.publish("putGStateDict"),Z(">>")}}(),function(){for(var t in Z("/XObject <<"),tC)tC.hasOwnProperty(t)&&tC[t].objectNumber>=0&&Z("/"+t+" "+tC[t].objectNumber+" 0 R");tk.publish("putXobjectDict"),Z(">>")}(),Z(">>"),Z("endobj")},t1=function(t){tv[t.fontName]=tv[t.fontName]||{},tv[t.fontName][t.fontStyle]=t.id},t0=function(t,e,n,r,i){var a={id:"F"+(Object.keys(tm).length+1).toString(10),postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i||!1,metadata:{}};return tk.publish("addFont",{font:a,instance:this}),tm[a.id]=a,t1(a),a.id},t2=d.__private__.pdfEscape=d.pdfEscape=function(t,e){return(function(t,e){var n,r,i,a,o,s,l,h,u;if(i=(e=e||{}).sourceEncoding||"Unicode",o=e.outputEncoding,(e.autoencode||o)&&tm[tc].metadata&&tm[tc].metadata[i]&&tm[tc].metadata[i].encoding&&(a=tm[tc].metadata[i].encoding,!o&&tm[tc].encoding&&(o=tm[tc].encoding),!o&&a.codePages&&(o=a.codePages[0]),"string"==typeof o&&(o=a[o]),o)){for(l=!1,s=[],n=0,r=t.length;n<r;n++)(h=o[t.charCodeAt(n)])?s.push(String.fromCharCode(h)):s.push(t[n]),s[n].charCodeAt(0)>>8&&(l=!0);t=s.join("")}for(n=t.length;void 0===l&&0!==n;)t.charCodeAt(n-1)>>8&&(l=!0),n--;if(!l)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;n<r;n++){if((u=(h=t.charCodeAt(n))>>8)>>8)throw Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(u),s.push(h-(u<<8))}return String.fromCharCode.apply(void 0,s)})(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},t5=d.__private__.beginPage=function(t){Y[++tA]=[],tL[tA]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},t6(tA),J(Y[D])},t3=function(t,e){var r,a,o;switch(n=e||n,"string"==typeof t&&Array.isArray(r=v(t.toLowerCase()))&&(a=r[0],o=r[1]),Array.isArray(t)&&(a=t[0]*tf,o=t[1]*tf),isNaN(a)&&(a=i[0],o=i[1]),(a>14400||o>14400)&&(sa("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),a=Math.min(14400,a),o=Math.min(14400,o)),i=[a,o],n.substr(0,1)){case"l":o>a&&(i=[o,a]);break;case"p":a>o&&(i=[o,a])}t5(i),eC(ek),Z(eO),0!==eU&&Z(eU+" J"),0!==e$&&Z(e$+" j"),tk.publish("addPage",{pageNumber:tA})},t4=function(t){t>0&&t<=tA&&(Y.splice(t,1),tL.splice(t,1),tA--,D>tA&&(D=tA),this.setPage(D))},t6=function(t){t>0&&t<=tA&&(D=t)},t8=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return Y.length-1},t7=function(t,e,n){var r,i=void 0;return n=n||{},t=void 0!==t?t:tm[tc].fontName,e=void 0!==e?e:tm[tc].fontStyle,void 0!==tv[r=t.toLowerCase()]&&void 0!==tv[r][e]?i=tv[r][e]:void 0!==tv[t]&&void 0!==tv[t][e]?i=tv[t][e]:!1===n.disableWarning&&sa("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."),i||n.noFallback||null==(i=tv.times[e])&&(i=tv.times.normal),i},t9=d.__private__.putInfo=function(){var t=tO(),e=function(t){return t};for(var n in null!==u&&(e=el.encryptor(t,0)),Z("<<"),Z("/Producer ("+t2(e("jsPDF "+sB.version))+")"),tu)tu.hasOwnProperty(n)&&tu[n]&&Z("/"+n.substr(0,1).toUpperCase()+n.substr(1)+" ("+t2(e(tu[n]))+")");Z("/CreationDate ("+t2(e(I))+")"),Z(">>"),Z("endobj")},et=d.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||tz;switch(tO(),Z("<<"),Z("/Type /Catalog"),Z("/Pages "+e+" 0 R"),tn||(tn="fullwidth"),tn){case"fullwidth":Z("/OpenAction [3 0 R /FitH null]");break;case"fullheight":Z("/OpenAction [3 0 R /FitV null]");break;case"fullpage":Z("/OpenAction [3 0 R /Fit]");break;case"original":Z("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+tn;"%"===n.substr(n.length-1)&&(tn=parseInt(tn)/100),"number"==typeof tn&&Z("/OpenAction [3 0 R /XYZ null null "+S(tn)+"]")}switch(ts||(ts="continuous"),ts){case"continuous":Z("/PageLayout /OneColumn");break;case"single":Z("/PageLayout /SinglePage");break;case"two":case"twoleft":Z("/PageLayout /TwoColumnLeft");break;case"tworight":Z("/PageLayout /TwoColumnRight")}ta&&Z("/PageMode /"+ta),tk.publish("putCatalog"),Z(">>"),Z("endobj")},ee=d.__private__.putTrailer=function(){Z("trailer"),Z("<<"),Z("/Size "+(U+1)),Z("/Root "+U+" 0 R"),Z("/Info "+(U-1)+" 0 R"),null!==u&&Z("/Encrypt "+el.oid+" 0 R"),Z("/ID [ <"+j+"> <"+j+"> ]"),Z(">>")},en=d.__private__.putHeader=function(){Z("%PDF-"+p),Z("%ºß¬à")},er=d.__private__.putXRef=function(){var t="0000000000";Z("xref"),Z("0 "+(U+1)),Z("0000000000 65535 f ");for(var e=1;e<=U;e++)"function"==typeof $[e]?Z((t+$[e]()).slice(-10)+" 00000 n "):void 0!==$[e]?Z((t+$[e]).slice(-10)+" 00000 n "):Z("0000000000 00000 n ")},ei=d.__private__.buildDocument=function(){U=0,W=0,H=[],$=[],X=[],tz=tT(),tq=tT(),J(H),tk.publish("buildDocument"),en(),tY(),function(){tk.publish("putAdditionalObjects");for(var t=0;t<X.length;t++){var e=X[t];tR(e.objId,!0),Z(e.content),Z("endobj")}tk.publish("postPutAdditionalObjects")}(),t=[],function(){for(var t in tm)tm.hasOwnProperty(t)&&(!1===c||!0===c&&f.hasOwnProperty(t))&&tV(tm[t])}(),function(){var t;for(t in t_)t_.hasOwnProperty(t)&&tK(t_[t])}(),function(){for(var t in tC)tC.hasOwnProperty(t)&&tG(tC[t])}(),function(t){var e;for(e in ty)ty.hasOwnProperty(e)&&(ty[e]instanceof sM?tJ(ty[e]):ty[e]instanceof sF&&tZ(ty[e],t))}(t),tk.publish("putResources"),t.forEach(tQ),tQ({resourcesOid:tq,objectOid:Number.MAX_SAFE_INTEGER}),tk.publish("postPutResources"),null!==u&&(el.oid=tO(),Z("<<"),Z("/Filter /Standard"),Z("/V "+el.v),Z("/R "+el.r),Z("/U <"+el.toHexString(el.U)+">"),Z("/O <"+el.toHexString(el.O)+">"),Z("/P "+el.P),Z(">>"),Z("endobj")),t9(),et();var t,e=W;return er(),ee(),Z("startxref"),Z(""+e),Z("%%EOF"),J(Y[D]),H.join("\n")},ea=d.__private__.getBlob=function(t){return new Blob([Q(t)],{type:"application/pdf"})},eo=d.output=d.__private__.output=((tB=function(t,e){switch("string"==typeof(e=e||{})?e={filename:e}:e.filename=e.filename||"generated.pdf",t){case void 0:return ei();case"save":d.save(e.filename);break;case"arraybuffer":return Q(ei());case"blob":return ea(ei());case"bloburi":case"bloburl":if(void 0!==sr.URL&&"function"==typeof sr.URL.createObjectURL)return sr.URL&&sr.URL.createObjectURL(ea(ei()))||void 0;sa("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var n="",r=ei();try{n=sd(r)}catch(t){n=sd(unescape(encodeURIComponent(r)))}return"data:application/pdf;filename="+e.filename+";base64,"+n;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(sr)){var i="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",a=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';e.pdfObjectUrl&&(i=e.pdfObjectUrl,a="");var o='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+i+'"'+a+'></script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(e)+");</script></body></html>",s=sr.open();return null!==s&&s.document.write(o),s}throw Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(sr)){var l='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(e.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+e.filename+'" width="500px" height="400px" /></body></html>',h=sr.open();if(null!==h){h.document.write(l);var u=this;h.document.documentElement.querySelector("#pdfViewer").onload=function(){h.document.title=e.filename,h.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(u.output("bloburl"))}}return h}throw Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(sr))throw Error("The option dataurlnewwindow just works in a browser-environment.");var c='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",e)+'"></iframe></body></html>',f=sr.open();if(null!==f&&(f.document.write(c),f.document.title=e.filename),f||"undefined"==typeof safari)return f;break;case"datauri":case"dataurl":return sr.document.location.href=this.output("datauristring",e);default:return null}}).foo=function(){try{return tB.apply(this,arguments)}catch(n){var t=n.stack||"";~t.indexOf(" at ")&&(t=t.split(" at ")[1]);var e="Error in function "+t.split("\n")[0].split("<")[0]+": "+n.message;if(!sr.console)throw Error(e);sr.console.error(e,n),sr.alert&&alert(e)}},tB.foo.bar=tB,tB.foo),es=function(t){return!0===Array.isArray(tS)&&tS.indexOf(t)>-1};switch(r){case"pt":tf=1;break;case"mm":tf=72/25.4;break;case"cm":tf=72/2.54;break;case"in":tf=72;break;case"px":tf=1==es("px_scaling")?.75:96/72;break;case"pc":case"em":tf=12;break;case"ex":tf=6;break;default:if("number"!=typeof r)throw Error("Invalid unit: "+r);tf=r}var el=null;T(),F();var eh=d.__private__.getPageInfo=d.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:tL[t].objId,pageNumber:t,pageContext:tL[t]}},eu=d.__private__.getPageInfoByObjId=function(t){if(isNaN(t)||t%1!=0)throw Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var e in tL)if(tL[e].objId===t)break;return eh(e)},ec=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:tL[D].objId,pageNumber:D,pageContext:tL[D]}};d.addPage=function(){return t3.apply(this,arguments),this},d.setPage=function(){return t6.apply(this,arguments),J.call(this,Y[D]),this},d.insertPage=function(t){return this.addPage(),this.movePage(D,t),this},d.movePage=function(t,e){var n,r;if(t>e){n=Y[t],r=tL[t];for(var i=t;i>e;i--)Y[i]=Y[i-1],tL[i]=tL[i-1];Y[e]=n,tL[e]=r,this.setPage(e)}else if(t<e){n=Y[t],r=tL[t];for(var a=t;a<e;a++)Y[a]=Y[a+1],tL[a]=tL[a+1];Y[e]=n,tL[e]=r,this.setPage(e)}return this},d.deletePage=function(){return t4.apply(this,arguments),this},d.__private__.text=d.text=function(t,e,n,r,i){var a,o,s,l,h,u,c,d,p,g=(r=r||{}).scope||this;if("number"==typeof t&&"number"==typeof e&&("string"==typeof n||Array.isArray(n))){var m=n;n=e,e=t,t=m}if(arguments[3]instanceof tI==0?(s=arguments[4],l=arguments[5],"object"===(0,nH.default)(c=arguments[3])&&null!==c||("string"==typeof s&&(l=s,s=null),"string"==typeof c&&(l=c,c=null),"number"==typeof c&&(s=c,c=null),r={flags:c,angle:s,align:l})):(L("The transform parameter of text() with a Matrix value"),p=i),isNaN(e)||isNaN(n)||null==t)throw Error("Invalid arguments passed to jsPDF.text");if(0===t.length)return g;var v,b="",_="number"==typeof r.lineHeightFactor?r.lineHeightFactor:eL,x=g.internal.scaleFactor;function N(t){for(var e,n=t.concat(),r=[],i=n.length;i--;)"string"==typeof(e=n.shift())?r.push(e):Array.isArray(t)&&(1===e.length||void 0===e[1]&&void 0===e[2])?r.push(e[0]):r.push([e[0],e[1],e[2]]);return r}function k(t,e){var n;if("string"==typeof t)n=e(t)[0];else if(Array.isArray(t)){for(var r,i,a=t.concat(),o=[],s=a.length;s--;)"string"==typeof(r=a.shift())?o.push(e(r)[0]):Array.isArray(r)&&"string"==typeof r[0]&&o.push([(i=e(r[0],r[1],r[2]))[0],i[1],i[2]]);n=o}return n}var S=!1,C=!0;if("string"==typeof t)S=!0;else if(Array.isArray(t)){var E=t.concat();o=[];for(var I,j=E.length;j--;)("string"!=typeof(I=E.shift())||Array.isArray(I)&&"string"!=typeof I[0])&&(C=!1);S=C}if(!1===S)throw Error('Type of text must be string or Array. "'+t+'" is not recognized.');"string"==typeof t&&(t=t.match(/[\r?\n]/)?t.split(/\r\n|\r|\n/g):[t]);var M=te/g.internal.scaleFactor,F=M*(_-1);switch(r.baseline){case"bottom":n-=F;break;case"top":n+=M-F;break;case"hanging":n+=M-2*F;break;case"middle":n+=M/2-F}if((u=r.maxWidth||0)>0&&("string"==typeof t?t=g.splitTextToSize(t,u):"[object Array]"===Object.prototype.toString.call(t)&&(t=t.reduce(function(t,e){return t.concat(g.splitTextToSize(e,u))},[]))),a={text:t,x:e,y:n,options:r,mutex:{pdfEscape:t2,activeFontKey:tc,fonts:tm,activeFontSize:te}},tk.publish("preProcessText",a),t=a.text,s=(r=a.options).angle,p instanceof tI==0&&s&&"number"==typeof s){s*=Math.PI/180,0===r.rotationDirection&&(s=-s),w===y&&(s=-s);var B=Math.cos(s),O=Math.sin(s);p=new tI(B,O,-O,B,0,0)}else s&&s instanceof tI&&(p=s);w!==y||p||(p=tM),void 0!==(h=r.charSpace||ez)&&(b+=A(P(h))+" Tc\n",this.setCharSpace(this.getCharSpace()||0)),void 0!==(d=r.horizontalScale)&&(b+=A(100*d)+" Tz\n"),r.lang;var T=-1,R=void 0!==r.renderingMode?r.renderingMode:r.stroke,D=g.internal.getCurrentPageInfo().pageContext;switch(R){case 0:case!1:case"fill":T=0;break;case 1:case!0:case"stroke":T=1;break;case 2:case"fillThenStroke":T=2;break;case 3:case"invisible":T=3;break;case 4:case"fillAndAddForClipping":T=4;break;case 5:case"strokeAndAddPathForClipping":T=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":T=6;break;case 7:case"addToPathForClipping":T=7}var z=void 0!==D.usedRenderingMode?D.usedRenderingMode:-1;-1!==T?b+=T+" Tr\n":-1!==z&&(b+="0 Tr\n"),-1!==T&&(D.usedRenderingMode=T),l=r.align||"left";var q,U=te*_,$=g.internal.pageSize.getWidth(),H=tm[tc];h=r.charSpace||ez,u=r.maxWidth||0,c=Object.assign({autoencode:!0,noBOM:!0},r.flags);var W=[],X=function(t){return g.getStringUnitWidth(t,{font:H,charSpace:h,fontSize:te,doKerning:!1})*te/x};if("[object Array]"===Object.prototype.toString.call(t)){o=N(t),"left"!==l&&(q=o.map(X));var Y,V,G=0;if("right"===l){e-=q[0],t=[],j=o.length;for(var J=0;J<j;J++)0===J?(V=ej(e),Y=eM(n)):(V=P(G-q[J]),Y=-U),t.push([o[J],V,Y]),G=q[J]}else if("center"===l){e-=q[0]/2,t=[],j=o.length;for(var K=0;K<j;K++)0===K?(V=ej(e),Y=eM(n)):(V=P((G-q[K])/2),Y=-U),t.push([o[K],V,Y]),G=q[K]}else if("left"===l){t=[],j=o.length;for(var Q=0;Q<j;Q++)t.push(o[Q])}else if("justify"===l&&"Identity-H"===H.encoding){t=[],j=o.length,u=0!==u?u:$;for(var tt=0,tn=0;tn<j;tn++)if(Y=0===tn?eM(n):-U,V=0===tn?ej(e):tt,tn<j-1){var tr=P((u-q[tn])/(o[tn].split(" ").length-1)),ta=o[tn].split(" ");t.push([ta[0]+" ",V,Y]),tt=0;for(var to=1;to<ta.length;to++){var ts=(X(ta[to-1]+" "+ta[to])-X(ta[to]))*x+tr;to==ta.length-1?t.push([ta[to],ts,0]):t.push([ta[to]+" ",ts,0]),tt-=ts}}else t.push([o[tn],V,Y]);t.push(["",tt,0])}else{if("justify"!==l)throw Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(t=[],j=o.length,u=0!==u?u:$,tn=0;tn<j;tn++){Y=0===tn?eM(n):-U,V=0===tn?ej(e):0;var tl=o[tn].split(" ").length-1,th=tl>0?(u-q[tn])/tl:0;tn<j-1?W.push(A(P(th))):W.push(0),t.push([o[tn],V,Y])}}}!0===("boolean"==typeof r.R2L?r.R2L:ti)&&(t=k(t,function(t,e,n){return[t.split("").reverse().join(""),e,n]})),a={text:t,x:e,y:n,options:r,mutex:{pdfEscape:t2,activeFontKey:tc,fonts:tm,activeFontSize:te}},tk.publish("postProcessText",a),t=a.text,v=a.mutex.isHex||!1;var tu=tm[tc].encoding;"WinAnsiEncoding"!==tu&&"StandardEncoding"!==tu||(t=k(t,function(t,e,n){return[t2(t.split(" ").join(Array(r.TabLen||9).join(" ")),c),e,n]})),o=N(t),t=[];for(var tf,td,tp,tg=+!!Array.isArray(o[0]),tv="",tb=function(t,e,n){var i="";return n instanceof tI?(n="number"==typeof r.angle?tj(n,new tI(1,0,0,1,t,e)):tj(new tI(1,0,0,1,t,e),n),w===y&&(n=tj(new tI(1,0,0,-1,0,0),n)),i=n.join(" ")+" Tm\n"):i=A(t)+" "+A(e)+" Td\n",i},ty=0;ty<o.length;ty++){switch(tv="",tg){case 1:tp=(v?"<":"(")+o[ty][0]+(v?">":")"),tf=parseFloat(o[ty][1]),td=parseFloat(o[ty][2]);break;case 0:tp=(v?"<":"(")+o[ty]+(v?">":")"),tf=ej(e),td=eM(n)}void 0!==W&&void 0!==W[ty]&&(tv=W[ty]+" Tw\n"),0===ty?t.push(tv+tb(tf,td,p)+tp):0===tg?t.push(tv+tp):1===tg&&t.push(tv+tb(tf,td,p)+tp)}t=(0===tg?t.join(" Tj\nT* "):t.join(" Tj\n"))+" Tj\n";var tw="BT\n/";return tw+=tc+" "+te+" Tf\n",tw+=A(te*_)+" TL\n",tw+=eR+"\n",tw+=b,tw+=t,Z(tw+="ET"),f[tc]=!0,g};var ef=d.__private__.clip=d.clip=function(t){return Z("evenodd"===t?"W*":"W"),this};d.clipEvenOdd=function(){return ef("evenodd")},d.__private__.discardPath=d.discardPath=function(){return Z("n"),this};var ed=d.__private__.isValidStyle=function(t){var e=!1;return -1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(t)&&(e=!0),e};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(t){return ed(t)&&(h=t),this};var ep=d.__private__.getStyle=d.getStyle=function(t){var e=h;switch(t){case"D":case"S":e="S";break;case"F":e="f";break;case"FD":case"DF":e="B";break;case"f":case"f*":case"B":case"B*":e=t}return e},eg=d.close=function(){return Z("h"),this};d.stroke=function(){return Z("S"),this},d.fill=function(t){return em("f",t),this},d.fillEvenOdd=function(t){return em("f*",t),this},d.fillStroke=function(t){return em("B",t),this},d.fillStrokeEvenOdd=function(t){return em("B*",t),this};var em=function(t,e){"object"===(0,nH.default)(e)?ey(e,t):Z(t)},ev=function(t){null===t||w===y&&void 0===t||Z(t=ep(t))};function eb(t,e,n,r,i){var a=new sF(e||this.boundingBox,n||this.xStep,r||this.yStep,this.gState,i||this.matrix);return a.stream=this.stream,tF(t+"$$"+this.cloneIndex+++"$$",a),a}var ey=function(t,e){var n=tw[t.key],r=ty[n];if(r instanceof sM)Z("q"),Z(ew(e)),r.gState&&d.setGState(r.gState),Z(t.matrix.toString()+" cm"),Z("/"+n+" sh"),Z("Q");else if(r instanceof sF){var i=new tI(1,0,0,-1,0,e2());t.matrix&&(i=i.multiply(t.matrix||tM),n=eb.call(r,t.key,t.boundingBox,t.xStep,t.yStep,i).id),Z("q"),Z("/Pattern cs"),Z("/"+n+" scn"),r.gState&&d.setGState(r.gState),Z(e),Z("Q")}},ew=function(t){switch(t){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},e_=d.moveTo=function(t,e){return Z(A(P(t))+" "+A(E(e))+" m"),this},ex=d.lineTo=function(t,e){return Z(A(P(t))+" "+A(E(e))+" l"),this},eN=d.curveTo=function(t,e,n,r,i,a){return Z([A(P(t)),A(E(e)),A(P(n)),A(E(r)),A(P(i)),A(E(a)),"c"].join(" ")),this};d.__private__.line=d.line=function(t,e,n,r,i){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||!ed(i))throw Error("Invalid arguments passed to jsPDF.line");return w===b?this.lines([[n-t,r-e]],t,e,[1,1],i||"S"):this.lines([[n-t,r-e]],t,e,[1,1]).stroke()},d.__private__.lines=d.lines=function(t,e,n,r,i,a){var o,s,l,h,u,c,f,d,p,g,m,v;if("number"==typeof t&&(v=n,n=e,e=t,t=v),r=r||[1,1],a=a||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!ed(i)||"boolean"!=typeof a)throw Error("Invalid arguments passed to jsPDF.lines");for(e_(e,n),o=r[0],s=r[1],h=t.length,g=e,m=n,l=0;l<h;l++)2===(u=t[l]).length?ex(g=u[0]*o+g,m=u[1]*s+m):(c=u[0]*o+g,f=u[1]*s+m,d=u[2]*o+g,p=u[3]*s+m,eN(c,f,d,p,g=u[4]*o+g,m=u[5]*s+m));return a&&eg(),ev(i),this},d.path=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n.c;switch(n.op){case"m":e_(r[0],r[1]);break;case"l":ex(r[0],r[1]);break;case"c":eN.apply(this,r);break;case"h":eg()}}return this},d.__private__.rect=d.rect=function(t,e,n,r,i){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||!ed(i))throw Error("Invalid arguments passed to jsPDF.rect");return w===b&&(r=-r),Z([A(P(t)),A(E(e)),A(P(n)),A(P(r)),"re"].join(" ")),ev(i),this},d.__private__.triangle=d.triangle=function(t,e,n,r,i,a,o){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(a)||!ed(o))throw Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[n-t,r-e],[i-n,a-r],[t-i,e-a]],t,e,[1,1],o,!0),this},d.__private__.roundedRect=d.roundedRect=function(t,e,n,r,i,a,o){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(a)||!ed(o))throw Error("Invalid arguments passed to jsPDF.roundedRect");var s=4/3*(Math.SQRT2-1);return i=Math.min(i,.5*n),a=Math.min(a,.5*r),this.lines([[n-2*i,0],[i*s,0,i,a-a*s,i,a],[0,r-2*a],[0,a*s,-i*s,a,-i,a],[2*i-n,0],[-i*s,0,-i,-a*s,-i,-a],[0,2*a-r],[0,-a*s,i*s,-a,i,-a]],t+i,e,[1,1],o,!0),this},d.__private__.ellipse=d.ellipse=function(t,e,n,r,i){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||!ed(i))throw Error("Invalid arguments passed to jsPDF.ellipse");var a=4/3*(Math.SQRT2-1)*n,o=4/3*(Math.SQRT2-1)*r;return e_(t+n,e),eN(t+n,e-o,t+a,e-r,t,e-r),eN(t-a,e-r,t-n,e-o,t-n,e),eN(t-n,e+o,t-a,e+r,t,e+r),eN(t+a,e+r,t+n,e+o,t+n,e),ev(i),this},d.__private__.circle=d.circle=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||!ed(r))throw Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(t,e,n,n,r)},d.setFont=function(t,e,n){return n&&(e=N(e,n)),tc=t7(t,e,{disableWarning:!1}),this};var eA=d.__private__.getFont=d.getFont=function(){return tm[t7.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var t,e,n={};for(t in tv)if(tv.hasOwnProperty(t))for(e in n[t]=[],tv[t])tv[t].hasOwnProperty(e)&&n[t].push(e);return n},d.addFont=function(t,e,n,r,i){var a=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&-1!==a.indexOf(arguments[3])?i=arguments[3]:arguments[3]&&-1==a.indexOf(arguments[3])&&(n=N(n,r)),t0.call(this,t,e,n,i=i||"Identity-H")};var eL,ek=t.lineWidth||.200025,eS=d.__private__.getLineWidth=d.getLineWidth=function(){return ek},eC=d.__private__.setLineWidth=d.setLineWidth=function(t){return ek=t,Z(A(P(t))+" w"),this};d.__private__.setLineDash=sB.API.setLineDash=sB.API.setLineDashPattern=function(t,e){if(t=t||[],isNaN(e=e||0)||!Array.isArray(t))throw Error("Invalid arguments passed to jsPDF.setLineDash");return Z("["+(t=t.map(function(t){return A(P(t))}).join(" "))+"] "+(e=A(P(e)))+" d"),this};var eP=d.__private__.getLineHeight=d.getLineHeight=function(){return te*eL};d.__private__.getLineHeight=d.getLineHeight=function(){return te*eL};var eE=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(t){return"number"==typeof(t=t||1.15)&&(eL=t),this},eI=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return eL};eE(t.lineHeight);var ej=d.__private__.getHorizontalCoordinate=function(t){return P(t)},eM=d.__private__.getVerticalCoordinate=function(t){return w===y?t:tL[D].mediaBox.topRightY-tL[D].mediaBox.bottomLeftY-P(t)},eF=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(t){return A(ej(t))},eB=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(t){return A(eM(t))},eO=t.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return tU(eO)},d.__private__.setStrokeColor=d.setDrawColor=function(t,e,n,r){return Z(eO=t$({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"draw",precision:2})),this};var eT=t.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return tU(eT)},d.__private__.setFillColor=d.setFillColor=function(t,e,n,r){return Z(eT=t$({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"fill",precision:2})),this};var eR=t.textColor||"0 g",eD=d.__private__.getTextColor=d.getTextColor=function(){return tU(eR)};d.__private__.setTextColor=d.setTextColor=function(t,e,n,r){return eR=t$({ch1:t,ch2:e,ch3:n,ch4:r,pdfColorType:"text",precision:3}),this};var ez=t.charSpace,eq=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat(ez||0)};d.__private__.setCharSpace=d.setCharSpace=function(t){if(isNaN(t))throw Error("Invalid argument passed to jsPDF.setCharSpace");return ez=t,this};var eU=0;d.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},d.__private__.setLineCap=d.setLineCap=function(t){var e=d.CapJoinStyles[t];if(void 0===e)throw Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return eU=e,Z(e+" J"),this};var e$=0;d.__private__.setLineJoin=d.setLineJoin=function(t){var e=d.CapJoinStyles[t];if(void 0===e)throw Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return e$=e,Z(e+" j"),this},d.__private__.setLineMiterLimit=d.__private__.setMiterLimit=d.setLineMiterLimit=d.setMiterLimit=function(t){if(isNaN(t=t||0))throw Error("Invalid argument passed to jsPDF.setLineMiterLimit");return Z(A(P(t))+" M"),this},d.GState=sI,d.setGState=function(t){(t="string"==typeof t?t_[tx[t]]:eH(null,t)).equals(tN)||(Z("/"+t.id+" gs"),tN=t)};var eH=function(t,e){if(!t||!tx[t]){var n=!1;for(var r in t_)if(t_.hasOwnProperty(r)&&t_[r].equals(e)){n=!0;break}if(n)e=t_[r];else{var i="GS"+(Object.keys(t_).length+1).toString(10);t_[i]=e,e.id=i}return t&&(tx[t]=e.id),tk.publish("addGState",e),e}};d.addGState=function(t,e){return eH(t,e),this},d.saveGraphicsState=function(){return Z("q"),tb.push({key:tc,size:te,color:eR}),this},d.restoreGraphicsState=function(){Z("Q");var t=tb.pop();return tc=t.key,te=t.size,eR=t.color,tN=null,this},d.setCurrentTransformationMatrix=function(t){return Z(t.toString()+" cm"),this},d.comment=function(t){return Z("#"+t),this};var eW=function(t,e){var n=t||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return n},set:function(t){isNaN(t)||(n=parseFloat(t))}});var r=e||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return r},set:function(t){isNaN(t)||(r=parseFloat(t))}});var i="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return i},set:function(t){i=t.toString()}}),this},eX=function(t,e,n,r){eW.call(this,t,e),this.type="rect";var i=n||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return i},set:function(t){isNaN(t)||(i=parseFloat(t))}});var a=r||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return a},set:function(t){isNaN(t)||(a=parseFloat(t))}}),this},eY=function(){this.page=tA,this.currentPage=D,this.pages=Y.slice(0),this.pagesContext=tL.slice(0),this.x=td,this.y=tp,this.matrix=tg,this.width=eJ(D),this.height=eK(D),this.outputDestination=G,this.id="",this.objectNumber=-1};eY.prototype.restore=function(){tA=this.page,D=this.currentPage,tL=this.pagesContext,Y=this.pages,td=this.x,tp=this.y,tg=this.matrix,eZ(D,this.width),eQ(D,this.height),G=this.outputDestination};var eV=function(t,e,n,r,i){tE.push(new eY),tA=D=0,Y=[],td=t,tp=e,tg=i,t5([n,r])};for(var eG in d.beginFormObject=function(t,e,n,r,i){return eV(t,e,n,r,i),this},d.endFormObject=function(t){return function(t){if(tP[t])tE.pop().restore();else{var e=new eY,n="Xo"+(Object.keys(tC).length+1).toString(10);e.id=n,tP[t]=n,tC[n]=e,tk.publish("addFormObject",e),tE.pop().restore()}}(t),this},d.doFormObject=function(t,e){var n=tC[tP[t]];return Z("q"),Z(e.toString()+" cm"),Z("/"+n.id+" Do"),Z("Q"),this},d.getFormObject=function(t){var e=tC[tP[t]];return{x:e.x,y:e.y,width:e.width,height:e.height,matrix:e.matrix}},d.save=function(t,e){return t=t||"generated.pdf",(e=e||{}).returnPromise=e.returnPromise||!1,!1===e.returnPromise?(su(ea(ei()),t),"function"==typeof su.unload&&sr.setTimeout&&setTimeout(su.unload,911),this):new Promise(function(e,n){try{var r=su(ea(ei()),t);"function"==typeof su.unload&&sr.setTimeout&&setTimeout(su.unload,911),e(r)}catch(t){n(t.message)}})},sB.API)sB.API.hasOwnProperty(eG)&&("events"===eG&&sB.API.events.length?function(t,e){var n,r,i;for(i=e.length-1;-1!==i;i--)n=e[i][0],r=e[i][1],t.subscribe.apply(t,[n].concat("function"==typeof r?[r]:r))}(tk,sB.API.events):d[eG]=sB.API[eG]);function eJ(t){return tL[t].mediaBox.topRightX-tL[t].mediaBox.bottomLeftX}function eZ(t,e){tL[t].mediaBox.topRightX=e+tL[t].mediaBox.bottomLeftX}function eK(t){return tL[t].mediaBox.topRightY-tL[t].mediaBox.bottomLeftY}function eQ(t,e){tL[t].mediaBox.topRightY=e+tL[t].mediaBox.bottomLeftY}var e1=d.getPageWidth=function(t){return eJ(t=t||D)/tf},e0=d.setPageWidth=function(t,e){eZ(t,e*tf)},e2=d.getPageHeight=function(t){return eK(t=t||D)/tf},e5=d.setPageHeight=function(t,e){eQ(t,e*tf)};return d.internal={pdfEscape:t2,getStyle:ep,getFont:eA,getFontSize:tr,getCharSpace:eq,getTextColor:eD,getLineHeight:eP,getLineHeightFactor:eI,getLineWidth:eS,write:K,getHorizontalCoordinate:ej,getVerticalCoordinate:eM,getCoordinateString:eF,getVerticalCoordinateString:eB,collections:{},newObject:tO,newAdditionalObject:tD,newObjectDeferred:tT,newObjectDeferredBegin:tR,getFilters:tH,putStream:tW,events:tk,scaleFactor:tf,pageSize:{getWidth:function(){return e1(D)},setWidth:function(t){e0(D,t)},getHeight:function(){return e2(D)},setHeight:function(t){e5(D,t)}},encryptionOptions:u,encryption:el,getEncryptor:function(t){return null!==u?el.encryptor(t,0):function(t){return t}},output:eo,getNumberOfPages:t8,get pages(){return Y},out:Z,f2:S,f3:C,getPageInfo:eh,getPageInfoByObjId:eu,getCurrentPageInfo:ec,getPDFVersion:g,Point:eW,Rectangle:eX,Matrix:tI,hasHotfix:es},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return e1(D)},set:function(t){e0(D,t)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return e2(D)},set:function(t){e5(D,t)},enumerable:!0,configurable:!0}),(function(t){for(var e=0,n=tt.length;e<n;e++){var r=t0.call(this,t[e][0],t[e][1],t[e][2],tt[e][3],!0);!1===c&&(f[r]=!0);var i=t[e][0].split("-");t1({id:r,fontName:i[0],fontStyle:i[1]||""})}tk.publish("addFonts",{fonts:tm,dictionary:tv})}).call(d,tt),tc="F1",t3(i,n),tk.publish("initialized"),d}sC.prototype.lsbFirstWord=function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)},sC.prototype.toHexString=function(t){return t.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},sC.prototype.hexToBytes=function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(String.fromCharCode(parseInt(t.substr(n,2),16)));return e.join("")},sC.prototype.processOwnerPassword=function(t,e){return sk(sN(e).substr(0,5),t)},sC.prototype.encryptor=function(t,e){var n=sN(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&e,e>>8&255)).substr(0,10);return function(t){return sk(n,t)}},sI.prototype.equals=function(t){var e,n="id,objectNumber,equals";if(!t||(0,nH.default)(t)!==(0,nH.default)(this))return!1;var r=0;for(e in this)if(!(n.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!t.hasOwnProperty(e)||this[e]!==t[e])return!1;r++}for(e in t)t.hasOwnProperty(e)&&0>n.indexOf(e)&&r--;return 0===r},sB.API={events:[]},sB.version="3.0.4";var sO=sB.API,sT=1,sR=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},sD=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},sz=function(t){return t.toFixed(2)},sq=function(t){return t.toFixed(5)};sO.__acroform__={};var sU=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},s$=function(t){return t*sT},sH=function(t){var e=new s8,n=lc.internal.getHeight(t)||0;return e.BBox=[0,0,Number(sz(lc.internal.getWidth(t)||0)),Number(sz(n))],e},sW=sO.__acroform__.setBit=function(t,e){if(e=e||0,isNaN(t=t||0)||isNaN(e))throw Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<e},sX=sO.__acroform__.clearBit=function(t,e){if(e=e||0,isNaN(t=t||0)||isNaN(e))throw Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},sY=sO.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},sV=sO.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return sY(t,e-1)},sG=sO.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return sW(t,e-1)},sJ=sO.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return sX(t,e-1)},sZ=sO.__acroform__.calculateCoordinates=function(t,e){var n=e.internal.getHorizontalCoordinate,r=e.internal.getVerticalCoordinate,i=t[0],a=t[1],o=t[2],s=t[3],l={};return l.lowerLeft_X=n(i)||0,l.lowerLeft_Y=r(a+s)||0,l.upperRight_X=n(i+o)||0,l.upperRight_Y=r(a)||0,[Number(sz(l.lowerLeft_X)),Number(sz(l.lowerLeft_Y)),Number(sz(l.upperRight_X)),Number(sz(l.upperRight_Y))]},sK=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t._V||t.DV,r=sQ(t,n),i=t.scope.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(t.scope.__private__.encodeColorString(t.color)),e.push("/"+i+" "+sz(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var a=sH(t);return a.scope=t.scope,a.stream=e.join("\n"),a}},sQ=function(t,e){var n=0===t.fontSize?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},i=(e=")"==(e="("==e.substr(0,1)?e.substr(1):e).substr(e.length-1)?e.substr(0,e.length-1):e).split(" ");i=t.multiline?i.map(function(t){return t.split("\n")}):i.map(function(t){return[t]});var a=n,o=lc.internal.getHeight(t)||0;o=o<0?-o:o;var s=lc.internal.getWidth(t)||0;s=s<0?-s:s,a++;n:for(;a>0;){e="";var l,h,u=s1("3",t,--a).height,c=t.multiline?o-a:(o-u)/2,f=c+=2,d=0,p=0,g=0;if(a<=0){e="(...) Tj\n",e+="% Width of Text: "+s1(e,t,a=12).width+", FieldWidth:"+s+"\n";break}for(var m="",v=0,b=0;b<i.length;b++)if(i.hasOwnProperty(b)){var y=!1;if(1!==i[b].length&&g!==i[b].length-1){if((u+2)*(v+2)+2>o)continue n;m+=i[b][g],y=!0,p=b,b--}else{m=" "==(m+=i[b][g]+" ").substr(m.length-1)?m.substr(0,m.length-1):m;var w,_,x=parseInt(b),N=(w=m,_=a,x+1<i.length&&s1(w+" "+i[x+1][0],t,_).width<=s-4),A=b>=i.length-1;if(N&&!A){m+=" ",g=0;continue}if(N||A){if(A)p=x;else if(t.multiline&&(u+2)*(v+2)+2>o)continue n}else{if(!t.multiline||(u+2)*(v+2)+2>o)continue n;p=x}}for(var L="",k=d;k<=p;k++){var S=i[k];if(t.multiline){if(k===p){L+=S[g]+" ",g=(g+1)%S.length;continue}if(k===d){L+=S[S.length-1]+" ";continue}}L+=S[0]+" "}switch(h=s1(L=" "==L.substr(L.length-1)?L.substr(0,L.length-1):L,t,a).width,t.textAlign){case"right":l=s-h-2;break;case"center":l=(s-h)/2;break;default:l=2}e+=sz(l)+" "+sz(f)+" Td\n",e+="("+sR(L)+") Tj\n",e+=-sz(l)+" 0 Td\n",f=-(a+2),h=0,d=y?p:p+1,v++,m=""}break}return r.text=e,r.fontSize=a,r},s1=function(t,e,n){var r=e.scope.internal.getFont(e.fontName,e.fontStyle),i=e.scope.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:e.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},s0={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},s2=function(t,e){var n={type:"reference",object:t};void 0===e.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===n.type&&t.object===n.object})&&e.internal.getPageInfo(t.page).pageContext.annotations.push(n)},s5=function(t,e){if(e.scope=t,void 0!==t.internal&&(void 0===t.internal.acroformPlugin||!1===t.internal.acroformPlugin.isInitialized)){if(s9.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(s0)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw Error("Exception while creating AcroformDictionary");sT=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new s7,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",function(){t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0}),t.internal.events.subscribe("buildDocument",function(){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var e=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];r.objId=void 0,r.hasAnnotation&&s2(r,t)}}),t.internal.events.subscribe("putCatalog",function(){if(void 0===t.internal.acroformPlugin.acroFormDictionaryRoot)throw Error("putCatalogCallback: Root missing.");t.internal.write("/AcroForm "+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")}),t.internal.events.subscribe("postPutPages",function(e){!function(t,e){var n=!t;for(var r in t||(e.internal.newObjectDeferredBegin(e.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),e.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||e.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(r)){var i=t[r],a=[],o=i.Rect;if(i.Rect&&(i.Rect=sZ(i.Rect,e)),e.internal.newObjectDeferredBegin(i.objId,!0),i.DA=lc.createDefaultAppearanceStream(i),"object"===(0,nH.default)(i)&&"function"==typeof i.getKeyValueListForStream&&(a=i.getKeyValueListForStream()),i.Rect=o,i.hasAppearanceStream&&!i.appearanceStreamContent){var s=sK(i);a.push({key:"AP",value:"<</N "+s+">>"}),e.internal.acroformPlugin.xForms.push(s)}if(i.appearanceStreamContent){var l="";for(var h in i.appearanceStreamContent)if(i.appearanceStreamContent.hasOwnProperty(h)){var u=i.appearanceStreamContent[h];if(l+="/"+h+" <<",Object.keys(u).length>=1||Array.isArray(u)){for(var r in u)if(u.hasOwnProperty(r)){var c=u[r];"function"==typeof c&&(c=c.call(e,i)),l+="/"+r+" "+c+" ",e.internal.acroformPlugin.xForms.indexOf(c)>=0||e.internal.acroformPlugin.xForms.push(c)}}else"function"==typeof(c=u)&&(c=c.call(e,i)),l+="/"+r+" "+c,e.internal.acroformPlugin.xForms.indexOf(c)>=0||e.internal.acroformPlugin.xForms.push(c);l+=">>"}a.push({key:"AP",value:"<<\n"+l+">>"})}e.internal.putStream({additionalKeyValues:a,objectId:i.objId}),e.internal.out("endobj")}n&&function(t,e){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];e.internal.newObjectDeferredBegin(r.objId,!0),"object"===(0,nH.default)(r)&&"function"==typeof r.putStream&&r.putStream(),delete t[n]}}(e.internal.acroformPlugin.xForms,e)}(e,t)}),t.internal.acroformPlugin.isInitialized=!0}},s3=sO.__acroform__.arrayToPdfArray=function(t,e,n){var r=function(t){return t};if(Array.isArray(t)){for(var i="[",a=0;a<t.length;a++)switch(0!==a&&(i+=" "),(0,nH.default)(t[a])){case"boolean":case"number":case"object":i+=t[a].toString();break;case"string":"/"!==t[a].substr(0,1)?(void 0!==e&&n&&(r=n.internal.getEncryptor(e)),i+="("+sR(r(t[a].toString()))+")"):i+=t[a].toString()}return i+"]"}throw Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},s4=function(t,e,n){var r=function(t){return t};return void 0!==e&&n&&(r=n.internal.getEncryptor(e)),(t=t||"").toString(),"("+sR(r(t))+")"},s6=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(void 0===this._objId){if(void 0===this.scope)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};s6.prototype.toString=function(){return this.objId+" 0 R"},s6.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},s6.prototype.getKeyValueListForStream=function(){var t=[],e=Object.getOwnPropertyNames(this).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"scope"!=t&&"objId"!=t&&"_"!=t.substring(0,1)});for(var n in e)if(!1===Object.getOwnPropertyDescriptor(this,e[n]).configurable){var r=e[n],i=this[r];i&&(Array.isArray(i)?t.push({key:r,value:s3(i,this.objId,this.scope)}):i instanceof s6?(i.scope=this.scope,t.push({key:r,value:i.objId+" 0 R"})):"function"!=typeof i&&t.push({key:r,value:i}))}return t};var s8=function(){s6.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(e){t=e.trim()},get:function(){return t||null}})};sU(s8,s6);var s7=function(){s6.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var e=function(t){return t};return this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),"("+sR(e(t))+")"}},set:function(e){t=e}})};sU(s7,s6);var s9=function t(){s6.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){if(isNaN(t))throw Error('Invalid value "'+t+'" for attribute F supplied.');e=t}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!sV(e,3)},set:function(t){!0==!!t?this.F=sG(e,3):this.F=sJ(e,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){if(isNaN(t))throw Error('Invalid value "'+t+'" for attribute Ff supplied.');n=t}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==r.length)return r},set:function(t){r=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(t){r[0]=t}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(t){r[1]=t}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(t){r[2]=t}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(t){r[3]=t}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=t;break;default:throw Error('Invalid value "'+t+'" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof ls)return;a="FieldObject"+t.FieldNum++}var e=function(t){return t};return this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),"("+sR(e(a))+")"},set:function(t){a=t.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(t){a=t}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(t){o=t}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(t){s=t}});var l=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return l},set:function(t){l=t}});var h=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return void 0===h?50/sT:h},set:function(t){h=t}});var u="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return u},set:function(t){u=t}});var c="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!c||this instanceof ls||this instanceof lh))return s4(c,this.objId,this.scope)},set:function(t){c=t.toString()}});var f=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof li==0?s4(f,this.objId,this.scope):f},set:function(t){t=t.toString(),f=this instanceof li==0?"("===t.substr(0,1)?sD(t.substr(1,t.length-2)):sD(t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof li==1?sD(f.substr(1,f.length-1)):f},set:function(t){t=t.toString(),f=this instanceof li==1?"/"+t:t}});var d=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(t){this.V=t}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof li==0?s4(d,this.objId,this.scope):d},set:function(t){t=t.toString(),d=this instanceof li==0?"("===t.substr(0,1)?sD(t.substr(1,t.length-2)):sD(t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof li==1?sD(d.substr(1,d.length-1)):d},set:function(t){t=t.toString(),d=this instanceof li==1?"/"+t:t}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var p,g=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return g},set:function(t){g=!!t}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(p)return p},set:function(t){p=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,1)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,1):this.Ff=sJ(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,2)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,2):this.Ff=sJ(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,3)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,3):this.Ff=sJ(this.Ff,3)}});var m=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==m)return m},set:function(t){if(-1===[0,1,2].indexOf(t))throw Error('Invalid value "'+t+'" for attribute Q supplied.');m=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t;switch(m){case 0:default:t="left";break;case 1:t="center";break;case 2:t="right"}return t},configurable:!0,enumerable:!0,set:function(t){switch(t){case"right":case 2:m=2;break;case"center":case 1:m=1;break;default:m=0}}})};sU(s9,s6);var lt=function(){s9.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){t=e}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return s3(e,this.objId,this.scope)},set:function(t){var n;n=[],"string"==typeof t&&(n=function(t,e,n){n||(n=1);for(var r,i=[];r=e.exec(t);)i.push(r[n]);return i}(t,/\((.*?)\)/g)),e=n}}),this.getOptions=function(){return e},this.setOptions=function(t){e=t,this.sort&&e.sort()},this.addOption=function(t){t=(t=t||"").toString(),e.push(t),this.sort&&e.sort()},this.removeOption=function(t,n){for(n=n||!1,t=(t=t||"").toString();-1!==e.indexOf(t)&&(e.splice(e.indexOf(t),1),!1!==n););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,18)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,18):this.Ff=sJ(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,19)},set:function(t){!0===this.combo&&(!0==!!t?this.Ff=sG(this.Ff,19):this.Ff=sJ(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,20)},set:function(t){!0==!!t?(this.Ff=sG(this.Ff,20),e.sort()):this.Ff=sJ(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,22)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,22):this.Ff=sJ(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,23)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,23):this.Ff=sJ(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,27)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,27):this.Ff=sJ(this.Ff,27)}}),this.hasAppearanceStream=!1};sU(lt,s9);var le=function(){lt.call(this),this.fontName="helvetica",this.combo=!1};sU(le,lt);var ln=function(){le.call(this),this.combo=!0};sU(ln,le);var lr=function(){ln.call(this),this.edit=!0};sU(lr,ln);var li=function(){s9.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,15)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,15):this.Ff=sJ(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,16)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,16):this.Ff=sJ(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,17)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,17):this.Ff=sJ(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,26)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,26):this.Ff=sJ(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(t){return t};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),0!==Object.keys(e).length){var n,r=[];for(n in r.push("<<"),e)r.push("/"+n+" ("+sR(t(e[n]))+")");return r.push(">>"),r.join("\n")}},set:function(t){"object"===(0,nH.default)(t)&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){"string"==typeof t&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(e){t="/"+e}})};sU(li,s9);var la=function(){li.call(this),this.pushButton=!0};sU(la,li);var lo=function(){li.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=void 0!==e?e:[]}})};sU(lo,li);var ls=function(){s9.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(t){e=t}});var t,e,n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(t){return t};this.scope&&(t=this.scope.internal.getEncryptor(this.objId));var e,n=[];for(e in n.push("<<"),r)n.push("/"+e+" ("+sR(t(r[e]))+")");return n.push(">>"),n.join("\n")},set:function(t){"object"===(0,nH.default)(t)&&(r=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(t){"string"==typeof t&&(r.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=lc.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};sU(ls,s9),lo.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},lo.prototype.createOption=function(t){var e=new ls;return e.Parent=this,e.optionName=t,this.Kids.push(e),lf.call(this.scope,e),e};var ll=function(){li.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=lc.CheckBox.createAppearanceStream()};sU(ll,li);var lh=function(){s9.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,13)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,13):this.Ff=sJ(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,21)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,21):this.Ff=sJ(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,23)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,23):this.Ff=sJ(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,24)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,24):this.Ff=sJ(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,25)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,25):this.Ff=sJ(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,26)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,26):this.Ff=sJ(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};sU(lh,s9);var lu=function(){lh.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!sV(this.Ff,14)},set:function(t){!0==!!t?this.Ff=sG(this.Ff,14):this.Ff=sJ(this.Ff,14)}}),this.password=!0};sU(lu,lh);var lc={CheckBox:{createAppearanceStream:function(){return{N:{On:lc.CheckBox.YesNormal},D:{On:lc.CheckBox.YesPushDown,Off:lc.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=sH(t);e.scope=t.scope;var n=[],r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,i=t.scope.__private__.encodeColorString(t.color),a=sQ(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+sz(lc.internal.getWidth(t))+" "+sz(lc.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+sz(a.fontSize)+" Tf "+i),n.push("BT"),n.push(a.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=sH(t);e.scope=t.scope;var n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color),i=[],a=lc.internal.getHeight(t),o=lc.internal.getWidth(t),s=sQ(t,t.caption);return i.push("1 g"),i.push("0 0 "+sz(o)+" "+sz(a)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+sz(o-1)+" "+sz(a-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+sz(s.fontSize)+" Tf "+r),i.push(s.text),i.push("ET"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=sH(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+sz(lc.internal.getWidth(t))+" "+sz(lc.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:lc.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=lc.RadioButton.Circle.YesNormal,e.D[t]=lc.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=sH(t);e.scope=t.scope;var n=[],r=lc.internal.getWidth(t)<=lc.internal.getHeight(t)?lc.internal.getWidth(t)/4:lc.internal.getHeight(t)/4,i=Number(((r=Number((.9*r).toFixed(5)))*lc.internal.Bezier_C).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+sq(lc.internal.getWidth(t)/2)+" "+sq(lc.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+i+" "+i+" "+r+" 0 "+r+" c"),n.push("-"+i+" "+r+" -"+r+" "+i+" -"+r+" 0 c"),n.push("-"+r+" -"+i+" -"+i+" -"+r+" 0 -"+r+" c"),n.push(i+" -"+r+" "+r+" -"+i+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=sH(t);e.scope=t.scope;var n=[],r=lc.internal.getWidth(t)<=lc.internal.getHeight(t)?lc.internal.getWidth(t)/4:lc.internal.getHeight(t)/4,i=Number((2*(r=Number((.9*r).toFixed(5)))).toFixed(5)),a=Number((i*lc.internal.Bezier_C).toFixed(5)),o=Number((r*lc.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+sq(lc.internal.getWidth(t)/2)+" "+sq(lc.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),n.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),n.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),n.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+sq(lc.internal.getWidth(t)/2)+" "+sq(lc.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=sH(t);e.scope=t.scope;var n=[],r=lc.internal.getWidth(t)<=lc.internal.getHeight(t)?lc.internal.getWidth(t)/4:lc.internal.getHeight(t)/4,i=Number((2*(r=Number((.9*r).toFixed(5)))).toFixed(5)),a=Number((i*lc.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+sq(lc.internal.getWidth(t)/2)+" "+sq(lc.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),n.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),n.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),n.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:lc.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=lc.RadioButton.Cross.YesNormal,e.D[t]=lc.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=sH(t);e.scope=t.scope;var n=[],r=lc.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+sz(lc.internal.getWidth(t)-2)+" "+sz(lc.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(sz(r.x1.x)+" "+sz(r.x1.y)+" m"),n.push(sz(r.x2.x)+" "+sz(r.x2.y)+" l"),n.push(sz(r.x4.x)+" "+sz(r.x4.y)+" m"),n.push(sz(r.x3.x)+" "+sz(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=sH(t);e.scope=t.scope;var n=lc.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+sz(lc.internal.getWidth(t))+" "+sz(lc.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+sz(lc.internal.getWidth(t)-2)+" "+sz(lc.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(sz(n.x1.x)+" "+sz(n.x1.y)+" m"),r.push(sz(n.x2.x)+" "+sz(n.x2.y)+" l"),r.push(sz(n.x4.x)+" "+sz(n.x4.y)+" m"),r.push(sz(n.x3.x)+" "+sz(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=sH(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+sz(lc.internal.getWidth(t))+" "+sz(lc.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};lc.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=lc.internal.getWidth(t),n=lc.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},lc.internal.getWidth=function(t){var e=0;return"object"===(0,nH.default)(t)&&(e=s$(t.Rect[2])),e},lc.internal.getHeight=function(t){var e=0;return"object"===(0,nH.default)(t)&&(e=s$(t.Rect[3])),e};var lf=sO.addField=function(t){if(s5(this,t),!(t instanceof s9))throw Error("Invalid argument passed to jsPDF.addField.");return t.scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};function ld(t){return t.reduce(function(t,e,n){return t[e]=n,t},{})}sO.AcroFormChoiceField=lt,sO.AcroFormListBox=le,sO.AcroFormComboBox=ln,sO.AcroFormEditBox=lr,sO.AcroFormButton=li,sO.AcroFormPushButton=la,sO.AcroFormRadioButton=lo,sO.AcroFormCheckBox=ll,sO.AcroFormTextField=lh,sO.AcroFormPasswordField=lu,sO.AcroFormAppearance=lc,sO.AcroForm={ChoiceField:lt,ListBox:le,ComboBox:ln,EditBox:lr,Button:li,PushButton:la,RadioButton:lo,CheckBox:ll,TextField:lh,PasswordField:lu,Appearance:lc},sB.AcroForm={ChoiceField:lt,ListBox:le,ComboBox:ln,EditBox:lr,Button:li,PushButton:la,RadioButton:lo,CheckBox:ll,TextField:lh,PasswordField:lu,Appearance:lc},sB.AcroForm,lk=sB.API,lS="addImage_",lk.__addimage__={},lC="UNKNOWN",lP={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},lE=lk.__addimage__.getImageFileTypeByImageData=function(t,e){var n,r,i,a,o,s=lC;if("RGBA"===(e=e||lC)||void 0!==t.data&&t.data instanceof Uint8ClampedArray&&"height"in t&&"width"in t)return"RGBA";if(lV(t))for(o in lP)for(i=lP[o],n=0;n<i.length;n+=1){for(a=!0,r=0;r<i[n].length;r+=1)if(void 0!==i[n][r]&&i[n][r]!==t[r]){a=!1;break}if(!0===a){s=o;break}}else for(o in lP)for(i=lP[o],n=0;n<i.length;n+=1){for(a=!0,r=0;r<i[n].length;r+=1)if(void 0!==i[n][r]&&i[n][r]!==t.charCodeAt(r)){a=!1;break}if(!0===a){s=o;break}}return s===lC&&e!==lC&&(s=e),s},lI=function t(e){for(var n=this.internal.write,r=this.internal.putStream,i=(0,this.internal.getFilters)();-1!==i.indexOf("FlateEncode");)i.splice(i.indexOf("FlateEncode"),1);e.objectId=this.internal.newObject();var a=[];if(a.push({key:"Type",value:"/XObject"}),a.push({key:"Subtype",value:"/Image"}),a.push({key:"Width",value:e.width}),a.push({key:"Height",value:e.height}),e.colorSpace===l$.INDEXED?a.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(e.palette.length/3-1)+" "+("sMask"in e&&void 0!==e.sMask?e.objectId+2:e.objectId+1)+" 0 R]"}):(a.push({key:"ColorSpace",value:"/"+e.colorSpace}),e.colorSpace===l$.DEVICE_CMYK&&a.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),a.push({key:"BitsPerComponent",value:e.bitsPerComponent}),"decodeParameters"in e&&void 0!==e.decodeParameters&&a.push({key:"DecodeParms",value:"<<"+e.decodeParameters+">>"}),"transparency"in e&&Array.isArray(e.transparency)&&e.transparency.length>0){for(var o="",s=0,l=e.transparency.length;s<l;s++)o+=e.transparency[s]+" "+e.transparency[s]+" ";a.push({key:"Mask",value:"["+o+"]"})}void 0!==e.sMask&&a.push({key:"SMask",value:e.objectId+1+" 0 R"});var h=void 0!==e.filter?["/"+e.filter]:void 0;if(r({data:e.data,additionalKeyValues:a,alreadyAppliedFilters:h,objectId:e.objectId}),n("endobj"),"sMask"in e&&void 0!==e.sMask){var u,c=null!=(u=e.sMaskBitsPerComponent)?u:e.bitsPerComponent,f={width:e.width,height:e.height,colorSpace:"DeviceGray",bitsPerComponent:c,data:e.sMask};"filter"in e&&(f.decodeParameters="/Predictor ".concat(e.predictor," /Colors 1 /BitsPerComponent ").concat(c," /Columns ").concat(e.width),f.filter=e.filter),t.call(this,f)}if(e.colorSpace===l$.INDEXED){var d=this.internal.newObject();r({data:lJ(new Uint8Array(e.palette)),objectId:d}),n("endobj")}},lj=function(){var t=this.internal.collections[lS+"images"];for(var e in t)lI.call(this,t[e])},lM=function(){var t,e=this.internal.collections[lS+"images"],n=this.internal.write;for(var r in e)n("/I"+(t=e[r]).index,t.objectId,"0","R")},lF=function(){this.internal.collections[lS+"images"]||(this.internal.collections[lS+"images"]={},this.internal.events.subscribe("putResources",lj),this.internal.events.subscribe("putXobjectDict",lM))},lB=function(){var t=this.internal.collections[lS+"images"];return lF.call(this),t},lO=function(){return Object.keys(this.internal.collections[lS+"images"]).length},lT=function(t){return"function"==typeof lk["process"+t.toUpperCase()]},lR=function(t){return"object"===(0,nH.default)(t)&&1===t.nodeType},lD=function(t,e){if("IMG"===t.nodeName&&t.hasAttribute("src")){var n,r=""+t.getAttribute("src");if(0===r.indexOf("data:image/"))return sf(unescape(r).split("base64,").pop());var i=lk.loadFile(r,!0);if(void 0!==i)return i}if("CANVAS"===t.nodeName){if(0===t.width||0===t.height)throw Error("Given canvas must have data. Canvas width: "+t.width+", height: "+t.height);switch(e){case"PNG":n="image/png";break;case"WEBP":n="image/webp";break;default:n="image/jpeg"}return sf(t.toDataURL(n,1).split("base64,").pop())}},lz=function(t){var e=this.internal.collections[lS+"images"];if(e){for(var n in e)if(t===e[n].alias)return e[n]}},lq=function(t,e,n){return t||e||(t=-96,e=-96),t<0&&(t=-1*n.width*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.height*72/e/this.internal.scaleFactor),0===t&&(t=e*n.width/n.height),0===e&&(e=t*n.height/n.width),[t,e]},lU=function(t,e,n,r,i,a){var o=lq.call(this,n,r,i),s=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString,h=lB.call(this);if(n=o[0],r=o[1],h[i.index]=i,a)var u=Math.cos(a*=Math.PI/180),c=Math.sin(a),f=function(t){return t.toFixed(4)},d=[f(u),f(c),f(-1*c),f(u),0,0,"cm"];this.internal.write("q"),a?(this.internal.write(["1 0 0 1",s(t),l(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([s(n),"0 0",s(r),"0 0 cm"].join(" "))):this.internal.write([s(n),"0 0",s(r),s(t),l(e+r),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write("1 0 0 -1 0 0 cm"),this.internal.write("/I"+i.index+" Do"),this.internal.write("Q")},l$=lk.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"},lk.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"},lH=lk.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},lW=lk.__addimage__.sHashCode=function(t){var e,n,r=0;if("string"==typeof t)for(n=t.length,e=0;e<n;e++)r=(r<<5)-r+t.charCodeAt(e)|0;else if(lV(t))for(n=t.byteLength/2,e=0;e<n;e++)r=(r<<5)-r+t[e]|0;return r},lX=lk.__addimage__.validateStringAsBase64=function(t){(t=t||"").toString().trim();var e=!0;return 0===t.length&&(e=!1),t.length%4!=0&&(e=!1),!1===/^[A-Za-z0-9+/]+$/.test(t.substr(0,t.length-2))&&(e=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(t.substr(-2))&&(e=!1),e},lY=lk.__addimage__.extractImageFromDataUrl=function(t){if(null==t||!(t=t.trim()).startsWith("data:"))return null;var e=t.indexOf(",");return e<0?null:t.substring(0,e).trim().endsWith("base64")?t.substring(e+1):null},lk.__addimage__.isArrayBuffer=function(t){return t instanceof ArrayBuffer},lV=lk.__addimage__.isArrayBufferView=function(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array},lG=lk.__addimage__.binaryStringToUint8Array=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r<e;r++)n[r]=t.charCodeAt(r);return n},lJ=lk.__addimage__.arrayBufferToBinaryString=function(t){for(var e="",n=lV(t)?t:new Uint8Array(t),r=0;r<n.length;r+=8192)e+=String.fromCharCode.apply(null,n.subarray(r,r+8192));return e},lk.addImage=function(){if("number"==typeof arguments[1]?(e=lC,n=arguments[1],r=arguments[2],i=arguments[3],a=arguments[4],o=arguments[5],s=arguments[6],l=arguments[7]):(e=arguments[1],n=arguments[2],r=arguments[3],i=arguments[4],a=arguments[5],o=arguments[6],s=arguments[7],l=arguments[8]),"object"===(0,nH.default)(t=arguments[0])&&!lR(t)&&"imageData"in t){var t,e,n,r,i,a,o,s,l,h=t;t=h.imageData,e=h.format||e||lC,n=h.x||n||0,r=h.y||r||0,i=h.w||h.width||i,a=h.h||h.height||a,o=h.alias||o,s=h.compression||s,l=h.rotation||h.angle||l}var u=this.internal.getFilters();if(void 0===s&&-1!==u.indexOf("FlateEncode")&&(s="SLOW"),isNaN(n)||isNaN(r))throw Error("Invalid coordinates passed to jsPDF.addImage");lF.call(this);var c=lZ.call(this,t,e,o,s);return lU.call(this,n,r,i,a,c,l),this},lZ=function(t,e,n,r){if("string"==typeof t&&lE(t)===lC){var i,a,o,s,l,h=lK(t=unescape(t),!1);(""!==h||void 0!==(h=lk.loadFile(t,!0)))&&(t=h)}if(lR(t)&&(t=lD(t,e)),!lT(e=lE(t,e)))throw Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if((null==(o=n)||0===o.length)&&(n="string"==typeof(s=t)||lV(s)?lW(s):lV(s.data)?lW(s.data):null),(i=lz.call(this,n))||(t instanceof Uint8Array||"RGBA"===e||(a=t,t=lG(t)),i=this["process"+e.toUpperCase()](t,lO.call(this),n,((l=r)&&"string"==typeof l&&(l=l.toUpperCase()),l in lk.image_compression?l:lH.NONE),a)),!i)throw Error("An unknown error occurred whilst processing the image.");return i},lK=lk.__addimage__.convertBase64ToBinaryString=function(t,e){e="boolean"!=typeof e||e;var n,r,i="";if("string"==typeof t){r=null!=(n=lY(t))?n:t;try{i=sf(r)}catch(t){if(e)throw lX(r)?Error("atob-Error in jsPDF.convertBase64ToBinaryString "+t.message):Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return i},lk.getImageProperties=function(t){var e,n,r="";if(lR(t)&&(t=lD(t)),"string"==typeof t&&lE(t)===lC&&(""===(r=lK(t,!1))&&(r=lk.loadFile(t)||""),t=r),!lT(n=lE(t)))throw Error("addImage does not support files of type '"+n+"', please ensure that a plugin for '"+n+"' support is added.");if(t instanceof Uint8Array||(t=lG(t)),!(e=this["process"+n.toUpperCase()](t)))throw Error("An unknown error occurred whilst processing the image");return e.fileType=n,e},lQ=sB.API,l1=function(t){if(void 0!==t&&""!=t)return!0},sB.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),lQ.events.push(["putPage",function(t){for(var e,n,r,i=this.internal.getCoordinateString,a=this.internal.getVerticalCoordinateString,o=this.internal.getPageInfoByObjId(t.objId),s=t.pageContext.annotations,l=!1,h=0;h<s.length&&!l;h++)switch((e=s[h]).type){case"link":(l1(e.options.url)||l1(e.options.pageNumber))&&(l=!0);break;case"reference":case"text":case"freetext":l=!0}if(0!=l){this.internal.write("/Annots [");for(var u=0;u<s.length;u++){e=s[u];var c=this.internal.pdfEscape,f=this.internal.getEncryptor(t.objId);switch(e.type){case"reference":this.internal.write(" "+e.object.objId+" 0 R ");break;case"text":var d=this.internal.newAdditionalObject(),p=this.internal.newAdditionalObject(),g=this.internal.getEncryptor(d.objId),m=e.title||"Note";d.content=r="<</Type /Annot /Subtype /Text "+(n="/Rect ["+i(e.bounds.x)+" "+a(e.bounds.y+e.bounds.h)+" "+i(e.bounds.x+e.bounds.w)+" "+a(e.bounds.y)+"] ")+"/Contents ("+c(g(e.contents))+")"+(" /Popup "+p.objId)+" 0 R"+(" /P "+o.objId)+" 0 R"+(" /T ("+c(g(m)))+") >>";var v=d.objId+" 0 R";r="<</Type /Annot /Subtype /Popup "+(n="/Rect ["+i(e.bounds.x+30)+" "+a(e.bounds.y+e.bounds.h)+" "+i(e.bounds.x+e.bounds.w+30)+" "+a(e.bounds.y)+"] ")+" /Parent "+v,e.open&&(r+=" /Open true"),p.content=r+=" >>",this.internal.write(d.objId,"0 R",p.objId,"0 R");break;case"freetext":n="/Rect ["+i(e.bounds.x)+" "+a(e.bounds.y)+" "+i(e.bounds.x+e.bounds.w)+" "+a(e.bounds.y+e.bounds.h)+"] ";var b=e.color||"#000000";r="<</Type /Annot /Subtype /FreeText "+n+"/Contents ("+c(f(e.contents))+")"+(" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+b)+") /Border [0 0 0] >>",this.internal.write(r);break;case"link":if(e.options.name){var y=this.annotations._nameMap[e.options.name];e.options.pageNumber=y.page,e.options.top=y.y}else e.options.top||(e.options.top=0);if(n="/Rect ["+e.finalBounds.x+" "+e.finalBounds.y+" "+e.finalBounds.w+" "+e.finalBounds.h+"] ",r="",e.options.url)r="<</Type /Annot /Subtype /Link "+n+"/Border [0 0 0] /A <</S /URI /URI ("+c(f(e.options.url))+") >>";else if(e.options.pageNumber)switch(r="<</Type /Annot /Subtype /Link "+n+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(e.options.pageNumber).objId+" 0 R",e.options.magFactor=e.options.magFactor||"XYZ",e.options.magFactor){case"Fit":r+=" /Fit]";break;case"FitH":r+=" /FitH "+e.options.top+"]";break;case"FitV":e.options.left=e.options.left||0,r+=" /FitV "+e.options.left+"]";break;default:var w=a(e.options.top);e.options.left=e.options.left||0,void 0===e.options.zoom&&(e.options.zoom=0),r+=" /XYZ "+e.options.left+" "+w+" "+e.options.zoom+"]"}""!=r&&(r+=" >>",this.internal.write(r))}}this.internal.write("]")}}]),lQ.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},lQ.link=function(t,e,n,r,i){var a=this.internal.getCurrentPageInfo(),o=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString;a.pageContext.annotations.push({finalBounds:{x:o(t),y:s(e),w:o(t+n),h:s(e+r)},options:i,type:"link"})},lQ.textWithLink=function(t,e,n,r){var i,a,o=this.getTextWidth(t),s=this.internal.getLineHeight()/this.internal.scaleFactor;return void 0!==r.maxWidth?(a=r.maxWidth,i=Math.ceil(s*this.splitTextToSize(t,a).length)):(a=o,i=s),this.text(t,e,n,r),n+=.2*s,"center"===r.align&&(e-=o/2),"right"===r.align&&(e-=o),this.link(e,n-s,a,i,r),o},lQ.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},l0=sB.API,l2={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},l5={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},l3={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},l4=[1570,1571,1573,1575],l0.__arabicParser__={},l6=l0.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==l2[t.charCodeAt(0)]},l8=l0.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},l7=l0.__arabicParser__.isArabicEndLetter=function(t){return l8(t)&&l6(t)&&l2[t.charCodeAt(0)].length<=2},l9=l0.__arabicParser__.isArabicAlfLetter=function(t){return l8(t)&&l4.indexOf(t.charCodeAt(0))>=0},l0.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return l8(t)&&l6(t)&&l2[t.charCodeAt(0)].length>=1},ht=l0.__arabicParser__.arabicLetterHasFinalForm=function(t){return l8(t)&&l6(t)&&l2[t.charCodeAt(0)].length>=2},l0.__arabicParser__.arabicLetterHasInitialForm=function(t){return l8(t)&&l6(t)&&l2[t.charCodeAt(0)].length>=3},he=l0.__arabicParser__.arabicLetterHasMedialForm=function(t){return l8(t)&&l6(t)&&4==l2[t.charCodeAt(0)].length},hn=l0.__arabicParser__.resolveLigatures=function(t){var e=0,n=l5,r="",i=0;for(e=0;e<t.length;e+=1)void 0!==n[t.charCodeAt(e)]?(i++,"number"==typeof(n=n[t.charCodeAt(e)])&&(r+=String.fromCharCode(n),n=l5,i=0),e===t.length-1&&(n=l5,r+=t.charAt(e-(i-1)),e-=i-1,i=0)):(n=l5,r+=t.charAt(e-i),e-=i,i=0);return r},l0.__arabicParser__.isArabicDiacritic=function(t){return void 0!==t&&void 0!==l3[t.charCodeAt(0)]},hr=l0.__arabicParser__.getCorrectForm=function(t,e,n){return l8(t)?!1===l6(t)?-1:!ht(t)||!l8(e)&&!l8(n)||!l8(n)&&l7(e)||l7(t)&&!l8(e)||l7(t)&&l9(e)||l7(t)&&l7(e)?0:he(t)&&l8(e)&&!l7(e)&&l8(n)&&ht(n)?3:l7(t)||!l8(n)?1:2:-1},hi=function(t){var e=0,n=0,r=0,i="",a="",o="",s=(t=t||"").split("\\s+"),l=[];for(e=0;e<s.length;e+=1){for(l.push(""),n=0;n<s[e].length;n+=1)i=s[e][n],a=s[e][n-1],o=s[e][n+1],l8(i)?(r=hr(i,a,o),l[e]+=-1!==r?String.fromCharCode(l2[i.charCodeAt(0)][r]):i):l[e]+=i;l[e]=hn(l[e])}return l.join(" ")},ha=l0.__arabicParser__.processArabic=l0.processArabic=function(){var t,e="string"==typeof arguments[0]?arguments[0]:arguments[0].text,n=[];if(Array.isArray(e)){var r=0;for(n=[],r=0;r<e.length;r+=1)Array.isArray(e[r])?n.push([hi(e[r][0]),e[r][1],e[r][2]]):n.push([hi(e[r])]);t=n}else t=hi(e);return"string"==typeof arguments[0]?t:(arguments[0].text=t,arguments[0])},l0.events.push(["preProcessText",ha]),sB.API.autoPrint=function(t){var e;return(t=t||{}).variant=t.variant||"non-conform","javascript"===t.variant?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})),this},ho=sB.API,(hs=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(e){t=e}});var e=150;Object.defineProperty(this,"width",{get:function(){return e},set:function(t){e=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=e+1)}});var n=300;Object.defineProperty(this,"height",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=n+1)}});var r=[];Object.defineProperty(this,"childNodes",{get:function(){return r},set:function(t){r=t}});var i={};Object.defineProperty(this,"style",{get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"parentNode",{})}).prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return this.pdf.context2d._canvas=this,this.pdf.context2d},hs.prototype.toDataURL=function(){throw Error("toDataURL is not implemented.")},ho.events.push(["initialized",function(){this.canvas=new hs,this.canvas.pdf=this}]),hl=sB.API,hh={left:0,top:0,bottom:0,right:0},hu=!1,hc=function(){void 0===this.internal.__cell__&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},hh),this.internal.__cell__.margins.width=this.getPageWidth(),hf.call(this))},hf=function(){this.internal.__cell__.lastCell=new hd,this.internal.__cell__.pages=1},(hd=function(){var t=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return t},set:function(e){t=e}});var e=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var n=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return n},set:function(t){n=t}});var r=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return r},set:function(t){r=t}});var i=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return i},set:function(t){i=t}});var a=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return a},set:function(t){a=t}});var o=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return o},set:function(t){o=t}}),this}).prototype.clone=function(){return new hd(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},hd.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},hl.setHeaderFunction=function(t){return hc.call(this),this.internal.__cell__.headerFunction="function"==typeof t?t:void 0,this},hl.getTextDimensions=function(t,e){hc.call(this);var n=(e=e||{}).fontSize||this.getFontSize(),r=e.font||this.getFont(),i=e.scaleFactor||this.internal.scaleFactor,a=0,o=0,s=0,l=this;if(!Array.isArray(t)&&"string"!=typeof t){if("number"!=typeof t)throw Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");t=String(t)}var h=e.maxWidth;h>0?"string"==typeof t?t=this.splitTextToSize(t,h):"[object Array]"===Object.prototype.toString.call(t)&&(t=t.reduce(function(t,e){return t.concat(l.splitTextToSize(e,h))},[])):t=Array.isArray(t)?t:[t];for(var u=0;u<t.length;u++)a<(s=this.getStringUnitWidth(t[u],{font:r})*n)&&(a=s);return 0!==a&&(o=t.length),{w:a/=i,h:Math.max((o*n*this.getLineHeightFactor()-n*(this.getLineHeightFactor()-1))/i,0)}},hl.cellAddPage=function(){hc.call(this),this.addPage();var t=this.internal.__cell__.margins||hh;return this.internal.__cell__.lastCell=new hd(t.left,t.top,void 0,void 0),this.internal.__cell__.pages+=1,this},hp=hl.cell=function(){t=arguments[0]instanceof hd?arguments[0]:new hd(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),hc.call(this);var t,e=this.internal.__cell__.lastCell,n=this.internal.__cell__.padding,r=this.internal.__cell__.margins||hh,i=this.internal.__cell__.tableHeaderRow,a=this.internal.__cell__.printHeaders;return void 0!==e.lineNumber&&(e.lineNumber===t.lineNumber?(t.x=(e.x||0)+(e.width||0),t.y=e.y||0):e.y+e.height+t.height+r.bottom>this.getPageHeight()?(this.cellAddPage(),t.y=r.top,a&&i&&(this.printHeaderRow(t.lineNumber,!0),t.y+=i[0].height)):t.y=e.y+e.height||t.y),void 0!==t.text[0]&&(this.rect(t.x,t.y,t.width,t.height,!0===hu?"FD":void 0),"right"===t.align?this.text(t.text,t.x+t.width-n,t.y+n,{align:"right",baseline:"top"}):"center"===t.align?this.text(t.text,t.x+t.width/2,t.y+n,{align:"center",baseline:"top",maxWidth:t.width-n-n}):this.text(t.text,t.x+n,t.y+n,{align:"left",baseline:"top",maxWidth:t.width-n-n})),this.internal.__cell__.lastCell=t,this},hl.table=function(t,e,n,r,i){if(hc.call(this),!n)throw Error("No data for PDF table.");var a,o,s,l,h=[],u=[],c=[],f={},d={},p=[],g=[],m=(i=i||{}).autoSize||!1,v=!1!==i.printHeaders,b=i.css&&void 0!==i.css["font-size"]?16*i.css["font-size"]:i.fontSize||12,y=i.margins||Object.assign({width:this.getPageWidth()},hh),w="number"==typeof i.padding?i.padding:3,_=i.headerBackgroundColor||"#c8c8c8",x=i.headerTextColor||"#000";if(hf.call(this),this.internal.__cell__.printHeaders=v,this.internal.__cell__.margins=y,this.internal.__cell__.table_font_size=b,this.internal.__cell__.padding=w,this.internal.__cell__.headerBackgroundColor=_,this.internal.__cell__.headerTextColor=x,this.setFontSize(b),null==r)u=h=Object.keys(n[0]),c=h.map(function(){return"left"});else if(Array.isArray(r)&&"object"===(0,nH.default)(r[0]))for(h=r.map(function(t){return t.name}),u=r.map(function(t){return t.prompt||t.name||""}),c=r.map(function(t){return t.align||"left"}),a=0;a<r.length;a+=1)d[r[a].name]=.7499990551181103*r[a].width;else Array.isArray(r)&&"string"==typeof r[0]&&(u=h=r,c=h.map(function(){return"left"}));if(m||Array.isArray(r)&&"string"==typeof r[0])for(a=0;a<h.length;a+=1){for(f[l=h[a]]=n.map(function(t){return t[l]}),this.setFont(void 0,"bold"),p.push(this.getTextDimensions(u[a],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),o=f[l],this.setFont(void 0,"normal"),s=0;s<o.length;s+=1)p.push(this.getTextDimensions(o[s],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);d[l]=Math.max.apply(null,p)+w+w,p=[]}if(v){var N={};for(a=0;a<h.length;a+=1)N[h[a]]={},N[h[a]].text=u[a],N[h[a]].align=c[a];var A=hg.call(this,N,d);g=h.map(function(n){return new hd(t,e,d[n],A,N[n].text,void 0,N[n].align)}),this.setTableHeaderRow(g),this.printHeaderRow(1,!1)}var L=r.reduce(function(t,e){return t[e.name]=e.align,t},{});for(a=0;a<n.length;a+=1){"rowStart"in i&&i.rowStart instanceof Function&&i.rowStart({row:a,data:n[a]},this);var k=hg.call(this,n[a],d);for(s=0;s<h.length;s+=1){var S=n[a][h[s]];"cellStart"in i&&i.cellStart instanceof Function&&i.cellStart({row:a,col:s,data:S},this),hp.call(this,new hd(t,e,d[h[s]],k,S,a+2,L[h[s]]))}}return this.internal.__cell__.table_x=t,this.internal.__cell__.table_y=e,this},hg=function(t,e){var n=this.internal.__cell__.padding,r=this.internal.__cell__.table_font_size,i=this.internal.scaleFactor;return Object.keys(t).map(function(r){var i=t[r];return this.splitTextToSize(i.hasOwnProperty("text")?i.text:i,e[r]-n-n)},this).map(function(t){return this.getLineHeightFactor()*t.length*r/i+n+n},this).reduce(function(t,e){return Math.max(t,e)},0)},hl.setTableHeaderRow=function(t){hc.call(this),this.internal.__cell__.tableHeaderRow=t},hl.printHeaderRow=function(t,e){if(hc.call(this),!this.internal.__cell__.tableHeaderRow)throw Error("Property tableHeaderRow does not exist.");if(hu=!0,"function"==typeof this.internal.__cell__.headerFunction){var n,r=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new hd(r[0],r[1],r[2],r[3],void 0,-1)}this.setFont(void 0,"bold");for(var i=[],a=0;a<this.internal.__cell__.tableHeaderRow.length;a+=1){n=this.internal.__cell__.tableHeaderRow[a].clone(),e&&(n.y=this.internal.__cell__.margins.top||0,i.push(n)),n.lineNumber=t;var o=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),hp.call(this,n),this.setTextColor(o)}i.length>0&&this.setTableHeaderRow(i),this.setFont(void 0,"normal"),hu=!1};var lp={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},lg=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],lm=ld(lg),lv=[100,200,300,400,500,600,700,800,900],lb=ld(lv);function ly(t){var e,n,r,i=t.family.replace(/"|'/g,"").toLowerCase(),a=lp[e=(e=t.style)||"normal"]?e:"normal",o=(n=t.weight)?"number"==typeof n?n>=100&&n<=900&&n%100==0?n:400:/^\d00$/.test(n)?parseInt(n):"bold"===n?700:400:400,s="number"==typeof lm[r=(r=t.stretch)||"normal"]?r:"normal";return{family:i,style:a,weight:o,stretch:s,src:t.src||[],ref:t.ref||{name:i,style:[s,a,o].join(" ")}}}function lw(t,e,n,r){var i;for(i=n;i>=0&&i<e.length;i+=r)if(t[e[i]])return t[e[i]];for(i=n;i>=0&&i<e.length;i-=r)if(t[e[i]])return t[e[i]]}var l_={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},lx={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function lN(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function lA(t){return t.trimLeft()}var lL,lk,lS,lC,lP,lE,lI,lj,lM,lF,lB,lO,lT,lR,lD,lz,lq,lU,l$,lH,lW,lX,lY,lV,lG,lJ,lZ,lK,lQ,l1,l0,l2,l5,l3,l4,l6,l8,l7,l9,ht,he,hn,hr,hi,ha,ho,hs,hl,hh,hu,hc,hf,hd,hp,hg,hm,hv,hb,hy,hw,h_,hx,hN,hA,hL,hk=["times"];function hS(t,e,n,r,i){var a=4,o=hP;switch(i){case sB.API.image_compression.FAST:a=1,o=hC;break;case sB.API.image_compression.MEDIUM:a=6,o=hE;break;case sB.API.image_compression.SLOW:a=9,o=hI}var s=r8(t=function(t,e,n,r){for(var i,a=t.length/e,o=new Uint8Array(t.length+a),s=0;s<a;s+=1){var l=s*e,h=t.subarray(l,l+e);o.set(r(h,n,i),l+s),i=h}return o}(t,e,Math.ceil(n*r/8),o),{level:a});return sB.API.__addimage__.arrayBufferToBinaryString(s)}function hC(t,e){var n=t.length,r=[];r[0]=1;for(var i=0;i<n;i+=1){var a=t[i-e]||0;r[i+1]=t[i]-a+256&255}return r}function hP(t,e,n){var r=t.length,i=[];i[0]=2;for(var a=0;a<r;a+=1){var o=n&&n[a]||0;i[a+1]=t[a]-o+256&255}return i}function hE(t,e,n){var r=t.length,i=[];i[0]=3;for(var a=0;a<r;a+=1){var o=t[a-e]||0,s=n&&n[a]||0;i[a+1]=t[a]+256-(o+s>>>1)&255}return i}function hI(t,e,n){var r=t.length,i=[];i[0]=4;for(var a=0;a<r;a+=1){var o=function(t,e,n){if(t===e&&e===n)return t;var r=Math.abs(e-n),i=Math.abs(t-n),a=Math.abs(t+e-n-n);return r<=i&&r<=a?t:i<=a?e:n}(t[a-e]||0,n&&n[a]||0,n&&n[a-e]||0);i[a+1]=t[a]-o+256&255}return i}function hj(t,e,n){var r=e*n,i=Math.floor(r/8),a=16-(r-8*i+n);return hF(t,i)>>a&(1<<n)-1}function hM(t,e,n,r){var i,a=n*r,o=Math.floor(a/8),s=16-(a-8*o+r),l=(1<<r)-1;i=hF(t,o)&~(l<<s)&65535|(e&l)<<s,o+1<t.byteLength?t.setUint16(o,i,!1):t.setUint8(o,i>>8&255)}function hF(t,e){return e+1<t.byteLength?t.getUint16(e,!1):t.getUint8(e)<<8}function hB(t){var e=0;if(71!==t[e++]||73!==t[e++]||70!==t[e++]||56!==t[e++]||56!=(t[e++]+1&253)||97!==t[e++])throw Error("Invalid GIF 87a/89a header.");var n=t[e++]|t[e++]<<8,r=t[e++]|t[e++]<<8,i=t[e++],a=1<<1+(7&i);t[e++],t[e++];var o=null,s=null;i>>7&&(o=e,s=a,e+=3*a);var l=!0,h=[],u=0,c=null,f=0,d=null;for(this.width=n,this.height=r;l&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(11!==t[e]||78==t[e+1]&&69==t[e+2]&&84==t[e+3]&&83==t[e+4]&&67==t[e+5]&&65==t[e+6]&&80==t[e+7]&&69==t[e+8]&&50==t[e+9]&&46==t[e+10]&&48==t[e+11]&&3==t[e+12]&&1==t[e+13]&&0==t[e+16])e+=14,d=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((g=t[e++])>=0))throw Error("Invalid block size");if(0===g)break;e+=g}break;case 249:if(4!==t[e++]||0!==t[e+4])throw Error("Invalid graphics extension block.");var p=t[e++];u=t[e++]|t[e++]<<8,c=t[e++],1&p||(c=null),f=p>>2&7,e++;break;case 254:for(;;){if(!((g=t[e++])>=0))throw Error("Invalid block size");if(0===g)break;e+=g}break;default:throw Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var g,m=t[e++]|t[e++]<<8,v=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,y=t[e++]|t[e++]<<8,w=t[e++],_=w>>6&1,x=1<<1+(7&w),N=o,A=s,L=!1;w>>7&&(L=!0,N=e,A=x,e+=3*x);var k=e;for(e++;;){if(!((g=t[e++])>=0))throw Error("Invalid block size");if(0===g)break;e+=g}h.push({x:m,y:v,width:b,height:y,has_local_palette:L,palette_offset:N,palette_size:A,data_offset:k,data_length:e-k,transparent_index:c,interlaced:!!_,delay:u,disposal:f});break;case 59:l=!1;break;default:throw Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return h.length},this.loopCount=function(){return d},this.frameInfo=function(t){if(t<0||t>=h.length)throw Error("Frame index out of range.");return h[t]},this.decodeAndBlitFrameBGRA=function(e,r){var i=this.frameInfo(e),a=i.width*i.height,o=new Uint8Array(a);hO(t,i.data_offset,o,a);var s=i.palette_offset,l=i.transparent_index;null===l&&(l=256);var h=i.width,u=n-h,c=h,f=4*(i.y*n+i.x),d=4*((i.y+i.height)*n+i.x),p=f,g=4*u;!0===i.interlaced&&(g+=4*n*7);for(var m=8,v=0,b=o.length;v<b;++v){var y=o[v];if(0===c&&(c=h,(p+=g)>=d&&(g=4*u+4*n*(m-1),p=f+(h+u)*(m<<1),m>>=1)),y===l)p+=4;else{var w=t[s+3*y],_=t[s+3*y+1],x=t[s+3*y+2];r[p++]=x,r[p++]=_,r[p++]=w,r[p++]=255}--c}},this.decodeAndBlitFrameRGBA=function(e,r){var i=this.frameInfo(e),a=i.width*i.height,o=new Uint8Array(a);hO(t,i.data_offset,o,a);var s=i.palette_offset,l=i.transparent_index;null===l&&(l=256);var h=i.width,u=n-h,c=h,f=4*(i.y*n+i.x),d=4*((i.y+i.height)*n+i.x),p=f,g=4*u;!0===i.interlaced&&(g+=4*n*7);for(var m=8,v=0,b=o.length;v<b;++v){var y=o[v];if(0===c&&(c=h,(p+=g)>=d&&(g=4*u+4*n*(m-1),p=f+(h+u)*(m<<1),m>>=1)),y===l)p+=4;else{var w=t[s+3*y],_=t[s+3*y+1],x=t[s+3*y+2];r[p++]=w,r[p++]=_,r[p++]=x,r[p++]=255}--c}}}function hO(t,e,n,r){for(var i=t[e++],a=1<<i,o=a+1,s=o+1,l=i+1,h=(1<<l)-1,u=0,c=0,f=0,d=t[e++],p=new Int32Array(4096),g=null;;){for(;u<16&&0!==d;)c|=t[e++]<<u,u+=8,1===d?d=t[e++]:--d;if(u<l)break;var m=c&h;if(c>>=l,u-=l,m!==a){if(m===o)break;for(var v=m<s?m:g,b=0,y=v;y>a;)y=p[y]>>8,++b;var w=y;if(f+b+ +(v!==m)>r)return void si("Warning, gif stream longer than expected.");n[f++]=w;var _=f+=b;for(v!==m&&(n[f++]=w),y=v;b--;)y=p[y],n[--_]=255&y,y>>=8;null!==g&&s<4096&&(p[s++]=g<<8|w,s>=h+1&&l<12&&(++l,h=h<<1|1)),g=m}else s=o+1,h=(1<<(l=i+1))-1,g=null}return f!==r&&si("Warning, gif stream shorter than expected."),n}function hT(t){var e,n,r,i,a,o=Math.floor,s=Array(64),l=Array(64),h=Array(64),u=Array(64),c=Array(65535),f=Array(65535),d=Array(64),p=Array(64),g=[],m=0,v=7,b=Array(64),y=Array(64),w=Array(64),_=Array(256),x=Array(2048),N=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],A=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],L=[0,1,2,3,4,5,6,7,8,9,10,11],k=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],S=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],C=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],P=[0,1,2,3,4,5,6,7,8,9,10,11],E=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],I=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function j(t,e){for(var n=0,r=0,i=[],a=1;a<=16;a++){for(var o=1;o<=t[a];o++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=a,r++,n++;n*=2}return i}function M(t){for(var e=t[0],n=t[1]-1;n>=0;)e&1<<n&&(m|=1<<v),n--,--v<0&&(255==m?(F(255),F(0)):F(m),v=7,m=0)}function F(t){g.push(t)}function B(t){F(t>>8&255),F(255&t)}function O(t,e,n,r,i){for(var a,o=i[0],s=i[240],l=function(t,e){var n,r,i,a,o,s,l,h,u,c,f=0;for(u=0;u<8;++u){n=t[f],r=t[f+1],i=t[f+2],a=t[f+3],o=t[f+4],s=t[f+5],l=t[f+6];var p=n+(h=t[f+7]),g=n-h,m=r+l,v=r-l,b=i+s,y=i-s,w=a+o,_=a-o,x=p+w,N=p-w,A=m+b,L=m-b;t[f]=x+A,t[f+4]=x-A;var k=.707106781*(L+N);t[f+2]=N+k,t[f+6]=N-k;var S=.382683433*((x=_+y)-(L=v+g)),C=.5411961*x+S,P=1.306562965*L+S,E=.707106781*(A=y+v),I=g+E,j=g-E;t[f+5]=j+C,t[f+3]=j-C,t[f+1]=I+P,t[f+7]=I-P,f+=8}for(f=0,u=0;u<8;++u){n=t[f],r=t[f+8],i=t[f+16],a=t[f+24],o=t[f+32],s=t[f+40],l=t[f+48];var M=n+(h=t[f+56]),F=n-h,B=r+l,O=r-l,T=i+s,R=i-s,D=a+o,z=a-o,q=M+D,U=M-D,$=B+T,H=B-T;t[f]=q+$,t[f+32]=q-$;var W=.707106781*(H+U);t[f+16]=U+W,t[f+48]=U-W;var X=.382683433*((q=z+R)-(H=O+F)),Y=.5411961*q+X,V=1.306562965*H+X,G=.707106781*($=R+O),J=F+G,Z=F-G;t[f+40]=Z+Y,t[f+24]=Z-Y,t[f+8]=J+V,t[f+56]=J-V,f++}for(u=0;u<64;++u)c=t[u]*e[u],d[u]=c>0?c+.5|0:c-.5|0;return d}(t,e),h=0;h<64;++h)p[N[h]]=l[h];var u=p[0]-n;n=p[0],0==u?M(r[0]):(M(r[f[a=32767+u]]),M(c[a]));for(var g=63;g>0&&0==p[g];)g--;if(0==g)return M(o),n;for(var m,v=1;v<=g;){for(var b=v;0==p[v]&&v<=g;)++v;var y=v-b;if(y>=16){m=y>>4;for(var w=1;w<=m;++w)M(s);y&=15}M(i[(y<<4)+f[a=32767+p[v]]]),M(c[a]),v++}return 63!=g&&M(o),n}function T(t){a!=(t=Math.min(Math.max(t,1),100))&&(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=o((e[n]*t+50)/100);r=Math.min(Math.max(r,1),255),s[N[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],a=0;a<64;a++){var c=o((i[a]*t+50)/100);c=Math.min(Math.max(c,1),255),l[N[a]]=c}for(var f=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],d=0,p=0;p<8;p++)for(var g=0;g<8;g++)h[d]=1/(s[N[d]]*f[p]*f[g]*8),u[d]=1/(l[N[d]]*f[p]*f[g]*8),d++}(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),a=t)}this.encode=function(t,a){a&&T(a),g=[],m=0,v=7,B(65496),B(65504),B(16),F(74),F(70),F(73),F(70),F(0),F(1),F(1),F(0),B(1),B(1),F(0),F(0),function(){B(65499),B(132),F(0);for(var t=0;t<64;t++)F(s[t]);F(1);for(var e=0;e<64;e++)F(l[e])}(),d=t.width,p=t.height,B(65472),B(17),F(8),B(p),B(d),F(3),F(1),F(17),F(0),F(2),F(17),F(1),F(3),F(17),F(1),function(){B(65476),B(418),F(0);for(var t=0;t<16;t++)F(A[t+1]);for(var e=0;e<=11;e++)F(L[e]);F(16);for(var n=0;n<16;n++)F(k[n+1]);for(var r=0;r<=161;r++)F(S[r]);F(1);for(var i=0;i<16;i++)F(C[i+1]);for(var a=0;a<=11;a++)F(P[a]);F(17);for(var o=0;o<16;o++)F(E[o+1]);for(var s=0;s<=161;s++)F(I[s])}(),B(65498),B(12),F(3),F(1),F(0),F(2),F(17),F(3),F(17),F(0),F(63),F(0);var o=0,c=0,f=0;m=0,v=7,this.encode.displayName="_encode_";for(var d,p,_,N,j,R,D,z,q,U,$,H=t.data,W=t.width,X=t.height,Y=4*W,V=0;V<X;){for(_=0;_<Y;){for(D=Y*V+_,q=-1,U=0,$=0;$<64;$++)z=D+(U=$>>3)*Y+(q=4*(7&$)),V+U>=X&&(z-=Y*(V+1+U-X)),_+q>=Y&&(z-=_+q-Y+4),N=H[z++],j=H[z++],R=H[z++],b[$]=(x[N]+x[j+256|0]+x[R+512|0]>>16)-128,y[$]=(x[N+768|0]+x[j+1024|0]+x[R+1280|0]>>16)-128,w[$]=(x[N+1280|0]+x[j+1536|0]+x[R+1792|0]>>16)-128;o=O(b,h,o,e,r),c=O(y,u,c,n,i),f=O(w,u,f,n,i),_+=32}V+=8}if(v>=0){var G=[];G[1]=v+1,G[0]=(1<<v+1)-1,M(G)}return B(65497),new Uint8Array(g)},t=t||50,function(){for(var t=String.fromCharCode,e=0;e<256;e++)_[e]=t(e)}(),e=j(A,L),n=j(C,P),r=j(k,S),i=j(E,I),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)f[32767+r]=n,c[32767+r]=[],c[32767+r][1]=n,c[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)f[32767+i]=n,c[32767+i]=[],c[32767+i][1]=n,c[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)x[t]=19595*t,x[t+256|0]=38470*t,x[t+512|0]=7471*t+32768,x[t+768|0]=-11059*t,x[t+1024|0]=-21709*t,x[t+1280|0]=32768*t+8421375,x[t+1536|0]=-27439*t,x[t+1792|0]=-5329*t}(),T(t)}function hR(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function hD(t){function e(t){if(!t)throw Error("assert :P")}function n(t,e,n){for(var r=0;4>r;r++)if(t[e+r]!=n.charCodeAt(r))return!0;return!1}function r(t,e,n,r,i){for(var a=0;a<i;a++)t[e+a]=n[r+a]}function i(t,e,n,r){for(var i=0;i<r;i++)t[e+i]=n}function a(t){return new Int32Array(t)}function o(t,e){for(var n=[],r=0;r<t;r++)n.push(new e);return n}function s(t,e){var n=[];return function t(n,r,i){for(var a=i[r],o=0;o<a&&(n.push(i.length>r+1?[]:new e),!(i.length<r+1));o++)t(n[o],r+1,i)}(n,0,t),n}var l=function(){var t=this;function l(t,e){for(var n=1<<e-1>>>0;t&n;)n>>>=1;return n?(t&n-1)+n:t}function h(t,n,r,i,a){e(!(i%r));do t[n+(i-=r)]=a;while(0<i)}function u(t,n,r,i,o){if(e(2328>=o),512>=o)var s=a(512);else if(null==(s=a(o)))return 0;return function(t,n,r,i,o,s){var u,f,d=n,p=1<<r,g=a(16),m=a(16);for(e(0!=o),e(null!=i),e(null!=t),e(0<r),f=0;f<o;++f){if(15<i[f])return 0;++g[i[f]]}if(g[0]==o)return 0;for(m[1]=0,u=1;15>u;++u){if(g[u]>1<<u)return 0;m[u+1]=m[u]+g[u]}for(f=0;f<o;++f)u=i[f],0<i[f]&&(s[m[u]++]=f);if(1==m[15])return(i=new c).g=0,i.value=s[0],h(t,d,1,p,i),p;var v,b=-1,y=p-1,w=0,_=1,x=1,N=1<<r;for(f=0,u=1,o=2;u<=r;++u,o<<=1){if(_+=x<<=1,0>(x-=g[u]))return 0;for(;0<g[u];--g[u])(i=new c).g=u,i.value=s[f++],h(t,d+w,o,N,i),w=l(w,u)}for(u=r+1,o=2;15>=u;++u,o<<=1){if(_+=x<<=1,0>(x-=g[u]))return 0;for(;0<g[u];--g[u]){if(i=new c,(w&y)!=b){for(d+=N,v=1<<(b=u)-r;15>b&&!(0>=(v-=g[b]));)++b,v<<=1;p+=N=1<<(v=b-r),t[n+(b=w&y)].g=v+r,t[n+b].value=d-n-b}i.g=u-r,i.value=s[f++],h(t,d+(w>>r),o,N,i),w=l(w,u)}}return _!=2*m[15]-1?0:p}(t,n,r,i,o,s)}function c(){this.value=this.g=0}function f(){this.value=this.g=0}function d(){this.G=o(5,c),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(nm,f)}function p(t,n,r,i){e(null!=t),e(null!=n),e(0x80000000>i),t.Ca=254,t.I=0,t.b=-8,t.Ka=0,t.oa=n,t.pa=r,t.Jd=n,t.Yc=r+i,t.Zc=4<=i?r+i-4+1:r,k(t)}function g(t,e){for(var n=0;0<e--;)n|=C(t,128)<<e;return n}function m(t,e){var n=g(t,e);return S(t)?-n:n}function v(t,n,r,i){var a,o=0;for(e(null!=t),e(null!=n),e(0xfffffff8>i),t.Sb=i,t.Ra=0,t.u=0,t.h=0,4<i&&(i=4),a=0;a<i;++a)o+=n[r+a]<<8*a;t.Ra=o,t.bb=i,t.oa=n,t.pa=r}function b(t){for(;8<=t.u&&t.bb<t.Sb;)t.Ra>>>=8,t.Ra+=t.oa[t.pa+t.bb]<<ny-8>>>0,++t.bb,t.u-=8;N(t)&&(t.h=1,t.u=0)}function y(t,n){if(e(0<=n),!t.h&&n<=nb){var r=x(t)&nv[n];return t.u+=n,b(t),r}return t.h=1,t.u=0}function w(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function _(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function x(t){return t.Ra>>>(t.u&ny-1)>>>0}function N(t){return e(t.bb<=t.Sb),t.h||t.bb==t.Sb&&t.u>ny}function A(t,e){t.u=e,t.h=N(t)}function L(t){t.u>=nw&&(e(t.u>=nw),b(t))}function k(t){e(null!=t&&null!=t.oa),t.pa<t.Zc?(t.I=(t.oa[t.pa++]|t.I<<8)>>>0,t.b+=8):(e(null!=t&&null!=t.oa),t.pa<t.Yc?(t.b+=8,t.I=t.oa[t.pa++]|t.I<<8):t.Ka?t.b=0:(t.I<<=8,t.b+=8,t.Ka=1))}function S(t){return g(t,1)}function C(t,e){var n=t.Ca;0>t.b&&k(t);var r=t.b,i=n*e>>>8,a=(t.I>>>r>i)+0;for(a?(n-=i,t.I-=i+1<<r>>>0):n=i+1,r=n,i=0;256<=r;)i+=8,r>>=8;return r=7^i+n_[r],t.b-=r,t.Ca=(n<<r)-1,a}function P(t,e,n){t[e+0]=n>>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n}function E(t,e){return t[e+0]|t[e+1]<<8}function I(t,e){return E(t,e)|t[e+2]<<16}function j(t,e){return E(t,e)|E(t,e+2)<<16}function M(t,n){return e(null!=t),e(0<n),t.X=a(1<<n),null==t.X?0:(t.Mb=32-n,t.Xa=n,1)}function F(t,n){e(null!=t),e(null!=n),e(t.Xa==n.Xa),r(n.X,0,t.X,0,1<<n.Xa)}function B(){this.X=[],this.Xa=this.Mb=0}function O(t,n,r,i){e(null!=r),e(null!=i);var a=r[0],o=i[0];return 0==a&&(a=(t*o+n/2)/n),0==o&&(o=(n*a+t/2)/t),0>=a||0>=o?0:(r[0]=a,i[0]=o,1)}function T(t,e){return t+(1<<e)-1>>>e}function R(t,e){return((0xff00ff00&t)+(0xff00ff00&e)>>>0&0xff00ff00)+((0xff00ff&t)+(0xff00ff&e)>>>0&0xff00ff)>>>0}function D(e,n){t[n]=function(n,r,i,a,o,s,l){var h;for(h=0;h<o;++h){var u=t[e](s[l+h-1],i,a+h);s[l+h]=R(n[r+h],u)}}}function z(){this.ud=this.hd=this.jd=0}function q(t,e){return((0xfefefefe&(t^e))>>>1)+(t&e)>>>0}function U(t){return 0<=t&&256>t?t:0>t?0:255<t?255:void 0}function $(t,e){return U(t+(t-e+.5>>1))}function H(t,e,n){return Math.abs(e-n)-Math.abs(t-n)}function W(t,e,n,r,i,a,o){for(r=a[o-1],n=0;n<i;++n)a[o+n]=r=R(t[e+n],r)}function X(t,e,n,r,i){var a;for(a=0;a<n;++a){var o=t[e+a],s=o>>8&255,l=0xff00ff&(l=(l=0xff00ff&o)+((s<<16)+s));r[i+a]=(0xff00ff00&o)+l>>>0}}function Y(t,e){e.jd=255&t,e.hd=t>>8&255,e.ud=t>>16&255}function V(t,e,n,r,i,a){var o;for(o=0;o<r;++o){var s=e[n+o],l=s>>>8,h=s,u=255&(u=(u=s>>>16)+((t.jd<<24>>24)*(l<<24>>24)>>>5));h=255&(h=(h+=(t.hd<<24>>24)*(l<<24>>24)>>>5)+((t.ud<<24>>24)*(u<<24>>24)>>>5)),i[a+o]=(0xff00ff00&s)+(u<<16)+h}}function G(e,n,r,i,a){t[n]=function(t,e,n,r,o,s,l,h,u){for(r=l;r<h;++r)for(l=0;l<u;++l)o[s++]=a(n[i(t[e++])])},t[e]=function(e,n,o,s,l,h,u){var c=8>>e.b,f=e.Ea,d=e.K[0],p=e.w;if(8>c)for(e=(1<<e.b)-1,p=(1<<c)-1;n<o;++n){var g,m=0;for(g=0;g<f;++g)g&e||(m=i(s[l++])),h[u++]=a(d[m&p]),m>>=c}else t["VP8LMapColor"+r](s,l,d,p,h,u,n,o,f)}}function J(t,e,n,r,i){for(n=e+n;e<n;){var a=t[e++];r[i++]=a>>16&255,r[i++]=a>>8&255,r[i++]=255&a}}function Z(t,e,n,r,i){for(n=e+n;e<n;){var a=t[e++];r[i++]=a>>16&255,r[i++]=a>>8&255,r[i++]=255&a,r[i++]=a>>24&255}}function K(t,e,n,r,i){for(n=e+n;e<n;){var a=(o=t[e++])>>16&240|o>>12&15,o=240&o|o>>28&15;r[i++]=a,r[i++]=o}}function Q(t,e,n,r,i){for(n=e+n;e<n;){var a=(o=t[e++])>>16&248|o>>13&7,o=o>>5&224|o>>3&31;r[i++]=a,r[i++]=o}}function tt(t,e,n,r,i){for(n=e+n;e<n;){var a=t[e++];r[i++]=255&a,r[i++]=a>>8&255,r[i++]=a>>16&255}}function te(t,e,n,i,a,o){if(0==o)for(n=e+n;e<n;)P(i,((o=t[e++])[0]>>24|o[1]>>8&65280|o[2]<<8&0xff0000|o[3]<<24)>>>0),a+=32;else r(i,a,t,e,n)}function tn(e,n){t[n][0]=t[e+"0"],t[n][1]=t[e+"1"],t[n][2]=t[e+"2"],t[n][3]=t[e+"3"],t[n][4]=t[e+"4"],t[n][5]=t[e+"5"],t[n][6]=t[e+"6"],t[n][7]=t[e+"7"],t[n][8]=t[e+"8"],t[n][9]=t[e+"9"],t[n][10]=t[e+"10"],t[n][11]=t[e+"11"],t[n][12]=t[e+"12"],t[n][13]=t[e+"13"],t[n][14]=t[e+"0"],t[n][15]=t[e+"0"]}function tr(t){return t==ru||t==rc||t==rf||t==rd}function ti(){this.eb=[],this.size=this.A=this.fb=0}function ta(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function to(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new ti,this.f.kb=new ta,this.sd=null}function ts(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function tl(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function th(t){return alert("todo:WebPSamplerProcessPlane"),t.T}function tu(t,e){var n=t.T,i=e.ba.f.RGBA,a=i.eb,o=i.fb+t.ka*i.A,s=rR[e.ba.S],l=t.y,h=t.O,u=t.f,c=t.N,f=t.ea,d=t.W,p=e.cc,g=e.dc,m=e.Mc,v=e.Nc,b=t.ka,y=t.ka+t.T,w=t.U,_=w+1>>1;for(0==b?s(l,h,null,null,u,c,f,d,u,c,f,d,a,o,null,null,w):(s(e.ec,e.fc,l,h,p,g,m,v,u,c,f,d,a,o-i.A,a,o,w),++n);b+2<y;b+=2)p=u,g=c,m=f,v=d,c+=t.Rc,d+=t.Rc,o+=2*i.A,s(l,(h+=2*t.fa)-t.fa,l,h,p,g,m,v,u,c,f,d,a,o-i.A,a,o,w);return h+=t.fa,t.j+y<t.o?(r(e.ec,e.fc,l,h,w),r(e.cc,e.dc,u,c,_),r(e.Mc,e.Nc,f,d,_),n--):1&y||s(l,h,null,null,u,c,f,d,u,c,f,d,a,o+i.A,null,null,w),n}function tc(t,n,r){var i=t.F,a=[t.J];if(null!=i){var o=t.U,s=n.ba.S,l=s==rs||s==rf;n=n.ba.f.RGBA;var h=[0],u=t.ka;h[0]=t.T,t.Kb&&(0==u?--h[0]:(--u,a[0]-=t.width),t.j+t.ka+t.T==t.o&&(h[0]=t.o-t.j-u));var c=n.eb;u=n.fb+u*n.A,t=n2(i,a[0],t.width,o,h,c,u+3*!l,n.A),e(r==h),t&&tr(s)&&n1(c,u,l,o,h,n.A)}return 0}function tf(t){var e=t.ma,n=e.ba.S,r=11>n,i=n==ri||n==ro||n==rs||n==rl||12==n||tr(n);if(e.memory=null,e.Ib=null,e.Jb=null,e.Nd=null,!nd(e.Oa,t,i?11:12))return 0;if(i&&tr(n)&&e6(),t.da)alert("todo:use_scaling");else{if(r){if(e.Ib=th,t.Kb){if(n=t.U+1>>1,e.memory=a(t.U+2*n),null==e.memory)return 0;e.ec=e.memory,e.fc=0,e.cc=e.ec,e.dc=e.fc+t.U,e.Mc=e.cc,e.Nc=e.dc+n,e.Ib=tu,e6()}}else alert("todo:EmitYUV");i&&(e.Jb=tc,r&&e3())}if(r&&!rK){for(t=0;256>t;++t)rQ[t]=89858*(t-128)+rY>>rX,r2[t]=-22014*(t-128)+rY,r0[t]=-45773*(t-128),r1[t]=113618*(t-128)+rY>>rX;for(t=rV;t<rG;++t)e=76283*(t-16)+rY>>rX,r5[t-rV]=tW(e,255),r3[t-rV]=tW(e+8>>4,15);rK=1}return 1}function td(t){var n=t.ma,r=t.U,i=t.T;return e(!(1&t.ka)),0>=r||0>=i?0:(r=n.Ib(t,n),null!=n.Jb&&n.Jb(t,n,r),n.Dc+=r,1)}function tp(t){t.ma.memory=null}function tg(t,e,n,r){return 47!=y(t,8)?0:(e[0]=y(t,14)+1,n[0]=y(t,14)+1,r[0]=y(t,1),0!=y(t,3)?0:!t.h)}function tm(t,e){if(4>t)return t+1;var n=t-2>>1;return(2+(1&t)<<n)+y(e,n)+1}function tv(t,e){var n;return 120<e?e-120:1<=(n=((n=ry[e-1])>>4)*t+(8-(15&n)))?n:1}function tb(t,e,n){var r=x(n),i=t[e+=255&r].g-8;return 0<i&&(A(n,n.u+8),r=x(n),e+=t[e].value,e+=r&(1<<i)-1),A(n,n.u+t[e].g),t[e].value}function ty(t,n,r){return r.g+=t.g,r.value+=t.value<<n>>>0,e(8>=r.g),t.g}function tw(t,n,r){var i=t.xc;return e((n=0==i?0:t.vc[t.md*(r>>i)+(n>>i)])<t.Wb),t.Ya[n]}function t_(t,n,i,a){var o=t.ab,s=t.c*n,l=t.C;n=l+n;var h=i,u=a;for(a=t.Ta,i=t.Ua;0<o--;){var c=t.gc[o],f=l,d=n,p=h,g=u,m=(u=a,h=i,c.Ea);switch(e(f<d),e(d<=c.nc),c.hc){case 2:nA(p,g,(d-f)*m,u,h);break;case 0:var v=f,b=d,y=u,w=h,_=(k=c).Ea;0==v&&(nx(p,g,null,null,1,y,w),W(p,g+1,0,0,_-1,y,w+1),g+=_,w+=_,++v);for(var x=1<<k.b,N=x-1,A=T(_,k.b),L=k.K,k=k.w+(v>>k.b)*A;v<b;){var S=L,C=k,P=1;for(nN(p,g,y,w-_,1,y,w);P<_;){var E=(P&~N)+x;E>_&&(E=_),(0,nP[S[C++]>>8&15])(p,g+ +P,y,w+P-_,E-P,y,w+P),P=E}g+=_,w+=_,++v&N||(k+=A)}d!=c.nc&&r(u,h-m,u,h+(d-f-1)*m,m);break;case 1:for(m=p,b=g,_=(p=c.Ea)-(w=p&~(y=(g=1<<c.b)-1)),v=T(p,c.b),x=c.K,c=c.w+(f>>c.b)*v;f<d;){for(N=x,A=c,L=new z,k=b+w,S=b+p;b<k;)Y(N[A++],L),nE(L,m,b,g,u,h),b+=g,h+=g;b<S&&(Y(N[A++],L),nE(L,m,b,_,u,h),b+=_,h+=_),++f&y||(c+=v)}break;case 3:if(p==u&&g==h&&0<c.b){for(b=u,p=m=h+(d-f)*m-(w=(d-f)*T(c.Ea,c.b)),g=u,y=h,v=[],w=(_=w)-1;0<=w;--w)v[w]=g[y+w];for(w=_-1;0<=w;--w)b[p+w]=v[w];nL(c,f,d,u,m,u,h)}else nL(c,f,d,p,g,u,h)}h=a,u=i}u!=i&&r(a,i,h,u,s)}function tx(t,n){var r=t.V,i=t.Ba+t.c*t.C,a=n-t.C;if(e(n<=t.l.o),e(16>=a),0<a){var o=t.l,s=t.Ta,l=t.Ua,h=o.width;if(t_(t,a,r,i),a=l=[l],e((r=t.C)<(i=n)),e(o.v<o.va),i>o.o&&(i=o.o),r<o.j){var u=o.j-r;r=o.j,a[0]+=u*h}if(r>=i?r=0:(a[0]+=4*o.v,o.ka=r-o.j,o.U=o.va-o.v,o.T=i-r,r=1),r){if(l=l[0],11>(r=t.ca).S){var c=r.f.RGBA,f=(i=r.S,a=o.U,o=o.T,u=c.eb,c.A),d=o;for(c=c.fb+t.Ma*c.A;0<d--;){var p=l,g=a,m=u,v=c;switch(i){case rr:nI(s,p,g,m,v);break;case ri:nj(s,p,g,m,v);break;case ru:nj(s,p,g,m,v),n1(m,v,0,g,1,0);break;case ra:nB(s,p,g,m,v);break;case ro:te(s,p,g,m,v,1);break;case rc:te(s,p,g,m,v,1),n1(m,v,0,g,1,0);break;case rs:te(s,p,g,m,v,0);break;case rf:te(s,p,g,m,v,0),n1(m,v,1,g,1,0);break;case rl:nM(s,p,g,m,v);break;case rd:nM(s,p,g,m,v),n0(m,v,g,1,0);break;case rh:nF(s,p,g,m,v);break;default:e(0)}l+=h,c+=f}t.Ma+=o}else alert("todo:EmitRescaledRowsYUVA");e(t.Ma<=r.height)}}t.C=n,e(t.C<=t.i)}function tN(t){var e;if(0<t.ua)return 0;for(e=0;e<t.Wb;++e){var n=t.Ya[e].G,r=t.Ya[e].H;if(0<n[1][r[1]+0].g||0<n[2][r[2]+0].g||0<n[3][r[3]+0].g)return 0}return 1}function tA(t,n,r,i,a,o){if(0!=t.Z){var s=t.qd,l=t.rd;for(e(null!=rT[t.Z]);n<r;++n)rT[t.Z](s,l,i,a,i,a,o),s=i,l=a,a+=o;t.qd=s,t.rd=l}}function tL(t,n){var r=t.l.ma,i=0==r.Z||1==r.Z?t.l.j:t.C;if(i=t.C<i?i:t.C,e(n<=t.l.o),n>i){var a=t.l.width,o=r.ca,s=r.tb+a*i,l=t.V,h=t.Ba+t.c*i,u=t.gc;e(1==t.ab),e(3==u[0].hc),nS(u[0],i,n,l,h,o,s),tA(r,i,n,o,s,a)}t.C=t.Ma=n}function tk(t,n,r,i,a,o,s){var l=t.$/i,h=t.$%i,u=t.m,c=t.s,f=r+t.$,d=f;a=r+i*a;var p=r+i*o,g=280+c.ua,m=t.Pb?l:0x1000000,v=0<c.ua?c.Wa:null,b=c.wc,y=f<p?tw(c,h,l):null;e(t.C<o),e(p<=a);var w=!1;n:for(;;){for(;w||f<p;){var _=0;if(l>=m){var k=f-r;e((m=t).Pb),m.wd=m.m,m.xd=k,0<m.s.ua&&F(m.s.Wa,m.s.vb),m=l+r_}if(h&b||(y=tw(c,h,l)),e(null!=y),y.Qb&&(n[f]=y.qb,w=!0),!w)if(L(u),y.jc){_=u,k=n;var S=f,C=y.pd[x(_)&nm-1];e(y.jc),256>C.g?(A(_,_.u+C.g),k[S]=C.value,_=0):(A(_,_.u+C.g-256),e(256<=C.value),_=C.value),0==_&&(w=!0)}else _=tb(y.G[0],y.H[0],u);if(u.h)break;if(w||256>_){if(!w)if(y.nd)n[f]=(y.qb|_<<8)>>>0;else{if(L(u),w=tb(y.G[1],y.H[1],u),L(u),k=tb(y.G[2],y.H[2],u),S=tb(y.G[3],y.H[3],u),u.h)break;n[f]=(S<<24|w<<16|_<<8|k)>>>0}if(w=!1,++f,++h>=i&&(h=0,++l,null!=s&&l<=o&&!(l%16)&&s(t,l),null!=v))for(;d<f;)_=n[d++],v.X[0x1e35a7bd*_>>>v.Mb]=_}else if(280>_){if(_=tm(_-256,u),k=tb(y.G[4],y.H[4],u),L(u),k=tv(i,k=tm(k,u)),u.h)break;if(f-r<k||a-f<_)break n;for(S=0;S<_;++S)n[f+S]=n[f+S-k];for(f+=_,h+=_;h>=i;)h-=i,++l,null!=s&&l<=o&&!(l%16)&&s(t,l);if(e(f<=a),h&b&&(y=tw(c,h,l)),null!=v)for(;d<f;)_=n[d++],v.X[0x1e35a7bd*_>>>v.Mb]=_}else{if(!(_<g))break n;for(w=_-280,e(null!=v);d<f;)_=n[d++],v.X[0x1e35a7bd*_>>>v.Mb]=_;_=f,e(!(w>>>(k=v).Xa)),n[_]=k.X[w],w=!0}w||e(u.h==N(u))}if(t.Pb&&u.h&&f<a)e(t.m.h),t.a=5,t.m=t.wd,t.$=t.xd,0<t.s.ua&&F(t.s.vb,t.s.Wa);else{if(u.h)break;null!=s&&s(t,l>o?o:l),t.a=0,t.$=f-r}return 1}return t.a=3,0}function tS(t){e(null!=t),t.vc=null,t.yc=null,t.Ya=null;var n=t.Wa;null!=n&&(n.X=null),t.vb=null,e(null!=t)}function tC(){var e=new eG;return null==e?null:(e.a=0,e.xb=rO,tn("Predictor","VP8LPredictors"),tn("Predictor","VP8LPredictors_C"),tn("PredictorAdd","VP8LPredictorsAdd"),tn("PredictorAdd","VP8LPredictorsAdd_C"),nA=X,nE=V,nI=J,nj=Z,nM=K,nF=Q,nB=tt,t.VP8LMapColor32b=nk,t.VP8LMapColor8b=nC,e)}function tP(t,n,r,s,l){for(var h=1,f=[t],p=[n],g=s.m,m=s.s,v=null,b=0;;){if(r)for(;h&&y(g,1);){var w=f,_=p,N=1,k=s.m,S=s.gc[s.ab],C=y(k,2);if(s.Oc&1<<C)h=0;else{switch(s.Oc|=1<<C,S.hc=C,S.Ea=w[0],S.nc=_[0],S.K=[null],++s.ab,e(4>=s.ab),C){case 0:case 1:S.b=y(k,3)+2,N=tP(T(S.Ea,S.b),T(S.nc,S.b),0,s,S.K),S.K=S.K[0];break;case 3:var P,E=y(k,8)+1,I=16<E?0:4<E?1:2<E?2:3;if(w[0]=T(S.Ea,I),S.b=I,P=N=tP(E,1,0,s,S.K)){var j,F=1<<(8>>S.b),B=a(F);if(null==B)P=0;else{var O=S.K[0],D=S.w;for(B[0]=S.K[0][0],j=1;j<+E;++j)B[j]=R(O[D+j],B[j-1]);for(;j<4*F;++j)B[j]=0;S.K[0]=null,S.K[0]=B,P=1}}N=P;break;case 2:break;default:e(0)}h=N}}if(f=f[0],p=p[0],h&&y(g,1)&&!(h=1<=(b=y(g,4))&&11>=b)){s.a=3;break}if(z=h)r:{var z,q,U,$,H=f,W=p,X=b,Y=s.m,V=s.s,G=[null],J=1,Z=0,K=rw[X];i:for(;;){if(r&&y(Y,1)){var Q=y(Y,3)+2,tt=T(H,Q),te=T(W,Q),tn=tt*te;if(!tP(tt,te,0,s,G))break;for(G=G[0],V.xc=Q,q=0;q<tn;++q){var tr=G[q]>>8&65535;G[q]=tr,tr>=J&&(J=tr+1)}}if(Y.h)break;for(U=0;5>U;++U){var ti=rm[U];!U&&0<X&&(ti+=1<<X),Z<ti&&(Z=ti)}var ta=o(J*K,c),to=J,ts=o(to,d);if(null==ts)var tl=null;else e(65536>=to),tl=ts;var th=a(Z);if(null==tl||null==th||null==ta){s.a=1;break}for(q=$=0;q<J;++q){var tu,tc=tl[q],tf=tc.G,td=tc.H,tp=0,tg=1,tm=0;for(U=0;5>U;++U){ti=rm[U],tf[U]=ta,td[U]=$,!U&&0<X&&(ti+=1<<X);a:{var tv,tb=ti,tw=$,t_=0,tx=s.m,tN=y(tx,1);if(i(th,0,0,tb),tN){var tA=y(tx,1)+1,tL=y(tx,1),tC=y(tx,0==tL?1:8);th[tC]=1,2==tA&&(th[tC=y(tx,8)]=1);var tE=1}else{var tI=a(19),tj=y(tx,4)+4;if(19<tj){s.a=3;var tM=0;break a}for(tv=0;tv<tj;++tv)tI[rb[tv]]=y(tx,3);var tF=void 0,tB=void 0,tO=0,tT=s.m,tR=8,tD=o(128,c);o:for(;u(tD,0,7,tI,19);){if(y(tT,1)){var tz=2+2*y(tT,3);if((tF=2+y(tT,tz))>tb)break}else tF=tb;for(tB=0;tB<tb&&tF--;){L(tT);var tq=tD[0+(127&x(tT))];A(tT,tT.u+tq.g);var tU=tq.value;if(16>tU)th[tB++]=tU,0!=tU&&(tR=tU);else{var t$=16==tU,tH=tU-16,tW=rg[tH],tX=y(tT,rp[tH])+tW;if(tB+tX>tb)break o;for(var tY=t$?tR:0;0<tX--;)th[tB++]=tY}}tO=1;break}tO||(s.a=3),tE=tO}(tE=tE&&!tx.h)&&(t_=u(ta,tw,8,th,tb)),tE&&0!=t_?tM=t_:(s.a=3,tM=0)}if(0==tM)break i;if(tg&&1==rv[U]&&(tg=0==ta[$].g),tp+=ta[$].g,$+=tM,3>=U){var tV,tG=th[0];for(tV=1;tV<ti;++tV)th[tV]>tG&&(tG=th[tV]);tm+=tG}}if(tc.nd=tg,tc.Qb=0,tg&&(tc.qb=(tf[3][td[3]+0].value<<24|tf[1][td[1]+0].value<<16|tf[2][td[2]+0].value)>>>0,0==tp&&256>tf[0][td[0]+0].value&&(tc.Qb=1,tc.qb+=tf[0][td[0]+0].value<<8)),tc.jc=!tc.Qb&&6>tm,tc.jc)for(tu=0;tu<nm;++tu){var tJ=tu,tZ=tc.pd[tJ],tK=tc.G[0][tc.H[0]+tJ];256<=tK.value?(tZ.g=tK.g+256,tZ.value=tK.value):(tZ.g=0,tZ.value=0,tJ>>=ty(tK,8,tZ),tJ>>=ty(tc.G[1][tc.H[1]+tJ],16,tZ),tJ>>=ty(tc.G[2][tc.H[2]+tJ],0,tZ),ty(tc.G[3][tc.H[3]+tJ],24,tZ))}}V.vc=G,V.Wb=J,V.Ya=tl,V.yc=ta,z=1;break r}z=0}if(!(h=z)){s.a=3;break}if(0<b){if(m.ua=1<<b,!M(m.Wa,b)){s.a=1,h=0;break}}else m.ua=0;var tQ=f,t1=p,t0=s.s,t2=t0.xc;if(s.c=tQ,s.i=t1,t0.md=T(tQ,t2),t0.wc=0==t2?-1:(1<<t2)-1,r){s.xb=rB;break}if(null==(v=a(f*p))){s.a=1,h=0;break}h=(h=tk(s,v,0,f,p,p,null))&&!g.h;break}return h?(null!=l?l[0]=v:(e(null==v),e(r)),s.$=0,r||tS(m)):tS(m),h}function tE(t,n){var r=t.c*t.i;return e(t.c<=n),t.V=a(r+n+16*n),null==t.V?(t.Ta=null,t.Ua=0,t.a=1,0):(t.Ta=t.V,t.Ua=t.Ba+r+n,1)}function tI(t,n){var r=t.C,i=n-r,a=t.V,o=t.Ba+t.c*r;for(e(n<=t.l.o);0<i;){var s=16<i?16:i,l=t.l.ma,h=t.l.width,u=h*s,c=l.ca,f=l.tb+h*r,d=t.Ta,p=t.Ua;t_(t,s,a,o),n5(d,p,c,f,u),tA(l,r,r+s,c,f,h),i-=s,a+=s*t.c,r+=s}e(r==n),t.C=t.Ma=n}function tj(){this.ub=this.yd=this.td=this.Rb=0}function tM(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function tF(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function tB(){var t;this.Yb=(function t(e,n,r){for(var i=r[n],a=0;a<i&&(e.push(r.length>n+1?[]:0),!(r.length<n+1));a++)t(e[a],n+1,r)}(t=[],0,[3,11]),t)}function tO(){this.jb=a(3),this.Wc=s([4,8],tB),this.Xc=s([4,17],tB)}function tT(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function tR(){this.ld=this.La=this.dd=this.tc=0}function tD(){this.Na=this.la=0}function tz(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function tq(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function tU(){this.uc=this.M=this.Nb=0,this.wa=Array(new tR),this.Y=0,this.ya=Array(new tq),this.aa=0,this.l=new tX}function t$(){this.y=a(16),this.f=a(8),this.ea=a(8)}function tH(){this.cb=this.a=0,this.sc="",this.m=new w,this.Od=new tj,this.Kc=new tM,this.ed=new tT,this.Qa=new tF,this.Ic=this.$c=this.Aa=0,this.D=new tU,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,w),this.ia=0,this.pb=o(4,tz),this.Pa=new tO,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new t$),this.Hd=0,this.rb=Array(new tD),this.sb=0,this.wa=Array(new tR),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new tq),this.L=this.aa=0,this.gd=s([4,2],tR),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function tW(t,e){return 0>t?0:t>e?e:t}function tX(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function tY(){var t=new tH;return null!=t&&(t.a=0,t.sc="OK",t.cb=0,t.Xb=0,rA||(rA=tZ)),t}function tV(t,e,n){return 0==t.a&&(t.a=e,t.sc=n,t.cb=0),0}function tG(t,e,n){return 3<=n&&157==t[e+0]&&1==t[e+1]&&42==t[e+2]}function tJ(t,n){if(null==t)return 0;if(t.a=0,t.sc="OK",null==n)return tV(t,2,"null VP8Io passed to VP8GetHeaders()");var r=n.data,a=n.w,o=n.ha;if(4>o)return tV(t,7,"Truncated header.");var s=r[a+0]|r[a+1]<<8|r[a+2]<<16,l=t.Od;if(l.Rb=!(1&s),l.td=s>>1&7,l.yd=s>>4&1,l.ub=s>>5,3<l.td)return tV(t,3,"Incorrect keyframe parameters.");if(!l.yd)return tV(t,4,"Frame not displayable.");a+=3,o-=3;var h=t.Kc;if(l.Rb){if(7>o)return tV(t,7,"cannot parse picture header");if(!tG(r,a,o))return tV(t,3,"Bad code word");h.c=16383&(r[a+4]<<8|r[a+3]),h.Td=r[a+4]>>6,h.i=16383&(r[a+6]<<8|r[a+5]),h.Ud=r[a+6]>>6,a+=7,o-=7,t.za=h.c+15>>4,t.Ub=h.i+15>>4,n.width=h.c,n.height=h.i,n.Da=0,n.j=0,n.v=0,n.va=n.width,n.o=n.height,n.da=0,n.ib=n.width,n.hb=n.height,n.U=n.width,n.T=n.height,i((s=t.Pa).jb,0,255,s.jb.length),e(null!=(s=t.Qa)),s.Cb=0,s.Bb=0,s.Fb=1,i(s.Zb,0,0,s.Zb.length),i(s.Lb,0,0,s.Lb)}if(l.ub>o)return tV(t,7,"bad partition length");p(s=t.m,r,a,l.ub),a+=l.ub,o-=l.ub,l.Rb&&(h.Ld=S(s),h.Kd=S(s)),h=t.Qa;var u,c=t.Pa;if(e(null!=s),e(null!=h),h.Cb=S(s),h.Cb){if(h.Bb=S(s),S(s)){for(h.Fb=S(s),u=0;4>u;++u)h.Zb[u]=S(s)?m(s,7):0;for(u=0;4>u;++u)h.Lb[u]=S(s)?m(s,6):0}if(h.Bb)for(u=0;3>u;++u)c.jb[u]=S(s)?g(s,8):255}else h.Bb=0;if(s.Ka)return tV(t,3,"cannot parse segment header");if((h=t.ed).zd=S(s),h.Tb=g(s,6),h.wb=g(s,3),h.Pc=S(s),h.Pc&&S(s)){for(c=0;4>c;++c)S(s)&&(h.vd[c]=m(s,6));for(c=0;4>c;++c)S(s)&&(h.od[c]=m(s,6))}if(t.L=0==h.Tb?0:h.zd?1:2,s.Ka)return tV(t,3,"cannot parse filter header");var f=o;if(o=u=a,a=u+f,h=f,t.Xb=(1<<g(t.m,2))-1,f<3*(c=t.Xb))r=7;else{for(u+=3*c,h-=3*c,f=0;f<c;++f){var d=r[o+0]|r[o+1]<<8|r[o+2]<<16;d>h&&(d=h),p(t.Jc[+f],r,u,d),u+=d,h-=d,o+=3}p(t.Jc[+c],r,u,h),r=u<a?0:5}if(0!=r)return tV(t,r,"cannot parse partitions");for(r=g(u=t.m,7),o=S(u)?m(u,4):0,a=S(u)?m(u,4):0,h=S(u)?m(u,4):0,c=S(u)?m(u,4):0,u=S(u)?m(u,4):0,f=t.Qa,d=0;4>d;++d){if(f.Cb){var v=f.Zb[d];f.Fb||(v+=r)}else{if(0<d){t.pb[d]=t.pb[0];continue}v=r}var b=t.pb[d];b.Sc[0]=rx[tW(v+o,127)],b.Sc[1]=rN[tW(v+0,127)],b.Eb[0]=2*rx[tW(v+a,127)],b.Eb[1]=101581*rN[tW(v+h,127)]>>16,8>b.Eb[1]&&(b.Eb[1]=8),b.Qc[0]=rx[tW(v+c,117)],b.Qc[1]=rN[tW(v+u,127)],b.lc=v+u}if(!l.Rb)return tV(t,4,"Not a key frame.");for(S(s),l=t.Pa,r=0;4>r;++r){for(o=0;8>o;++o)for(a=0;3>a;++a)for(h=0;11>h;++h)c=C(s,rE[r][o][a][h])?g(s,8):rC[r][o][a][h],l.Wc[r][o].Yb[a][h]=c;for(o=0;17>o;++o)l.Xc[r][o]=l.Wc[r][rI[o]]}return t.kc=S(s),t.kc&&(t.Bd=g(s,8)),t.cb=1}function tZ(t,e,n,r,i,a,o){var s=e[i].Yb[n];for(n=0;16>i;++i){if(!C(t,s[n+0]))return i;for(;!C(t,s[n+1]);)if(s=e[++i].Yb[0],n=0,16==i)return 16;var l=e[i+1].Yb;if(C(t,s[n+2])){var h=t,u=0;if(C(h,(f=s)[(c=n)+3]))if(C(h,f[c+6])){for(s=0,c=2*(u=C(h,f[c+8]))+(f=C(h,f[c+9+u])),u=0,f=rL[c];f[s];++s)u+=u+C(h,f[s]);u+=3+(8<<c)}else u=C(h,f[c+7])?7+2*C(h,165)+C(h,145):5+C(h,159);else u=C(h,f[c+4])?3+C(h,f[c+5]):2;s=l[2]}else u=1,s=l[1];l=o+rk[i],0>(h=t).b&&k(h);var c,f=h.b,d=(c=h.Ca>>1)-(h.I>>f)>>31;--h.b,h.Ca+=d,h.Ca|=1,h.I-=(c+1&d)<<f,a[l]=((u^d)-d)*r[(0<i)+0]}return 16}function tK(t){var e=t.rb[t.sb-1];e.la=0,e.Na=0,i(t.zc,0,0,t.zc.length),t.ja=0}function tQ(t,e,n,r,i){i=t[e+n+32*r]+(i>>3),t[e+n+32*r]=-256&i?0>i?0:255:i}function t1(t,e,n,r,i,a){tQ(t,e,0,n,r+i),tQ(t,e,1,n,r+a),tQ(t,e,2,n,r-a),tQ(t,e,3,n,r-i)}function t0(t){return(20091*t>>16)+t}function t2(t,e,n,r){var i,o=0,s=a(16);for(i=0;4>i;++i){var l=t[e+0]+t[e+8],h=t[e+0]-t[e+8],u=(35468*t[e+4]>>16)-t0(t[e+12]),c=t0(t[e+4])+(35468*t[e+12]>>16);s[o+0]=l+c,s[o+1]=h+u,s[o+2]=h-u,s[o+3]=l-c,o+=4,e++}for(i=o=0;4>i;++i)l=(t=s[o+0]+4)+s[o+8],h=t-s[o+8],u=(35468*s[o+4]>>16)-t0(s[o+12]),tQ(n,r,0,0,l+(c=t0(s[o+4])+(35468*s[o+12]>>16))),tQ(n,r,1,0,h+u),tQ(n,r,2,0,h-u),tQ(n,r,3,0,l-c),o++,r+=32}function t5(t,e,n,r){var i=t[e+0]+4,a=35468*t[e+4]>>16,o=t0(t[e+4]),s=35468*t[e+1]>>16;t1(n,r,0,i+o,t=t0(t[e+1]),s),t1(n,r,1,i+a,t,s),t1(n,r,2,i-a,t,s),t1(n,r,3,i-o,t,s)}function t3(t,e,n,r,i){t2(t,e,n,r),i&&t2(t,e+16,n,r+4)}function t4(t,e,n,r){nT(t,e+0,n,r,1),nT(t,e+32,n,r+128,1)}function t6(t,e,n,r){var i;for(t=t[e+0]+4,i=0;4>i;++i)for(e=0;4>e;++e)tQ(n,r,e,i,t)}function t8(t,e,n,r){t[e+0]&&nz(t,e+0,n,r),t[e+16]&&nz(t,e+16,n,r+4),t[e+32]&&nz(t,e+32,n,r+128),t[e+48]&&nz(t,e+48,n,r+128+4)}function t7(t,e,n,r){var i,o=a(16);for(i=0;4>i;++i){var s=t[e+0+i]+t[e+12+i],l=t[e+4+i]+t[e+8+i],h=t[e+4+i]-t[e+8+i],u=t[e+0+i]-t[e+12+i];o[0+i]=s+l,o[8+i]=s-l,o[4+i]=u+h,o[12+i]=u-h}for(i=0;4>i;++i)s=(t=o[0+4*i]+3)+o[3+4*i],l=o[1+4*i]+o[2+4*i],h=o[1+4*i]-o[2+4*i],u=t-o[3+4*i],n[r+0]=s+l>>3,n[r+16]=u+h>>3,n[r+32]=s-l>>3,n[r+48]=u-h>>3,r+=64}function t9(t,e,n){var r,i=e-32,a=255-t[i-1];for(r=0;r<n;++r){var o,s=a+t[e-1];for(o=0;o<n;++o)t[e+o]=re[s+t[i+o]];e+=32}}function et(t,e){t9(t,e,4)}function ee(t,e){t9(t,e,8)}function en(t,e){t9(t,e,16)}function er(t,e){var n;for(n=0;16>n;++n)r(t,e+32*n,t,e-32,16)}function ei(t,e){var n;for(n=16;0<n;--n)i(t,e,t[e-1],16),e+=32}function ea(t,e,n){var r;for(r=0;16>r;++r)i(e,n+32*r,t,16)}function eo(t,e){var n,r=16;for(n=0;16>n;++n)r+=t[e-1+32*n]+t[e+n-32];ea(r>>5,t,e)}function es(t,e){var n,r=8;for(n=0;16>n;++n)r+=t[e-1+32*n];ea(r>>4,t,e)}function el(t,e){var n,r=8;for(n=0;16>n;++n)r+=t[e+n-32];ea(r>>4,t,e)}function eh(t,e){ea(128,t,e)}function eu(t,e,n){return t+2*e+n+2>>2}function ec(t,e){var n,i=e-32;for(i=new Uint8Array([eu(t[i-1],t[i+0],t[i+1]),eu(t[i+0],t[i+1],t[i+2]),eu(t[i+1],t[i+2],t[i+3]),eu(t[i+2],t[i+3],t[i+4])]),n=0;4>n;++n)r(t,e+32*n,i,0,i.length)}function ef(t,e){var n=t[e-1],r=t[e-1+32],i=t[e-1+64],a=t[e-1+96];P(t,e+0,0x1010101*eu(t[e-1-32],n,r)),P(t,e+32,0x1010101*eu(n,r,i)),P(t,e+64,0x1010101*eu(r,i,a)),P(t,e+96,0x1010101*eu(i,a,a))}function ed(t,e){var n,r=4;for(n=0;4>n;++n)r+=t[e+n-32]+t[e-1+32*n];for(r>>=3,n=0;4>n;++n)i(t,e+32*n,r,4)}function ep(t,e){var n=t[e-1+0],r=t[e-1+32],i=t[e-1+64],a=t[e-1-32],o=t[e+0-32],s=t[e+1-32],l=t[e+2-32],h=t[e+3-32];t[e+0+96]=eu(r,i,t[e-1+96]),t[e+1+96]=t[e+0+64]=eu(n,r,i),t[e+2+96]=t[e+1+64]=t[e+0+32]=eu(a,n,r),t[e+3+96]=t[e+2+64]=t[e+1+32]=t[e+0+0]=eu(o,a,n),t[e+3+64]=t[e+2+32]=t[e+1+0]=eu(s,o,a),t[e+3+32]=t[e+2+0]=eu(l,s,o),t[e+3+0]=eu(h,l,s)}function eg(t,e){var n=t[e+1-32],r=t[e+2-32],i=t[e+3-32],a=t[e+4-32],o=t[e+5-32],s=t[e+6-32],l=t[e+7-32];t[e+0+0]=eu(t[e+0-32],n,r),t[e+1+0]=t[e+0+32]=eu(n,r,i),t[e+2+0]=t[e+1+32]=t[e+0+64]=eu(r,i,a),t[e+3+0]=t[e+2+32]=t[e+1+64]=t[e+0+96]=eu(i,a,o),t[e+3+32]=t[e+2+64]=t[e+1+96]=eu(a,o,s),t[e+3+64]=t[e+2+96]=eu(o,s,l),t[e+3+96]=eu(s,l,l)}function em(t,e){var n=t[e-1+0],r=t[e-1+32],i=t[e-1+64],a=t[e-1-32],o=t[e+0-32],s=t[e+1-32],l=t[e+2-32],h=t[e+3-32];t[e+0+0]=t[e+1+64]=a+o+1>>1,t[e+1+0]=t[e+2+64]=o+s+1>>1,t[e+2+0]=t[e+3+64]=s+l+1>>1,t[e+3+0]=l+h+1>>1,t[e+0+96]=eu(i,r,n),t[e+0+64]=eu(r,n,a),t[e+0+32]=t[e+1+96]=eu(n,a,o),t[e+1+32]=t[e+2+96]=eu(a,o,s),t[e+2+32]=t[e+3+96]=eu(o,s,l),t[e+3+32]=eu(s,l,h)}function ev(t,e){var n=t[e+0-32],r=t[e+1-32],i=t[e+2-32],a=t[e+3-32],o=t[e+4-32],s=t[e+5-32],l=t[e+6-32],h=t[e+7-32];t[e+0+0]=n+r+1>>1,t[e+1+0]=t[e+0+64]=r+i+1>>1,t[e+2+0]=t[e+1+64]=i+a+1>>1,t[e+3+0]=t[e+2+64]=a+o+1>>1,t[e+0+32]=eu(n,r,i),t[e+1+32]=t[e+0+96]=eu(r,i,a),t[e+2+32]=t[e+1+96]=eu(i,a,o),t[e+3+32]=t[e+2+96]=eu(a,o,s),t[e+3+64]=eu(o,s,l),t[e+3+96]=eu(s,l,h)}function eb(t,e){var n=t[e-1+0],r=t[e-1+32],i=t[e-1+64],a=t[e-1+96];t[e+0+0]=n+r+1>>1,t[e+2+0]=t[e+0+32]=r+i+1>>1,t[e+2+32]=t[e+0+64]=i+a+1>>1,t[e+1+0]=eu(n,r,i),t[e+3+0]=t[e+1+32]=eu(r,i,a),t[e+3+32]=t[e+1+64]=eu(i,a,a),t[e+3+64]=t[e+2+64]=t[e+0+96]=t[e+1+96]=t[e+2+96]=t[e+3+96]=a}function ey(t,e){var n=t[e-1+0],r=t[e-1+32],i=t[e-1+64],a=t[e-1+96],o=t[e-1-32],s=t[e+0-32],l=t[e+1-32],h=t[e+2-32];t[e+0+0]=t[e+2+32]=n+o+1>>1,t[e+0+32]=t[e+2+64]=r+n+1>>1,t[e+0+64]=t[e+2+96]=i+r+1>>1,t[e+0+96]=a+i+1>>1,t[e+3+0]=eu(s,l,h),t[e+2+0]=eu(o,s,l),t[e+1+0]=t[e+3+32]=eu(n,o,s),t[e+1+32]=t[e+3+64]=eu(r,n,o),t[e+1+64]=t[e+3+96]=eu(i,r,n),t[e+1+96]=eu(a,i,r)}function ew(t,e){var n;for(n=0;8>n;++n)r(t,e+32*n,t,e-32,8)}function e_(t,e){var n;for(n=0;8>n;++n)i(t,e,t[e-1],8),e+=32}function ex(t,e,n){var r;for(r=0;8>r;++r)i(e,n+32*r,t,8)}function eN(t,e){var n,r=8;for(n=0;8>n;++n)r+=t[e+n-32]+t[e-1+32*n];ex(r>>4,t,e)}function eA(t,e){var n,r=4;for(n=0;8>n;++n)r+=t[e+n-32];ex(r>>3,t,e)}function eL(t,e){var n,r=4;for(n=0;8>n;++n)r+=t[e-1+32*n];ex(r>>3,t,e)}function ek(t,e){ex(128,t,e)}function eS(t,e,n){var r=t[e-n],i=t[e+0],a=3*(i-r)+n9[1020+t[e-2*n]-t[e+n]],o=rt[112+(a+4>>3)];t[e-n]=re[255+r+rt[112+(a+3>>3)]],t[e+0]=re[255+i-o]}function eC(t,e,n,r){var i=t[e+0],a=t[e+n];return rn[255+t[e-2*n]-t[e-n]]>r||rn[255+a-i]>r}function eP(t,e,n,r){return 4*rn[255+t[e-n]-t[e+0]]+rn[255+t[e-2*n]-t[e+n]]<=r}function eE(t,e,n,r,i){var a=t[e-3*n],o=t[e-2*n],s=t[e-n],l=t[e+0],h=t[e+n],u=t[e+2*n],c=t[e+3*n];return 4*rn[255+s-l]+rn[255+o-h]>r?0:rn[255+t[e-4*n]-a]<=i&&rn[255+a-o]<=i&&rn[255+o-s]<=i&&rn[255+c-u]<=i&&rn[255+u-h]<=i&&rn[255+h-l]<=i}function eI(t,e,n,r){var i=2*r+1;for(r=0;16>r;++r)eP(t,e+r,n,i)&&eS(t,e+r,n)}function ej(t,e,n,r){var i=2*r+1;for(r=0;16>r;++r)eP(t,e+r*n,1,i)&&eS(t,e+r*n,1)}function eM(t,e,n,r){var i;for(i=3;0<i;--i)eI(t,e+=4*n,n,r)}function eF(t,e,n,r){var i;for(i=3;0<i;--i)ej(t,e+=4,n,r)}function eB(t,e,n,r,i,a,o,s){for(a=2*a+1;0<i--;){if(eE(t,e,n,a,o))if(eC(t,e,n,s))eS(t,e,n);else{var l=e,h=t[l-2*n],u=t[l-n],c=t[l+0],f=t[l+n],d=t[l+2*n],p=27*(m=n9[1020+3*(c-u)+n9[1020+h-f]])+63>>7,g=18*m+63>>7,m=9*m+63>>7;t[l-3*n]=re[255+t[l-3*n]+m],t[l-2*n]=re[255+h+g],t[l-n]=re[255+u+p],t[l+0]=re[255+c-p],t[l+n]=re[255+f-g],t[l+2*n]=re[255+d-m]}e+=r}}function eO(t,e,n,r,i,a,o,s){for(a=2*a+1;0<i--;){if(eE(t,e,n,a,o))if(eC(t,e,n,s))eS(t,e,n);else{var l=e,h=t[l-n],u=t[l+0],c=t[l+n],f=rt[112+(4+(d=3*(u-h))>>3)],d=rt[112+(d+3>>3)],p=f+1>>1;t[l-2*n]=re[255+t[l-2*n]+p],t[l-n]=re[255+h+d],t[l+0]=re[255+u-f],t[l+n]=re[255+c-p]}e+=r}}function eT(t,e,n,r,i,a){eB(t,e,n,1,16,r,i,a)}function eR(t,e,n,r,i,a){eB(t,e,1,n,16,r,i,a)}function eD(t,e,n,r,i,a){var o;for(o=3;0<o;--o)eO(t,e+=4*n,n,1,16,r,i,a)}function ez(t,e,n,r,i,a){var o;for(o=3;0<o;--o)eO(t,e+=4,1,n,16,r,i,a)}function eq(t,e,n,r,i,a,o,s){eB(t,e,i,1,8,a,o,s),eB(n,r,i,1,8,a,o,s)}function eU(t,e,n,r,i,a,o,s){eB(t,e,1,i,8,a,o,s),eB(n,r,1,i,8,a,o,s)}function e$(t,e,n,r,i,a,o,s){eO(t,e+4*i,i,1,8,a,o,s),eO(n,r+4*i,i,1,8,a,o,s)}function eH(t,e,n,r,i,a,o,s){eO(t,e+4,1,i,8,a,o,s),eO(n,r+4,1,i,8,a,o,s)}function eW(){this.ba=new to,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new tl,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function eX(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function eY(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function eV(){this.ua=0,this.Wa=new B,this.vb=new B,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new d,this.yc=new c}function eG(){this.xb=this.a=0,this.l=new tX,this.ca=new to,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new _,this.Pb=0,this.wd=new _,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new eV,this.ab=0,this.gc=o(4,eY),this.Oc=0}function eJ(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new tX,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function eZ(t,e,n,r,i,a,o){for(t=null==t?0:t[e+0],e=0;e<o;++e)i[a+e]=t+n[r+e]&255,t=i[a+e]}function eK(t,e,n,r,i,a,o){var s;if(null==t)eZ(null,null,n,r,i,a,o);else for(s=0;s<o;++s)i[a+s]=t[e+s]+n[r+s]&255}function eQ(t,e,n,r,i,a,o){if(null==t)eZ(null,null,n,r,i,a,o);else{var s,l=t[e+0],h=l,u=l;for(s=0;s<o;++s)h=u+(l=t[e+s])-h,u=n[r+s]+(-256&h?0>h?0:255:h)&255,h=l,i[a+s]=u}}function e1(t,e,n,r,i,a){for(;0<i--;){var o,s=e+ +!!n,l=e+3*!n;for(o=0;o<r;++o){var h=t[l+4*o];255!=h&&(h*=32897,t[s+4*o+0]=t[s+4*o+0]*h>>23,t[s+4*o+1]=t[s+4*o+1]*h>>23,t[s+4*o+2]=t[s+4*o+2]*h>>23)}e+=a}}function e0(t,e,n,r,i){for(;0<r--;){var a;for(a=0;a<n;++a){var o=t[e+2*a+0],s=15&(h=t[e+2*a+1]),l=4369*s,h=(240&h|h>>4)*l>>16;t[e+2*a+0]=(240&o|o>>4)*l>>16&240|(15&o|o<<4)*l>>16>>4&15,t[e+2*a+1]=240&h|s}e+=i}}function e2(t,e,n,r,i,a,o,s){var l,h,u=255;for(h=0;h<i;++h){for(l=0;l<r;++l){var c=t[e+l];a[o+4*l]=c,u&=c}e+=n,o+=s}return 255!=u}function e5(t,e,n,r,i){var a;for(a=0;a<i;++a)n[r+a]=t[e+a]>>8}function e3(){n1=e1,n0=e0,n2=e2,n5=e5}function e4(n,r,i){t[n]=function(t,n,a,o,s,l,h,u,c,f,d,p,g,m,v,b,y){var w,_=y-1>>1,x=s[l+0]|h[u+0]<<16,N=c[f+0]|d[p+0]<<16;e(null!=t);var A=3*x+N+131074>>2;for(r(t[n+0],255&A,A>>16,g,m),null!=a&&(A=3*N+x+131074>>2,r(a[o+0],255&A,A>>16,v,b)),w=1;w<=_;++w){var L=s[l+w]|h[u+w]<<16,k=c[f+w]|d[p+w]<<16,S=x+L+N+k+524296,C=S+2*(L+N)>>3;A=C+x>>1,x=(S=S+2*(x+k)>>3)+L>>1,r(t[n+2*w-1],255&A,A>>16,g,m+(2*w-1)*i),r(t[n+2*w-0],255&x,x>>16,g,m+(2*w-0)*i),null!=a&&(A=S+N>>1,x=C+k>>1,r(a[o+2*w-1],255&A,A>>16,v,b+(2*w-1)*i),r(a[o+2*w+0],255&x,x>>16,v,b+(2*w+0)*i)),x=L,N=k}1&y||(A=3*x+N+131074>>2,r(t[n+y-1],255&A,A>>16,g,m+(y-1)*i),null!=a&&(A=3*N+x+131074>>2,r(a[o+y-1],255&A,A>>16,v,b+(y-1)*i)))}}function e6(){rR[rr]=rD,rR[ri]=rq,rR[ra]=rz,rR[ro]=rU,rR[rs]=r$,rR[rl]=rH,rR[rh]=rW,rR[ru]=rq,rR[rc]=rU,rR[rf]=r$,rR[rd]=rH}function e8(t){return t&~rZ?0>t?0:255:t>>rJ}function e7(t,e){return e8((19077*t>>8)+(26149*e>>8)-14234)}function e9(t,e,n){return e8((19077*t>>8)-(6419*e>>8)-(13320*n>>8)+8708)}function nt(t,e){return e8((19077*t>>8)+(33050*e>>8)-17685)}function ne(t,e,n,r,i){r[i+0]=e7(t,n),r[i+1]=e9(t,e,n),r[i+2]=nt(t,e)}function nn(t,e,n,r,i){r[i+0]=nt(t,e),r[i+1]=e9(t,e,n),r[i+2]=e7(t,n)}function nr(t,e,n,r,i){var a=e9(t,e,n);e=a<<3&224|nt(t,e)>>3,r[i+0]=248&e7(t,n)|a>>5,r[i+1]=e}function ni(t,e,n,r,i){var a=240&nt(t,e)|15;r[i+0]=240&e7(t,n)|e9(t,e,n)>>4,r[i+1]=a}function na(t,e,n,r,i){r[i+0]=255,ne(t,e,n,r,i+1)}function no(t,e,n,r,i){nn(t,e,n,r,i),r[i+3]=255}function ns(t,e,n,r,i){ne(t,e,n,r,i),r[i+3]=255}function nl(e,n,r){t[e]=function(t,e,i,a,o,s,l,h,u){for(var c=h+(-2&u)*r;h!=c;)n(t[e+0],i[a+0],o[s+0],l,h),n(t[e+1],i[a+0],o[s+0],l,h+r),e+=2,++a,++s,h+=2*r;1&u&&n(t[e+0],i[a+0],o[s+0],l,h)}}function nh(t,e,n){return 0==n?0==t?0==e?6:5:4*(0==e):n}function nu(t,e,n,r,i){switch(t>>>30){case 3:nT(e,n,r,i,0);break;case 2:nR(e,n,r,i);break;case 1:nz(e,n,r,i)}}function nc(t,e){var n,a,o=e.M,s=e.Nb,l=t.oc,h=t.pc+40,u=t.oc,c=t.pc+584,f=t.oc,d=t.pc+600;for(n=0;16>n;++n)l[h+32*n-1]=129;for(n=0;8>n;++n)u[c+32*n-1]=129,f[d+32*n-1]=129;for(0<o?l[h-1-32]=u[c-1-32]=f[d-1-32]=129:(i(l,h-32-1,127,21),i(u,c-32-1,127,9),i(f,d-32-1,127,9)),a=0;a<t.za;++a){var p=e.ya[e.aa+a];if(0<a){for(n=-1;16>n;++n)r(l,h+32*n-4,l,h+32*n+12,4);for(n=-1;8>n;++n)r(u,c+32*n-4,u,c+32*n+4,4),r(f,d+32*n-4,f,d+32*n+4,4)}var g=t.Gd,m=t.Hd+a,v=p.ad,b=p.Hc;if(0<o&&(r(l,h-32,g[m].y,0,16),r(u,c-32,g[m].f,0,8),r(f,d-32,g[m].ea,0,8)),p.Za){var y=l,w=h-32+16;for(0<o&&(a>=t.za-1?i(y,w,g[m].y[15],4):r(y,w,g[m+1].y,0,4)),n=0;4>n;n++)y[w+128+n]=y[w+256+n]=y[w+384+n]=y[w+0+n];for(n=0;16>n;++n,b<<=2)y=l,w=h+r4[n],rM[p.Ob[n]](y,w),nu(b,v,16*n,y,w)}else if(rj[y=nh(a,o,p.Ob[0])](l,h),0!=b)for(n=0;16>n;++n,b<<=2)nu(b,v,16*n,l,h+r4[n]);for(n=p.Gc,rF[y=nh(a,o,p.Dd)](u,c),rF[y](f,d),b=v,y=u,w=c,255&(p=0|n)&&(170&p?nD(b,256,y,w):nq(b,256,y,w)),p=f,b=d,255&(n>>=8)&&(170&n?nD(v,320,p,b):nq(v,320,p,b)),o<t.Ub-1&&(r(g[m].y,0,l,h+480,16),r(g[m].f,0,u,c+224,8),r(g[m].ea,0,f,d+224,8)),n=8*s*t.B,g=t.sa,m=t.ta+16*a+16*s*t.R,v=t.qa,p=t.ra+8*a+n,b=t.Ha,y=t.Ia+8*a+n,n=0;16>n;++n)r(g,m+n*t.R,l,h+32*n,16);for(n=0;8>n;++n)r(v,p+n*t.B,u,c+32*n,8),r(b,y+n*t.B,f,d+32*n,8)}}function nf(t,r,i,a,o,s,l,h,u){var c=[0],f=[0],d=0,p=null!=u?u.kd:0,g=null!=u?u:new eX;if(null==t||12>i)return 7;g.data=t,g.w=r,g.ha=i,r=[r],i=[i],g.gb=[g.gb];n:{var m=r,b=i,y=g.gb;if(e(null!=t),e(null!=b),e(null!=y),y[0]=0,12<=b[0]&&!n(t,m[0],"RIFF")){if(n(t,m[0]+8,"WEBP")){y=3;break n}var w=j(t,m[0]+4);if(12>w||0xfffffff6<w){y=3;break n}if(p&&w>b[0]-8){y=7;break n}y[0]=w,m[0]+=12,b[0]-=12}y=0}if(0!=y)return y;for(w=0<g.gb[0],i=i[0];;){n:{var x=t;b=r,y=i;var N=c,A=f,L=m=[0];if((C=d=[d])[0]=0,8>y[0])y=7;else{if(!n(x,b[0],"VP8X")){if(10!=j(x,b[0]+4)){y=3;break n}if(18>y[0]){y=7;break n}var k=j(x,b[0]+8),S=1+I(x,b[0]+12);if(0x80000000<=S*(x=1+I(x,b[0]+15))){y=3;break n}null!=L&&(L[0]=k),null!=N&&(N[0]=S),null!=A&&(A[0]=x),b[0]+=18,y[0]-=18,C[0]=1}y=0}}if(d=d[0],m=m[0],0!=y)return y;if(b=!!(2&m),!w&&d)return 3;if(null!=s&&(s[0]=!!(16&m)),null!=l&&(l[0]=b),null!=h&&(h[0]=0),l=c[0],m=f[0],d&&b&&null==u){y=0;break}if(4>i){y=7;break}if(w&&d||!w&&!d&&!n(t,r[0],"ALPH")){i=[i],g.na=[g.na],g.P=[g.P],g.Sa=[g.Sa];n:{k=t,y=r,w=i;var C=g.gb;N=g.na,A=g.P,L=g.Sa,S=22,e(null!=k),e(null!=w),x=y[0];var P=w[0];for(e(null!=N),e(null!=L),N[0]=null,A[0]=null,L[0]=0;;){if(y[0]=x,w[0]=P,8>P){y=7;break n}var E=j(k,x+4);if(0xfffffff6<E){y=3;break n}var M=8+E+1&-2;if(S+=M,0<C&&S>C){y=3;break n}if(!n(k,x,"VP8 ")||!n(k,x,"VP8L")){y=0;break n}if(P[0]<M){y=7;break n}n(k,x,"ALPH")||(N[0]=k,A[0]=x+8,L[0]=E),x+=M,P-=M}}if(i=i[0],g.na=g.na[0],g.P=g.P[0],g.Sa=g.Sa[0],0!=y)break}i=[i],g.Ja=[g.Ja],g.xa=[g.xa];n:if(C=t,y=r,w=i,N=g.gb[0],A=g.Ja,L=g.xa,x=!n(C,k=y[0],"VP8 "),S=!n(C,k,"VP8L"),e(null!=C),e(null!=w),e(null!=A),e(null!=L),8>w[0])y=7;else{if(x||S){if(C=j(C,k+4),12<=N&&C>N-12){y=3;break n}if(p&&C>w[0]-8){y=7;break n}A[0]=C,y[0]+=8,w[0]-=8,L[0]=S}else L[0]=5<=w[0]&&47==C[k+0]&&!(C[k+4]>>5),A[0]=w[0];y=0}if(i=i[0],g.Ja=g.Ja[0],g.xa=g.xa[0],r=r[0],0!=y)break;if(0xfffffff6<g.Ja)return 3;if(null==h||b||(h[0]=g.xa?2:1),l=[l],m=[m],g.xa){if(5>i){y=7;break}h=l,p=m,b=s,null==t||5>i?t=0:5<=i&&47==t[r+0]&&!(t[r+4]>>5)?(w=[0],C=[0],N=[0],v(A=new _,t,r,i),tg(A,w,C,N)?(null!=h&&(h[0]=w[0]),null!=p&&(p[0]=C[0]),null!=b&&(b[0]=N[0]),t=1):t=0):t=0}else{if(10>i){y=7;break}h=m,null==t||10>i||!tG(t,r+3,i-3)?t=0:(p=t[r+0]|t[r+1]<<8|t[r+2]<<16,b=16383&(t[r+7]<<8|t[r+6]),t=16383&(t[r+9]<<8|t[r+8]),1&p||3<(p>>1&7)||!(p>>4&1)||p>>5>=g.Ja||!b||!t?t=0:(l&&(l[0]=b),h&&(h[0]=t),t=1))}if(!t||(l=l[0],m=m[0],d&&(c[0]!=l||f[0]!=m)))return 3;null!=u&&(u[0]=g,u.offset=r-u.w,e(0xfffffff6>r-u.w),e(u.offset==u.ha-i));break}return 0==y||7==y&&d&&null==u?(null!=s&&(s[0]|=null!=g.na&&0<g.na.length),null!=a&&(a[0]=l),null!=o&&(o[0]=m),0):y}function nd(t,e,n){var r=e.width,i=e.height,a=0,o=0,s=r,l=i;if(e.Da=null!=t&&0<t.Da,e.Da&&(s=t.cd,l=t.bd,a=t.v,o=t.j,11>n||(a&=-2,o&=-2),0>a||0>o||0>=s||0>=l||a+s>r||o+l>i))return 0;if(e.v=a,e.j=o,e.va=a+s,e.o=o+l,e.U=s,e.T=l,e.da=null!=t&&0<t.da,e.da){if(!O(s,l,n=[t.ib],a=[t.hb]))return 0;e.ib=n[0],e.hb=a[0]}return e.ob=null!=t&&t.ob,e.Kb=null==t||!t.Sd,e.da&&(e.ob=e.ib<3*r/4&&e.hb<3*i/4,e.Kb=0),1}function np(t){if(null==t)return 2;if(11>t.S){var e=t.f.RGBA;e.fb+=(t.height-1)*e.A,e.A=-e.A}else e=t.f.kb,t=t.height,e.O+=(t-1)*e.fa,e.fa=-e.fa,e.N+=(t-1>>1)*e.Ab,e.Ab=-e.Ab,e.W+=(t-1>>1)*e.Db,e.Db=-e.Db,null!=e.F&&(e.J+=(t-1)*e.lb,e.lb=-e.lb);return 0}function ng(t,e,n,r){if(null==r||0>=t||0>=e)return 2;if(null!=n){if(n.Da){var i=n.cd,o=n.bd,s=-2&n.v,l=-2&n.j;if(0>s||0>l||0>=i||0>=o||s+i>t||l+o>e)return 2;t=i,e=o}if(n.da){if(!O(t,e,i=[n.ib],o=[n.hb]))return 2;t=i[0],e=o[0]}}r.width=t,r.height=e;n:{var h=r.width,u=r.height;if(t=r.S,0>=h||0>=u||!(t>=rr&&13>t))t=2;else{if(0>=r.Rd&&null==r.sd){s=o=i=e=0;var c=(l=h*r7[t])*u;if(11>t||(o=(u+1)/2*(e=(h+1)/2),12==t&&(s=(i=h)*u)),null==(u=a(c+2*o+s))){t=1;break n}r.sd=u,11>t?((h=r.f.RGBA).eb=u,h.fb=0,h.A=l,h.size=c):((h=r.f.kb).y=u,h.O=0,h.fa=l,h.Fd=c,h.f=u,h.N=0+c,h.Ab=e,h.Cd=o,h.ea=u,h.W=0+c+o,h.Db=e,h.Ed=o,12==t&&(h.F=u,h.J=0+c+2*o),h.Tc=s,h.lb=i)}if(e=1,i=r.S,o=r.width,s=r.height,i>=rr&&13>i)if(11>i)e&=(l=Math.abs((t=r.f.RGBA).A))*(s-1)+o<=t.size,e&=l>=o*r7[i],e&=null!=t.eb;else{t=r.f.kb,l=(o+1)/2,c=(s+1)/2,h=Math.abs(t.fa),u=Math.abs(t.Ab);var f=Math.abs(t.Db),d=Math.abs(t.lb),p=d*(s-1)+o;e&=h*(s-1)+o<=t.Fd,e&=u*(c-1)+l<=t.Cd,e=(e&=f*(c-1)+l<=t.Ed)&h>=o&u>=l&f>=l&null!=t.y&null!=t.f&null!=t.ea,12==i&&(e&=d>=o,e&=p<=t.Tc,e&=null!=t.F)}else e=0;t=2*!e}}return 0!=t||null!=n&&n.fd&&(t=np(r)),t}var nm=64,nv=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,0xffffff],nb=24,ny=32,nw=8,n_=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];D("Predictor0","PredictorAdd0"),t.Predictor0=function(){return 0xff000000},t.Predictor1=function(t){return t},t.Predictor2=function(t,e,n){return e[n+0]},t.Predictor3=function(t,e,n){return e[n+1]},t.Predictor4=function(t,e,n){return e[n-1]},t.Predictor5=function(t,e,n){return q(q(t,e[n+1]),e[n+0])},t.Predictor6=function(t,e,n){return q(t,e[n-1])},t.Predictor7=function(t,e,n){return q(t,e[n+0])},t.Predictor8=function(t,e,n){return q(e[n-1],e[n+0])},t.Predictor9=function(t,e,n){return q(e[n+0],e[n+1])},t.Predictor10=function(t,e,n){return q(q(t,e[n-1]),q(e[n+0],e[n+1]))},t.Predictor11=function(t,e,n){var r=e[n+0];return 0>=H(r>>24&255,t>>24&255,(e=e[n-1])>>24&255)+H(r>>16&255,t>>16&255,e>>16&255)+H(r>>8&255,t>>8&255,e>>8&255)+H(255&r,255&t,255&e)?r:t},t.Predictor12=function(t,e,n){var r=e[n+0];return(U((t>>24&255)+(r>>24&255)-((e=e[n-1])>>24&255))<<24|U((t>>16&255)+(r>>16&255)-(e>>16&255))<<16|U((t>>8&255)+(r>>8&255)-(e>>8&255))<<8|U((255&t)+(255&r)-(255&e)))>>>0},t.Predictor13=function(t,e,n){var r=e[n-1];return($((t=q(t,e[n+0]))>>24&255,r>>24&255)<<24|$(t>>16&255,r>>16&255)<<16|$(t>>8&255,r>>8&255)<<8|$(255&t,255&r))>>>0};var nx=t.PredictorAdd0;t.PredictorAdd1=W,D("Predictor2","PredictorAdd2"),D("Predictor3","PredictorAdd3"),D("Predictor4","PredictorAdd4"),D("Predictor5","PredictorAdd5"),D("Predictor6","PredictorAdd6"),D("Predictor7","PredictorAdd7"),D("Predictor8","PredictorAdd8"),D("Predictor9","PredictorAdd9"),D("Predictor10","PredictorAdd10"),D("Predictor11","PredictorAdd11"),D("Predictor12","PredictorAdd12"),D("Predictor13","PredictorAdd13");var nN=t.PredictorAdd2;G("ColorIndexInverseTransform","MapARGB","32b",function(t){return t>>8&255},function(t){return t}),G("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(t){return t},function(t){return t>>8&255});var nA,nL=t.ColorIndexInverseTransform,nk=t.MapARGB,nS=t.VP8LColorIndexInverseTransformAlpha,nC=t.MapAlpha,nP=t.VP8LPredictorsAdd=[];nP.length=16,(t.VP8LPredictors=[]).length=16,(t.VP8LPredictorsAdd_C=[]).length=16,(t.VP8LPredictors_C=[]).length=16;var nE,nI,nj,nM,nF,nB,nO,nT,nR,nD,nz,nq,nU,n$,nH,nW,nX,nY,nV,nG,nJ,nZ,nK,nQ,n1,n0,n2,n5,n3=a(511),n4=a(2041),n6=a(225),n8=a(767),n7=0,n9=n4,rt=n6,re=n8,rn=n3,rr=0,ri=1,ra=2,ro=3,rs=4,rl=5,rh=6,ru=7,rc=8,rf=9,rd=10,rp=[2,3,7],rg=[3,3,11],rm=[280,256,256,256,40],rv=[0,1,1,1,0],rb=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],ry=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],rw=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],r_=8,rx=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],rN=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],rA=null,rL=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],rk=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],rS=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],rC=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],rP=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],rE=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],rI=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],rj=[],rM=[],rF=[],rB=1,rO=2,rT=[],rR=[];e4("UpsampleRgbLinePair",ne,3),e4("UpsampleBgrLinePair",nn,3),e4("UpsampleRgbaLinePair",ns,4),e4("UpsampleBgraLinePair",no,4),e4("UpsampleArgbLinePair",na,4),e4("UpsampleRgba4444LinePair",ni,2),e4("UpsampleRgb565LinePair",nr,2);var rD=t.UpsampleRgbLinePair,rz=t.UpsampleBgrLinePair,rq=t.UpsampleRgbaLinePair,rU=t.UpsampleBgraLinePair,r$=t.UpsampleArgbLinePair,rH=t.UpsampleRgba4444LinePair,rW=t.UpsampleRgb565LinePair,rX=16,rY=32768,rV=-227,rG=482,rJ=6,rZ=16383,rK=0,rQ=a(256),r1=a(256),r0=a(256),r2=a(256),r5=a(rG-rV),r3=a(rG-rV);nl("YuvToRgbRow",ne,3),nl("YuvToBgrRow",nn,3),nl("YuvToRgbaRow",ns,4),nl("YuvToBgraRow",no,4),nl("YuvToArgbRow",na,4),nl("YuvToRgba4444Row",ni,2),nl("YuvToRgb565Row",nr,2);var r4=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],r6=[0,2,8],r8=[8,7,6,4,4,2,2,2,1,1,1,1];this.WebPDecodeRGBA=function(t,n,s,l,h){var u=ri,c=new eW,f=new to;c.ba=f,f.S=u,f.width=[f.width],f.height=[f.height];var d=f.width,p=f.height,g=new ts;if(null==g||null==t)var m=2;else e(null!=g),m=nf(t,n,s,g.width,g.height,g.Pd,g.Qd,g.format,null);if(0!=m?d=0:(null!=d&&(d[0]=g.width[0]),null!=p&&(p[0]=g.height[0]),d=1),d){f.width=f.width[0],f.height=f.height[0],null!=l&&(l[0]=f.width),null!=h&&(h[0]=f.height);n:{if(l=new tX,(h=new eX).data=t,h.w=n,h.ha=s,h.kd=1,n=[0],e(null!=h),(0==(t=nf(h.data,h.w,h.ha,null,null,null,n,null,h))||7==t)&&n[0]&&(t=4),0==(n=t)){if(e(null!=c),l.data=h.data,l.w=h.w+h.offset,l.ha=h.ha-h.offset,l.put=td,l.ac=tf,l.bc=tp,l.ma=c,h.xa){if(null==(t=tC())){c=1;break n}if(function(t,n){for(var r=[0],i=[0],a=[0];;){if(null==t)return 0;if(null==n)return t.a=2,0;if(t.l=n,t.a=0,v(t.m,n.data,n.w,n.ha),!tg(t.m,r,i,a)){t.a=3;break}if(t.xb=rO,n.width=r[0],n.height=i[0],!tP(r[0],i[0],1,t,null))break;return 1}return e(0!=t.a),0}(t,l)){if(l=0==(n=ng(l.width,l.height,c.Oa,c.ba))){r:{for(l=t;;){if(null==l){l=0;break r}if(e(null!=l.s.yc),e(null!=l.s.Ya),e(0<l.s.Wb),e(null!=(s=l.l)),e(null!=(h=s.ma)),0!=l.xb){if(l.ca=h.ba,l.tb=h.tb,e(null!=l.ca),!nd(h.Oa,s,ro)){l.a=2;break}if(!tE(l,s.width)||s.da)break;if((s.da||tr(l.ca.S))&&e3(),11>l.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=l.ca.f.kb.F&&e3()),l.Pb&&0<l.s.ua&&null==l.s.vb.X&&!M(l.s.vb,l.s.Wa.Xa)){l.a=1;break}l.xb=0}if(!tk(l,l.V,l.Ba,l.c,l.i,s.o,tx))break;h.Dc=l.Ma,l=1;break r}e(0!=l.a),l=0}l=!l}l&&(n=t.a)}else n=t.a}else if((t=new tY).Fa=h.na,t.P=h.P,t.qc=h.Sa,tJ(t,l)){if(0==(n=ng(l.width,l.height,c.Oa,c.ba))){if(t.Aa=0,s=c.Oa,e(null!=(h=t)),null!=s){if(0<(d=0>(d=s.Md)?0:100<d?255:255*d/100)){for(p=g=0;4>p;++p)12>(m=h.pb[p]).lc&&(m.ia=d*r8[0>m.lc?0:m.lc]>>3),g|=m.ia;g&&(alert("todo:VP8InitRandom"),h.ia=1)}h.Ga=s.Id,100<h.Ga?h.Ga=100:0>h.Ga&&(h.Ga=0)}(function(t,n){if(null==t)return 0;if(null==n)return tV(t,2,"NULL VP8Io parameter in VP8Decode().");if(!t.cb&&!tJ(t,n))return 0;if(e(t.cb),null==n.ac||n.ac(n)){n.ob&&(t.L=0);var s=r6[t.L];if(2==t.L?(t.yb=0,t.zb=0):(t.yb=n.v-s>>4,t.zb=n.j-s>>4,0>t.yb&&(t.yb=0),0>t.zb&&(t.zb=0)),t.Va=n.o+15+s>>4,t.Hb=n.va+15+s>>4,t.Hb>t.za&&(t.Hb=t.za),t.Va>t.Ub&&(t.Va=t.Ub),0<t.L){var l,h=t.ed;for(s=0;4>s;++s){if(t.Qa.Cb){var u=t.Qa.Lb[s];t.Qa.Fb||(u+=h.Tb)}else u=h.Tb;for(l=0;1>=l;++l){var c=t.gd[s][l],f=u;if(h.Pc&&(f+=h.vd[0],l&&(f+=h.od[0])),0<(f=0>f?0:63<f?63:f)){var d=f;0<h.wb&&(d=4<h.wb?d>>2:d>>1)>9-h.wb&&(d=9-h.wb),1>d&&(d=1),c.dd=d,c.tc=2*f+d,c.ld=40<=f?2:+(15<=f)}else c.tc=0;c.La=l}}}s=0}else tV(t,6,"Frame setup failed"),s=t.a;if(s=0==s){if(s){t.$c=0,0<t.Aa||(t.Ic=1);r:{s=t.Ic,h=4*(d=t.za);var p=32*d,g=d+1,m=0<t.L?d*(0<t.Aa?2:1):0,b=(2==t.Aa?2:1)*d;if((c=h+832+(l=3*(16*s+r6[t.L])/2*p)+(u=null!=t.Fa&&0<t.Fa.length?t.Kc.c*t.Kc.i:0))!=c)s=0;else{if(c>t.Vb){if(t.Vb=0,t.Ec=a(c),t.Fc=0,null==t.Ec){s=tV(t,1,"no memory during frame initialization.");break r}t.Vb=c}c=t.Ec,f=t.Fc,t.Ac=c,t.Bc=f,f+=h,t.Gd=o(p,t$),t.Hd=0,t.rb=o(g+1,tD),t.sb=1,t.wa=m?o(m,tR):null,t.Y=0,t.D.Nb=0,t.D.wa=t.wa,t.D.Y=t.Y,0<t.Aa&&(t.D.Y+=d),e(!0),t.oc=c,t.pc=f,f+=832,t.ya=o(b,tq),t.aa=0,t.D.ya=t.ya,t.D.aa=t.aa,2==t.Aa&&(t.D.aa+=d),t.R=16*d,t.B=8*d,d=(p=r6[t.L])*t.R,p=p/2*t.B,t.sa=c,t.ta=f+d,t.qa=t.sa,t.ra=t.ta+16*s*t.R+p,t.Ha=t.qa,t.Ia=t.ra+8*s*t.B+p,t.$c=0,f+=l,t.mb=u?c:null,t.nb=u?f:null,e(f+u<=t.Fc+t.Vb),tK(t),i(t.Ac,t.Bc,0,h),s=1}}if(s){if(n.ka=0,n.y=t.sa,n.O=t.ta,n.f=t.qa,n.N=t.ra,n.ea=t.Ha,n.Vd=t.Ia,n.fa=t.R,n.Rc=t.B,n.F=null,n.J=0,!n7){for(s=-255;255>=s;++s)n3[255+s]=0>s?-s:s;for(s=-1020;1020>=s;++s)n4[1020+s]=-128>s?-128:127<s?127:s;for(s=-112;112>=s;++s)n6[112+s]=-16>s?-16:15<s?15:s;for(s=-255;510>=s;++s)n8[255+s]=0>s?0:255<s?255:s;n7=1}nO=t7,nT=t3,nD=t4,nz=t6,nq=t8,nR=t5,nU=eT,n$=eR,nH=eq,nW=eU,nX=eD,nY=ez,nV=e$,nG=eH,nJ=eI,nZ=ej,nK=eM,nQ=eF,rM[0]=ed,rM[1]=et,rM[2]=ec,rM[3]=ef,rM[4]=ep,rM[5]=em,rM[6]=eg,rM[7]=ev,rM[8]=ey,rM[9]=eb,rj[0]=eo,rj[1]=en,rj[2]=er,rj[3]=ei,rj[4]=es,rj[5]=el,rj[6]=eh,rF[0]=eN,rF[1]=ee,rF[2]=ew,rF[3]=e_,rF[4]=eL,rF[5]=eA,rF[6]=ek,s=1}else s=0}s&&(s=function(t,n){for(t.M=0;t.M<t.Va;++t.M){var o,s=t.Jc[t.M&t.Xb],l=t.m,h=t;for(o=0;o<h.za;++o){var u=l,c=h,f=c.Ac,d=c.Bc+4*o,p=c.zc,g=c.ya[c.aa+o];if(c.Qa.Bb?g.$b=C(u,c.Pa.jb[0])?2+C(u,c.Pa.jb[2]):C(u,c.Pa.jb[1]):g.$b=0,c.kc&&(g.Ad=C(u,c.Bd)),g.Za=!C(u,145)+0,g.Za){var m=g.Ob,b=0;for(c=0;4>c;++c){var y,w=p[0+c];for(y=0;4>y;++y){w=rP[f[d+y]][w];for(var _=rS[C(u,w[0])];0<_;)_=rS[2*_+C(u,w[_])];w=-_,f[d+y]=w}r(m,b,f,d,4),b+=4,p[0+c]=w}}else w=C(u,156)?C(u,128)?1:3:2*!!C(u,163),g.Ob[0]=w,i(f,d,w,4),i(p,0,w,4);g.Dd=C(u,142)?C(u,114)?C(u,183)?1:3:2:0}if(h.m.Ka)return tV(t,7,"Premature end-of-partition0 encountered.");for(;t.ja<t.za;++t.ja){if(h=s,u=(l=t).rb[l.sb-1],f=l.rb[l.sb+l.ja],o=l.ya[l.aa+l.ja],d=l.kc?o.Ad:0)u.la=f.la=0,o.Za||(u.Na=f.Na=0),o.Hc=0,o.Gc=0,o.ia=0;else{if(u=f,f=h,d=l.Pa.Xc,p=l.ya[l.aa+l.ja],g=l.pb[p.$b],c=p.ad,m=0,b=l.rb[l.sb-1],w=y=0,i(c,m,0,384),p.Za)var x,A,k=0,S=d[3];else{_=a(16);var P=u.Na+b.Na;if(P=rA(f,d[1],P,g.Eb,0,_,0),u.Na=b.Na=(0<P)+0,1<P)nO(_,0,c,m);else{var E=_[0]+3>>3;for(_=0;256>_;_+=16)c[m+_]=E}k=1,S=d[0]}var I=15&u.la,j=15&b.la;for(_=0;4>_;++_){var M=1&j;for(E=A=0;4>E;++E)I=I>>1|(M=(P=rA(f,S,P=M+(1&I),g.Sc,k,c,m))>k)<<7,A=A<<2|(3<P?3:1<P?2:0!=c[m+0]),m+=16;I>>=4,j=j>>1|M<<7,y=(y<<8|A)>>>0}for(S=I,k=j>>4,x=0;4>x;x+=2){for(A=0,I=u.la>>4+x,j=b.la>>4+x,_=0;2>_;++_){for(M=1&j,E=0;2>E;++E)P=M+(1&I),I=I>>1|(M=0<(P=rA(f,d[2],P,g.Qc,0,c,m)))<<3,A=A<<2|(3<P?3:1<P?2:0!=c[m+0]),m+=16;I>>=2,j=j>>1|M<<5}w|=A<<4*x,S|=I<<4<<x,k|=(240&j)<<x}u.la=S,b.la=k,p.Hc=y,p.Gc=w,p.ia=43690&w?0:g.ia,d=!(y|w)}if(0<l.L&&(l.wa[l.Y+l.ja]=l.gd[o.$b][o.Za],l.wa[l.Y+l.ja].La|=!d),h.Ka)return tV(t,7,"Premature end-of-file encountered.")}if(tK(t),l=n,h=1,o=(s=t).D,u=0<s.L&&s.M>=s.zb&&s.M<=s.Va,0==s.Aa)r:{if(o.M=s.M,o.uc=u,nc(s,o),h=1,o=(A=s.D).Nb,u=(w=r6[s.L])*s.R,f=w/2*s.B,_=16*o*s.R,E=8*o*s.B,d=s.sa,p=s.ta-u+_,g=s.qa,c=s.ra-f+E,m=s.Ha,b=s.Ia-f+E,j=0==(I=A.M),y=I>=s.Va-1,2==s.Aa&&nc(s,A),A.uc)for(M=(P=s).D.M,e(P.D.uc),A=P.yb;A<P.Hb;++A){k=A,S=M;var F=(B=(H=P).D).Nb;x=H.R;var B=B.wa[B.Y+k],O=H.sa,T=H.ta+16*F*x+16*k,R=B.dd,D=B.tc;if(0!=D)if(e(3<=D),1==H.L)0<k&&nZ(O,T,x,D+4),B.La&&nQ(O,T,x,D),0<S&&nJ(O,T,x,D+4),B.La&&nK(O,T,x,D);else{var z=H.B,q=H.qa,U=H.ra+8*F*z+8*k,$=H.Ha,H=H.Ia+8*F*z+8*k;F=B.ld,0<k&&(n$(O,T,x,D+4,R,F),nW(q,U,$,H,z,D+4,R,F)),B.La&&(nY(O,T,x,D,R,F),nG(q,U,$,H,z,D,R,F)),0<S&&(nU(O,T,x,D+4,R,F),nH(q,U,$,H,z,D+4,R,F)),B.La&&(nX(O,T,x,D,R,F),nV(q,U,$,H,z,D,R,F))}}if(s.ia&&alert("todo:DitherRow"),null!=l.put){if(A=16*I,I=16*(I+1),j?(l.y=s.sa,l.O=s.ta+_,l.f=s.qa,l.N=s.ra+E,l.ea=s.Ha,l.W=s.Ia+E):(A-=w,l.y=d,l.O=p,l.f=g,l.N=c,l.ea=m,l.W=b),y||(I-=w),I>l.o&&(I=l.o),l.F=null,l.J=null,null!=s.Fa&&0<s.Fa.length&&A<I&&(l.J=function(t,n,i,o){var s=n.width,l=n.o;if(e(null!=t&&null!=n),0>i||0>=o||i+o>l)return null;if(!t.Cc){if(null==t.ga){if(t.ga=new eJ,(k=null==t.ga)||(k=n.width*n.o,e(0==t.Gb.length),t.Gb=a(k),t.Uc=0,null==t.Gb?k=0:(t.mb=t.Gb,t.nb=t.Uc,t.rc=null,k=1),k=!k),!k){k=t.ga;var h=t.Fa,u=t.P,c=t.qc,f=t.mb,d=t.nb,p=u+1,g=c-1,m=k.l;if(e(null!=h&&null!=f&&null!=n),rT[0]=null,rT[1]=eZ,rT[2]=eK,rT[3]=eQ,k.ca=f,k.tb=d,k.c=n.width,k.i=n.height,e(0<k.c&&0<k.i),1>=c)n=0;else if(k.$a=3&h[u+0],k.Z=h[u+0]>>2&3,k.Lc=h[u+0]>>4&3,u=h[u+0]>>6&3,0>k.$a||1<k.$a||4<=k.Z||1<k.Lc||u)n=0;else if(m.put=td,m.ac=tf,m.bc=tp,m.ma=k,m.width=n.width,m.height=n.height,m.Da=n.Da,m.v=n.v,m.va=n.va,m.j=n.j,m.o=n.o,k.$a)n:{for(e(1==k.$a),n=tC();;){if(null==n){n=0;break n}if(e(null!=k),k.mc=n,n.c=k.c,n.i=k.i,n.l=k.l,n.l.ma=k,n.l.width=k.c,n.l.height=k.i,n.a=0,v(n.m,h,p,g),!tP(k.c,k.i,1,n,null)||(1==n.ab&&3==n.gc[0].hc&&tN(n.s)?(k.ic=1,h=n.c*n.i,n.Ta=null,n.Ua=0,n.V=a(h),n.Ba=0,null==n.V?(n.a=1,n=0):n=1):(k.ic=0,n=tE(n,k.c)),!n))break;n=1;break n}k.mc=null,n=0}else n=g>=k.c*k.i;k=!n}if(k)return null;1!=t.ga.Lc?t.Ga=0:o=l-i}e(null!=t.ga),e(i+o<=l);n:{if(n=(h=t.ga).c,l=h.l.o,0==h.$a){if(p=t.rc,g=t.Vc,m=t.Fa,u=t.P+1+i*n,c=t.mb,f=t.nb+i*n,e(u<=t.P+t.qc),0!=h.Z)for(e(null!=rT[h.Z]),k=0;k<o;++k)rT[h.Z](p,g,m,u,c,f,n),p=c,g=f,f+=n,u+=n;else for(k=0;k<o;++k)r(c,f,m,u,n),p=c,g=f,f+=n,u+=n;t.rc=p,t.Vc=g}else{if(e(null!=h.mc),n=i+o,e(null!=(k=h.mc)),e(n<=k.i),k.C>=n)n=1;else if(h.ic||e3(),h.ic){h=k.V,p=k.Ba,g=k.c;var b=k.i,y=(m=1,u=k.$/g,c=k.$%g,f=k.m,d=k.s,k.$),w=g*b,_=g*n,x=d.wc,A=y<_?tw(d,c,u):null;e(y<=w),e(n<=b),e(tN(d));r:for(;;){for(;!f.h&&y<_;){if(c&x||(A=tw(d,c,u)),e(null!=A),L(f),256>(b=tb(A.G[0],A.H[0],f)))h[p+y]=b,++y,++c>=g&&(c=0,++u<=n&&!(u%16)&&tL(k,u));else{if(!(280>b)){m=0;break r}b=tm(b-256,f);var k,S,C=tb(A.G[4],A.H[4],f);if(L(f),!(y>=(C=tv(g,C=tm(C,f)))&&w-y>=b)){m=0;break r}for(S=0;S<b;++S)h[p+y+S]=h[p+y+S-C];for(y+=b,c+=b;c>=g;)c-=g,++u<=n&&!(u%16)&&tL(k,u);y<_&&c&x&&(A=tw(d,c,u))}e(f.h==N(f))}tL(k,u>n?n:u);break}!m||f.h&&y<w?(m=0,k.a=f.h?5:3):k.$=y,n=m}else n=tk(k,k.V,k.Ba,k.c,k.i,n,tI);if(!n){o=0;break n}}i+o>=l&&(t.Cc=1),o=1}if(!o)return null;if(t.Cc&&(null!=(o=t.ga)&&(o.mc=null),t.ga=null,0<t.Ga))return alert("todo:WebPDequantizeLevels"),null}return t.nb+i*s}(s,l,A,I-A),l.F=s.mb,null==l.F&&0==l.F.length)){h=tV(s,3,"Could not decode alpha data.");break r}A<l.j&&(w=l.j-A,A=l.j,e(!(1&w)),l.O+=s.R*w,l.N+=s.B*(w>>1),l.W+=s.B*(w>>1),null!=l.F&&(l.J+=l.width*w)),A<I&&(l.O+=l.v,l.N+=l.v>>1,l.W+=l.v>>1,null!=l.F&&(l.J+=l.v),l.ka=A-l.j,l.U=l.va-l.v,l.T=I-A,h=l.put(l))}o+1!=s.Ic||y||(r(s.sa,s.ta-u,d,p+16*s.R,u),r(s.qa,s.ra-f,g,c+8*s.B,f),r(s.Ha,s.Ia-f,m,b+8*s.B,f))}if(!h)return tV(t,6,"Output aborted.")}return 1}(t,n)),null!=n.bc&&n.bc(n),s&=1}return s?(t.cb=0,s):0})(t,l)||(n=t.a)}}else n=t.a;0==n&&null!=c.Oa&&c.Oa.fd&&(n=np(c.ba))}c=n}u=0!=c?null:11>u?f.f.RGBA.eb:f.f.kb.y}else u=null;return u};var r7=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function h(t,e){return(t[e+0]|t[e+1]<<8|t[e+2]<<16)>>>0}function u(t,e){return(t[e+0]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}new l;var c=[0],f=[0],d=[],p=new l,g=function(t,e){var n={},r=0,i=!1,a=0,o=0;if(n.frames=[],!function(t,e){for(var n=0;n<4;n++)if(t[e+n]!="RIFF".charCodeAt(n))return!0;return!1}(t,e)){for(u(t,e+=4),e+=8;e<t.length;){var s,l,c,f=function(t,e){for(var n="",r=0;r<4;r++)n+=String.fromCharCode(t[e++]);return n}(t,e),d=u(t,e+=4);e+=4;var p=d+(1&d);switch(f){case"VP8 ":case"VP8L":void 0===n.frames[r]&&(n.frames[r]={}),(c=n.frames[r]).src_off=i?o:e-8,c.src_size=a+d+8,r++,i&&(i=!1,a=0,o=0);break;case"VP8X":(c=n.header={}).feature_flags=t[e];var g=e+4;c.canvas_width=1+h(t,g),g+=3,c.canvas_height=1+h(t,g),g+=3;break;case"ALPH":i=!0,a=p+8,o=e-8;break;case"ANIM":(c=n.header).bgcolor=u(t,e),g=e+4,c.loop_count=t[(s=g)+0]|t[s+1]<<8,g+=2;break;case"ANMF":(c=n.frames[r]={}).offset_x=2*h(t,e),e+=3,c.offset_y=2*h(t,e),e+=3,c.width=1+h(t,e),e+=3,c.height=1+h(t,e),e+=3,c.duration=h(t,e),e+=3,l=t[e++],c.dispose=1&l,c.blend=l>>1&1}"ANMF"!=f&&(e+=p)}return n}}(t,0);g.response=t,g.rgbaoutput=!0,g.dataurl=!1;var m=g.header?g.header:null,v=g.frames?g.frames:null;if(m){m.loop_counter=m.loop_count,c=[m.canvas_height],f=[m.canvas_width];for(var b=0;b<v.length&&0!=v[b].blend;b++);}var y=v[0],w=p.WebPDecodeRGBA(t,y.src_off,y.src_size,f,c);y.rgba=w,y.imgwidth=f[0],y.imgheight=c[0];for(var _=0;_<f[0]*c[0]*4;_++)d[_]=w[_];return this.width=f,this.height=c,this.data=d,this}hz=sB.API,hJ=function(t){return t=t||{},this.isStrokeTransparent=t.isStrokeTransparent||!1,this.strokeOpacity=t.strokeOpacity||1,this.strokeStyle=t.strokeStyle||"#000000",this.fillStyle=t.fillStyle||"#000000",this.isFillTransparent=t.isFillTransparent||!1,this.fillOpacity=t.fillOpacity||1,this.font=t.font||"10px sans-serif",this.textBaseline=t.textBaseline||"alphabetic",this.textAlign=t.textAlign||"left",this.lineWidth=t.lineWidth||1,this.lineJoin=t.lineJoin||"miter",this.lineCap=t.lineCap||"butt",this.path=t.path||[],this.transform=void 0!==t.transform?t.transform.clone():new hV,this.globalCompositeOperation=t.globalCompositeOperation||"normal",this.globalAlpha=t.globalAlpha||1,this.clip_path=t.clip_path||[],this.currentPoint=t.currentPoint||new hX,this.miterLimit=t.miterLimit||10,this.lastPoint=t.lastPoint||new hX,this.lineDashOffset=t.lineDashOffset||0,this.lineDash=t.lineDash||[],this.margin=t.margin||[0,0,0,0],this.prevPageLastElemOffset=t.prevPageLastElemOffset||0,this.ignoreClearRect="boolean"!=typeof t.ignoreClearRect||t.ignoreClearRect,this},hz.events.push(["initialized",function(){this.context2d=new hZ(this),hq=this.internal.f2,hU=this.internal.getCoordinateString,h$=this.internal.getVerticalCoordinateString,hH=this.internal.getHorizontalCoordinate,hW=this.internal.getVerticalCoordinate,hX=this.internal.Point,hY=this.internal.Rectangle,hV=this.internal.Matrix,hG=new hJ}]),(hZ=function(t){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}}),Object.defineProperty(this,"pdf",{get:function(){return t}});var e=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return e},set:function(t){e=!!t}});var n=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return n},set:function(t){n=!!t}});var r=0;Object.defineProperty(this,"posX",{get:function(){return r},set:function(t){isNaN(t)||(r=t)}});var i=0;Object.defineProperty(this,"posY",{get:function(){return i},set:function(t){isNaN(t)||(i=t)}}),Object.defineProperty(this,"margin",{get:function(){return hG.margin},set:function(t){var e;"number"==typeof t?e=[t,t,t,t]:((e=[,,,,])[0]=t[0],e[1]=t.length>=2?t[1]:e[0],e[2]=t.length>=3?t[2]:e[0],e[3]=t.length>=4?t[3]:e[1]),hG.margin=e}});var a=!1;Object.defineProperty(this,"autoPaging",{get:function(){return a},set:function(t){a=t}});var o=0;Object.defineProperty(this,"lastBreak",{get:function(){return o},set:function(t){o=t}});var s=[];Object.defineProperty(this,"pageBreaks",{get:function(){return s},set:function(t){s=t}}),Object.defineProperty(this,"ctx",{get:function(){return hG},set:function(t){t instanceof hJ&&(hG=t)}}),Object.defineProperty(this,"path",{get:function(){return hG.path},set:function(t){hG.path=t}});var l=[];Object.defineProperty(this,"ctxStack",{get:function(){return l},set:function(t){l=t}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(t){var e;e=hK(t),this.ctx.fillStyle=e.style,this.ctx.isFillTransparent=0===e.a,this.ctx.fillOpacity=e.a,this.pdf.setFillColor(e.r,e.g,e.b,{a:e.a}),this.pdf.setTextColor(e.r,e.g,e.b,{a:e.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(t){var e=hK(t);this.ctx.strokeStyle=e.style,this.ctx.isStrokeTransparent=0===e.a,this.ctx.strokeOpacity=e.a,0===e.a?this.pdf.setDrawColor(255,255,255):(e.a,this.pdf.setDrawColor(e.r,e.g,e.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(t){-1!==["butt","round","square"].indexOf(t)&&(this.ctx.lineCap=t,this.pdf.setLineCap(t))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(t){isNaN(t)||(this.ctx.lineWidth=t,this.pdf.setLineWidth(t))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(t){-1!==["bevel","round","miter"].indexOf(t)&&(this.ctx.lineJoin=t,this.pdf.setLineJoin(t))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(t){isNaN(t)||(this.ctx.miterLimit=t,this.pdf.setMiterLimit(t))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(t){this.ctx.textBaseline=t}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(t){-1!==["right","end","center","left","start"].indexOf(t)&&(this.ctx.textAlign=t)}});var h=null,u=null,c=null;Object.defineProperty(this,"fontFaces",{get:function(){return c},set:function(t){h=null,u=null,c=t}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(t){var e;if(this.ctx.font=t,null!==(e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(t))){var n=e[1];e[2];var r=e[3],i=e[4];e[5];var a=e[6],o=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(i)[2];i="px"===o?Math.floor(parseFloat(i)*this.pdf.internal.scaleFactor):"em"===o?Math.floor(parseFloat(i)*this.pdf.getFontSize()):Math.floor(parseFloat(i)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(i);var s=function(t){var e,n,r=[],i=t.trim();if(""===i)return hk;if(i in lx)return[lx[i]];for(;""!==i;){switch(n=null,e=(i=lA(i)).charAt(0)){case'"':case"'":n=function(t,e){for(var n=0;n<t.length;){if(t.charAt(n)===e)return[t.substring(0,n),t.substring(n+1)];n+=1}return null}(i.substring(1),e);break;default:n=function(t){var e=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return null===e?null:[e[0],t.substring(e[0].length)]}(i)}if(null===n||(r.push(n[0]),""!==(i=lA(n[1]))&&","!==i.charAt(0)))return hk;i=i.replace(/^,/,"")}return r}(a);if(this.fontFaces){var l=function(t,e,n){for(var r=(n=n||{}).defaultFontFamily||"times",i=Object.assign({},l_,n.genericFontFamilies||{}),a=null,o=null,s=0;s<e.length;++s)if(i[(a=ly(e[s])).family]&&(a.family=i[a.family]),t.hasOwnProperty(a.family)){o=t[a.family];break}if(!(o=o||t[r]))throw Error("Could not find a font-family for the rule '"+lN(a)+"' and default family '"+r+"'.");if(o=function(t,e){if(e[t])return e[t];var n=lm[t],r=n<=lm.normal?-1:1,i=lw(e,lg,n,r);if(!i)throw Error("Could not find a matching font-stretch value for "+t);return i}(a.stretch,o),o=function(t,e){if(e[t])return e[t];for(var n=lp[t],r=0;r<n.length;++r)if(e[n[r]])return e[n[r]];throw Error("Could not find a matching font-style for "+t)}(a.style,o),!(o=function(t,e){if(e[t])return e[t];if(400===t&&e[500])return e[500];if(500===t&&e[400])return e[400];var n=lw(e,lv,lb[t],t<400?-1:1);if(!n)throw Error("Could not find a matching font-weight for value "+t);return n}(a.weight,o)))throw Error("Failed to resolve a font for the rule '"+lN(a)+"'.");return o}(function(t,e){var n,r=t.getFontList(),i=JSON.stringify(r);return(null===h||u!==i)&&(h=function(t){for(var e={},n=0;n<t.length;++n){var r=ly(t[n]),i=r.family,a=r.stretch,o=r.style,s=r.weight;e[i]=e[i]||{},e[i][a]=e[i][a]||{},e[i][a][o]=e[i][a][o]||{},e[i][a][o][s]=r}return e}((n=[],Object.keys(r).forEach(function(t){r[t].forEach(function(e){var r=null;switch(e){case"bold":r={family:t,weight:"bold"};break;case"italic":r={family:t,style:"italic"};break;case"bolditalic":r={family:t,weight:"bold",style:"italic"};break;case"":case"normal":r={family:t}}null!==r&&(r.ref={name:t,style:e},n.push(r))})}),n).concat(e)),u=i),h}(this.pdf,this.fontFaces),s.map(function(t){return{family:t,stretch:"normal",weight:r,style:n}}));this.pdf.setFont(l.ref.name,l.ref.style)}else{var c="";("bold"===r||parseInt(r,10)>=700||"bold"===n)&&(c="bold"),"italic"===n&&(c+="italic"),0===c.length&&(c="normal");for(var f="",d={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},p=0;p<s.length;p++){if(void 0!==this.pdf.internal.getFont(s[p],c,{noFallback:!0,disableWarning:!0})){f=s[p];break}if("bolditalic"===c&&void 0!==this.pdf.internal.getFont(s[p],"bold",{noFallback:!0,disableWarning:!0}))f=s[p],c="bold";else if(void 0!==this.pdf.internal.getFont(s[p],"normal",{noFallback:!0,disableWarning:!0})){f=s[p],c="normal";break}}if(""===f){for(var g=0;g<s.length;g++)if(d[s[g]]){f=d[s[g]];break}}f=""===f?"Times":f,this.pdf.setFont(f,c)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(t){this.ctx.globalCompositeOperation=t}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(t){this.ctx.globalAlpha=t}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(t){this.ctx.lineDashOffset=t,ud.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(t){this.ctx.lineDash=t,ud.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(t){this.ctx.ignoreClearRect=!!t}})}).prototype.setLineDash=function(t){this.lineDash=t},hZ.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},hZ.prototype.fill=function(){h6.call(this,"fill",!1)},hZ.prototype.stroke=function(){h6.call(this,"stroke",!1)},hZ.prototype.beginPath=function(){this.path=[{type:"begin"}]},hZ.prototype.moveTo=function(t,e){if(isNaN(t)||isNaN(e))throw so("jsPDF.context2d.moveTo: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.moveTo");var n=this.ctx.transform.applyToPoint(new hX(t,e));this.path.push({type:"mt",x:n.x,y:n.y}),this.ctx.lastPoint=new hX(t,e)},hZ.prototype.closePath=function(){var t=new hX(0,0),e=0;for(e=this.path.length-1;-1!==e;e--)if("begin"===this.path[e].type&&"object"===(0,nH.default)(this.path[e+1])&&"number"==typeof this.path[e+1].x){t=new hX(this.path[e+1].x,this.path[e+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new hX(t.x,t.y)},hZ.prototype.lineTo=function(t,e){if(isNaN(t)||isNaN(e))throw so("jsPDF.context2d.lineTo: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.lineTo");var n=this.ctx.transform.applyToPoint(new hX(t,e));this.path.push({type:"lt",x:n.x,y:n.y}),this.ctx.lastPoint=new hX(n.x,n.y)},hZ.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),h6.call(this,null,!0)},hZ.prototype.quadraticCurveTo=function(t,e,n,r){if(isNaN(n)||isNaN(r)||isNaN(t)||isNaN(e))throw so("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var i=this.ctx.transform.applyToPoint(new hX(n,r)),a=this.ctx.transform.applyToPoint(new hX(t,e));this.path.push({type:"qct",x1:a.x,y1:a.y,x:i.x,y:i.y}),this.ctx.lastPoint=new hX(i.x,i.y)},hZ.prototype.bezierCurveTo=function(t,e,n,r,i,a){if(isNaN(i)||isNaN(a)||isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw so("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var o=this.ctx.transform.applyToPoint(new hX(i,a)),s=this.ctx.transform.applyToPoint(new hX(t,e)),l=this.ctx.transform.applyToPoint(new hX(n,r));this.path.push({type:"bct",x1:s.x,y1:s.y,x2:l.x,y2:l.y,x:o.x,y:o.y}),this.ctx.lastPoint=new hX(o.x,o.y)},hZ.prototype.arc=function(t,e,n,r,i,a){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i))throw so("jsPDF.context2d.arc: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.arc");if(a=!!a,!this.ctx.transform.isIdentity){var o=this.ctx.transform.applyToPoint(new hX(t,e));t=o.x,e=o.y;var s=this.ctx.transform.applyToPoint(new hX(0,n)),l=this.ctx.transform.applyToPoint(new hX(0,0));n=Math.sqrt(Math.pow(s.x-l.x,2)+Math.pow(s.y-l.y,2))}Math.abs(i-r)>=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:a})},hZ.prototype.arcTo=function(t,e,n,r,i){throw Error("arcTo not implemented.")},hZ.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw so("jsPDF.context2d.rect: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},hZ.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw so("jsPDF.context2d.fillRect: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!hQ.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},hZ.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw so("jsPDF.context2d.strokeRect: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.strokeRect");h1.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},hZ.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw so("jsPDF.context2d.clearRect: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},hZ.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("q");if(this.pdf.setPage(e),t){this.ctx.fontSize=this.pdf.internal.getFontSize();var r=new hJ(this.ctx);this.ctxStack.push(this.ctx),this.ctx=r}},hZ.prototype.restore=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n<this.pdf.internal.getNumberOfPages();n++)this.pdf.setPage(n+1),this.pdf.internal.out("Q");this.pdf.setPage(e),t&&0!==this.ctxStack.length&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},hZ.prototype.toDataURL=function(){throw Error("toDataUrl not implemented.")},hK=function(t){var e,n,r,i;if(!0===t.isCanvasGradient&&(t=t.getColor()),!t)return{r:0,g:0,b:0,a:0,style:t};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(t))e=0,n=0,r=0,i=0;else{var a=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(t);if(null!==a)e=parseInt(a[1]),n=parseInt(a[2]),r=parseInt(a[3]),i=1;else if(null!==(a=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(t)))e=parseInt(a[1]),n=parseInt(a[2]),r=parseInt(a[3]),i=parseFloat(a[4]);else{if(i=1,"string"==typeof t&&"#"!==t.charAt(0)){var o=new sc(t);t=o.ok?o.toHex():"#000000"}4===t.length?(e=t.substring(1,2),e+=e,n=t.substring(2,3),n+=n,r=t.substring(3,4),r+=r):(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7)),e=parseInt(e,16),n=parseInt(n,16),r=parseInt(r,16)}}return{r:e,g:n,b:r,a:i,style:t}},hQ=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},h1=function(){return!!(this.ctx.isStrokeTransparent||0==this.globalAlpha)},hZ.prototype.fillText=function(t,e,n,r){if(isNaN(e)||isNaN(n)||"string"!=typeof t)throw so("jsPDF.context2d.fillText: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.fillText");if(r=isNaN(r)?void 0:r,!hQ.call(this)){var i=uu(this.ctx.transform.rotation);ui.call(this,{text:t,x:e,y:n,scale:this.ctx.transform.scaleX,angle:i,align:this.textAlign,maxWidth:r})}},hZ.prototype.strokeText=function(t,e,n,r){if(isNaN(e)||isNaN(n)||"string"!=typeof t)throw so("jsPDF.context2d.strokeText: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!h1.call(this)){r=isNaN(r)?void 0:r;var i=uu(this.ctx.transform.rotation);ui.call(this,{text:t,x:e,y:n,scale:this.ctx.transform.scaleX,renderingMode:"stroke",angle:i,align:this.textAlign,maxWidth:r})}},hZ.prototype.measureText=function(t){if("string"!=typeof t)throw so("jsPDF.context2d.measureText: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.measureText");var e=this.pdf,n=this.pdf.internal.scaleFactor,r=e.internal.getFontSize(),i=e.getStringUnitWidth(t)*r/e.internal.scaleFactor;return new function(t){var e=(t=t||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return e}}),this}({width:i*=Math.round(96*n/72*1e4)/1e4})},hZ.prototype.scale=function(t,e){if(isNaN(t)||isNaN(e))throw so("jsPDF.context2d.scale: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.scale");var n=new hV(t,0,0,e,0,0);this.ctx.transform=this.ctx.transform.multiply(n)},hZ.prototype.rotate=function(t){if(isNaN(t))throw so("jsPDF.context2d.rotate: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.rotate");var e=new hV(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0);this.ctx.transform=this.ctx.transform.multiply(e)},hZ.prototype.translate=function(t,e){if(isNaN(t)||isNaN(e))throw so("jsPDF.context2d.translate: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.translate");var n=new hV(1,0,0,1,t,e);this.ctx.transform=this.ctx.transform.multiply(n)},hZ.prototype.transform=function(t,e,n,r,i,a){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(a))throw so("jsPDF.context2d.transform: Invalid arguments",arguments),Error("Invalid arguments passed to jsPDF.context2d.transform");var o=new hV(t,e,n,r,i,a);this.ctx.transform=this.ctx.transform.multiply(o)},hZ.prototype.setTransform=function(t,e,n,r,i,a){t=isNaN(t)?1:t,e=isNaN(e)?0:e,n=isNaN(n)?0:n,r=isNaN(r)?1:r,i=isNaN(i)?0:i,a=isNaN(a)?0:a,this.ctx.transform=new hV(t,e,n,r,i,a)},h0=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0},hZ.prototype.drawImage=function(t,e,n,r,i,a,o,s,l){var h=this.pdf.getImageProperties(t),u=1,c=1,f=1,d=1;void 0!==r&&void 0!==s&&(f=s/r,d=l/i,u=h.width/r*s/r,c=h.height/i*l/i),void 0===a&&(a=e,o=n,e=0,n=0),void 0!==r&&void 0===s&&(s=r,l=i),void 0===r&&void 0===s&&(s=h.width,l=h.height);var p=this.ctx.transform.decompose(),g=uu(p.rotate.shx),m=new hV,v=(m=(m=(m=m.multiply(p.translate)).multiply(p.skew)).multiply(p.scale)).applyToRectangle(new hY(a-e*f,o-n*d,r*u,i*c));if(this.autoPaging){for(var b,y=h2.call(this,v),w=[],_=0;_<y.length;_+=1)-1===w.indexOf(y[_])&&w.push(y[_]);h4(w);for(var x=w[0],N=w[w.length-1],A=x;A<N+1;A++){this.pdf.setPage(A);var L=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],k=1===A?this.posY+this.margin[0]:this.margin[0],S=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],C=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],P=1===A?0:S+(A-2)*C;if(0!==this.ctx.clip_path.length){var E=this.path;b=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=h3(b,this.posX+this.margin[3],-P+k+this.ctx.prevPageLastElemOffset),h8.call(this,"fill",!0),this.path=E}var I=JSON.parse(JSON.stringify(v));I=h3([I],this.posX+this.margin[3],-P+k+this.ctx.prevPageLastElemOffset)[0];var j=(A>x||A<N)&&h0.call(this);j&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],L,C,null).clip().discardPath()),this.pdf.addImage(t,"JPEG",I.x,I.y,I.w,I.h,null,null,g),j&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(t,"JPEG",v.x,v.y,v.w,v.h,null,null,g)},h2=function(t,e,n){var r=[];e=e||this.pdf.internal.pageSize.width,n=n||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var i=this.posY+this.ctx.prevPageLastElemOffset;switch(t.type){default:case"mt":case"lt":r.push(Math.floor((t.y+i)/n)+1);break;case"arc":r.push(Math.floor((t.y+i-t.radius)/n)+1),r.push(Math.floor((t.y+i+t.radius)/n)+1);break;case"qct":var a=uc(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x,t.y);r.push(Math.floor((a.y+i)/n)+1),r.push(Math.floor((a.y+a.h+i)/n)+1);break;case"bct":var o=uf(this.ctx.lastPoint.x,this.ctx.lastPoint.y,t.x1,t.y1,t.x2,t.y2,t.x,t.y);r.push(Math.floor((o.y+i)/n)+1),r.push(Math.floor((o.y+o.h+i)/n)+1);break;case"rect":r.push(Math.floor((t.y+i)/n)+1),r.push(Math.floor((t.y+t.h+i)/n)+1)}for(var s=0;s<r.length;s+=1)for(;this.pdf.internal.getNumberOfPages()<r[s];)h5.call(this);return r},h5=function(){var t=this.fillStyle,e=this.strokeStyle,n=this.font,r=this.lineCap,i=this.lineWidth,a=this.lineJoin;this.pdf.addPage(),this.fillStyle=t,this.strokeStyle=e,this.font=n,this.lineCap=r,this.lineWidth=i,this.lineJoin=a},h3=function(t,e,n){for(var r=0;r<t.length;r++)switch(t[r].type){case"bct":t[r].x2+=e,t[r].y2+=n;case"qct":t[r].x1+=e,t[r].y1+=n;default:t[r].x+=e,t[r].y+=n}return t},h4=function(t){return t.sort(function(t,e){return t-e})},h6=function(t,e){var n=this.fillStyle,r=this.strokeStyle,i=this.lineCap,a=this.lineWidth,o=Math.abs(a*this.ctx.transform.scaleX),s=this.lineJoin;if(this.autoPaging){for(var l,h,u=JSON.parse(JSON.stringify(this.path)),c=JSON.parse(JSON.stringify(this.path)),f=[],d=0;d<c.length;d++)if(void 0!==c[d].x)for(var p=h2.call(this,c[d]),g=0;g<p.length;g+=1)-1===f.indexOf(p[g])&&f.push(p[g]);for(var m=0;m<f.length;m++)for(;this.pdf.internal.getNumberOfPages()<f[m];)h5.call(this);h4(f);for(var v=f[0],b=f[f.length-1],y=v;y<b+1;y++){this.pdf.setPage(y),this.fillStyle=n,this.strokeStyle=r,this.lineCap=i,this.lineWidth=o,this.lineJoin=s;var w=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],_=1===y?this.posY+this.margin[0]:this.margin[0],x=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],N=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],A=1===y?0:x+(y-2)*N;if(0!==this.ctx.clip_path.length){var L=this.path;l=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=h3(l,this.posX+this.margin[3],-A+_+this.ctx.prevPageLastElemOffset),h8.call(this,t,!0),this.path=L}if(h=JSON.parse(JSON.stringify(u)),this.path=h3(h,this.posX+this.margin[3],-A+_+this.ctx.prevPageLastElemOffset),!1===e||0===y){var k=(y>v||y<b)&&h0.call(this);k&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],w,N,null).clip().discardPath()),h8.call(this,t,e),k&&this.pdf.restoreGraphicsState()}this.lineWidth=a}this.path=u}else this.lineWidth=o,h8.call(this,t,e),this.lineWidth=a},h8=function(t,e){if(("stroke"!==t||e||!h1.call(this))&&("stroke"===t||e||!hQ.call(this))){for(var n,r,i=[],a=this.path,o=0;o<a.length;o++){var s=a[o];switch(s.type){case"begin":i.push({begin:!0});break;case"close":i.push({close:!0});break;case"mt":i.push({start:s,deltas:[],abs:[]});break;case"lt":var l=i.length;if(a[o-1]&&!isNaN(a[o-1].x)&&(n=[s.x-a[o-1].x,s.y-a[o-1].y],l>0)){for(;l>=0;l--)if(!0!==i[l-1].close&&!0!==i[l-1].begin){i[l-1].deltas.push(n),i[l-1].abs.push(s);break}}break;case"bct":n=[s.x1-a[o-1].x,s.y1-a[o-1].y,s.x2-a[o-1].x,s.y2-a[o-1].y,s.x-a[o-1].x,s.y-a[o-1].y],i[i.length-1].deltas.push(n);break;case"qct":var h=a[o-1].x+2/3*(s.x1-a[o-1].x),u=a[o-1].y+2/3*(s.y1-a[o-1].y),c=s.x+2/3*(s.x1-s.x),f=s.y+2/3*(s.y1-s.y),d=s.x,p=s.y;n=[h-a[o-1].x,u-a[o-1].y,c-a[o-1].x,f-a[o-1].y,d-a[o-1].x,p-a[o-1].y],i[i.length-1].deltas.push(n);break;case"arc":i.push({deltas:[],abs:[],arc:!0}),Array.isArray(i[i.length-1].abs)&&i[i.length-1].abs.push(s)}}r=e?null:"stroke"===t?"stroke":"fill";for(var g=!1,m=0;m<i.length;m++)if(i[m].arc)for(var v=i[m].abs,b=0;b<v.length;b++){var y=v[b];"arc"===y.type?ut.call(this,y.x,y.y,y.radius,y.startAngle,y.endAngle,y.counterclockwise,void 0,e,!g):ua.call(this,y.x,y.y),g=!0}else if(!0===i[m].close)this.pdf.internal.out("h"),g=!1;else if(!0!==i[m].begin){var w=i[m].start.x,_=i[m].start.y;uo.call(this,i[m].deltas,w,_),g=!0}r&&ue.call(this,r),e&&un.call(this)}},h7=function(t){var e=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,n=e*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return t-n;case"top":return t+e-n;case"hanging":return t+e-2*n;case"middle":return t+e/2-n;default:return t}},h9=function(t){return t+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)},hZ.prototype.createLinearGradient=function(){var t=function(){};return t.colorStops=[],t.addColorStop=function(t,e){this.colorStops.push([t,e])},t.getColor=function(){return 0===this.colorStops.length?"#000000":this.colorStops[0][1]},t.isCanvasGradient=!0,t},hZ.prototype.createPattern=function(){return this.createLinearGradient()},hZ.prototype.createRadialGradient=function(){return this.createLinearGradient()},ut=function(t,e,n,r,i,a,o,s,l){for(var h=ul.call(this,n,r,i,a),u=0;u<h.length;u++){var c=h[u];0===u&&(l?ur.call(this,c.x1+t,c.y1+e):ua.call(this,c.x1+t,c.y1+e)),us.call(this,t,e,c.x2,c.y2,c.x3,c.y3,c.x4,c.y4)}s?un.call(this):ue.call(this,o)},ue=function(t){switch(t){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},un=function(){this.pdf.clip(),this.pdf.discardPath()},ur=function(t,e){this.pdf.internal.out(hU(t)+" "+h$(e)+" m")},ui=function(t){switch(t.align){case"right":case"end":e="right";break;case"center":e="center";break;default:e="left"}var e,n,r,i,a=this.pdf.getTextDimensions(t.text),o=h7.call(this,t.y),s=h9.call(this,o)-a.h,l=this.ctx.transform.applyToPoint(new hX(t.x,o));if(this.autoPaging){var h=this.ctx.transform.decompose(),u=new hV;u=(u=(u=u.multiply(h.translate)).multiply(h.skew)).multiply(h.scale);for(var c=this.ctx.transform.applyToRectangle(new hY(t.x,o,a.w,a.h)),f=u.applyToRectangle(new hY(t.x,s,a.w,a.h)),d=h2.call(this,f),p=[],g=0;g<d.length;g+=1)-1===p.indexOf(d[g])&&p.push(d[g]);h4(p);for(var m=p[0],v=p[p.length-1],b=m;b<v+1;b++){this.pdf.setPage(b);var y=1===b?this.posY+this.margin[0]:this.margin[0],w=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],_=this.pdf.internal.pageSize.height-this.margin[2],x=_-this.margin[0],N=this.pdf.internal.pageSize.width-this.margin[1],A=N-this.margin[3],L=1===b?0:w+(b-2)*x;if(0!==this.ctx.clip_path.length){var k=this.path;n=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=h3(n,this.posX+this.margin[3],-1*L+y),h8.call(this,"fill",!0),this.path=k}var S=h3([JSON.parse(JSON.stringify(f))],this.posX+this.margin[3],-L+y+this.ctx.prevPageLastElemOffset)[0];t.scale>=.01&&(r=this.pdf.internal.getFontSize(),this.pdf.setFontSize(r*t.scale),i=this.lineWidth,this.lineWidth=i*t.scale);var C="text"!==this.autoPaging;if(C||S.y+S.h<=_){if(C||S.y>=y&&S.x<=N){var P=C?t.text:this.pdf.splitTextToSize(t.text,t.maxWidth||N-S.x)[0],E=h3([JSON.parse(JSON.stringify(c))],this.posX+this.margin[3],-L+y+this.ctx.prevPageLastElemOffset)[0],I=C&&(b>m||b<v)&&h0.call(this);I&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],A,x,null).clip().discardPath()),this.pdf.text(P,E.x,E.y,{angle:t.angle,align:e,renderingMode:t.renderingMode}),I&&this.pdf.restoreGraphicsState()}}else S.y<_&&(this.ctx.prevPageLastElemOffset+=_-S.y);t.scale>=.01&&(this.pdf.setFontSize(r),this.lineWidth=i)}}else t.scale>=.01&&(r=this.pdf.internal.getFontSize(),this.pdf.setFontSize(r*t.scale),i=this.lineWidth,this.lineWidth=i*t.scale),this.pdf.text(t.text,l.x+this.posX,l.y+this.posY,{angle:t.angle,align:e,renderingMode:t.renderingMode,maxWidth:t.maxWidth}),t.scale>=.01&&(this.pdf.setFontSize(r),this.lineWidth=i)},ua=function(t,e,n,r){n=n||0,r=r||0,this.pdf.internal.out(hU(t+n)+" "+h$(e+r)+" l")},uo=function(t,e,n){return this.pdf.lines(t,e,n,null,null)},us=function(t,e,n,r,i,a,o,s){this.pdf.internal.out([hq(hH(n+t)),hq(hW(r+e)),hq(hH(i+t)),hq(hW(a+e)),hq(hH(o+t)),hq(hW(s+e)),"c"].join(" "))},ul=function(t,e,n,r){for(var i=2*Math.PI,a=Math.PI/2;e>n;)e-=i;var o=Math.abs(n-e);o<i&&r&&(o=i-o);for(var s=[],l=r?-1:1,h=e;o>1e-5;){var u=h+l*Math.min(o,a);s.push(uh.call(this,t,h,u)),o-=Math.abs(u-h),h=u}return s},uh=function(t,e,n){var r=(n-e)/2,i=t*Math.cos(r),a=t*Math.sin(r),o=-a,s=i*i+o*o,l=s+i*i+o*a,h=4/3*(Math.sqrt(2*s*l)-l)/(i*a-o*i),u=i-h*o,c=o+h*i,f=-c,d=r+e,p=Math.cos(d),g=Math.sin(d);return{x1:t*Math.cos(e),y1:t*Math.sin(e),x2:u*p-c*g,y2:u*g+c*p,x3:u*p-f*g,y3:u*g+f*p,x4:t*Math.cos(n),y4:t*Math.sin(n)}},uu=function(t){return 180*t/Math.PI},uc=function(t,e,n,r,i,a){var o=t+.5*(n-t),s=e+.5*(r-e),l=i+.5*(n-i),h=a+.5*(r-a),u=Math.min(t,i,o,l),c=Math.min(e,a,s,h);return new hY(u,c,Math.max(t,i,o,l)-u,Math.max(e,a,s,h)-c)},uf=function(t,e,n,r,i,a,o,s){var l,h,u,c,f,d,p,g,m,v,b,y,w,_,x=n-t,N=r-e,A=i-n,L=a-r,k=o-i,S=s-a;for(h=0;h<41;h++)m=(p=(u=t+(l=h/40)*x)+l*((f=n+l*A)-u))+l*(f+l*(i+l*k-f)-p),v=(g=(c=e+l*N)+l*((d=r+l*L)-c))+l*(d+l*(a+l*S-d)-g),0==h?(b=m,y=v,w=m,_=v):(b=Math.min(b,m),y=Math.min(y,v),w=Math.max(w,m),_=Math.max(_,v));return new hY(Math.round(b),Math.round(y),Math.round(w-b),Math.round(_-y))},ud=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var t=JSON.stringify({lineDash:this.ctx.lineDash,lineDashOffset:this.ctx.lineDashOffset});this.prevLineDash!==t&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=t)}},up=sB.API,ug=function(t){var e,n,r,i,a,o,s,l,h,u;for(/[^\x00-\xFF]/.test(t),n=[],r=0,i=(t+=e="\0\0\0\0".slice(t.length%4||4)).length;i>r;r+=4)0!==(a=(t.charCodeAt(r)<<24)+(t.charCodeAt(r+1)<<16)+(t.charCodeAt(r+2)<<8)+t.charCodeAt(r+3))?(o=(a=((a=((a=((a=(a-(u=a%85))/85)-(h=a%85))/85)-(l=a%85))/85)-(s=a%85))/85)%85,n.push(o+33,s+33,l+33,h+33,u+33)):n.push(122);return function(t,e){for(var n=e;n>0;n--)t.pop()}(n,e.length),String.fromCharCode.apply(String,n)+"~>"},um=function(t){var e,n,r,i,a,o=String,s="length",l="charCodeAt",h="slice",u="replace";for(t[h](-2),t=t[h](0,-2)[u](/\s/g,"")[u]("z","!!!!!"),r=[],i=0,a=(t+=e="uuuuu"[h](t[s]%5||5))[s];a>i;i+=5)n=0x31c84b1*(t[l](i)-33)+614125*(t[l](i+1)-33)+7225*(t[l](i+2)-33)+85*(t[l](i+3)-33)+(t[l](i+4)-33),r.push(255&n>>24,255&n>>16,255&n>>8,255&n);return function(t,e){for(var n=e;n>0;n--)t.pop()}(r,e[s]),o.fromCharCode.apply(o,r)},uv=function(t){var e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(t=t.replace(/\s/g,"")).indexOf(">")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r<t.length;r+=2)n+=String.fromCharCode("0x"+(t[r]+t[r+1]));return n},ub=function(t){for(var e=new Uint8Array(t.length),n=t.length;n--;)e[n]=t.charCodeAt(n);return(e=r8(e)).reduce(function(t,e){return t+String.fromCharCode(e)},"")},up.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n<e.length;n+=1)switch(e[n]){case"ASCII85Decode":case"/ASCII85Decode":r=um(r),i.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":r=ug(r),i.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":r=uv(r),i.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":r=r.split("").map(function(t){return("0"+t.charCodeAt().toString(16)).slice(-2)}).join("")+">",i.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":r=ub(r),i.push("/FlateDecode");break;default:throw Error('The filter: "'+e[n]+'" is not implemented')}return{data:r,reverseChain:i.reverse().join(" ")}},(uy=sB.API).loadFile=function(t,e,n){var r=e,i=n;r=!1!==r,i="function"==typeof i?i:function(){};var a=void 0;try{a=function(t,e,n){var r=new XMLHttpRequest,i=0,a=function(t){var e=t.length,n=[],r=String.fromCharCode;for(i=0;i<e;i+=1)n.push(r(255&t.charCodeAt(i)));return n.join("")};if(r.open("GET",t,!e),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===e&&(r.onload=function(){200===r.status?n(a(this.responseText)):n(void 0)}),r.send(null),e&&200===r.status)return a(r.responseText)}(t,r,i)}catch(t){}return a},uy.loadImageFile=uy.loadFile,function(e){function n(){return(sr.html2canvas?Promise.resolve(sr.html2canvas):t.A(74541)).catch(function(t){return Promise.reject(Error("Could not load html2canvas: "+t))}).then(function(t){return t.default?t.default:t})}function r(){return(sr.DOMPurify?Promise.resolve(sr.DOMPurify):t.A(36972)).catch(function(t){return Promise.reject(Error("Could not load dompurify: "+t))}).then(function(t){return t.default?t.default:t})}var i=function(t){var e=(0,nH.default)(t);return"undefined"===e?"undefined":"string"===e||t instanceof String?"string":"number"===e||t instanceof Number?"number":"function"===e||t instanceof Function?"function":t&&t.constructor===Array?"array":t&&1===t.nodeType?"element":"object"===e?"object":"unknown"},a=function(t,e){var n=document.createElement(t);for(var r in e.className&&(n.className=e.className),e.innerHTML&&e.dompurify&&(n.innerHTML=e.dompurify.sanitize(e.innerHTML)),e.style)n.style[r]=e.style[r];return n},o=function t(e,n){for(var r=3===e.nodeType?document.createTextNode(e.nodeValue):e.cloneNode(!1),i=e.firstChild;i;i=i.nextSibling)!0!==n&&1===i.nodeType&&"SCRIPT"===i.nodeName||r.appendChild(t(i,n));return 1===e.nodeType&&("CANVAS"===e.nodeName?(r.width=e.width,r.height=e.height,r.getContext("2d").drawImage(e,0,0)):"TEXTAREA"!==e.nodeName&&"SELECT"!==e.nodeName||(r.value=e.value),r.addEventListener("load",function(){r.scrollTop=e.scrollTop,r.scrollLeft=e.scrollLeft},!0)),r},s=function t(e){var n=Object.assign(t.convert(Promise.resolve()),JSON.parse(JSON.stringify(t.template))),r=t.convert(Promise.resolve(),n);return(r=r.setProgress(1,t,1,[t])).set(e)};(s.prototype=Object.create(Promise.prototype)).constructor=s,s.convert=function(t,e){return t.__proto__=e||s.prototype,t},s.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},s.prototype.from=function(t,e){return this.then(function(){switch(e=e||function(t){switch(i(t)){case"string":return"string";case"element":return"canvas"===t.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(t)){case"string":return this.then(r).then(function(e){return this.set({src:a("div",{innerHTML:t,dompurify:e})})});case"element":return this.set({src:t});case"canvas":return this.set({canvas:t});case"img":return this.set({img:t});default:return this.error("Unknown source type.")}})},s.prototype.to=function(t){switch(t){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},s.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var t={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},e=o(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===e.tagName&&(t.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=a("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=a("div",{className:"html2pdf__container",style:t}),this.prop.container.appendChild(e),this.prop.container.firstChild.appendChild(a("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},s.prototype.toCanvas=function(){var t=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(t).then(n).then(function(t){var e=Object.assign({},this.opt.html2canvas);return delete e.onrendered,t(this.prop.container,e)}).then(function(t){(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)})},s.prototype.toContext2d=function(){var t=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(t).then(n).then(function(t){var e=this.opt.jsPDF,n=this.opt.fontFaces,r=Object.assign({async:!0,allowTaint:!0,scale:"number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete r.onrendered,e.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,e.context2d.posX=this.opt.x,e.context2d.posY=this.opt.y,e.context2d.margin=this.opt.margin,e.context2d.fontFaces=n,n)for(var i=0;i<n.length;++i){var a=n[i],o=a.src.find(function(t){return"truetype"===t.format});o&&e.addFont(o.url,a.ref.name,a.ref.style)}return r.windowHeight=r.windowHeight||0,r.windowHeight=0==r.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):r.windowHeight,e.context2d.save(!0),t(this.prop.container,r)}).then(function(t){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)})},s.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var t=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=t})},s.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},s.prototype.output=function(t,e,n){return"img"===(n=n||"pdf").toLowerCase()||"image"===n.toLowerCase()?this.outputImg(t,e):this.outputPdf(t,e)},s.prototype.outputPdf=function(t,e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(t,e)})},s.prototype.outputImg=function(t){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(t){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+t+'" is not supported.'}})},s.prototype.save=function(t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(t?{filename:t}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},s.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},s.prototype.set=function(t){if("object"!==i(t))return this;var e=Object.keys(t||{}).map(function(e){if(e in s.template.prop)return function(){this.prop[e]=t[e]};switch(e){case"margin":return this.setMargin.bind(this,t.margin);case"jsPDF":return function(){return this.opt.jsPDF=t.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,t.pageSize);default:return function(){this.opt[e]=t[e]}}},this);return this.then(function(){return this.thenList(e)})},s.prototype.get=function(t,e){return this.then(function(){var n=t in s.template.prop?this.prop[t]:this.opt[t];return e?e(n):n})},s.prototype.setMargin=function(t){return this.then(function(){switch(i(t)){case"number":t=[t,t,t,t];case"array":if(2===t.length&&(t=[t[0],t[1],t[0],t[1]]),4===t.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=t}).then(this.setPageSize)},s.prototype.setPageSize=function(t){function e(t,e){return Math.floor(t*e/72*96)}return this.then(function(){(t=t||sB.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(t.inner={width:t.width-this.opt.margin[1]-this.opt.margin[3],height:t.height-this.opt.margin[0]-this.opt.margin[2]},t.inner.px={width:e(t.inner.width,t.k),height:e(t.inner.height,t.k)},t.inner.ratio=t.inner.height/t.inner.width),this.prop.pageSize=t})},s.prototype.setProgress=function(t,e,n,r){return null!=t&&(this.progress.val=t),null!=e&&(this.progress.state=e),null!=n&&(this.progress.n=n),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},s.prototype.updateProgress=function(t,e,n,r){return this.setProgress(t?this.progress.val+t:null,e||null,n?this.progress.n+n:null,r?this.progress.stack.concat(r):null)},s.prototype.then=function(t,e){var n=this;return this.thenCore(t,e,function(t,e){return n.updateProgress(null,null,1,[t]),Promise.prototype.then.call(this,function(e){return n.updateProgress(null,t),e}).then(t,e).then(function(t){return n.updateProgress(1),t})})},s.prototype.thenCore=function(t,e,n){n=n||Promise.prototype.then,t&&(t=t.bind(this)),e&&(e=e.bind(this));var r=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?this:s.convert(Object.assign({},this),Promise.prototype),i=n.call(r,t,e);return s.convert(i,this.__proto__)},s.prototype.thenExternal=function(t,e){return Promise.prototype.then.call(this,t,e)},s.prototype.thenList=function(t){var e=this;return t.forEach(function(t){e=e.thenCore(t)}),e},s.prototype.catch=function(t){t&&(t=t.bind(this));var e=Promise.prototype.catch.call(this,t);return s.convert(e,this)},s.prototype.catchExternal=function(t){return Promise.prototype.catch.call(this,t)},s.prototype.error=function(t){return this.then(function(){throw Error(t)})},s.prototype.using=s.prototype.set,s.prototype.saveAs=s.prototype.save,s.prototype.export=s.prototype.output,s.prototype.run=s.prototype.then,sB.getPageSize=function(t,e,n){if("object"===(0,nH.default)(t)){var r=t;t=r.orientation,e=r.unit||e,n=r.format||n}e=e||"mm",n=n||"a4",t=(""+(t||"P")).toLowerCase();var i,a=(""+n).toLowerCase(),o={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(e){case"pt":i=1;break;case"mm":i=72/25.4;break;case"cm":i=72/2.54;break;case"in":i=72;break;case"px":i=.75;break;case"pc":case"em":i=12;break;case"ex":i=6;break;default:throw"Invalid unit: "+e}var s,l=0,h=0;if(o.hasOwnProperty(a))l=o[a][1]/i,h=o[a][0]/i;else try{l=n[1],h=n[0]}catch(t){throw Error("Invalid format: "+n)}if("p"===t||"portrait"===t)t="p",h>l&&(s=h,h=l,l=s);else{if("l"!==t&&"landscape"!==t)throw"Invalid orientation: "+t;t="l",l>h&&(s=h,h=l,l=s)}return{width:h,height:l,unit:e,k:i,orientation:t}},e.html=function(t,e){(e=e||{}).callback=e.callback||function(){},e.html2canvas=e.html2canvas||{},e.html2canvas.canvas=e.html2canvas.canvas||this.canvas,e.jsPDF=e.jsPDF||this,e.fontFaces=e.fontFaces?e.fontFaces.map(ly):null;var n=new s(e);return e.worker?n:n.from(t).doCallback()}}(sB.API),sB.API.addJS=function(t){return hw=t,this.internal.events.subscribe("postPutResources",function(){hb=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(hb+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),hy=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+hw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==hb&&void 0!==hy&&this.internal.out("/Names <</JavaScript "+hb+" 0 R>>")}),this},(uw=sB.API).events.push(["postPutResources",function(){var t=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var e=this.outline.render().split(/\r\n/),n=0;n<e.length;n++){var r=e[n],i=t.exec(r);if(null!=i){var a=i[1];this.internal.newObjectDeferredBegin(a,!1)}this.internal.write(r)}if(this.outline.createNamedDestinations){var o=this.internal.pages.length,s=[];for(n=0;n<o;n++){var l=this.internal.newObject();s.push(l);var h=this.internal.getPageInfo(n+1);this.internal.write("<< /D["+h.objId+" 0 R /XYZ null null null]>> endobj")}var u=this.internal.newObject();for(this.internal.write("<< /Names [ "),n=0;n<s.length;n++)this.internal.write("(page_"+(n+1)+")"+s[n]+" 0 R");this.internal.write(" ] >>","endobj"),u_=this.internal.newObject(),this.internal.write("<< /Dests "+u+" 0 R"),this.internal.write(">>","endobj")}}]),uw.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+u_+" 0 R"))}]),uw.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(t,e,n){var r={title:e,options:n,children:[]};return null==t&&(t=this.root),t.children.push(r),r},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(e){e.id=t.internal.newObjectDeferred();for(var n=0;n<e.children.length;n++)this.genIds_r(e.children[n])},t.outline.renderRoot=function(t){this.objStart(t),this.line("/Type /Outlines"),t.children.length>0&&(this.line("/First "+this.makeRef(t.children[0])),this.line("/Last "+this.makeRef(t.children[t.children.length-1]))),this.line("/Count "+this.count_r({count:0},t)),this.objEnd()},t.outline.renderItems=function(e){for(var n=this.ctx.pdf.internal.getVerticalCoordinateString,r=0;r<e.children.length;r++){var i=e.children[r];this.objStart(i),this.line("/Title "+this.makeString(i.title)),this.line("/Parent "+this.makeRef(e)),r>0&&this.line("/Prev "+this.makeRef(e.children[r-1])),r<e.children.length-1&&this.line("/Next "+this.makeRef(e.children[r+1])),i.children.length>0&&(this.line("/First "+this.makeRef(i.children[0])),this.line("/Last "+this.makeRef(i.children[i.children.length-1])));var a=this.count=this.count_r({count:0},i);if(a>0&&this.line("/Count "+a),i.options&&i.options.pageNumber){var o=t.internal.getPageInfo(i.options.pageNumber);this.line("/Dest ["+o.objId+" 0 R /XYZ 0 "+n(0)+" 0]")}this.objEnd()}for(var s=0;s<e.children.length;s++)this.renderItems(e.children[s])},t.outline.line=function(t){this.ctx.val+=t+"\r\n"},t.outline.makeRef=function(t){return t.id+" 0 R"},t.outline.makeString=function(e){return"("+t.internal.pdfEscape(e)+")"},t.outline.objStart=function(t){this.ctx.val+="\r\n"+t.id+" 0 obj\r\n<<\r\n"},t.outline.objEnd=function(){this.ctx.val+=">> \r\nendobj\r\n"},t.outline.count_r=function(t,e){for(var n=0;n<e.children.length;n++)t.count++,this.count_r(t,e.children[n]);return t.count}}]),ux=sB.API,uN=[192,193,194,195,196,197,198,199],ux.processJPEG=function(t,e,n,r,i,a){var o,s=this.decode.DCT_DECODE,l=null;if("string"==typeof t||this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t)){switch(t=i||t,t=this.__addimage__.isArrayBuffer(t)?new Uint8Array(t):t,(o=function(t){for(var e,n=256*t.charCodeAt(4)+t.charCodeAt(5),r=t.length,i={width:0,height:0,numcomponents:1},a=4;a<r;a+=2){if(a+=n,-1!==uN.indexOf(t.charCodeAt(a+1))){e=256*t.charCodeAt(a+5)+t.charCodeAt(a+6),i={width:256*t.charCodeAt(a+7)+t.charCodeAt(a+8),height:e,numcomponents:t.charCodeAt(a+9)};break}n=256*t.charCodeAt(a+2)+t.charCodeAt(a+3)}return i}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t)).numcomponents){case 1:a=this.color_spaces.DEVICE_GRAY;break;case 4:a=this.color_spaces.DEVICE_CMYK;break;case 3:a=this.color_spaces.DEVICE_RGB}l={data:t,width:o.width,height:o.height,colorSpace:a,bitsPerComponent:8,filter:s,index:e,alias:n}}return l},sB.API.processPNG=function(t,e,n,r){if(this.__addimage__.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.__addimage__.isArrayBufferView(t)){var i,a,o,s,l,h,u=new sn(t,{checkCrc:!0}).decode(),c=u.width,f=u.height,d=u.channels,p=u.palette,g=u.depth,m=(i=p&&1===d?function(t){for(var e=t.width,n=t.height,r=t.data,i=t.palette,a=t.depth,o=!1,s=[],l=[],h=void 0,u=!1,c=0,f=0;f<i.length;f++){var d=iN(i[f],4),p=d[0],g=d[1],m=d[2],v=d[3];s.push(p,g,m),null!=v&&(0===v?(c++,l.length<1&&l.push(f)):v<255&&(u=!0))}if(u||c>1){o=!0,l=void 0;var b=e*n;h=new Uint8Array(b);for(var y=new DataView(r.buffer),w=0;w<b;w++){var _=iN(i[hj(y,w,a)],4)[3];h[w]=_}}else 0===c&&(l=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:o?8:void 0,colorBytes:r,alphaBytes:h,needSMask:o,palette:s,mask:l}}(u):2===d||4===d?function(t){for(var e=t.data,n=t.width,r=t.height,i=t.channels,a=t.depth,o=i-1,s=n*r,l=Math.ceil(s*o*a/8),h=Math.ceil(s*a/8),u=new Uint8Array(l),c=new Uint8Array(h),f=new DataView(e.buffer),d=new DataView(u.buffer),p=new DataView(c.buffer),g=!1,m=0;m<s;m++){for(var v=m*i,b=0;b<o;b++)hM(d,hj(f,v+b,a),m*o+b,a);var y=hj(f,v+o,a);y<(1<<a)-1&&(g=!0),hM(p,y,+m,a)}return{colorSpace:2===i?"DeviceGray":"DeviceRGB",colorsPerPixel:o,sMaskBitsPerComponent:g?a:void 0,colorBytes:u,alphaBytes:c,needSMask:g}}(u):(a=u.data,{colorSpace:o=1===u.channels?"DeviceGray":"DeviceRGB",colorsPerPixel:"DeviceGray"===o?1:3,colorBytes:a instanceof Uint16Array?function(t){for(var e=t.length,n=new Uint8Array(2*e),r=new DataView(n.buffer,n.byteOffset,n.byteLength),i=0;i<e;i++)r.setUint16(2*i,t[i],!1);return n}(a):a,needSMask:!1})).colorSpace,v=i.colorsPerPixel,b=i.sMaskBitsPerComponent,y=i.colorBytes,w=i.alphaBytes,_=i.needSMask,x=i.palette,N=i.mask,A=null;return r!==sB.API.image_compression.NONE?(A=function(t){var e;switch(t){case sB.API.image_compression.FAST:e=11;break;case sB.API.image_compression.MEDIUM:e=13;break;case sB.API.image_compression.SLOW:e=14;break;default:e=12}return e}(r),s=this.decode.FLATE_DECODE,l="/Predictor ".concat(A," /Colors ").concat(v," /BitsPerComponent ").concat(g," /Columns ").concat(c),t=hS(y,Math.ceil(c*v*g/8),v,g,r),_&&(h=hS(w,Math.ceil(c*b/8),1,b,r))):(s=void 0,l=void 0,t=y,_&&(h=w)),(this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t))&&(t=this.__addimage__.arrayBufferToBinaryString(t)),(h&&this.__addimage__.isArrayBuffer(h)||this.__addimage__.isArrayBufferView(h))&&(h=this.__addimage__.arrayBufferToBinaryString(h)),{alias:n,data:t,index:e,filter:s,decodeParameters:l,transparency:N,palette:x,sMask:h,predictor:A,width:c,height:f,bitsPerComponent:g,sMaskBitsPerComponent:b,colorSpace:m}}},(uA=sB.API).processGIF89A=function(t,e,n,r){var i=new hB(t),a=i.width,o=i.height,s=[];i.decodeAndBlitFrameRGBA(0,s);var l=new hT(100).encode({data:s,width:a,height:o},100);return uA.processJPEG.call(this,l,e,n,r)},uA.processGIF87A=uA.processGIF89A,hR.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:r,blue:n,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},hR.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(t){si("bit decode error:"+t)}},hR.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),n=e%4;for(t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,i=0;i<e;i++)for(var a=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var l=this.palette[a>>7-s&1];this.data[o+4*s]=l.blue,this.data[o+4*s+1]=l.green,this.data[o+4*s+2]=l.red,this.data[o+4*s+3]=255}0!==n&&(this.pos+=4-n)}},hR.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++){var a=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+2*i*4,s=a>>4,l=15&a,h=this.palette[s];if(this.data[o]=h.blue,this.data[o+1]=h.green,this.data[o+2]=h.red,this.data[o+3]=255,2*i+1>=this.width)break;h=this.palette[l],this.data[o+4]=h.blue,this.data[o+4+1]=h.green,this.data[o+4+2]=h.red,this.data[o+4+3]=255}0!==e&&(this.pos+=4-e)}},hR.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+4*r;if(i<this.palette.length){var o=this.palette[i];this.data[a]=o.red,this.data[a+1]=o.green,this.data[a+2]=o.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}0!==t&&(this.pos+=4-t)}},hR.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&e)/e*255|0,s=(a>>5&e)/e*255|0,l=(a>>10&e)/e*255|0,h=a>>15?255:0,u=r*this.width*4+4*i;this.data[u]=l,this.data[u+1]=s,this.data[u+2]=o,this.data[u+3]=h}this.pos+=t}},hR.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,a=0;a<this.width;a++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&e)/e*255|0,l=(o>>5&n)/n*255|0,h=(o>>11)/e*255|0,u=i*this.width*4+4*a;this.data[u]=h,this.data[u+1]=l,this.data[u+2]=s,this.data[u+3]=255}this.pos+=t}},hR.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=e*this.width*4+4*n;this.data[o]=a,this.data[o+1]=i,this.data[o+2]=r,this.data[o+3]=255}this.pos+=this.width%4}},hR.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=e*this.width*4+4*n;this.data[s]=a,this.data[s+1]=i,this.data[s+2]=r,this.data[s+3]=o}},hR.prototype.getData=function(){return this.data},(uL=sB.API).processBMP=function(t,e,n,r){var i=new hR(t,!1),a=i.width,o=i.height,s={data:i.getData(),width:a,height:o},l=new hT(100).encode(s,100);return uL.processJPEG.call(this,l,e,n,r)},hD.prototype.getData=function(){return this.data},(uk=sB.API).processWEBP=function(t,e,n,r){var i=new hD(t),a=i.width,o=i.height,s={data:i.getData(),width:a,height:o},l=new hT(100).encode(s,100);return uk.processJPEG.call(this,l,e,n,r)},sB.API.processRGBA=function(t,e,n){for(var r=t.data,i=r.length,a=new Uint8Array(i/4*3),o=new Uint8Array(i/4),s=0,l=0,h=0;h<i;h+=4){var u=r[h],c=r[h+1],f=r[h+2],d=r[h+3];a[s++]=u,a[s++]=c,a[s++]=f,o[l++]=d}var p=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:p,index:e,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},sB.API.setLanguage=function(t){return void 0===this.internal.languageSettings&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),void 0!==({af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"})[t]&&(this.internal.languageSettings.languageCode=t,!1===this.internal.languageSettings.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},hx=(h_=sB.API).getCharWidthsArray=function(t,e){var n,r,i=(e=e||{}).font||this.internal.getFont(),a=e.fontSize||this.internal.getFontSize(),o=e.charSpace||this.internal.getCharSpace(),s=e.widths?e.widths:i.metadata.Unicode.widths,l=s.fof?s.fof:1,h=e.kerning?e.kerning:i.metadata.Unicode.kerning,u=h.fof?h.fof:1,c=!1!==e.doKerning,f=0,d=t.length,p=0,g=s[0]||l,m=[];for(n=0;n<d;n++)r=t.charCodeAt(n),"function"==typeof i.metadata.widthOfString?m.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+1e3/a*o||0)/1e3):(f=c&&"object"===(0,nH.default)(h[r])&&!isNaN(parseInt(h[r][p],10))?h[r][p]/u:0,m.push((s[r]||g)/l+f)),p=r;return m},hN=h_.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return h_.processArabic&&(t=h_.processArabic(t)),"function"==typeof r.metadata.widthOfString?r.metadata.widthOfString(t,n,i)/n:hx.apply(this,arguments).reduce(function(t,e){return t+e},0)},hA=function(t,e,n,r){for(var i=[],a=0,o=t.length,s=0;a!==o&&s+e[a]<n;)s+=e[a],a++;i.push(t.slice(0,a));var l=a;for(s=0;a!==o;)s+e[a]>r&&(i.push(t.slice(l,a)),s=0,l=a),s+=e[a],a++;return l!==a&&i.push(t.slice(l,a)),i},hL=function(t,e,n){n||(n={});var r,i,a,o,s,l,h,u=[],c=[u],f=n.textIndent||0,d=0,p=0,g=t.split(" "),m=hx.apply(this,[" ",n])[0];if(l=-1===n.lineIndent?g[0].length+2:n.lineIndent||0){var v=Array(l).join(" "),b=[];g.map(function(t){(t=t.split(/\s*\n/)).length>1?b=b.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):b.push(t[0])}),g=b,l=hN.apply(this,[v,n])}for(a=0,o=g.length;a<o;a++){var y=0;if(r=g[a],l&&"\n"==r[0]&&(r=r.substr(1),y=1),f+d+(p=(i=hx.apply(this,[r,n])).reduce(function(t,e){return t+e},0))>e||y){if(p>e){for(s=hA.apply(this,[r,i,e-(f+d),e]),u.push(s.shift()),u=[s.pop()];s.length;)c.push([s.shift()]);p=i.slice(r.length-(u[0]?u[0].length:0)).reduce(function(t,e){return t+e},0)}else u=[r];c.push(u),f=p+l,d=m}else u.push(r),f+=d+p,d=m}return h=l?function(t,e){return(e?v:"")+t.join(" ")}:function(t){return t.join(" ")},c.map(h)},h_.splitTextToSize=function(t,e,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),a=(function(t){if(t.widths&&t.kerning)return{widths:t.widths,kerning:t.kerning};var e=this.internal.getFont(t.fontName,t.fontStyle),n="Unicode";return e.metadata[n]?{widths:e.metadata[n].widths||{0:1},kerning:e.metadata[n].kerning||{}}:{font:e.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(t)?t:String(t).split(/\r?\n/);var o=this.internal.scaleFactor*e/i;a.textIndent=n.textIndent?n.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=n.lineIndent;var s,l,h=[];for(s=0,l=r.length;s<l;s++)h=h.concat(hL.apply(this,[r[s],o,a]));return h},function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="0123456789abcdef",n="klmnopqrstuvwxyz",r={},i={},a=0;a<16;a++)r[n[a]]=e[a],i[e[a]]=n[a];var o=function(t){return"0x"+parseInt(t,10).toString(16)},s=t.__fontmetrics__.compress=function(t){var e,n,r,a,l=["{"];for(var h in t){if(e=t[h],n=isNaN(parseInt(h,10))?"'"+h+"'":(n=o(h=parseInt(h,10)).slice(2)).slice(0,-1)+i[n.slice(-1)],"number"==typeof e)e<0?(r=o(e).slice(3),a="-"):(r=o(e).slice(2),a=""),r=a+r.slice(0,-1)+i[r.slice(-1)];else{if("object"!==(0,nH.default)(e))throw Error("Don't know what to do with value type "+(0,nH.default)(e)+".");r=s(e)}l.push(n+r)}return l.push("}"),l.join("")},l=t.__fontmetrics__.uncompress=function(t){if("string"!=typeof t)throw Error("Invalid argument passed to uncompress.");for(var e,n,i,a,o={},s=1,l=o,h=[],u="",c="",f=t.length-1,d=1;d<f;d+=1)"'"==(a=t[d])?e?(i=e.join(""),e=void 0):e=[]:e?e.push(a):"{"==a?(h.push([l,i]),l={},i=void 0):"}"==a?((n=h.pop())[0][n[1]]=l,i=void 0,l=n[0]):"-"==a?s=-1:void 0===i?r.hasOwnProperty(a)?(u+=r[a],i=parseInt(u,16)*s,s=1,u=""):u+=a:r.hasOwnProperty(a)?(c+=r[a],l[i]=parseInt(c,16)*s,s=1,i=void 0,c=""):c+=a;return o},h={codePages:["WinAnsiEncoding"],WinAnsiEncoding:l("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},u={Courier:h,"Courier-Bold":h,"Courier-BoldOblique":h,"Courier-Oblique":h,Helvetica:h,"Helvetica-Bold":h,"Helvetica-BoldOblique":h,"Helvetica-Oblique":h,"Times-Roman":h,"Times-Bold":h,"Times-BoldItalic":h,"Times-Italic":h},c={Unicode:{"Courier-Oblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":l("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":l("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:l("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:l("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":l("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":l("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};t.events.push(["addFont",function(t){var e=t.font,n=c.Unicode[e.postScriptName];n&&(e.metadata.Unicode={},e.metadata.Unicode.widths=n.widths,e.metadata.Unicode.kerning=n.kerning);var r=u[e.postScriptName];r&&(e.metadata.Unicode.encoding=r,e.encoding=r.codePages[0])}])}(sB.API),uS=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r<e;r++)n[r]=t.charCodeAt(r);return n},sB.API.events.push(["addFont",function(t){var e,n=void 0,r=t.font,i=t.instance;if(!r.isStandardFont){if(void 0===i)throw Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+r.postScriptName+"').");if("string"!=typeof(n=!1===i.existsFileInVFS(r.postScriptName)?i.loadFile(r.postScriptName):i.getFileFromVFS(r.postScriptName)))throw Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+r.postScriptName+"').");e=n,e=/^\x00\x01\x00\x00/.test(e)?uS(e):uS(sf(e)),r.metadata=sB.API.TTFFont.open(e),r.metadata.Unicode=r.metadata.Unicode||{encoding:{},kerning:{},widths:[]},r.metadata.glyIdsUsed=[0]}}]),sB.API.addSvgAsImage=function(e,n,r,i,a,o,s,l){if(isNaN(n)||isNaN(r))throw so("jsPDF.addSvgAsImage: Invalid coordinates",arguments),Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(a))throw so("jsPDF.addSvgAsImage: Invalid measurements",arguments),Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=a;var u=h.getContext("2d");u.fillStyle="#fff",u.fillRect(0,0,h.width,h.height);var c={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return(sr.canvg?Promise.resolve(sr.canvg):t.A(58828)).catch(function(t){return Promise.reject(Error("Could not load canvg: "+t))}).then(function(t){return t.default?t.default:t}).then(function(t){return t.fromString(u,e,c)},function(){return Promise.reject(Error("Could not load canvg."))}).then(function(t){return t.render(c)}).then(function(){f.addImage(h.toDataURL("image/jpeg",1),n,r,i,a,s,l)})},sB.API.putTotalPages=function(t){var e,n=0;15>parseInt(this.internal.getFont().id.substr(1),10)?(e=RegExp(t,"g"),n=this.internal.getNumberOfPages()):(e=RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(e,n);return this},sB.API.viewerPreferences=function(t,e){t=t||{},e=e||!1;var n,r,i,a,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(o),l=[],h=0,u=0,c=0;function f(t,e){var n,r=!1;for(n=0;n<t.length;n+=1)t[n]===e&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===t||!0===e){var d=s.length;for(c=0;c<d;c+=1)n[s[c]].value=n[s[c]].defaultValue,n[s[c]].explicitSet=!1}if("object"===(0,nH.default)(t)){for(i in t)if(a=t[i],f(s,i)&&void 0!==a){if("boolean"===n[i].type&&"boolean"==typeof a)n[i].value=a;else if("name"===n[i].type&&f(n[i].valueSet,a))n[i].value=a;else if("integer"===n[i].type&&Number.isInteger(a))n[i].value=a;else if("array"===n[i].type){for(h=0;h<a.length;h+=1)if(r=!0,1===a[h].length&&"number"==typeof a[h][0])l.push(String(a[h]-1));else if(a[h].length>1){for(u=0;u<a[h].length;u+=1)"number"!=typeof a[h][u]&&(r=!1);!0===r&&l.push([a[h][0]-1,a[h][1]-1].join(" "))}n[i].value="["+l.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},uC=sB.API,uP=function(){var t='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',e=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),i=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),a=unescape(encodeURIComponent("</x:xmpmeta>")),o=n.length+r.length+i.length+e.length+a.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+o+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+a),this.internal.write("endstream"),this.internal.write("endobj")},uE=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")},uC.addMetadata=function(t,e){return void 0===this.internal.__metadata__&&(this.internal.__metadata__={metadata:t,namespaceuri:e||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",uE),this.internal.events.subscribe("postPutResources",uP)),this},uj=(uI=sB.API).pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],a=[""],o=0,s=t.length;o<s&&(n=e.metadata.characterToGlyph(t.charCodeAt(o)),e.metadata.glyIdsUsed.push(n),e.metadata.toUnicode[n]=t.charCodeAt(o),-1==r.indexOf(n)&&(r.push(n),r.push([parseInt(e.metadata.widthOfGlyph(n),10)])),"0"!=n);++o)n=n.toString(16),a.push(i[4-n.length],n);return a.join("")},uM=function(t){var e,n,r,i,a,o,s;for(a="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",r=[],o=0,s=(n=Object.keys(t).sort(function(t,e){return t-e})).length;o<s;o++)e=n[o],r.length>=100&&(a+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),void 0!==t[e]&&null!==t[e]&&"function"==typeof t[e].toString&&(i=("0000"+t[e].toString(16)).slice(-4),e=("0000"+(+e).toString(16)).slice(-4),r.push("<"+e+"><"+i+">"));return r.length&&(a+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),a+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"},uI.events.push(["putFont",function(t){!function(t){var e=t.font,n=t.out,r=t.newObject,i=t.putStream;if(e.metadata instanceof sB.API.TTFFont&&"Identity-H"===e.encoding){for(var a=e.metadata.Unicode.widths,o=e.metadata.subset.encode(e.metadata.glyIdsUsed,1),s="",l=0;l<o.length;l++)s+=String.fromCharCode(o[l]);var h=r();i({data:s,addLength1:!0,objectId:h}),n("endobj");var u=r();i({data:uM(e.metadata.toUnicode),addLength1:!0,objectId:u}),n("endobj");var c=r();n("<<"),n("/Type /FontDescriptor"),n("/FontName /"+sP(e.fontName)),n("/FontFile2 "+h+" 0 R"),n("/FontBBox "+sB.API.PDFObject.convert(e.metadata.bbox)),n("/Flags "+e.metadata.flags),n("/StemV "+e.metadata.stemV),n("/ItalicAngle "+e.metadata.italicAngle),n("/Ascent "+e.metadata.ascender),n("/Descent "+e.metadata.decender),n("/CapHeight "+e.metadata.capHeight),n(">>"),n("endobj");var f=r();n("<<"),n("/Type /Font"),n("/BaseFont /"+sP(e.fontName)),n("/FontDescriptor "+c+" 0 R"),n("/W "+sB.API.PDFObject.convert(a)),n("/CIDToGIDMap /Identity"),n("/DW 1000"),n("/Subtype /CIDFontType2"),n("/CIDSystemInfo"),n("<<"),n("/Supplement 0"),n("/Registry (Adobe)"),n("/Ordering ("+e.encoding+")"),n(">>"),n(">>"),n("endobj"),e.objectNumber=r(),n("<<"),n("/Type /Font"),n("/Subtype /Type0"),n("/ToUnicode "+u+" 0 R"),n("/BaseFont /"+sP(e.fontName)),n("/Encoding /"+e.encoding),n("/DescendantFonts ["+f+" 0 R]"),n(">>"),n("endobj"),e.isAlreadyPutted=!0}}(t)}]),uI.events.push(["putFont",function(t){!function(t){var e=t.font,n=t.out,r=t.newObject,i=t.putStream;if(e.metadata instanceof sB.API.TTFFont&&"WinAnsiEncoding"===e.encoding){for(var a=e.metadata.rawData,o="",s=0;s<a.length;s++)o+=String.fromCharCode(a[s]);var l=r();i({data:o,addLength1:!0,objectId:l}),n("endobj");var h=r();i({data:uM(e.metadata.toUnicode),addLength1:!0,objectId:h}),n("endobj");var u=r();n("<<"),n("/Descent "+e.metadata.decender),n("/CapHeight "+e.metadata.capHeight),n("/StemV "+e.metadata.stemV),n("/Type /FontDescriptor"),n("/FontFile2 "+l+" 0 R"),n("/Flags 96"),n("/FontBBox "+sB.API.PDFObject.convert(e.metadata.bbox)),n("/FontName /"+sP(e.fontName)),n("/ItalicAngle "+e.metadata.italicAngle),n("/Ascent "+e.metadata.ascender),n(">>"),n("endobj"),e.objectNumber=r();for(var c=0;c<e.metadata.hmtx.widths.length;c++)e.metadata.hmtx.widths[c]=parseInt(e.metadata.hmtx.widths[c]*(1e3/e.metadata.head.unitsPerEm));n("<</Subtype/TrueType/Type/Font/ToUnicode "+h+" 0 R/BaseFont/"+sP(e.fontName)+"/FontDescriptor "+u+" 0 R/Encoding/"+e.encoding+" /FirstChar 29 /LastChar 255 /Widths "+sB.API.PDFObject.convert(e.metadata.hmtx.widths)+">>"),n("endobj"),e.isAlreadyPutted=!0}}(t)}]),uF=function(t){var e,n=t.text||"",r=t.x,i=t.y,a=t.options||{},o=t.mutex||{},s=o.pdfEscape,l=o.activeFontKey,h=o.fonts,u=l,c="",f=0,d="",p=h[u].encoding;if("Identity-H"!==h[u].encoding)return{text:n,x:r,y:i,options:a,mutex:o};for(d=n,u=l,Array.isArray(n)&&(d=n[0]),f=0;f<d.length;f+=1)h[u].metadata.hasOwnProperty("cmap")&&(e=h[u].metadata.cmap.unicode.codeMap[d[f].charCodeAt(0)]),e||256>d[f].charCodeAt(0)&&h[u].metadata.hasOwnProperty("Unicode")?c+=d[f]:c+="";var g="";return 14>parseInt(u.slice(1))||"WinAnsiEncoding"===p?g=s(c,u).split("").map(function(t){return t.charCodeAt(0).toString(16)}).join(""):"Identity-H"===p&&(g=uj(c,h[u])),o.isHex=!0,{text:g,x:r,y:i,options:a,mutex:o}},uI.events.push(["postProcessText",function(t){var e=t.text||"",n=[],r={text:e,x:t.x,y:t.y,options:t.options,mutex:t.mutex};if(Array.isArray(e)){var i=0;for(i=0;i<e.length;i+=1)Array.isArray(e[i])&&3===e[i].length?n.push([uF(Object.assign({},r,{text:e[i][0]})).text,e[i][1],e[i][2]]):n.push(uF(Object.assign({},r,{text:e[i]})).text);t.text=n}else t.text=uF(Object.assign({},r,{text:e})).text}]),uB=sB.API,uO=function(){return void 0===this.internal.vFS&&(this.internal.vFS={}),!0},uB.existsFileInVFS=function(t){return uO.call(this),void 0!==this.internal.vFS[t]},uB.addFileToVFS=function(t,e){return uO.call(this),this.internal.vFS[t]=e,this},uB.getFileFromVFS=function(t){return uO.call(this),void 0!==this.internal.vFS[t]?this.internal.vFS[t]:null},sB.__bidiEngine__=sB.prototype.__bidiEngine__=function(t){var e,n,r,i,a,o,s,l=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],h=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],u={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},c={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},f=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","","","","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],d=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),p=!1,g=0;this.__bidiEngine__={};var m=function(t){var e=t.charCodeAt(),n=e>>8,r=c[n];return void 0!==r?uT[256*r+(255&e)]:252===n||253===n?"AL":d.test(n)?"L":8===n?"R":"N"},v=function(t){for(var e,n=0;n<t.length&&"L"!==(e=m(t.charAt(n)));n++)if("R"===e)return!0;return!1},b=function(t,a,o,s){var l,h,u,c,f=a[s];switch(f){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":p=!1;break;case"N":case"AN":break;case"EN":p&&(f="AN");break;case"AL":p=!0,f="R";break;case"WS":case"BN":f="N";break;case"CS":s<1||s+1>=a.length||"EN"!==(l=o[s-1])&&"AN"!==l||"EN"!==(h=a[s+1])&&"AN"!==h?f="N":p&&(h="AN"),f=h===l?h:"N";break;case"ES":f="EN"===(l=s>0?o[s-1]:"B")&&s+1<a.length&&"EN"===a[s+1]?"EN":"N";break;case"ET":if(s>0&&"EN"===o[s-1]){f="EN";break}if(p){f="N";break}for(u=s+1,c=a.length;u<c&&"ET"===a[u];)u++;f=u<c&&"EN"===a[u]?"EN":"N";break;case"NSM":if(r&&!i){for(c=a.length,u=s+1;u<c&&"NSM"===a[u];)u++;if(u<c){var d=t[s];if(l=a[u],(d>=1425&&d<=2303||64286===d)&&("R"===l||"AL"===l)){f="R";break}}}f=s<1||"B"===(l=a[s-1])?"N":o[s-1];break;case"B":p=!1,e=!0,f=g;break;case"S":n=!0,f="N"}return f},y=function(t,e,n){var r=t.split("");return n&&w(r,n,{hiLevel:g}),r.reverse(),e&&e.reverse(),r.join("")},w=function(t,r,i){var a,o,s,c,f,d=-1,v=t.length,y=0,w=[],_=g?h:l,x=[];for(p=!1,e=!1,n=!1,o=0;o<v;o++)x[o]=m(t[o]);for(s=0;s<v;s++){if(f=y,w[s]=b(t,x,w,s),a=240&(y=_[f][u[w[s]]]),y&=15,r[s]=c=_[y][5],a>0)if(16===a){for(o=d;o<s;o++)r[o]=1;d=-1}else d=-1;if(_[y][6])-1===d&&(d=s);else if(d>-1){for(o=d;o<s;o++)r[o]=c;d=-1}"B"===x[s]&&(r[s]=0),i.hiLevel|=c}n&&function(t,e,n){for(var r=0;r<n;r++)if("S"===t[r]){e[r]=g;for(var i=r-1;i>=0&&"WS"===t[i];i--)e[i]=g}}(x,r,v)},_=function(t,n,r,i,a){if(!(a.hiLevel<t)){if(1===t&&1===g&&!e)return n.reverse(),void(r&&r.reverse());for(var o,s,l,h,u=n.length,c=0;c<u;){if(i[c]>=t){for(l=c+1;l<u&&i[l]>=t;)l++;for(h=c,s=l-1;h<s;h++,s--)o=n[h],n[h]=n[s],n[s]=o,r&&(o=r[h],r[h]=r[s],r[s]=o);c=l}c++}}},x=function(t,e,n){var r=t.split(""),i={hiLevel:g};return n||(n=[]),w(r,n,i),function(t,e,n){if(0!==n.hiLevel&&s)for(var r,i=0;i<t.length;i++)1===e[i]&&(r=f.indexOf(t[i]))>=0&&(t[i]=f[r+1])}(r,n,i),_(2,r,e,n,i),_(1,r,e,n,i),r.join("")};return this.__bidiEngine__.doBidiReorder=function(t,e,n){if(function(t,e){if(e)for(var n=0;n<t.length;n++)e[n]=n;void 0===i&&(i=v(t)),void 0===o&&(o=v(t))}(t,e),r||!a||o)if(r&&a&&i^o)g=+!!i,t=y(t,e,n);else if(!r&&a&&o)g=+!!i,t=y(t=x(t,e,n),e);else if(!r||i||a||o){if(r&&!a&&i^o)t=y(t,e),i?(g=0,t=x(t,e,n)):(g=1,t=y(t=x(t,e,n),e));else if(r&&i&&!a&&o)g=1,t=y(t=x(t,e,n),e);else if(!r&&!a&&i^o){var l=s;i?(g=1,t=x(t,e,n),g=0,s=!1,t=x(t,e,n),s=l):(g=0,t=y(t=x(t,e,n),e),g=1,s=!1,t=x(t,e,n),s=l,t=y(t,e))}}else g=0,t=x(t,e,n);else g=+!!i,t=x(t,e,n);return t},this.__bidiEngine__.setOptions=function(t){t&&(r=t.isInputVisual,a=t.isOutputVisual,i=t.isInputRtl,o=t.isOutputRtl,s=t.isSymmetricSwapping)},this.__bidiEngine__.setOptions(t),this.__bidiEngine__},uT=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],uR=new sB.__bidiEngine__({isInputVisual:!0}),sB.API.events.push(["postProcessText",function(t){var e=t.text;t.x,t.y;var n=t.options||{};t.mutex,n.lang;var r=[];if(n.isInputVisual="boolean"!=typeof n.isInputVisual||n.isInputVisual,uR.setOptions(n),"[object Array]"===Object.prototype.toString.call(e)){var i=0;for(r=[],i=0;i<e.length;i+=1)"[object Array]"===Object.prototype.toString.call(e[i])?r.push([uR.doBidiReorder(e[i][0]),e[i][1],e[i][2]]):r.push([uR.doBidiReorder(e[i])]);t.text=r}else t.text=uR.doBidiReorder(e);uR.setOptions({isInputVisual:!0})}]),sB.API.TTFFont=function(){function t(t){var e;if(this.rawData=t,e=this.contents=new uz(t),this.contents.pos=4,"ttcf"===e.readString(4))throw Error("TTCF not supported.");e.pos=0,this.parse(),this.subset=new u4(this),this.registerTTF()}return t.open=function(e){return new t(e)},t.prototype.parse=function(){return this.directory=new uq(this.contents),this.head=new uH(this),this.name=new uZ(this),this.cmap=new uX(this),this.toUnicode={},this.hhea=new uY(this),this.maxp=new uK(this),this.hmtx=new uQ(this),this.post=new uG(this),this.os2=new uV(this),this.loca=new u3(this),this.glyf=new u0(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var t,e,n,r,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var e,n,r,i;for(i=[],e=0,n=(r=this.bbox).length;e<n;e++)t=r[e],i.push(Math.round(t*this.scaleFactor));return i}).call(this),this.stemV=0,this.post.exists?(n=255&(r=this.post.italic_angle),32768&(e=r>>16)&&(e=-(1+(65535^e))),this.italicAngle=+(e+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(i=this.familyClass)||2===i||3===i||4===i||5===i||7===i,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw Error("No unicode cmap for font")},t.prototype.characterToGlyph=function(t){var e;return(null!=(e=this.cmap.unicode)?e.codeMap[t]:void 0)||0},t.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*e},t.prototype.widthOfString=function(t,e,n){var r,i,a,o;for(a=0,i=0,o=(t=""+t).length;0<=o?i<o:i>o;i=0<=o?++i:--i)r=t.charCodeAt(i),a+=this.widthOfGlyph(this.characterToGlyph(r))+1e3/e*n||0;return e/1e3*a},t.prototype.lineHeight=function(t,e){var n;return null==e&&(e=!1),n=e?this.lineGap:0,(this.ascender+n-this.decender)/1e3*t},t}();var hz,hq,hU,h$,hH,hW,hX,hY,hV,hG,hJ,hZ,hK,hQ,h1,h0,h2,h5,h3,h4,h6,h8,h7,h9,ut,ue,un,ur,ui,ua,uo,us,ul,uh,uu,uc,uf,ud,up,ug,um,uv,ub,uy,uw,u_,ux,uN,uA,uL,uk,uS,uC,uP,uE,uI,uj,uM,uF,uB,uO,uT,uR,uD,uz=function(){function t(t){this.data=null!=t?t:[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(t){return this.data[this.pos++]=t},t.prototype.readUInt32=function(){return 0x1000000*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=0x80000000?t-0x100000000:t},t.prototype.writeInt32=function(t){return t<0&&(t+=0x100000000),this.writeUInt32(t)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},t.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},t.prototype.readString=function(t){var e,n;for(n=[],e=0;0<=t?e<t:e>t;e=0<=t?++e:--e)n[e]=String.fromCharCode(this.readByte());return n.join("")},t.prototype.writeString=function(t){var e,n,r;for(r=[],e=0,n=t.length;0<=n?e<n:e>n;e=0<=n?++e:--e)r.push(this.writeByte(t.charCodeAt(e)));return r},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(t){return this.writeInt16(t)},t.prototype.readLongLong=function(){var t,e,n,r,i,a,o,s;return t=this.readByte(),e=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),a=this.readByte(),o=this.readByte(),s=this.readByte(),128&t?-1*(0x100000000000000*(255^t)+0x1000000000000*(255^e)+0x10000000000*(255^n)+0x100000000*(255^r)+0x1000000*(255^i)+65536*(255^a)+256*(255^o)+(255^s)+1):0x100000000000000*t+0x1000000000000*e+0x10000000000*n+0x100000000*r+0x1000000*i+65536*a+256*o+s},t.prototype.writeLongLong=function(t){var e,n;return e=Math.floor(t/0x100000000),n=0|t,this.writeByte(e>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var e,n;for(e=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)e.push(this.readByte());return e},t.prototype.write=function(t){var e,n,r,i;for(i=[],n=0,r=t.length;n<r;n++)e=t[n],i.push(this.writeByte(e));return i},t}(),uq=function(){var t;function e(t){var e,n,r;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},n=0,r=this.tableCount;0<=r?n<r:n>r;n=0<=r?++n:--n)e={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[e.tag]=e}return e.prototype.encode=function(e){var n,r,i,a,o,s,l,h,u,c,f,d,p;for(p in a=Math.floor((u=16*Math.floor(Math.log(f=Object.keys(e).length)/(s=Math.log(2))))/s),h=16*f-u,(r=new uz).writeInt(this.scalarType),r.writeShort(f),r.writeShort(u),r.writeShort(a),r.writeShort(h),i=16*f,l=r.pos+i,o=null,d=[],e)for(c=e[p],r.writeString(p),r.writeInt(t(c)),r.writeInt(l),r.writeInt(c.length),d=d.concat(c),"head"===p&&(o=l),l+=c.length;l%4;)d.push(0),l++;return r.write(d),n=0xb1b0afba-t(r.data),r.pos=o+8,r.writeUInt32(n),r.data},t=function(t){var e,n,r,i;for(t=u1.call(t);t.length%4;)t.push(0);for(r=new uz(t),n=0,e=0,i=t.length;e<i;e=e+=4)n+=r.readUInt32();return 0|n},e}(),uU={}.hasOwnProperty,u$=function(t,e){for(var n in e)uU.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t};uD=function(){function t(t){var e;this.file=t,e=this.file.directory.tables[this.tag],this.exists=!!e,e&&(this.offset=e.offset,this.length=e.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}();var uH=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return u$(t,uD),t.prototype.tag="head",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},t.prototype.encode=function(t){var e;return(e=new uz).writeInt(this.version),e.writeInt(this.revision),e.writeInt(this.checkSumAdjustment),e.writeInt(this.magicNumber),e.writeShort(this.flags),e.writeShort(this.unitsPerEm),e.writeLongLong(this.created),e.writeLongLong(this.modified),e.writeShort(this.xMin),e.writeShort(this.yMin),e.writeShort(this.xMax),e.writeShort(this.yMax),e.writeShort(this.macStyle),e.writeShort(this.lowestRecPPEM),e.writeShort(this.fontDirectionHint),e.writeShort(t),e.writeShort(this.glyphDataFormat),e.data},t}(),uW=function(){function t(t,e){var n,r,i,a,o,s,l,h,u,c,f,d,p,g,m,v;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=e+t.readInt(),u=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(s=0;s<256;++s)this.codeMap[s]=t.readByte();break;case 4:for(c=t.readUInt16()/2,t.pos+=6,i=function(){var e,n;for(n=[],s=e=0;0<=c?e<c:e>c;s=0<=c?++e:--e)n.push(t.readUInt16());return n}(),t.pos+=2,d=function(){var e,n;for(n=[],s=e=0;0<=c?e<c:e>c;s=0<=c?++e:--e)n.push(t.readUInt16());return n}(),l=function(){var e,n;for(n=[],s=e=0;0<=c?e<c:e>c;s=0<=c?++e:--e)n.push(t.readUInt16());return n}(),h=function(){var e,n;for(n=[],s=e=0;0<=c?e<c:e>c;s=0<=c?++e:--e)n.push(t.readUInt16());return n}(),r=(this.length-t.pos+this.offset)/2,o=function(){var e,n;for(n=[],s=e=0;0<=r?e<r:e>r;s=0<=r?++e:--e)n.push(t.readUInt16());return n}(),s=g=0,v=i.length;g<v;s=++g)for(p=i[s],n=m=f=d[s];f<=p?m<=p:m>=p;n=f<=p?++m:--m)0===h[s]?a=n+l[s]:0!==(a=o[h[s]/2+(n-f)-(c-s)]||0)&&(a+=l[s]),this.codeMap[n]=65535&a}t.pos=u}return t.encode=function(t,e){var n,r,i,a,o,s,l,h,u,c,f,d,p,g,m,v,b,y,w,_,x,N,A,L,k,S,C,P,E,I,j,M,F,B,O,T,R,D,z,q,U,$,H,W,X,Y;switch(P=new uz,a=Object.keys(t).sort(function(t,e){return t-e}),e){case"macroman":for(p=0,g=function(){var t=[];for(d=0;d<256;++d)t.push(0);return t}(),v={0:0},i={},E=0,F=a.length;E<F;E++)null==v[H=t[r=a[E]]]&&(v[H]=++p),i[r]={old:t[r],new:v[t[r]]},g[r]=v[t[r]];return P.writeUInt16(1),P.writeUInt16(0),P.writeUInt32(12),P.writeUInt16(0),P.writeUInt16(262),P.writeUInt16(0),P.write(g),{charMap:i,subtable:P.data,maxGlyphID:p+1};case"unicode":for(S=[],u=[],b=0,v={},n={},m=l=null,I=0,B=a.length;I<B;I++)null==v[w=t[r=a[I]]]&&(v[w]=++b),n[r]={old:w,new:v[w]},o=v[w]-r,null!=m&&o===l||(m&&u.push(m),S.push(r),l=o),m=r;for(m&&u.push(m),u.push(65535),S.push(65535),L=2*(A=S.length),c=Math.log((N=2*Math.pow(Math.log(A)/Math.LN2,2))/2)/Math.LN2,x=2*A-N,s=[],_=[],f=[],d=j=0,O=S.length;j<O;d=++j){if(k=S[d],h=u[d],65535===k){s.push(0),_.push(0);break}if(k-(C=n[k].new)>=32768)for(s.push(0),_.push(2*(f.length+A-d)),r=M=k;k<=h?M<=h:M>=h;r=k<=h?++M:--M)f.push(n[r].new);else s.push(C-k),_.push(0)}for(P.writeUInt16(3),P.writeUInt16(1),P.writeUInt32(12),P.writeUInt16(4),P.writeUInt16(16+8*A+2*f.length),P.writeUInt16(0),P.writeUInt16(L),P.writeUInt16(N),P.writeUInt16(c),P.writeUInt16(x),U=0,T=u.length;U<T;U++)r=u[U],P.writeUInt16(r);for(P.writeUInt16(0),$=0,R=S.length;$<R;$++)r=S[$],P.writeUInt16(r);for(W=0,D=s.length;W<D;W++)o=s[W],P.writeUInt16(o);for(X=0,z=_.length;X<z;X++)y=_[X],P.writeUInt16(y);for(Y=0,q=f.length;Y<q;Y++)p=f[Y],P.writeUInt16(p);return{charMap:n,subtable:P.data,maxGlyphID:b+1}}},t}(),uX=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return u$(t,uD),t.prototype.tag="cmap",t.prototype.parse=function(t){var e,n,r;for(t.pos=this.offset,this.version=t.readUInt16(),r=t.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=r?n<r:n>r;n=0<=r?++n:--n)e=new uW(t,this.offset),this.tables.push(e),e.isUnicode&&null==this.unicode&&(this.unicode=e);return!0},t.encode=function(t,e){var n,r;return null==e&&(e="macroman"),n=uW.encode(t,e),(r=new uz).writeUInt16(0),r.writeUInt16(1),n.table=r.data.concat(n.subtable),n},t}(),uY=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return u$(t,uD),t.prototype.tag="hhea",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},t}(),uV=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return u$(t,uD),t.prototype.tag="OS/2",t.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var e,n;for(n=[],e=0;e<10;++e)n.push(t.readByte());return n}(),this.charRange=function(){var e,n;for(n=[],e=0;e<4;++e)n.push(t.readInt());return n}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var e,n;for(n=[],e=0;e<2;e=++e)n.push(t.readInt());return n}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},t}(),uG=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return u$(t,uD),t.prototype.tag="post",t.prototype.parse=function(t){var e,n,r,i;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:case 196608:break;case 131072:for(n=t.readUInt16(),this.glyphNameIndex=[],i=0;0<=n?i<n:i>n;i=0<=n?++i:--i)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],r=[];t.pos<this.offset+this.length;)e=t.readByte(),r.push(this.names.push(t.readString(e)));return r;case 151552:return n=t.readUInt16(),this.offsets=t.read(n);case 262144:return this.map=(function(){var e,n,r;for(r=[],i=e=0,n=this.file.maxp.numGlyphs;0<=n?e<n:e>n;i=0<=n?++e:--e)r.push(t.readUInt32());return r}).call(this)}},t}(),uJ=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},uZ=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return u$(t,uD),t.prototype.tag="name",t.prototype.parse=function(t){var e,n,r,i,a,o,s,l,h,u;for(t.pos=this.offset,t.readShort(),e=t.readShort(),o=t.readShort(),n=[],i=0;0<=e?i<e:i>e;i=0<=e?++i:--i)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+o+t.readShort()});for(s={},i=l=0,h=n.length;l<h;i=++l)t.pos=(r=n[i]).offset,a=new uJ(t.readString(r.length),r),null==s[u=r.nameID]&&(s[u]=[]),s[r.nameID].push(a);this.strings=s,this.copyright=s[0],this.fontFamily=s[1],this.fontSubfamily=s[2],this.uniqueSubfamily=s[3],this.fontName=s[4],this.version=s[5];try{this.postscriptName=s[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(t){this.postscriptName=s[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=s[7],this.manufacturer=s[8],this.designer=s[9],this.description=s[10],this.vendorUrl=s[11],this.designerUrl=s[12],this.license=s[13],this.licenseUrl=s[14],this.preferredFamily=s[15],this.preferredSubfamily=s[17],this.compatibleFull=s[18],this.sampleText=s[19]},t}(),uK=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return u$(t,uD),t.prototype.tag="maxp",t.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},t}(),uQ=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return u$(t,uD),t.prototype.tag="hmtx",t.prototype.parse=function(t){var e,n,r,i,a,o,s;for(t.pos=this.offset,this.metrics=[],e=0,o=this.file.hhea.numberOfMetrics;0<=o?e<o:e>o;e=0<=o?++e:--e)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var n,i;for(i=[],e=n=0;0<=r?n<r:n>r;e=0<=r?++n:--n)i.push(t.readInt16());return i}(),this.widths=(function(){var t,e,n,r;for(r=[],t=0,e=(n=this.metrics).length;t<e;t++)i=n[t],r.push(i.advance);return r}).call(this),n=this.widths[this.widths.length-1],s=[],e=a=0;0<=r?a<r:a>r;e=0<=r?++a:--a)s.push(this.widths.push(n));return s},t.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},t}(),u1=[].slice,u0=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return u$(t,uD),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(t){var e,n,r,i,a,o,s,l,h,u;return t in this.cache?this.cache[t]:(i=this.file.loca,e=this.file.contents,n=i.indexOf(t),0===(r=i.lengthOf(t))?this.cache[t]=null:(e.pos=this.offset+n,a=(o=new uz(e.read(r))).readShort(),l=o.readShort(),u=o.readShort(),s=o.readShort(),h=o.readShort(),this.cache[t]=-1===a?new u5(o,l,u,s,h):new u2(o,a,l,u,s,h),this.cache[t]))},t.prototype.encode=function(t,e,n){var r,i,a,o,s;for(a=[],i=[],o=0,s=e.length;o<s;o++)r=t[e[o]],i.push(a.length),r&&(a=a.concat(r.encode(n)));return i.push(a.length),{table:a,offsets:i}},t}(),u2=function(){function t(t,e,n,r,i,a){this.raw=t,this.numberOfContours=e,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=a,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),u5=function(){function t(t,e,n,r,i){var a,o;for(this.raw=t,this.xMin=e,this.yMin=n,this.xMax=r,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],a=this.raw;o=a.readShort(),this.glyphOffsets.push(a.pos),this.glyphIDs.push(a.readUInt16()),32&o;)a.pos+=1&o?4:2,128&o?a.pos+=8:64&o?a.pos+=4:8&o&&(a.pos+=2)}return t.prototype.encode=function(){var t,e,n;for(e=new uz(u1.call(this.raw.data)),t=0,n=this.glyphIDs.length;t<n;++t)e.pos=this.glyphOffsets[t];return e.data},t}(),u3=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return u$(t,uD),t.prototype.tag="loca",t.prototype.parse=function(t){var e,n;return t.pos=this.offset,e=this.file.head.indexToLocFormat,this.offsets=0===e?(function(){var e,r;for(r=[],n=0,e=this.length;n<e;n+=2)r.push(2*t.readUInt16());return r}).call(this):(function(){var e,r;for(r=[],n=0,e=this.length;n<e;n+=4)r.push(t.readUInt32());return r}).call(this)},t.prototype.indexOf=function(t){return this.offsets[t]},t.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},t.prototype.encode=function(t,e){for(var n=new Uint32Array(this.offsets.length),r=0,i=0,a=0;a<n.length;++a)if(n[a]=r,i<e.length&&e[i]==a){++i,n[a]=r;var o=this.offsets[a],s=this.offsets[a+1]-o;s>0&&(r+=s)}for(var l=Array(4*n.length),h=0;h<n.length;++h)l[4*h+3]=255&n[h],l[4*h+2]=(65280&n[h])>>8,l[4*h+1]=(0xff0000&n[h])>>16,l[4*h]=(0xff000000&n[h])>>24;return l},t}(),u4=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,e,n,r,i;for(e in r=this.font.cmap.tables[0].codeMap,t={},i=this.subset)n=i[e],t[e]=r[n];return t},t.prototype.glyphsFor=function(t){var e,n,r,i,a,o,s;for(r={},a=0,o=t.length;a<o;a++)r[i=t[a]]=this.font.glyf.glyphFor(i);for(i in e=[],r)(null!=(n=r[i])?n.compound:void 0)&&e.push.apply(e,n.glyphIDs);if(e.length>0)for(i in s=this.glyphsFor(e))n=s[i],r[i]=n;return r},t.prototype.encode=function(t,e){var n,r,i,a,o,s,l,h,u,c,f,d,p,g,m;for(r in n=uX.encode(this.generateCmap(),"unicode"),a=this.glyphsFor(t),f={0:0},m=n.charMap)f[(s=m[r]).old]=s.new;for(d in c=n.maxGlyphID,a)d in f||(f[d]=c++);return u=Object.keys(h=function(t){var e,n;for(e in n={},t)n[t[e]]=e;return n}(f)).sort(function(t,e){return t-e}),p=function(){var t,e,n;for(n=[],t=0,e=u.length;t<e;t++)o=u[t],n.push(h[o]);return n}(),i=this.font.glyf.encode(a,p,f),l=this.font.loca.encode(i.offsets,p),g={cmap:this.font.cmap.raw(),glyf:i.table,loca:l,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(e)},this.font.os2.exists&&(g["OS/2"]=this.font.os2.raw()),this.font.directory.encode(g)},t}();sB.API.PDFObject=function(){var t;function e(){}return t=function(t,e){return(Array(e+1).join("0")+t).slice(-e)},e.convert=function(n){var r,i,a,o;if(Array.isArray(n))return"["+(function(){var t,i,a;for(a=[],t=0,i=n.length;t<i;t++)r=n[t],a.push(e.convert(r));return a})().join(" ")+"]";if("string"==typeof n)return"/"+n;if(null!=n?n.isString:void 0)return"("+n+")";if(n instanceof Date)return"(D:"+t(n.getUTCFullYear(),4)+t(n.getUTCMonth(),2)+t(n.getUTCDate(),2)+t(n.getUTCHours(),2)+t(n.getUTCMinutes(),2)+t(n.getUTCSeconds(),2)+"Z)";if("[object Object]"===({}).toString.call(n)){for(i in a=["<<"],n)o=n[i],a.push("/"+i+" "+e.convert(o));return a.push(">>"),a.join("\n")}return""+n},e}();let u6=(0,u.forwardRef)(({members:t,rootId:e,onMemberClick:n,onExport:r,relationMode:i=!1,selectedMembers:a=[]},o)=>{console.log("D3OrgChartFlow render, selectedMembers:",a,"relationMode:",i);let l=(0,u.useRef)(null),h=(0,u.useRef)(null),[f,d]=(0,u.useState)(!1),[p,g]=(0,u.useState)(new Map);(0,u.useEffect)(()=>((async()=>{let e=new Map;for(let n of Object.values(t))if(n.avatarImageId)try{let t=await c.db.images.get(n.avatarImageId);if(t){let r=URL.createObjectURL(t.blob);e.set(n.avatarImageId,r)}}catch(t){console.error(`Failed to load avatar for ${n.fullName}:`,t)}g(e)})(),()=>{p.forEach(t=>URL.revokeObjectURL(t))}),[t]),(0,u.useEffect)(()=>{if(!l.current||!e)return;l.current&&(l.current.innerHTML="");let r=(()=>{let n=[];if(!t[e])return[];let r=new Set,i=[e];for(;i.length>0;){let a=i.shift();if(r.has(a))continue;r.add(a);let o=t[a];if(!o)continue;let s=o.spouseIds?.map(e=>t[e]).filter(Boolean)||[],l=null;if(a!==e){let e=o.fatherId?t[o.fatherId]:null,n=o.motherId?t[o.motherId]:null,r=e&&o.surname===e.surname,i=n&&o.surname===n.surname;r?l=o.fatherId||null:i?l=o.motherId||null:e?l=o.fatherId||null:n&&(l=o.motherId||null)}let h=function(t,e){if(!t)return null;let n=new Date(t),r=e?new Date(e):new Date,i=r.getFullYear()-n.getFullYear(),a=r.getMonth()-n.getMonth();return(a<0||0===a&&r.getDate()<n.getDate())&&i--,i}(o.birthDate,o.deathDate),u=null!==h?o.deathDate?`享年${h}`:`${h}`:"";n.push({id:o.id,parentId:l,name:o.fullName,generation:`${o.generation}`,birthYear:o.birthDate?new Date(o.birthDate).getFullYear().toString():"",deathYear:o.deathDate?new Date(o.deathDate).getFullYear().toString():"",birthPlace:o.birthPlace||"",gender:"MALE"===o.gender?"男":"女",avatarImageId:o.avatarImageId,spouseName:s.length>0?s.map(t=>t.fullName).join(", "):"",spouseId:s.length>0?s[0].id:null,hasChildren:Object.values(t).some(t=>t.fatherId===o.id||t.motherId===o.id),ageText:u}),Object.values(t).forEach(t=>{t.fatherId!==a&&t.motherId!==a||r.has(t.id)||i.push(t.id)})}return n})(),i=new n$().container(l.current).data(r).nodeWidth(()=>160).nodeHeight(()=>120).childrenMargin(()=>50).compactMarginBetween(()=>35).compactMarginPair(()=>35).neighbourMargin(()=>35).siblingsMargin(()=>35).linkUpdate(function(t,e,n){tp(n[e]).attr("stroke","#475569").attr("stroke-width",2.5)}).buttonContent(({node:t})=>`<div style="color:#716E7B;border-radius:5px;padding:4px;font-size:10px;margin:auto auto;background-color:white;border: 1px solid #E4E2E9"> <span style="font-size:9px">${t.children?'<i class="fas fa-angle-up"></i>':'<i class="fas fa-angle-down"></i>'}</span> ${t.data._directSubordinates||0} </div>`).nodeContent(t=>{let e=t.data,n="男"===e.gender?"#3b82f6":"#ec4899",r="男"===e.gender?"#dbeafe":"#fce7f3",i=e.avatarImageId?p.get(e.avatarImageId):null,o=a.includes(e.id);return`
<div style="
position: relative;
width: 160px;
height: 120px;
box-sizing: border-box;
background: ${e.deathYear?"#fafafa":"white"};
border: 2px solid ${n};
border-radius: 10px;
padding: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
cursor: pointer;
transition: all 0.3s;
" onmouseover="this.style.boxShadow='0 4px 12px rgba(0,0,0,0.2)'" onmouseout="this.style.boxShadow='0 2px 8px rgba(0,0,0,0.1)'">
<div style="display: flex; align-items: center; gap: 8px; margin-bottom: 5px;">
<div style="
width: 40px;
height: 40px;
border-radius: 50%;
background: ${r};
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: ${n};
font-weight: bold;
flex-shrink: 0;
overflow: hidden;
border: 1px solid ${n}40;
">
${i?`<img src="${i}" alt="${e.name}" style="width: 100%; height: 100%; object-fit: cover;" />`:(e.gender,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width: 24px; height: 24px;"><circle cx="12" cy="8" r="5"/><path d="M20 21a8 8 0 1 0-16 0"/></svg>')}
</div>
<div style="flex: 1; min-width: 0;">
<div style="font-size: 13px; font-weight: 600; color: #1f2937; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px;">
<span>${e.name}</span>
${o?'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#3b82f6" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>':""}
</div>
<div style="font-size: 9px; color: #6b7280; padding: 1px 4px; background: #f3f4f6; border-radius: 3px; display: inline-block;">
${e.generation}
</div>
</div>
</div>
<div style="font-size: 10px; color: #6b7280; line-height: 1.3;">
${e.birthYear?`<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 1px;">
<span>${e.birthYear}${e.deathYear?` - ${e.deathYear}`:""}</span>
${e.ageText?`<span style="font-size: 9px; color: #9ca3af;">${e.ageText}</span>`:""}
</div>`:""}
${e.birthPlace?`<div style="margin-bottom: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
${e.birthPlace}
</div>`:""}
</div>
${e.spouseName&&e.spouseId?`
<div
class="spouse-area"
data-spouse-id="${e.spouseId}"
style="
margin-top: 4px;
padding: 3px 5px;
background: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 4px;
font-size: 9px;
color: #4b5563;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
transition: all 0.2s;
"
onmouseover="this.style.borderColor='#3b82f6'; this.style.background='#eff6ff'; this.style.color='#1e40af'"
onmouseout="this.style.borderColor='#e5e7eb'; this.style.background='#f9fafb'; this.style.color='#4b5563'"
>
配偶: ${e.spouseName}
</div>
`:""}
${e.deathYear?`
<div style="
position: absolute;
bottom: 4px;
left: 4px;
width: 12px;
height: 12px;
border-radius: 50%;
background: #737373;
border: 2px solid white;
"></div>
`:""}
</div>
`}).onNodeClick(t=>{if(n&&t){let e="string"==typeof t?t:t.data?.id||t.id;e&&n(e)}}).render().expandAll();return setTimeout(()=>{let t=l.current?.querySelectorAll(".spouse-area");t?.forEach(t=>{t.addEventListener("click",e=>{e.stopPropagation();let r=t.getAttribute("data-spouse-id");r&&n&&n(r)})})},100),h.current=i,d(!0),()=>{l.current&&(l.current.innerHTML="")}},[t,e,n,p]);let m=()=>{h.current&&h.current.exportImg({save:!0,full:!0,onLoad:()=>{r?.()}})},v=()=>{h.current&&h.current.exportImg({save:!1,full:!0,onLoad:t=>{let e=new sB({orientation:"landscape",unit:"px",format:"a4"}),n=new Image;n.src=t,n.onload=function(){let t=n.width,i=n.height,a=e.internal.pageSize.getWidth(),o=e.internal.pageSize.getHeight(),s=Math.min(a/t,o/i),l=t*s,h=i*s;e.addImage(n,"PNG",(a-l)/2,(o-h)/2,l,h),e.save(`家谱图-${new Date().toISOString().split("T")[0]}.pdf`),r?.()}}})},b=()=>{h.current&&h.current.expandAll()},y=()=>{h.current&&h.current.collapseAll()},w=()=>{h.current&&h.current.fit()};return(0,u.useImperativeHandle)(o,()=>({exportPNG:m,exportPDF:v,expandAll:b,collapseAll:y,fitView:w})),(0,s.jsx)("div",{className:"w-full h-full bg-background rounded-lg border relative",children:(0,s.jsx)("div",{ref:l,className:"w-full h-full",style:{overflow:"hidden"}})},`d3-chart-${e}`)});u6.displayName="D3OrgChartFlow";let u8=(0,u.memo)(u6,(t,e)=>t.rootId===e.rootId&&t.members===e.members);var u7=t.i(60207),u9=t.i(9991),ct=t.i(99495),ce=t.i(90432),cn=t.i(90672),cr=t.i(78657);let ci=(0,g.default)("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),ca=(0,g.default)("Move",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]);var co=t.i(42864);let cs=(0,g.default)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var cl=t.i(49515),ch=t.i(43359);function cu(){let{treeData:e}=(0,w.useFamily)(),{calculateRelationship:n}=(0,u7.useRelationship)(),r=(0,_.useRouter)(),i=(0,_.useSearchParams)(),[a,o]=(0,u.useState)("traditional"),[h,c]=(0,u.useState)(!1),[f,d]=(0,u.useState)([]),[p,g]=(0,u.useState)(null),[m,v]=(0,u.useState)(!1),b=(0,u.useRef)(h),y=(0,u.useRef)(f);(0,u.useEffect)(()=>{b.current=h,y.current=f},[h,f]),(0,u.useEffect)(()=>{let t=i.get("view");("d3-org-chart"===t||"traditional"===t)&&o(t)},[i]);let[N,A]=(0,u.useState)(1),[L,k]=(0,u.useState)({x:0,y:0}),[S,C]=(0,u.useState)(!1),[P,E]=(0,u.useState)({x:0,y:0}),[I,j]=(0,u.useState)({x:0,y:0}),M=(0,u.useRef)(null),F=(0,u.useRef)(null),B=()=>{C(!1)},O=(0,u.useCallback)(t=>{if(console.log("D3 onMemberClick triggered:",t,"relationMode:",b.current),b.current){console.log("Calling handleMemberClick");let r=(t,e)=>{let n=document.querySelector(".w-full.h-full.bg-background.rounded-lg.border"),r=n?.querySelector("svg");r&&r.querySelectorAll("foreignObject").forEach(n=>{let r=n.parentNode?.__data__?.data;if(r?.id===t){let t=n.querySelector('div[style*="font-size: 13px"]');if(t)if(e)t.querySelector("svg")||(t.style.display="flex",t.style.alignItems="center",t.insertAdjacentHTML("beforeend",'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#3b82f6" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" style="margin-left: 4px"><polyline points="20 6 9 17 4 12"/></svg>'));else{let e=t.querySelector("svg");e&&e.remove()}}})};if(0===y.current.length)r(t,!0),d([t]);else if(1===y.current.length){let[i]=y.current;if(i===t){r(t,!1),d([]);return}r(t,!0);let a=n(i,t);g({from:e.members[i],to:e.members[t],relationship:a}),v(!0),d([]),c(!1)}}else console.log("Navigating to member detail"),r.push(`/members/${t}`)},[r,n,e.members]),T=async()=>{if(M.current)try{let e={...L};k({x:0,y:0}),A(1),await new Promise(t=>setTimeout(t,800));let n=M.current.querySelector('div[style*="transform"]');if(!n)throw Error("找不到族谱容器");let r=n.querySelectorAll("div"),i=[];r.forEach(t=>{String(t.className||"").includes("bg-foreground")&&i.push(t)});let a=n.cloneNode(!0),o=a.querySelectorAll("div"),s=0;o.forEach(t=>{if(String(t.className||"").includes("bg-foreground")&&i[s]){let e=i[s],n=window.getComputedStyle(e);t.style.backgroundColor=n.backgroundColor,t.style.width=n.width,t.style.height=n.height,t.style.position="absolute",t.style.left=n.left,t.style.top=n.top,s++}}),a.querySelectorAll("*").forEach(t=>{let e=String(t.className||"");e.includes("bg-foreground")||e.includes("pointer-events-none")||(t.style.border="none",t.style.outline="none")}),a.style.position="fixed",a.style.left="-9999px",a.style.top="0",document.body.appendChild(a),await new Promise(t=>setTimeout(t,200));let l=await t.A(91205),h=await l.default.toBlob(a,{quality:.95,bgcolor:"#ffffff"});document.body.removeChild(a),k(e),A(N);let u=URL.createObjectURL(h),c=document.createElement("a");c.download=`family-tree-${new Date().toISOString().split("T")[0]}.png`,c.href=u,c.click(),setTimeout(()=>URL.revokeObjectURL(u),100)}catch(t){console.error("导出图片失败:",t)}};return e.rootId?(0,s.jsxs)("div",{className:"h-screen flex flex-col bg-muted/30 overflow-hidden",children:[(0,s.jsx)(l.SiteHeader,{}),(0,s.jsxs)("div",{className:"absolute top-20 right-4 z-30 flex gap-2",children:[(0,s.jsxs)(u9.Button,{variant:h?"default":"outline",className:"gap-2 shadow-lg",onClick:()=>{c(!h),d([]),g(null)},children:[(0,s.jsx)(ch.Users,{className:"h-4 w-4"}),h?0===f.length?"选择第一个成员":"选择第二个成员":"关系查询"]}),(0,s.jsxs)(ct.DropdownMenu,{children:[(0,s.jsx)(ct.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsxs)(u9.Button,{variant:"outline",className:"gap-2 shadow-lg",children:[(0,s.jsx)(cs,{className:"h-4 w-4"}),"traditional"===a?"传统视图":"D3家谱图",(0,s.jsx)(cl.ChevronDown,{className:"h-3 w-3"})]})}),(0,s.jsxs)(ct.DropdownMenuContent,{align:"end",className:"w-48",children:[(0,s.jsx)(ct.DropdownMenuItem,{onClick:()=>{let t=new URLSearchParams(i.toString());t.set("view","traditional"),r.push(`/tree?${t.toString()}`)},className:"traditional"===a?"bg-accent":"",children:(0,s.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,s.jsx)("span",{children:"传统家谱视图"}),"traditional"===a&&(0,s.jsx)("span",{className:"text-primary",children:"✓"})]})}),(0,s.jsx)(ct.DropdownMenuItem,{onClick:()=>{let t=new URLSearchParams(i.toString());t.set("view","d3-org-chart"),r.push(`/tree?${t.toString()}`)},className:"d3-org-chart"===a?"bg-accent":"",children:(0,s.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,s.jsx)("span",{children:"D3 家谱图"}),"d3-org-chart"===a&&(0,s.jsx)("span",{className:"text-primary",children:"✓"})]})})]})]})]}),"traditional"===a?(0,s.jsxs)("div",{className:"flex-1 relative",children:[(0,s.jsxs)("div",{className:"absolute top-4 left-4 z-20 flex flex-col gap-2 bg-background/80 backdrop-blur p-2 rounded-lg border shadow-sm",children:[(0,s.jsx)(u9.Button,{variant:"outline",size:"icon",onClick:()=>A(t=>Math.min(t+.1,2)),children:(0,s.jsx)(cr.ZoomIn,{className:"h-4 w-4"})}),(0,s.jsx)(u9.Button,{variant:"outline",size:"icon",onClick:()=>A(t=>Math.max(t-.1,.1)),children:(0,s.jsx)(ci,{className:"h-4 w-4"})}),(0,s.jsx)(u9.Button,{variant:"outline",size:"icon",onClick:()=>k({x:0,y:0}),children:(0,s.jsx)(ca,{className:"h-4 w-4"})}),(0,s.jsx)("div",{className:"h-px bg-border my-1"}),(0,s.jsx)(u9.Button,{variant:"outline",size:"icon",onClick:T,title:"导出为图片",children:(0,s.jsx)(co.Download,{className:"h-4 w-4"})})]}),(0,s.jsx)("div",{ref:M,className:"w-full h-full overflow-hidden cursor-move relative touch-none bg-[url('https://www.transparenttextures.com/patterns/rice-paper.png')] bg-repeat select-none",onMouseDown:t=>{t.target.closest(".family-node-card")||(C(!0),E({x:t.clientX-L.x,y:t.clientY-L.y}),j({x:t.clientX,y:t.clientY}))},onMouseMove:t=>{if(!S)return;let e=Math.abs(t.clientX-I.x),n=Math.abs(t.clientY-I.y);e<5&&n<5||k({x:t.clientX-P.x,y:t.clientY-P.y})},onMouseUp:B,onMouseLeave:B,children:(0,s.jsx)("div",{style:{transform:`translate(${L.x}px, ${L.y}px) scale(${N})`,transformOrigin:"top center",transition:S?"none":"transform 0.1s ease-out"},className:"absolute min-w-full min-h-full flex justify-center pt-20 pb-20",children:(0,s.jsx)(x,{rootId:e.rootId,relationMode:h,selectedMembers:f,onMemberClick:t=>{if(0===f.length)d([t]);else if(1===f.length){let[r]=f;if(r===t)return void d([]);let i=n(r,t);g({from:e.members[r],to:e.members[t],relationship:i}),v(!0),d([]),c(!1)}}})})})]}):(0,s.jsxs)("div",{className:"flex-1 relative",children:[(0,s.jsxs)("div",{className:"absolute top-4 left-4 z-20 flex flex-col gap-2 bg-background/80 backdrop-blur p-2 rounded-lg border shadow-sm",children:[(0,s.jsx)(u9.Button,{variant:"outline",size:"icon",onClick:()=>F.current?.expandAll(),title:"展开全部",children:(0,s.jsx)(cr.ZoomIn,{className:"h-4 w-4"})}),(0,s.jsx)(u9.Button,{variant:"outline",size:"icon",onClick:()=>F.current?.collapseAll(),title:"折叠全部",children:(0,s.jsx)(ci,{className:"h-4 w-4"})}),(0,s.jsx)(u9.Button,{variant:"outline",size:"icon",onClick:()=>F.current?.fitView(),title:"适应视图",children:(0,s.jsx)(ca,{className:"h-4 w-4"})}),(0,s.jsx)("div",{className:"h-px bg-border my-1"}),(0,s.jsx)(u9.Button,{variant:"outline",size:"icon",onClick:()=>F.current?.exportPNG(),title:"导出PNG",children:(0,s.jsx)(co.Download,{className:"h-4 w-4"})})]}),(0,s.jsx)("div",{className:"w-full h-full p-4",children:(0,s.jsx)(u8,{ref:F,members:e.members,rootId:e.rootId,relationMode:h,selectedMembers:f,onMemberClick:O})})]}),(0,s.jsx)(ce.Dialog,{open:m,onOpenChange:t=>{if(v(t),!t&&p){let t=t=>{let e=document.querySelector(".w-full.h-full.bg-background.rounded-lg.border"),n=e?.querySelector("svg");n&&n.querySelectorAll("foreignObject").forEach(e=>{let n=e.parentNode?.__data__?.data;if(n?.id===t){let t=e.querySelector('div[style*="font-size: 13px"]');if(t){let e=t.querySelector("svg");e&&e.remove()}}})};t(p.from.id),t(p.to.id)}},children:(0,s.jsxs)(ce.DialogContent,{className:"max-w-2xl","aria-describedby":"relation-description",children:[(0,s.jsx)(ce.DialogHeader,{children:(0,s.jsx)(ce.DialogTitle,{children:"关系查询结果"})}),p&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-center gap-4 p-6 bg-muted rounded-lg",children:[(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold font-serif mb-1",children:p.from.fullName}),(0,s.jsxs)("div",{className:"text-sm text-muted-foreground",children:["第",p.from.generation,"世"]})]}),(0,s.jsx)("div",{className:"flex flex-col items-center gap-2",children:(0,s.jsx)(cn.Badge,{variant:"default",className:"text-lg px-4 py-2",children:p.relationship.term})}),(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold font-serif mb-1",children:p.to.fullName}),(0,s.jsxs)("div",{className:"text-sm text-muted-foreground",children:["第",p.to.generation,"世"]})]})]}),(0,s.jsxs)("div",{id:"relation-description",className:"p-4 bg-blue-50 dark:bg-blue-950 rounded-lg",children:[(0,s.jsx)("div",{className:"text-sm font-medium mb-1",children:"关系说明:"}),(0,s.jsxs)("div",{className:"text-muted-foreground",children:[(0,s.jsx)("strong",{children:p.from.fullName})," 是 ",(0,s.jsx)("strong",{children:p.to.fullName})," 的 ",(0,s.jsx)("strong",{className:"text-primary",children:p.relationship.term})]})]}),p.relationship.path&&(0,s.jsxs)("div",{className:"p-4 bg-muted rounded-lg",children:[(0,s.jsx)("div",{className:"text-sm font-medium mb-2",children:"关系路径:"}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground break-all",children:p.relationship.path})]})]})]})})]}):(0,s.jsxs)("div",{className:"min-h-screen bg-background flex flex-col",children:[(0,s.jsx)(l.SiteHeader,{}),(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"暂无家族树数据"})]})}t.s(["default",()=>cu],85398)}]);