(()=>{"use strict";var e,t,n,r,i={2284(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})}},o={};function s(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return i[e].call(n.exports,n,n.exports,s),n.exports}s.m=i,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);s.r(i);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>o[e]=()=>n[e]);return o.default=()=>n,s.d(i,o),i},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,n)=>(s.f[n](e,t),t),[])),s.u=e=>e+".js",s.miniCssF=e=>{},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="surecookie:",s.l=(e,t,i,o)=>{if(n[e])n[e].push(t);else{var a,c;if(void 0!==i)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+i){a=d;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",r+i),a.src=e),n[e]=[t];var h=(t,r)=>{a.onerror=a.onload=null,clearTimeout(f);var i=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach(e=>e(r)),t)return t(r)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),c&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),(()=>{var e={624:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise((n,i)=>r=e[t]=[n,i]);n.push(r[2]=i);var o=s.p+s.u(t),a=new Error;s.l(o,n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,r[1](a)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[o,a,c]=n,l=0;if(o.some(t=>0!==e[t])){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);c&&c(s)}for(t&&t(n);l<o.length;l++)i=o[l],s.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=globalThis.webpackChunksurecookie=globalThis.webpackChunksurecookie||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var a={};s.r(a),s.d(a,{base64:()=>Xp,base64url:()=>Qp,bigint:()=>lm,boolean:()=>hm,browserEmail:()=>Wp,cidrv4:()=>Kp,cidrv6:()=>Yp,cuid:()=>Np,cuid2:()=>Lp,date:()=>im,datetime:()=>am,domain:()=>tm,duration:()=>Op,e164:()=>nm,email:()=>Dp,emoji:()=>Hp,extendedDuration:()=>jp,guid:()=>zp,hex:()=>bm,hostname:()=>em,html5Email:()=>Bp,idnEmail:()=>$p,integer:()=>um,ipv4:()=>Vp,ipv6:()=>Gp,ksuid:()=>Ep,lowercase:()=>mm,mac:()=>Jp,md5_base64:()=>_m,md5_base64url:()=>xm,md5_hex:()=>wm,nanoid:()=>Ip,null:()=>fm,number:()=>dm,rfc5322Email:()=>qp,sha1_base64:()=>Sm,sha1_base64url:()=>Am,sha1_hex:()=>km,sha256_base64:()=>Lm,sha256_base64url:()=>Pm,sha256_hex:()=>Nm,sha384_base64:()=>Em,sha384_base64url:()=>Im,sha384_hex:()=>Cm,sha512_base64:()=>jm,sha512_base64url:()=>zm,sha512_hex:()=>Om,string:()=>cm,time:()=>sm,ulid:()=>Pp,undefined:()=>pm,unicodeEmail:()=>Up,uppercase:()=>gm,uuid:()=>Fp,uuid4:()=>Tp,uuid6:()=>Rp,uuid7:()=>Mp,xid:()=>Cp});var c={};s.r(c),s.d(c,{endsWith:()=>Tv,gt:()=>vv,gte:()=>yv,includes:()=>zv,length:()=>Ev,lowercase:()=>Ov,lt:()=>gv,lte:()=>bv,maxLength:()=>Pv,maxSize:()=>Av,mime:()=>Mv,minLength:()=>Cv,minSize:()=>Nv,multipleOf:()=>Sv,negative:()=>_v,nonnegative:()=>kv,nonpositive:()=>xv,normalize:()=>Bv,overwrite:()=>Dv,positive:()=>wv,property:()=>Rv,regex:()=>Iv,size:()=>Lv,slugify:()=>Wv,startsWith:()=>Fv,toLowerCase:()=>Uv,toUpperCase:()=>$v,trim:()=>qv,uppercase:()=>jv});var l={};s.r(l),s.d(l,{ZodISODate:()=>ry,ZodISODateTime:()=>ty,ZodISODuration:()=>ay,ZodISOTime:()=>oy,date:()=>iy,datetime:()=>ny,duration:()=>cy,time:()=>sy});var u={};s.r(u),s.d(u,{ZodAny:()=>Ww,ZodArray:()=>e_,ZodBase64:()=>uw,ZodBase64URL:()=>hw,ZodBigInt:()=>jw,ZodBigIntFormat:()=>Fw,ZodBoolean:()=>Iw,ZodCIDRv4:()=>sw,ZodCIDRv6:()=>cw,ZodCUID:()=>Wy,ZodCUID2:()=>Hy,ZodCatch:()=>K_,ZodCodec:()=>nx,ZodCustom:()=>px,ZodCustomStringFormat:()=>vw,ZodDate:()=>Xw,ZodDefault:()=>U_,ZodDiscriminatedUnion:()=>d_,ZodE164:()=>pw,ZodEmail:()=>Py,ZodEmoji:()=>By,ZodEnum:()=>N_,ZodExactOptional:()=>R_,ZodFile:()=>I_,ZodFunction:()=>hx,ZodGUID:()=>Ey,ZodIPv4:()=>ew,ZodIPv6:()=>iw,ZodIntersection:()=>f_,ZodJWT:()=>gw,ZodKSUID:()=>Xy,ZodLazy:()=>cx,ZodLiteral:()=>C_,ZodMAC:()=>nw,ZodMap:()=>x_,ZodNaN:()=>X_,ZodNanoID:()=>Uy,ZodNever:()=>Gw,ZodNonOptional:()=>H_,ZodNull:()=>Uw,ZodNullable:()=>D_,ZodNumber:()=>kw,ZodNumberFormat:()=>Aw,ZodObject:()=>r_,ZodOptional:()=>F_,ZodPipe:()=>ex,ZodPrefault:()=>W_,ZodPromise:()=>ux,ZodReadonly:()=>ix,ZodRecord:()=>b_,ZodSet:()=>S_,ZodString:()=>Ay,ZodStringFormat:()=>Ly,ZodSuccess:()=>G_,ZodSymbol:()=>Mw,ZodTemplateLiteral:()=>sx,ZodTransform:()=>j_,ZodTuple:()=>m_,ZodType:()=>ky,ZodULID:()=>Gy,ZodURL:()=>Ry,ZodUUID:()=>Oy,ZodUndefined:()=>Bw,ZodUnion:()=>a_,ZodUnknown:()=>Hw,ZodVoid:()=>Kw,ZodXID:()=>Ky,ZodXor:()=>l_,_ZodString:()=>Sy,_default:()=>$_,_function:()=>fx,any:()=>Zw,array:()=>t_,base64:()=>dw,base64url:()=>fw,bigint:()=>zw,boolean:()=>Ow,catch:()=>Y_,check:()=>mx,cidrv4:()=>aw,cidrv6:()=>lw,codec:()=>rx,cuid:()=>Zy,cuid2:()=>Vy,custom:()=>gx,date:()=>Qw,describe:()=>yx,discriminatedUnion:()=>h_,e164:()=>mw,email:()=>Cy,emoji:()=>qy,enum:()=>L_,exactOptional:()=>M_,file:()=>O_,float32:()=>Lw,float64:()=>Pw,function:()=>fx,guid:()=>Iy,hash:()=>xw,hex:()=>_w,hostname:()=>ww,httpUrl:()=>Dy,instanceof:()=>xx,int:()=>Nw,int32:()=>Cw,int64:()=>Tw,intersection:()=>p_,ipv4:()=>tw,ipv6:()=>ow,json:()=>Sx,jwt:()=>bw,keyof:()=>n_,ksuid:()=>Qy,lazy:()=>lx,literal:()=>E_,looseObject:()=>s_,looseRecord:()=>w_,mac:()=>rw,map:()=>k_,meta:()=>wx,nan:()=>Q_,nanoid:()=>$y,nativeEnum:()=>P_,never:()=>Jw,nonoptional:()=>V_,null:()=>$w,nullable:()=>B_,nullish:()=>q_,number:()=>Sw,object:()=>i_,optional:()=>T_,partialRecord:()=>y_,pipe:()=>tx,prefault:()=>Z_,preprocess:()=>Ax,promise:()=>dx,readonly:()=>ox,record:()=>v_,refine:()=>bx,set:()=>A_,strictObject:()=>o_,string:()=>Ny,stringFormat:()=>yw,stringbool:()=>kx,success:()=>J_,superRefine:()=>vx,symbol:()=>Dw,templateLiteral:()=>ax,transform:()=>z_,tuple:()=>g_,uint32:()=>Ew,uint64:()=>Rw,ulid:()=>Jy,undefined:()=>qw,union:()=>c_,unknown:()=>Vw,url:()=>My,uuid:()=>jy,uuidv4:()=>zy,uuidv6:()=>Fy,uuidv7:()=>Ty,void:()=>Yw,xid:()=>Yy,xor:()=>u_});const d=window.wp.element,h=window.wp.hooks,f=window.ReactJSXRuntime,p=e=>{const{fill:t="#0FA961",...n}=e;return(0,f.jsxs)("svg",{width:"25",height:"25",viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[(0,f.jsx)("path",{d:"M97.0156 9.74499C120.404 0.0570803 146.141 -2.47884 170.971 2.45983C195.8 7.39873 218.609 19.59 236.51 37.4911L200.307 73.6942C189.566 62.9535 175.88 55.64 160.982 52.6766C146.085 49.7134 130.643 51.233 116.609 57.0458C102.576 62.8586 90.5814 72.7032 82.1426 85.3329C73.7038 97.9625 69.1992 112.811 69.1992 128.001C69.1992 140.594 72.2983 152.952 78.166 164.007C78.2596 164.006 78.3534 164.001 78.4473 164.001C89.4146 164.001 98.5033 172.026 100.17 182.524C105.185 179.335 111.141 177.497 117.525 177.518C133.572 177.572 146.835 189.36 149.221 204.729C153.155 204.564 157.087 204.1 160.982 203.325C175.88 200.362 189.566 193.046 200.307 182.306L236.51 218.511C218.609 236.412 195.8 248.603 170.971 253.542C146.141 258.48 120.404 255.945 97.0156 246.257C73.6273 236.569 53.6369 220.163 39.5723 199.114C25.5075 178.065 18 153.317 18 128.001C18 102.685 25.5074 77.9371 39.5723 56.8876C53.6369 35.8385 73.6272 19.433 97.0156 9.74499Z",fill:t}),(0,f.jsx)("path",{d:"M164 140.001C170.627 140.001 176 145.373 176 152.001C176 158.628 170.627 164.001 164 164.001C157.373 164.001 152 158.628 152 152.001C152 145.373 157.373 140.001 164 140.001Z",fill:t}),(0,f.jsx)("path",{d:"M108 108.001C114.627 108.001 120 113.373 120 120.001C120 126.628 114.627 132.001 108 132.001C101.373 132.001 96.0004 126.628 96 120.001C96 113.373 101.373 108.001 108 108.001Z",fill:t}),(0,f.jsx)("path",{d:"M152 76.0008C158.627 76.0008 164 81.3734 164 88.0008C164 94.6279 158.627 100.001 152 100.001C145.373 100.001 140 94.6279 140 88.0008C140 81.3734 145.373 76.0008 152 76.0008Z",fill:t})]})},m=window.wp.i18n,g=window.React;var b=s.t(g,2);const v=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},w=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),_=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var x={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const k=(0,g.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},c)=>(0,g.createElement)("svg",{ref:c,...x,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:w("lucide",i),...!o&&!_(a)&&{"aria-hidden":"true"},...a},[...s.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(o)?o:[o]])),S=(e,t)=>{const n=(0,g.forwardRef)(({className:n,...r},i)=>(0,g.createElement)(k,{ref:i,iconNode:t,className:w(`lucide-${v(y(e))}`,`lucide-${e}`,n),...r}));return n.displayName=y(e),n},A=S("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),N=S("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),L=e=>{const t=/^#?([a-f\d]{3}|[a-f\d]{6})$/i.exec(e||"");if(!t)return!1;const n=3===t[1].length?t[1].replace(/(.)/g,"$1$1"):t[1];return(.299*parseInt(n.slice(0,2),16)+.587*parseInt(n.slice(2,4),16)+.114*parseInt(n.slice(4,6),16))/255<.5},P=(e,{source:t="surecookie_plugin",medium:n="wordpress_plugin",campaign:r="core_plugin",content:i}={})=>{if(!e)return e;try{const o=new URL(e);return o.searchParams.set("utm_source",t),o.searchParams.set("utm_medium",n),o.searchParams.set("utm_campaign",r),i&&o.searchParams.set("utm_content",i),o.toString()}catch(t){return e}},C=(window,window?.surecookieAdminData?.colorPalettes||{}),E=(Object.values(C),P("https://surecookie.com/share-usage-data/",{content:"usage_optin"}),(e,t="")=>{const n=window?.surecookieAdminData||window?.surecookieOnboardingData||window?.surecookiePublicSettings;return e&&n?.website_links?.[e]?n.website_links[e]:P(`https://surecookie.com/${t}`,{content:e})});(0,m.__)("30 days","surecookie"),(0,m.__)("60 days","surecookie"),(0,m.__)("90 days","surecookie"),(0,m.__)("365 days","surecookie"),(0,m.__)("Never","surecookie");const I=window.wp.apiFetch;var O=s.n(I);new Set,(()=>{const{ai_authenticated:e}=window.surecookieOnboardingData||{}})();const j=window.wp.url;!0===window?.surecookieAdminData?.ai_authenticated||"true"===window?.surecookieAdminData?.ai_authenticated||"1"===window?.surecookieAdminData?.ai_authenticated||window,window,new Set;const z=e=>{const t=M(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),F(n,t)||R(e)},getConflictingClassGroupIds:(e,t)=>{const i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},F=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?F(e.slice(1),r):void 0;if(i)return i;if(0===t.validators.length)return;const o=e.join("-");return t.validators.find(({validator:e})=>e(o))?.classGroupId},T=/^\[(.+)\]$/,R=e=>{if(T.test(e)){const t=T.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},M=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return U(Object.entries(e.classGroups),n).forEach(([e,n])=>{D(n,r,e,t)}),r},D=(e,t,n,r)=>{e.forEach(e=>{if("string"!=typeof e)return"function"==typeof e?q(e)?void D(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n}):void Object.entries(e).forEach(([e,i])=>{D(i,B(t,e),n,r)});(""===e?t:B(t,e)).classGroupId=n})},B=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},q=e=>e.isThemeGetter,U=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,$=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(i(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},W=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,i=t[0],o=t.length,s=e=>{const n=[];let s,a=0,c=0;for(let l=0;l<e.length;l++){let u=e[l];if(0===a){if(u===i&&(r||e.slice(l,l+o)===t)){n.push(e.slice(c,l)),c=l+o;continue}if("/"===u){s=l;continue}}"["===u?a++:"]"===u&&a--}const l=0===n.length?e:e.substring(c),u=l.startsWith("!");return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:s&&s>c?s-c:void 0}};return n?e=>n({className:e,parseClassName:s}):s},Z=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},H=/\s+/;function V(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=G(e))&&(r&&(r+=" "),r+=t);return r}const G=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=G(e[r]))&&(n&&(n+=" "),n+=t);return n};function J(e,...t){let n,r,i,o=function(a){const c=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:$(e.cacheSize),parseClassName:W(e),...z(e)}))(c),r=n.cache.get,i=n.cache.set,o=s,s(a)};function s(e){const t=r(e);if(t)return t;const o=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(H);let a="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t);let h=Boolean(d),f=r(h?u.substring(0,d):u);if(!f){if(!h){a=t+(a.length>0?" "+a:a);continue}if(f=r(u),!f){a=t+(a.length>0?" "+a:a);continue}h=!1}const p=Z(c).join(":"),m=l?p+"!":p,g=m+f;if(o.includes(g))continue;o.push(g);const b=i(f,h);for(let e=0;e<b.length;++e){const t=b[e];o.push(m+t)}a=t+(a.length>0?" "+a:a)}return a})(e,n);return i(e,o),o}return function(){return o(V.apply(null,arguments))}}const K=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Y=/^\[(?:([a-z-]+):)?(.+)\]$/i,X=/^\d+\/\d+$/,Q=new Set(["px","full","screen"]),ee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,te=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ne=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,re=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oe=e=>ae(e)||Q.has(e)||X.test(e),se=e=>we(e,"length",_e),ae=e=>Boolean(e)&&!Number.isNaN(Number(e)),ce=e=>we(e,"number",ae),le=e=>Boolean(e)&&Number.isInteger(Number(e)),ue=e=>e.endsWith("%")&&ae(e.slice(0,-1)),de=e=>Y.test(e),he=e=>ee.test(e),fe=new Set(["length","size","percentage"]),pe=e=>we(e,fe,xe),me=e=>we(e,"position",xe),ge=new Set(["image","url"]),be=e=>we(e,ge,Se),ve=e=>we(e,"",ke),ye=()=>!0,we=(e,t,n)=>{const r=Y.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},_e=e=>te.test(e)&&!ne.test(e),xe=()=>!1,ke=e=>re.test(e),Se=e=>ie.test(e),Ae=J((Symbol.toStringTag,()=>{const e=K("colors"),t=K("spacing"),n=K("blur"),r=K("brightness"),i=K("borderColor"),o=K("borderRadius"),s=K("borderSpacing"),a=K("borderWidth"),c=K("contrast"),l=K("grayscale"),u=K("hueRotate"),d=K("invert"),h=K("gap"),f=K("gradientColorStops"),p=K("gradientColorStopPositions"),m=K("inset"),g=K("margin"),b=K("opacity"),v=K("padding"),y=K("saturate"),w=K("scale"),_=K("sepia"),x=K("skew"),k=K("space"),S=K("translate"),A=()=>["auto",de,t],N=()=>[de,t],L=()=>["",oe,se],P=()=>["auto",ae,de],C=()=>["","0",de],E=()=>[ae,de];return{cacheSize:500,separator:":",theme:{colors:[ye],spacing:[oe,se],blur:["none","",he,de],brightness:E(),borderColor:[e],borderRadius:["none","","full",he,de],borderSpacing:N(),borderWidth:L(),contrast:E(),grayscale:C(),hueRotate:E(),invert:C(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[ue,se],inset:A(),margin:A(),opacity:E(),padding:N(),saturate:E(),scale:E(),sepia:C(),skew:E(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",de]}],container:["container"],columns:[{columns:[he]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",de]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",le,de]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",de]}],grow:[{grow:C()}],shrink:[{shrink:C()}],order:[{order:["first","last","none",le,de]}],"grid-cols":[{"grid-cols":[ye]}],"col-start-end":[{col:["auto",{span:["full",le,de]},de]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[ye]}],"row-start-end":[{row:["auto",{span:[le,de]},de]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",de]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",de]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",de,t]}],"min-w":[{"min-w":[de,t,"min","max","fit"]}],"max-w":[{"max-w":[de,t,"none","full","min","max","fit","prose",{screen:[he]},he]}],h:[{h:[de,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[de,t,"auto","min","max","fit"]}],"font-size":[{text:["base",he,se]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ce]}],"font-family":[{font:[ye]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",de]}],"line-clamp":[{"line-clamp":["none",ae,ce]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",oe,de]}],"list-image":[{"list-image":["none",de]}],"list-style-type":[{list:["none","disc","decimal",de]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",oe,se]}],"underline-offset":[{"underline-offset":["auto",oe,de]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",me]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},be]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[oe,de]}],"outline-w":[{outline:[oe,se]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[oe,se]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",he,ve]}],"shadow-color":[{shadow:[ye]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",he,de]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",de]}],duration:[{duration:E()}],ease:[{ease:["linear","in","out","in-out",de]}],delay:[{delay:E()}],animate:[{animate:["none","spin","ping","pulse","bounce",de]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[le,de]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",de]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[oe,se,ce]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}));function Ne(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ne(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Le(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ne(e))&&(r&&(r+=" "),r+=t);return r}const Pe=(...e)=>Ae(Le(...e)),Ce=e=>{const t={0:"gap-0",xxs:"gap-1",xs:"gap-2",sm:"gap-3",md:"gap-4",lg:"gap-5",xl:"gap-6","2xl":"gap-8"};return t[e]||t.md},Ee=e=>e<1024?`${e} bytes`:e<1048576?`${(e/1024).toFixed(2)} KB`:e<1073741824?`${(e/1048576).toFixed(2)} MB`:`${(e/1073741824).toFixed(2)} GB`,Ie=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Oe=(...e)=>e.filter((e,t,n)=>Boolean(e)&&n.indexOf(e)===t).join(" ");var je={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ze=(0,g.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},c)=>(0,g.createElement)("svg",{ref:c,...je,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Oe("lucide",i),...a},[...s.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(o)?o:[o]])),Fe=(e,t)=>{const n=(0,g.forwardRef)(({className:n,...r},i)=>(0,g.createElement)(ze,{ref:i,iconNode:t,className:Oe(`lucide-${Ie(e)}`,n),...r}));return n.displayName=`${e}`,n},Te=Fe("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Re=Fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Me=Fe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),De=Fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function Be(){return"undefined"!=typeof window}function qe(e){return We(e)?(e.nodeName||"").toLowerCase():"#document"}function Ue(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function $e(e){var t;return null==(t=(We(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function We(e){return!!Be()&&(e instanceof Node||e instanceof Ue(e).Node)}function Ze(e){return!!Be()&&(e instanceof Element||e instanceof Ue(e).Element)}function He(e){return!!Be()&&(e instanceof HTMLElement||e instanceof Ue(e).HTMLElement)}function Ve(e){return!(!Be()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Ue(e).ShadowRoot)}function Ge(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=it(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function Je(e){return/^(table|td|th)$/.test(qe(e))}function Ke(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const Ye=/transform|translate|scale|rotate|perspective|filter/,Xe=/paint|layout|strict|content/,Qe=e=>!!e&&"none"!==e;let et;function tt(e){const t=Ze(e)?it(e):e;return Qe(t.transform)||Qe(t.translate)||Qe(t.scale)||Qe(t.rotate)||Qe(t.perspective)||!nt()&&(Qe(t.backdropFilter)||Qe(t.filter))||Ye.test(t.willChange||"")||Xe.test(t.contain||"")}function nt(){return null==et&&(et="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),et}function rt(e){return/^(html|body|#document)$/.test(qe(e))}function it(e){return Ue(e).getComputedStyle(e)}function ot(e){return Ze(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function st(e){if("html"===qe(e))return e;const t=e.assignedSlot||e.parentNode||Ve(e)&&e.host||$e(e);return Ve(t)?t.host:t}function at(e){const t=st(e);return rt(t)?e.ownerDocument?e.ownerDocument.body:e.body:He(t)&&Ge(t)?t:at(t)}function ct(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=at(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),s=Ue(i);if(o){const e=lt(s);return t.concat(s,s.visualViewport||[],Ge(i)?i:[],e&&n?ct(e):[])}return t.concat(i,ct(i,[],n))}function lt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ut(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function dt(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ve(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ht(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function ft(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function pt(e){return!(0!==e.mozInputSource||!e.isTrusted)||(bt()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function mt(e){return!ft().includes("jsdom/")&&(!bt()&&0===e.width&&0===e.height||bt()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function gt(){return/apple/i.test(navigator.vendor)}function bt(){const e=/android/i;return e.test(ht())||e.test(ft())}function vt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function yt(e){return(null==e?void 0:e.ownerDocument)||document}function wt(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function _t(e){return"composedPath"in e?e.composedPath()[0]:e.target}function xt(e){return He(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function kt(e){e.preventDefault(),e.stopPropagation()}function St(e){return!!e&&"combobox"===e.getAttribute("role")&&xt(e)}const At=Math.min,Nt=Math.max,Lt=Math.round,Pt=Math.floor,Ct=e=>({x:e,y:e}),Et={left:"right",right:"left",bottom:"top",top:"bottom"};function It(e,t){return"function"==typeof e?e(t):e}function Ot(e){return e.split("-")[0]}function jt(e){return e.split("-")[1]}function zt(e){return"y"===e?"height":"width"}function Ft(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Tt(e){return"x"===Ft(e)?"y":"x"}function Rt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Mt=["left","right"],Dt=["right","left"],Bt=["top","bottom"],qt=["bottom","top"];function Ut(e){const t=Ot(e);return Et[t]+e.slice(t.length)}function $t(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var Wt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),Zt="undefined"==typeof Element,Ht=Zt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Vt=!Zt&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Gt=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):Gt(e.parentNode))},Jt=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var o=i.shift();if(!Gt(o,!1))if("SLOT"===o.tagName){var s=o.assignedElements(),a=s.length?s:o.children,c=Jt(a,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:o,candidates:c})}else{Ht.call(o,Wt)&&n.filter(o)&&(t||!e.includes(o))&&r.push(o);var l=o.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(o),u=!Gt(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(o));if(l&&u){var d=Jt(!0===l?o.children:l.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:o,candidates:d})}else i.unshift.apply(i,o.children)}}return r},Kt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Yt=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Kt(e)?0:e.tabIndex},Xt=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Qt=function(e){return"INPUT"===e.tagName},en=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},tn=function(e,t){return!(t.disabled||function(e){return Qt(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var i=Ht.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ht.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return en(e)}else{if("function"==typeof r){for(var o=e;e;){var s=e.parentElement,a=Vt(e);if(s&&!s.shadowRoot&&!0===r(s))return en(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=o}if(function(e){var t,n,r,i,o=e&&Vt(e),s=null===(t=o)||void 0===t?void 0:t.host,a=!1;if(o&&o!==e)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(s)||null!=e&&null!==(i=e.ownerDocument)&&void 0!==i&&i.contains(e));!a&&s;){var c,l,u;a=!(null===(l=s=null===(c=o=Vt(s))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(s))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Ht.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},nn=function(e,t){return!(function(e){return function(e){return Qt(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Vt(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var i=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!i||i===e}(e)}(t)||Yt(t)<0||!tn(e,t))},rn=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},on=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,o=i?e.scopeParent:e,s=function(e,t){var n=Yt(e);return n<0&&t&&!Kt(e)?0:n}(o,i),a=i?on(e.candidates):o;0===s?i?t.push.apply(t,a):t.push(o):n.push({documentOrder:r,tabIndex:s,item:e,isScope:i,content:a})}),n.sort(Xt).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},sn=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Jt([e],t.includeContainer,{filter:nn.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:rn}):function(e,t,n){if(Gt(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Wt));return t&&Ht.call(e,Wt)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,nn.bind(null,t)),on(n)};const an=window.ReactDOM;function cn(e,t,n){let{reference:r,floating:i}=e;const o=Ft(t),s=Tt(t),a=zt(s),c=Ot(t),l="y"===o,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let f;switch(c){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(jt(t)){case"start":f[s]-=h*(n&&l?-1:1);break;case"end":f[s]+=h*(n&&l?-1:1)}return f}async function ln(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=It(t,e),p=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(f),m=a[h?"floating"===d?"reference":"floating":d],g=$t(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b="floating"===d?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),y=await(null==o.isElement?void 0:o.isElement(v))&&await(null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},w=$t(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:v,strategy:c}):b);return{top:(g.top-w.top+p.top)/y.y,bottom:(w.bottom-g.bottom+p.bottom)/y.y,left:(g.left-w.left+p.left)/y.x,right:(w.right-g.right+p.right)/y.x}}const un=new Set(["left","top"]);function dn(e){const t=it(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=He(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Lt(n)!==o||Lt(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function hn(e){return Ze(e)?e:e.contextElement}function fn(e){const t=hn(e);if(!He(t))return Ct(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=dn(t);let s=(o?Lt(n.width):n.width)/r,a=(o?Lt(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const pn=Ct(0);function mn(e){const t=Ue(e);return nt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:pn}function gn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=hn(e);let s=Ct(1);t&&(r?Ze(r)&&(s=fn(r)):s=fn(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Ue(e))&&t}(o,n,r)?mn(o):Ct(0);let c=(i.left+a.x)/s.x,l=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const e=Ue(o),t=r&&Ze(r)?Ue(r):r;let n=e,i=lt(n);for(;i&&r&&t!==n;){const e=fn(i),t=i.getBoundingClientRect(),r=it(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=o,l+=s,n=Ue(i),i=lt(n)}}return $t({width:u,height:d,x:c,y:l})}function bn(e,t){const n=ot(e).scrollLeft;return t?t.left+n:gn($e(e)).left+n}function vn(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-bn(e,n),y:n.top+t.scrollTop}}function yn(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Ue(e),r=$e(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;const e=nt();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,c=i.offsetTop)}const l=bn(r);if(l<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(r.clientWidth-t.clientWidth-i);s<=25&&(o-=s)}else l<=25&&(o+=l);return{width:o,height:s,x:a,y:c}}(e,n);else if("document"===t)r=function(e){const t=$e(e),n=ot(e),r=e.ownerDocument.body,i=Nt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Nt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+bn(e);const a=-n.scrollTop;return"rtl"===it(r).direction&&(s+=Nt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}($e(e));else if(Ze(t))r=function(e,t){const n=gn(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=He(e)?fn(e):Ct(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=mn(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $t(r)}function wn(e,t){const n=st(e);return!(n===t||!Ze(n)||rt(n))&&("fixed"===it(n).position||wn(n,t))}function xn(e,t,n){const r=He(t),i=$e(t),o="fixed"===n,s=gn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=Ct(0);function l(){c.x=bn(i)}if(r||!r&&!o)if(("body"!==qe(t)||Ge(i))&&(a=ot(t)),r){const e=gn(t,!0,o,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();o&&!r&&i&&l();const u=!i||r||o?Ct(0):vn(i,a);return{x:s.left+a.scrollLeft-c.x-u.x,y:s.top+a.scrollTop-c.y-u.y,width:s.width,height:s.height}}function kn(e){return"static"===it(e).position}function Sn(e,t){if(!He(e)||"fixed"===it(e).position)return null;if(t)return t(e);let n=e.offsetParent;return $e(e)===n&&(n=n.ownerDocument.body),n}function An(e,t){const n=Ue(e);if(Ke(e))return n;if(!He(e)){let t=st(e);for(;t&&!rt(t);){if(Ze(t)&&!kn(t))return t;t=st(t)}return n}let r=Sn(e,t);for(;r&&Je(r)&&kn(r);)r=Sn(r,t);return r&&rt(r)&&kn(r)&&!tt(r)?n:r||function(e){let t=st(e);for(;He(t)&&!rt(t);){if(tt(t))return t;if(Ke(t))return null;t=st(t)}return null}(e)||n}const Nn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o="fixed"===i,s=$e(r),a=!!t&&Ke(t.floating);if(r===s||a&&o)return n;let c={scrollLeft:0,scrollTop:0},l=Ct(1);const u=Ct(0),d=He(r);if((d||!d&&!o)&&(("body"!==qe(r)||Ge(s))&&(c=ot(r)),d)){const e=gn(r);l=fn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const h=!s||d||o?Ct(0):vn(s,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}},getDocumentElement:$e,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[..."clippingAncestors"===n?Ke(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=ct(e,[],!1).filter(e=>Ze(e)&&"body"!==qe(e)),i=null;const o="fixed"===it(e).position;let s=o?st(e):e;for(;Ze(s)&&!rt(s);){const t=it(s),n=tt(s);n||"fixed"!==t.position||(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&("absolute"===i.position||"fixed"===i.position)||Ge(s)&&!n&&wn(e,s))?r=r.filter(e=>e!==s):i=t,s=st(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=yn(t,o[0],i);let a=s.top,c=s.right,l=s.bottom,u=s.left;for(let e=1;e<o.length;e++){const n=yn(t,o[e],i);a=Nt(n.top,a),c=At(n.right,c),l=At(n.bottom,l),u=Nt(n.left,u)}return{width:c-u,height:l-a,x:u,y:a}},getOffsetParent:An,getElementRects:async function(e){const t=this.getOffsetParent||An,n=this.getDimensions,r=await n(e.floating);return{reference:xn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=dn(e);return{width:t,height:n}},getScale:fn,isElement:Ze,isRTL:function(e){return"rtl"===it(e).direction}};function Ln(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Pn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,l=hn(e),u=i||o?[...l?ct(l):[],...t?ct(t):[]]:[];u.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const d=l&&a?function(e,t){let n,r=null;const i=$e(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,c){void 0===a&&(a=!1),void 0===c&&(c=1),o();const l=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=l;if(a||t(),!h||!f)return;const p={rootMargin:-Pt(d)+"px "+-Pt(i.clientWidth-(u+h))+"px "+-Pt(i.clientHeight-(d+f))+"px "+-Pt(u)+"px",threshold:Nt(0,At(1,c))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==c){if(!m)return s();r?s(!1,r):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==r||Ln(l,e.getBoundingClientRect())||s(),m=!1}try{r=new IntersectionObserver(g,{...p,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),o}(l,n):null;let h,f=-1,p=null;s&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m=c?gn(e):null;return c&&function t(){const r=gn(e);m&&!Ln(m,r)&&n(),m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=p)||e.disconnect(),p=null,c&&cancelAnimationFrame(h)}}const Cn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=It(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const b=Ot(i),v=Ft(a),y=Ot(a)===a,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),_=h||(y||!m?[Ut(a)]:function(e){const t=Ut(e);return[Rt(e),t,Rt(t)]}(a)),x="none"!==p;!h&&x&&_.push(...function(e,t,n,r){const i=jt(e);let o=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Dt:Mt:t?Mt:Dt;case"left":case"right":return t?Bt:qt;default:return[]}}(Ot(e),"start"===n,r);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(Rt)))),o}(a,m,p,w));const k=[a,..._],S=await c.detectOverflow(t,g),A=[];let N=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&A.push(S[b]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=jt(e),i=Tt(e),o=zt(i);let s="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Ut(s)),[s,Ut(s)]}(i,s,w);A.push(S[e[0]],S[e[1]])}if(N=[...N,{placement:i,overflows:A}],!A.every(e=>e<=0)){var L,P;const e=((null==(L=o.flip)?void 0:L.index)||0)+1,t=k[e];if(t&&("alignment"!==d||v===Ft(t)||N.every(e=>Ft(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:N},reset:{placement:t}};let n=null==(P=N.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!n)switch(f){case"bestFit":{var C;const e=null==(C=N.filter(e=>{if(x){const t=Ft(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:C[0];e&&(n=e);break}case"initialPlacement":n=a}if(i!==n)return{reset:{placement:n}}}return{}}}},En=(e,t,n)=>{const r=new Map,i={platform:Nn,...n},o={...i.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:ln},c=await(null==s.isRTL?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=cn(l,r,c),h=r,f=0;const p={};for(let n=0;n<o.length;n++){const m=o[n];if(!m)continue;const{name:g,fn:b}=m,{x:v,y,data:w,reset:_}=await b({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=y?y:d,p[g]={...p[g],...w},_&&f<50&&(f++,"object"==typeof _&&(_.placement&&(h=_.placement),_.rects&&(l=!0===_.rects?await s.getElementRects({reference:e,floating:t,strategy:i}):_.rects),({x:u,y:d}=cn(l,h,c))),n=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:p}})(e,t,{...i,platform:o})};var In="undefined"!=typeof document?g.useLayoutEffect:function(){};function On(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!On(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!==r--;){const n=i[r];if(!("_owner"===n&&e.$$typeof||On(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function jn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zn(e,t){const n=jn(e);return Math.round(t*n)/n}function Fn(e){const t=g.useRef(e);return In(()=>{t.current=e}),t}const Tn=(e,t)=>{const n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,c=await async function(e,t){const{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),s=Ot(n),a=jt(n),c="y"===Ft(n),l=un.has(s)?-1:1,u=o&&c?-1:1,d=It(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),c?{x:f*u,y:h*l}:{x:h*l,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rn=(e,t)=>{const n=Cn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mn=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:c=()=>{},...l}=It(e,t),u=await s.detectOverflow(t,l),d=Ot(i),h=jt(i),f="y"===Ft(i),{width:p,height:m}=o.floating;let g,b;"top"===d||"bottom"===d?(g=d,b=h===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,g="end"===h?"top":"bottom");const v=m-u.top-u.bottom,y=p-u.left-u.right,w=At(m-u[g],v),_=At(p-u[b],y),x=!t.middlewareData.shift;let k=w,S=_;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=y),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(k=v),x&&!h){const e=Nt(u.left,0),t=Nt(u.right,0),n=Nt(u.top,0),r=Nt(u.bottom,0);f?S=p-2*(0!==e||0!==t?e+t:Nt(u.left,u.right)):k=m-2*(0!==n||0!==r?n+r:Nt(u.top,u.bottom))}await c({...t,availableWidth:S,availableHeight:k});const A=await s.getDimensions(a.floating);return p!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dn={...b},Bn=Dn.useInsertionEffect||(e=>e());function qn(e){const t=g.useRef(()=>{});return Bn(()=>{t.current=e}),g.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}const Un="ArrowUp",$n="ArrowDown",Wn="ArrowLeft",Zn="ArrowRight";function Hn(e,t,n){return Math.floor(e/t)!==n}function Vn(e,t){return t<0||t>=e.current.length}function Gn(e,t){return Kn(e,{disabledIndices:t})}function Jn(e,t){return Kn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Kn(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=void 0===t?{}:t;const s=e.current;let a=n;do{a+=r?-o:o}while(a>=0&&a<=s.length-1&&Qn(s,a,i));return a}function Yn(e,t,n,r,i){if(-1===e)return-1;const o=n.indexOf(e),s=t[e];switch(i){case"tl":return o;case"tr":return s?o+s.width-1:o;case"bl":return s?o+(s.height-1)*r:o;case"br":return n.lastIndexOf(e)}}function Xn(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Qn(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}var er="undefined"!=typeof document?g.useLayoutEffect:g.useEffect;function tr(){return tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tr.apply(this,arguments)}let nr=!1,rr=0;const ir=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+rr++,or=Dn.useId||function(){const[e,t]=g.useState(()=>nr?ir():void 0);return er(()=>{null==e&&t(ir())},[]),g.useEffect(()=>{nr=!0},[]),e};let sr;function ar(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");var o;null!=(e=sr)&&e.has(i)||(null==(o=sr)||o.add(i),console.error(i))}const cr=g.createContext(null),lr=g.createContext(null),ur=()=>{var e;return(null==(e=g.useContext(cr))?void 0:e.id)||null},dr=()=>g.useContext(lr);function hr(e){return"data-floating-ui-"+e}function fr(e){const t=(0,g.useRef)(e);return er(()=>{t.current=e}),t}let pr=0;function mr(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(pr);const o=()=>null==e?void 0:e.focus({preventScroll:n});i?o():pr=requestAnimationFrame(o)}function gr(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),r=n;for(;r.length;)r=e.filter(e=>{var t;return null==(t=r)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(r);return n}let br=new WeakMap,vr=new WeakSet,yr={},wr=0;const _r=e=>e&&(e.host||_r(e.parentNode));function xr(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=yt(e[0]).body;return function(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=(a=t,e.map(e=>{if(a.contains(e))return e;const t=_r(e);return a.contains(t)?t:null}).filter(e=>null!=e));var a;const c=new Set,l=new Set(s),u=[];yr[i]||(yr[i]=new WeakMap);const d=yr[i];return s.forEach(function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!l.has(t)&&[].forEach.call(t.children,t=>{if("script"!==qe(t))if(c.has(t))e(t);else{const e=o?t.getAttribute(o):null,n=null!==e&&"false"!==e,r=(br.get(t)||0)+1,s=(d.get(t)||0)+1;br.set(t,r),d.set(t,s),u.push(t),1===r&&n&&vr.add(t),1===s&&t.setAttribute(i,""),!n&&o&&t.setAttribute(o,"true")}})}(t),c.clear(),wr++,()=>{u.forEach(e=>{const t=(br.get(e)||0)-1,n=(d.get(e)||0)-1;br.set(e,t),d.set(e,n),t||(!vr.has(e)&&o&&e.removeAttribute(o),vr.delete(e)),n||e.removeAttribute(i)}),wr--,wr||(br=new WeakMap,br=new WeakMap,vr=new WeakSet,yr={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const kr=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Sr(e,t){const n=sn(e,kr());"prev"===t&&n.reverse();const r=n.indexOf(ut(yt(e)));return n.slice(r+1)[0]}function Ar(){return Sr(document.body,"next")}function Nr(){return Sr(document.body,"prev")}function Lr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!dt(n,r)}function Pr(e){sn(e,kr()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function Cr(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}const Er={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Ir(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const Or=g.forwardRef(function(e,t){const[n,r]=g.useState();er(()=>(gt()&&r("button"),document.addEventListener("keydown",Ir),()=>{document.removeEventListener("keydown",Ir)}),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[hr("focus-guard")]:"",style:Er};return g.createElement("span",tr({},e,i))}),jr=g.createContext(null),zr=hr("portal");function Fr(e){const{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,o=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=or(),i=Tr(),[o,s]=g.useState(null),a=g.useRef(null);return er(()=>()=>{null==o||o.remove(),queueMicrotask(()=>{a.current=null})},[o]),er(()=>{if(!r)return;if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(zr,""),e.appendChild(n),a.current=n,s(n)},[t,r]),er(()=>{if(null===n)return;if(!r)return;if(a.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!Ze(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const c=document.createElement("div");c.id=r,c.setAttribute(zr,""),e=o||e,e.appendChild(c),a.current=c,s(c)},[t,n,r,i]),o}({id:n,root:r}),[s,a]=g.useState(null),c=g.useRef(null),l=g.useRef(null),u=g.useRef(null),d=g.useRef(null),h=null==s?void 0:s.modal,f=null==s?void 0:s.open,p=!!s&&!s.modal&&s.open&&i&&!(!r&&!o);return g.useEffect(()=>{if(o&&i&&!h)return o.addEventListener("focusin",e,!0),o.addEventListener("focusout",e,!0),()=>{o.removeEventListener("focusin",e,!0),o.removeEventListener("focusout",e,!0)};function e(e){o&&Lr(e)&&("focusin"===e.type?Cr:Pr)(o)}},[o,i,h]),g.useEffect(()=>{o&&(f||Cr(o))},[f,o]),g.createElement(jr.Provider,{value:g.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:o,setFocusManagerState:a}),[i,o])},p&&o&&g.createElement(Or,{"data-type":"outside",ref:c,onFocus:e=>{if(Lr(e,o)){var t;null==(t=u.current)||t.focus()}else{const e=Nr()||(null==s?void 0:s.refs.domReference.current);null==e||e.focus()}}}),p&&o&&g.createElement("span",{"aria-owns":o.id,style:Er}),o&&an.createPortal(t,o),p&&o&&g.createElement(Or,{"data-type":"outside",ref:l,onFocus:e=>{if(Lr(e,o)){var t;null==(t=d.current)||t.focus()}else{const t=Ar()||(null==s?void 0:s.refs.domReference.current);null==t||t.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const Tr=()=>g.useContext(jr),Rr="data-floating-ui-focusable";function Mr(e){return e?e.hasAttribute(Rr)?e:e.querySelector("["+Rr+"]")||e:null}let Dr=[];function Br(e){Dr=Dr.filter(e=>e.isConnected);let t=e;if(t&&"body"!==qe(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ht.call(e,Wt)&&nn(t,e)}(t,kr())){const e=sn(t,kr())[0];e&&(t=e)}Dr.push(t),Dr.length>20&&(Dr=Dr.slice(-20))}}function qr(){return Dr.slice().reverse().find(e=>e.isConnected)}const Ur=g.forwardRef(function(e,t){return g.createElement("button",tr({},e,{type:"button",ref:t,tabIndex:-1,style:Er}))});function $r(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0}=e,{open:h,refs:f,nodeId:p,onOpenChange:m,events:b,dataRef:v,floatingId:y,elements:{domReference:w,floating:_}}=t,x="number"==typeof s&&s<0,k=St(w)&&x,S="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||o,A=fr(i),N=fr(s),L=fr(a),P=dr(),C=Tr(),E=g.useRef(null),I=g.useRef(null),O=g.useRef(!1),j=g.useRef(!1),z=g.useRef(-1),F=null!=C,T=Mr(_),R=qn(function(e){return void 0===e&&(e=T),e?sn(e,kr()):[]}),M=qn(e=>{const t=R(e);return A.current.map(e=>w&&"reference"===e?w:T&&"floating"===e?T:t).filter(Boolean).flat()});function D(e){return!r&&u&&l?g.createElement(Ur,{ref:"start"===e?E:I,onClick:e=>m(!1,e.nativeEvent)},"string"==typeof u?u:"Dismiss"):null}g.useEffect(()=>{if(r)return;if(!l)return;function e(e){if("Tab"===e.key){dt(T,ut(yt(T)))&&0===R().length&&!k&&kt(e);const t=M(),n=_t(e);"reference"===A.current[0]&&n===w&&(kt(e),e.shiftKey?mr(t[t.length-1]):mr(t[1])),"floating"===A.current[1]&&n===T&&e.shiftKey&&(kt(e),mr(t[0]))}}const t=yt(T);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,w,T,l,A,k,R,M]),g.useEffect(()=>{if(!r&&_)return _.addEventListener("focusin",e),()=>{_.removeEventListener("focusin",e)};function e(e){const t=_t(e),n=R().indexOf(t);-1!==n&&(z.current=n)}},[r,_,R]),g.useEffect(()=>{if(!r&&d)return _&&He(w)?(w.addEventListener("focusout",t),w.addEventListener("pointerdown",e),_.addEventListener("focusout",t),()=>{w.removeEventListener("focusout",t),w.removeEventListener("pointerdown",e),_.removeEventListener("focusout",t)}):void 0;function e(){j.current=!0,setTimeout(()=>{j.current=!1})}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(dt(w,t)||dt(_,t)||dt(t,_)||dt(null==C?void 0:C.portalNode,t)||null!=t&&t.hasAttribute(hr("focus-guard"))||P&&(gr(P.nodesRef.current,p).find(e=>{var n,r;return dt(null==(n=e.context)?void 0:n.elements.floating,t)||dt(null==(r=e.context)?void 0:r.elements.domReference,t)})||function(e,t){var n;let r=[],i=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;i;){const t=e.find(e=>e.id===i);i=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(P.nodesRef.current,p).find(e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t})));if(c&&n&&ut(yt(T))===yt(T).body){He(T)&&T.focus();const e=z.current,t=R(),n=t[e]||t[t.length-1]||T;He(n)&&n.focus()}!k&&l||!t||!n||j.current||t===qr()||(O.current=!0,m(!1,e,"focus-out"))})}},[r,w,_,T,l,p,P,C,m,d,c,R,k]),g.useEffect(()=>{var e;if(r)return;const t=Array.from((null==C||null==(e=C.portalNode)?void 0:e.querySelectorAll("["+hr("portal")+"]"))||[]);if(_){const e=[_,...t,E.current,I.current,A.current.includes("reference")||k?w:null].filter(e=>null!=e),n=l||k?xr(e,S,!S):xr(e);return()=>{n()}}},[r,w,_,l,A,C,k,S]),er(()=>{if(r||!He(T))return;const e=ut(yt(T));queueMicrotask(()=>{const t=M(T),n=N.current,r=("number"==typeof n?t[n]:n.current)||T,i=dt(T,e);x||i||!h||mr(r,{preventScroll:r===T})})},[r,h,T,x,M,N]),er(()=>{if(r||!T)return;let e=!1;const t=yt(T),n=ut(t);let i=v.current.openEvent;function o(t){let{open:n,reason:r,event:o,nested:s}=t;n&&(i=o),"escape-key"===r&&f.domReference.current&&Br(f.domReference.current),"hover"===r&&"mouseleave"===o.type&&(O.current=!0),"outside-press"===r&&(s?(O.current=!1,e=!0):O.current=!(pt(o)||mt(o)))}Br(n),b.on("openchange",o);const s=t.createElement("span");return s.setAttribute("tabindex","-1"),s.setAttribute("aria-hidden","true"),Object.assign(s.style,Er),F&&w&&w.insertAdjacentElement("afterend",s),()=>{b.off("openchange",o);const n=ut(t),r=dt(_,n)||P&&gr(P.nodesRef.current,p).some(e=>{var t;return dt(null==(t=e.context)?void 0:t.elements.floating,n)});(r||i&&["click","mousedown"].includes(i.type))&&f.domReference.current&&Br(f.domReference.current);const a="boolean"==typeof L.current?qr()||s:L.current.current||s;queueMicrotask(()=>{L.current&&!O.current&&He(a)&&(a===n||n===t.body||r)&&a.focus({preventScroll:e}),s.remove()})}},[r,_,T,L,v,f,b,P,p,F,w]),g.useEffect(()=>{queueMicrotask(()=>{O.current=!1})},[r]),er(()=>{if(!r&&C)return C.setFocusManagerState({modal:l,closeOnFocusOut:d,open:h,onOpenChange:m,refs:f}),()=>{C.setFocusManagerState(null)}},[r,C,l,h,m,f,d]),er(()=>{if(r)return;if(!T)return;if("function"!=typeof MutationObserver)return;if(x)return;const e=()=>{const e=T.getAttribute("tabindex"),t=R(),n=ut(yt(_)),r=t.indexOf(n);-1!==r&&(z.current=r),A.current.includes("floating")||n!==f.domReference.current&&0===t.length?"0"!==e&&T.setAttribute("tabindex","0"):"-1"!==e&&T.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(T,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[r,_,T,f,A,R,x]);const B=!r&&S&&(!l||!k)&&(F||l);return g.createElement(g.Fragment,null,B&&g.createElement(Or,{"data-type":"inside",ref:null==C?void 0:C.beforeInsideRef,onFocus:e=>{if(l){const e=M();mr("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=C&&C.preserveTabOrder&&C.portalNode)if(O.current=!1,Lr(e,C.portalNode)){const e=Ar()||w;null==e||e.focus()}else{var t;null==(t=C.beforeOutsideRef.current)||t.focus()}}}),!k&&D("start"),n,D("end"),B&&g.createElement(Or,{"data-type":"inside",ref:null==C?void 0:C.afterInsideRef,onFocus:e=>{if(l)mr(M()[0]);else if(null!=C&&C.preserveTabOrder&&C.portalNode)if(d&&(O.current=!0),Lr(e,C.portalNode)){const e=Nr()||w;null==e||e.focus()}else{var t;null==(t=C.afterOutsideRef.current)||t.focus()}}}))}function Wr(e){return He(e.target)&&"BUTTON"===e.target.tagName}function Zr(e){return xt(e)}const Hr={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Vr={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Gr=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Jr(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=or(),o=g.useRef({}),[s]=g.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}()),a=null!=ur(),[c,l]=g.useState(r.reference),u=qn((e,t,r)=>{o.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:a}),null==n||n(e,t,r)}),d=g.useMemo(()=>({setPositionReference:l}),[]),h=g.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return g.useMemo(()=>({dataRef:o,open:t,onOpenChange:u,elements:h,events:s,floatingId:i,refs:d}),[t,u,h,s,i,d])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[o,s]=g.useState(null),[a,c]=g.useState(null),l=(null==i?void 0:i.domReference)||o,u=g.useRef(null),d=dr();er(()=>{l&&(u.current=l)},[l]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=g.useState(r);On(h,r)||f(r);const[p,m]=g.useState(null),[b,v]=g.useState(null),y=g.useCallback(e=>{e!==k.current&&(k.current=e,m(e))},[]),w=g.useCallback(e=>{e!==S.current&&(S.current=e,v(e))},[]),_=o||p,x=s||b,k=g.useRef(null),S=g.useRef(null),A=g.useRef(u),N=null!=c,L=Fn(c),P=Fn(i),C=Fn(l),E=g.useCallback(()=>{if(!k.current||!S.current)return;const e={placement:t,strategy:n,middleware:h};P.current&&(e.platform=P.current),En(k.current,S.current,e).then(e=>{const t={...e,isPositioned:!1!==C.current};I.current&&!On(A.current,t)&&(A.current=t,an.flushSync(()=>{d(t)}))})},[h,t,n,P,C]);In(()=>{!1===l&&A.current.isPositioned&&(A.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);const I=g.useRef(!1);In(()=>(I.current=!0,()=>{I.current=!1}),[]),In(()=>{if(_&&(k.current=_),x&&(S.current=x),_&&x){if(L.current)return L.current(_,x,E);E()}},[_,x,E,L,N]);const O=g.useMemo(()=>({reference:k,floating:S,setReference:y,setFloating:w}),[y,w]),j=g.useMemo(()=>({reference:_,floating:x}),[_,x]),z=g.useMemo(()=>{const e={position:n,left:0,top:0};if(!j.floating)return e;const t=zn(j.floating,u.x),r=zn(j.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...jn(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,a,j.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:E,refs:O,elements:j,floatingStyles:z}),[u,E,O,j,z])}({...e,elements:{...i,...a&&{reference:a}}}),f=g.useCallback(e=>{const t=Ze(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),h.refs.setReference(t)},[h.refs]),p=g.useCallback(e=>{(Ze(e)||null===e)&&(u.current=e,s(e)),(Ze(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!Ze(e))&&h.refs.setReference(e)},[h.refs]),m=g.useMemo(()=>({...h.refs,setReference:p,setPositionReference:f,domReference:u}),[h.refs,p,f]),b=g.useMemo(()=>({...h.elements,domReference:l}),[h.elements,l]),v=g.useMemo(()=>({...h,...r,refs:m,elements:b,nodeId:t}),[h,m,b,t,r]);return er(()=>{r.dataRef.current.floatingContext=v;const e=null==d?void 0:d.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),g.useMemo(()=>({...h,context:v,refs:m,elements:b}),[h,m,b,v])}const Kr="active",Yr="selected";function Xr(e,t,n){const r=new Map,i="item"===n;let o=e;if(i&&e){const{[Kr]:t,[Yr]:__,...n}=e;o=n}return{..."floating"===n&&{tabIndex:-1,[Rr]:""},...o,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,o]=t;var s;i&&[Kr,Yr].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(s=r.get(n))||s.push(o),e[n]=function(){for(var e,t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return null==(e=r.get(n))?void 0:e.map(e=>e(...i)).find(e=>void 0!==e)})):e[n]=o)}),e):e,{})}}let Qr=!1;function ei(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ti(e,t){return ei(t,e===Un||e===$n,e===Wn||e===Zn)}function ni(e,t,n){return ei(t,e===$n,n?e===Wn:e===Zn)||"Enter"===e||" "===e||""===e}function ri(e,t,n){return ei(t,n?e===Zn:e===Wn,e===Un)}function ii(e,t){const{open:n,onOpenChange:r,elements:i}=e,{listRef:o,activeIndex:s,onNavigate:a=()=>{},enabled:c=!0,selectedIndex:l=null,allowEscape:u=!1,loop:d=!1,nested:h=!1,rtl:f=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:v=!0,disabledIndices:y,orientation:w="vertical",cols:_=1,scrollItemIntoView:x=!0,virtualItemRef:k,itemSizes:S,dense:A=!1}=t,N=fr(Mr(i.floating)),L=ur(),P=dr(),C=qn(a),E=St(i.domReference),I=g.useRef(m),O=g.useRef(null!=l?l:-1),j=g.useRef(null),z=g.useRef(!0),F=g.useRef(C),T=g.useRef(!!i.floating),R=g.useRef(n),M=g.useRef(!1),D=g.useRef(!1),B=fr(y),q=fr(n),U=fr(x),$=fr(l),[W,Z]=g.useState(),[H,V]=g.useState(),G=qn(function(e,t,n){function r(e){p?(Z(e.id),null==P||P.events.emit("virtualfocus",e),k&&(k.current=e)):mr(e,{preventScroll:!0,sync:!(!ht().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!gt())&&(Qr||M.current)})}void 0===n&&(n=!1);const i=e.current[t.current];i&&r(i),requestAnimationFrame(()=>{const o=e.current[t.current]||i;if(!o)return;i||r(o);const s=U.current;s&&K&&(n||!z.current)&&(null==o.scrollIntoView||o.scrollIntoView("boolean"==typeof s?{block:"nearest",inline:"nearest"}:s))})});er(()=>{document.createElement("div").focus({get preventScroll(){return Qr=!0,!1}})},[]),er(()=>{c&&(n&&i.floating?I.current&&null!=l&&(D.current=!0,O.current=l,C(l)):T.current&&(O.current=-1,F.current(null)))},[c,n,i.floating,l,C]),er(()=>{if(c&&n&&i.floating)if(null==s){if(M.current=!1,null!=$.current)return;if(T.current&&(O.current=-1,G(o,O)),(!R.current||!T.current)&&I.current&&(null!=j.current||!0===I.current&&null==j.current)){let e=0;const t=()=>{null==o.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(O.current=null==j.current||ni(j.current,w,f)||h?Gn(o,B.current):Jn(o,B.current),j.current=null,C(O.current))};t()}}else Vn(o,s)||(O.current=s,G(o,O,D.current),D.current=!1)},[c,n,i.floating,s,$,h,o,w,f,C,G,B]),er(()=>{var e;if(!c||i.floating||!P||p||!T.current)return;const t=P.nodesRef.current,n=null==(e=t.find(e=>e.id===L))||null==(e=e.context)?void 0:e.elements.floating,r=ut(yt(i.floating)),o=t.some(e=>e.context&&dt(e.context.elements.floating,r));n&&!o&&z.current&&n.focus({preventScroll:!0})},[c,i.floating,P,L,p]),er(()=>{if(c&&P&&p&&!L)return P.events.on("virtualfocus",e),()=>{P.events.off("virtualfocus",e)};function e(e){V(e.id),k&&(k.current=e)}},[c,P,p,L,k]),er(()=>{F.current=C,T.current=!!i.floating}),er(()=>{n||(j.current=null)},[n]),er(()=>{R.current=n},[n]);const J=null!=s,K=g.useMemo(()=>{function e(e){if(!n)return;const t=o.current.indexOf(e);-1!==t&&C(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...b&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;z.current&&"touch"!==t&&(O.current=-1,G(o,O),C(null),p||mr(N.current,{preventScroll:!0}))}}}},[n,N,G,b,o,C,p]),Y=qn(e=>{if(z.current=!1,M.current=!0,229===e.which)return;if(!q.current&&e.currentTarget===N.current)return;if(h&&ri(e.key,w,f))return kt(e),r(!1,e.nativeEvent,"list-navigation"),void(He(i.domReference)&&(p?null==P||P.events.emit("virtualfocus",i.domReference):i.domReference.focus()));const t=O.current,s=Gn(o,y),a=Jn(o,y);if(E||("Home"===e.key&&(kt(e),O.current=s,C(O.current)),"End"===e.key&&(kt(e),O.current=a,C(O.current))),_>1){const t=S||Array.from({length:o.current.length},()=>({width:1,height:1})),n=function(e,t,n){const r=[];let i=0;return e.forEach((e,o)=>{let{width:s,height:a}=e,c=!1;for(n&&(i=0);!c;){const e=[];for(let n=0;n<s;n++)for(let r=0;r<a;r++)e.push(i+n+r*t);i%t+s<=t&&e.every(e=>null==r[e])?(e.forEach(e=>{r[e]=o}),c=!0):i++}}),[...r]}(t,_,A),r=n.findIndex(e=>null!=e&&!Qn(o.current,e,y)),i=n.reduce((e,t,n)=>null==t||Qn(o.current,t,y)?e:n,-1),c=n[function(e,t){let{event:n,orientation:r,loop:i,rtl:o,cols:s,disabledIndices:a,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}=t,h=u;if(n.key===Un){if(d&&kt(n),-1===u)h=l;else if(h=Kn(e,{startingIndex:h,amount:s,decrement:!0,disabledIndices:a}),i&&(u-s<c||h<0)){const e=u%s,t=l%s,n=l-(t-e);h=t===e?l:t>e?n:n-s}Vn(e,h)&&(h=u)}if(n.key===$n&&(d&&kt(n),-1===u?h=c:(h=Kn(e,{startingIndex:u,amount:s,disabledIndices:a}),i&&u+s>l&&(h=Kn(e,{startingIndex:u%s-s,amount:s,disabledIndices:a}))),Vn(e,h)&&(h=u)),"both"===r){const t=Pt(u/s);n.key===(o?Wn:Zn)&&(d&&kt(n),u%s!==s-1?(h=Kn(e,{startingIndex:u,disabledIndices:a}),i&&Hn(h,s,t)&&(h=Kn(e,{startingIndex:u-u%s-1,disabledIndices:a}))):i&&(h=Kn(e,{startingIndex:u-u%s-1,disabledIndices:a})),Hn(h,s,t)&&(h=u)),n.key===(o?Zn:Wn)&&(d&&kt(n),u%s!==0?(h=Kn(e,{startingIndex:u,decrement:!0,disabledIndices:a}),i&&Hn(h,s,t)&&(h=Kn(e,{startingIndex:u+(s-u%s),decrement:!0,disabledIndices:a}))):i&&(h=Kn(e,{startingIndex:u+(s-u%s),decrement:!0,disabledIndices:a})),Hn(h,s,t)&&(h=u));const r=Pt(l/s)===t;Vn(e,h)&&(h=i&&r?n.key===(o?Zn:Wn)?l:Kn(e,{startingIndex:u-u%s-1,disabledIndices:a}):u)}return h}({current:n.map(e=>null!=e?o.current[e]:null)},{event:e,orientation:w,loop:d,rtl:f,cols:_,disabledIndices:Xn([...y||o.current.map((e,t)=>Qn(o.current,t)?t:void 0),void 0],n),minIndex:r,maxIndex:i,prevIndex:Yn(O.current>a?s:O.current,t,n,_,e.key===$n?"bl":e.key===(f?Wn:Zn)?"tr":"tl"),stopEvent:!0})];if(null!=c&&(O.current=c,C(O.current)),"both"===w)return}if(ti(e.key,w)){if(kt(e),n&&!p&&ut(e.currentTarget.ownerDocument)===e.currentTarget)return O.current=ni(e.key,w,f)?s:a,void C(O.current);ni(e.key,w,f)?O.current=d?t>=a?u&&t!==o.current.length?-1:s:Kn(o,{startingIndex:t,disabledIndices:y}):Math.min(a,Kn(o,{startingIndex:t,disabledIndices:y})):O.current=d?t<=s?u&&-1!==t?o.current.length:a:Kn(o,{startingIndex:t,decrement:!0,disabledIndices:y}):Math.max(s,Kn(o,{startingIndex:t,decrement:!0,disabledIndices:y})),Vn(o,O.current)?C(null):C(O.current)}}),X=g.useMemo(()=>p&&n&&J&&{"aria-activedescendant":H||W},[p,n,J,H,W]),Q=g.useMemo(()=>({"aria-orientation":"both"===w?void 0:w,...!St(i.domReference)&&X,onKeyDown:Y,onPointerMove(){z.current=!0}}),[X,Y,i.domReference,w]),ee=g.useMemo(()=>{function e(e){"auto"===m&&pt(e.nativeEvent)&&(I.current=!0)}return{...X,onKeyDown(e){z.current=!1;const t=e.key.startsWith("Arrow"),i=["Home","End"].includes(e.key),s=t||i,a=function(e,t,n){return ei(t,n?e===Wn:e===Zn,e===$n)}(e.key,w,f),c=ri(e.key,w,f),u=ti(e.key,w),d=(h?a:u)||"Enter"===e.key||""===e.key.trim();if(p&&n){const t=null==P?void 0:P.nodesRef.current.find(e=>null==e.parentId),n=P&&t?function(e,t){let n,r=-1;return function t(i,o){o>r&&(n=i,r=o),gr(e,i).forEach(e=>{t(e.id,o+1)})}(t,0),e.find(e=>e.id===n)}(P.nodesRef.current,t.id):null;if(s&&n&&k){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(a||c){var m,g;const r=(null==(m=n.context)?void 0:m.elements.domReference)===e.currentTarget,i=c&&!r?null==(g=n.context)?void 0:g.elements.domReference:a?o.current.find(e=>(null==e?void 0:e.id)===W):null;i&&(kt(e),i.dispatchEvent(t),V(void 0))}var b;if((u||i)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return kt(e),void(null==(b=n.context.elements.domReference)||b.dispatchEvent(t))}return Y(e)}(n||v||!t)&&(d&&(j.current=h&&u?null:e.key),h?a&&(kt(e),n?(O.current=Gn(o,B.current),C(O.current)):r(!0,e.nativeEvent,"list-navigation")):u&&(null!=l&&(O.current=l),kt(e),!n&&v?r(!0,e.nativeEvent,"list-navigation"):Y(e),n&&C(O.current)))},onFocus(){n&&!p&&C(null)},onPointerDown:function(e){I.current=m,"auto"===m&&mt(e.nativeEvent)&&(I.current=!0)},onMouseDown:e,onClick:e}},[W,X,Y,B,m,o,h,C,r,n,v,w,f,l,P,p,k]);return g.useMemo(()=>c?{reference:ee,floating:Q,item:K}:{},[c,ee,Q,K])}const oi=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),si=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},ai={sm:{icon:"[&>svg]:size-4",searchIcon:"[&>svg]:size-4",selectButton:"px-2.5 py-2 rounded text-xs font-medium leading-4 min-h-[2rem]",multiSelect:"pl-2 pr-2 py-1.5",displaySelected:"text-xs font-normal",dropdown:"rounded-md",dropdownItemsWrapper:"p-1.5",searchbarWrapper:"p-3 flex items-center gap-0.5",searchbar:"font-medium text-sm",searchbarIcon:"size-4",label:"text-sm font-medium"},md:{icon:"[&>svg]:size-5",searchIcon:"[&>svg]:size-5",selectButton:"px-3.5 py-2.5 rounded-md text-sm font-medium leading-4 min-h-[2.5rem]",multiSelect:"pl-2 pr-2.5 py-2",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"size-5",label:"text-sm font-medium"},lg:{icon:"[&>svg]:size-6",searchIcon:"[&>svg]:size-5",selectButton:"px-4 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",multiSelect:"pl-2.5 pr-3 py-2.5",displaySelected:"text-base font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"size-5",label:"text-base font-medium"}},ci="group-disabled:text-field-color-disabled",li={sm:"w-[calc(100%+0.75rem)] translate-x-[-0.375rem]",md:"w-[calc(100%+1rem)] translate-x-[-0.5rem]",lg:"w-[calc(100%+1rem)] translate-x-[-0.5rem]"},ui={sm:"py-1.5 px-2 text-xs font-normal",md:"p-2 text-sm font-normal",lg:"p-2 text-base font-normal"},di=e=>null===e||"boolean"==typeof e?"":"string"==typeof e||"number"==typeof e?e.toString():Array.isArray(e)?e.map(di).join(" ").trim():(0,g.isValidElement)(e)?e.props&&e.props.children?di(e.props.children):"":"object"==typeof e&&"textContent"in e?e.textContent?.toString().toLowerCase()||"":"object"==typeof e&&"children"in e?di(e.children):"",hi=Fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),fi=(0,g.forwardRef)(({label:e="",size:t="sm",className:n="",type:r="pill",variant:i="neutral",icon:o=null,disabled:s=!1,onClose:a=()=>{},closable:c=!1,onMouseDown:l=()=>{},disableHover:u=!1},d)=>{const h={neutral:"bg-badge-background-gray text-badge-color-gray border-badge-border-gray",red:"bg-badge-background-red text-badge-color-red border-badge-border-red",yellow:"bg-badge-background-yellow text-badge-color-yellow border-badge-border-yellow",green:"bg-badge-background-green text-badge-color-green border-badge-border-green",blue:"bg-badge-background-sky text-badge-color-sky border-badge-border-sky",inverse:"bg-background-inverse text-text-inverse border-background-inverse",disabled:"bg-badge-background-disabled text-badge-color-disabled border-badge-border-disabled disabled cursor-not-allowed"};let p="",m="group relative justify-center flex items-center cursor-pointer";const g={xxs:"[&>svg]:size-3",xs:"[&>svg]:size-3",sm:"[&>svg]:size-3",md:"[&>svg]:size-4",lg:"[&>svg]:size-5"};return s?(p=h.disabled,m+=" cursor-not-allowed disabled"):p=h[i],e?(0,f.jsxs)("span",{className:Pe("font-medium border-badge-border-gray flex items-center justify-center border border-solid box-border max-w-full transition-colors duration-150 ease-in-out",{xxs:"py-0.5 px-0.5 text-xs h-4",xs:"py-0.5 px-1 text-xs h-5",sm:"py-1 px-1.5 text-xs h-6",md:"py-1 px-1.5 text-sm h-7",lg:"py-1 px-1.5 text-base h-8"}[t],{pill:"rounded-full",rounded:"rounded"}[r],"gap-0.5",p,!u&&{neutral:"hover:bg-badge-hover-gray",red:"hover:bg-badge-hover-red",yellow:"hover:bg-badge-hover-yellow",green:"hover:bg-badge-hover-green",blue:"hover:bg-badge-hover-sky",inverse:"hover:bg-badge-hover-inverse",disabled:"hover:bg-badge-hover-disabled"}[i],n),ref:d,children:[o?(0,f.jsx)("span",{className:Pe("justify-center flex items-center",g[t]),children:o}):null,(0,f.jsx)("span",{className:"px-1 truncate inline-block",children:e}),c&&(0,f.jsxs)("span",{className:Pe(m,g[t]),onMouseDown:l,role:"button",tabIndex:0,...!s&&{onClick:a},children:[(0,f.jsx)("span",{className:"sr-only",children:`Remove ${e}`}),(0,f.jsx)(hi,{}),(0,f.jsx)("span",{className:"absolute -inset-1"})]})]}):null});fi.displayName="Badge";const pi=Fe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),mi=({variant:e="primary",size:t="md",icon:n=null,className:r=""})=>{const i={primary:"text-brand-primary-600",secondary:"text-background-primary"}[e],o={sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6",xl:"[&>svg]:size-8"}[t];return(0,f.jsx)("span",{className:Pe("flex",o,i,r),children:n||(0,f.jsx)(pi,{className:"animate-spin shrink-0"})})},gi=(0,g.createContext)({}),bi=()=>(0,g.useContext)(gi),vi=(0,g.forwardRef)(({children:e,icon:t=null,placeholder:n="Select an option",optionIcon:r=null,render:i,label:o,className:s,...a},c)=>{const{sizeValue:l,getReferenceProps:u,getValues:d,selectId:h,refs:p,isOpen:m,multiple:b,combobox:v,setSelected:y,onChange:w,isControlled:_,disabled:x,by:k}=bi(),S={sm:"xs",md:"sm",lg:"md"}[l],A=(0,g.useCallback)(()=>{if(t)return t;const e="text-field-placeholder group-disabled:text-icon-disabled";return v?(0,f.jsx)(Te,{className:e}):(0,f.jsx)(Re,{className:e})},[t]),N=(0,g.useCallback)(()=>{const t=d();if(!t)return null;if(b)return t.map((e,t)=>(0,f.jsx)(fi,{className:"cursor-default",icon:r,type:"rounded",size:S,onMouseDown:L(e),label:"function"==typeof i?i(e):e.toString(),closable:!0,disabled:x},t));let n="string"==typeof t?t:"";if("function"==typeof i&&(n=i(t)),"function"==typeof e&&"function"!=typeof i){const r={value:t,...b?{onClose:L(t)}:{}};n=e(r)}return((0,g.isValidElement)(e)||"string"==typeof e)&&"function"!=typeof i&&(n=e),(0,f.jsx)("span",{className:Pe("truncate",ai[l].displaySelected,ci),children:n})},[d,x]),L=e=>t=>{t?.preventDefault(),t?.stopPropagation();const n=[...d()??[]],r=n.findIndex(t=>null!==t&&null!==e&&"object"==typeof t?t[k]===e[k]:t===e);-1!==r&&(n.splice(r,1),_||y(n),"function"==typeof w&&w(n))};return(0,f.jsxs)("div",{className:"w-full flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[!!o&&(0,f.jsx)("label",{className:Pe(ai[l]?.label,"text-field-label"),htmlFor:h,children:o}),(0,f.jsxs)("button",{id:h,ref:si(p.setReference,c),className:Pe("flex items-center justify-between w-full box-border transition-[outline,background-color,color,box-shadow] duration-200 bg-white","outline outline-1 outline-field-border border-none cursor-pointer",!m&&"focus:ring-2 focus:ring-offset-2 focus:outline-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:outline-border-strong",ai[l].selectButton,b&&ai[l].multiSelect,"group disabled:outline-field-border-disabled [&:hover:has(:disabled)]:outline-field-border-disabled disabled:cursor-default",s),tabIndex:0,disabled:x,...a,...u(),children:[(0,f.jsxs)("div",{className:Pe("flex-1 grid items-center justify-start gap-1.5 overflow-hidden",d()&&"flex flex-wrap"),children:[N(),(b?!d()?.length:!d())&&(0,f.jsx)("div",{className:Pe("[grid-area:1/1/2/3] text-field-input px-1",ai[l].displaySelected,ci),children:n})]}),(0,f.jsx)("div",{className:Pe("flex items-center [&>svg]:shrink-0",ai[l].icon),children:A()})]})]})});function yi({label:e,children:t,className:n,...r}){const{index:i,totalGroups:o}=r,{sizeValue:s}=bi();return(0,f.jsxs)(g.Fragment,{children:[(0,f.jsxs)("div",{className:"flex flex-col",role:"group","aria-label":e,children:[(0,f.jsx)("div",{className:Pe("p-2 font-normal text-text-tertiary",{sm:"text-xs",md:"text-xs",lg:"text-sm"}[s],n),id:`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:e}),(0,f.jsx)("div",{className:"flex flex-col",role:"presentation","aria-labelledby":`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:t})]}),i<o&&!!(t&&g.Children.count(t)>0)&&(0,f.jsx)("hr",{className:Pe("h-px my-2 w-full border-border-subtle border-b border-t-0 border-solid",li[s])})]})}function wi({children:e,className:t}){const{isOpen:n,context:r,refs:i,combobox:o,floatingStyles:s,getFloatingProps:a,sizeValue:c,setSearchKeyword:l,setActiveIndex:u,setSelectedIndex:d,value:h,selected:p,getValues:m,searchKeyword:b,listContentRef:v,by:y,searchPlaceholder:w,activeIndex:_,searchFn:x,debounceDelay:k}=bi(),S=(0,g.useMemo)(()=>{const t=m();let n=-1;if(t){let r=g.Children.toArray(e);r.length>0&&(0,g.isValidElement)(r[0])&&r[0].type===yi&&(r=g.Children.toArray(e).map(e=>(0,g.isValidElement)(e)?g.Children.toArray(e.props.children):[]).flat()),n=r.findIndex(e=>{if(!(0,g.isValidElement)(e))return!1;const n=e.props.value;return"object"==typeof n&&"object"==typeof t?n[y]===t[y]:n===t})}return n},[h,p,e,y]);(0,g.useLayoutEffect)(()=>{n||(u(S),d(S))},[S,n]),(0,g.useLayoutEffect)(()=>{n&&(o&&[-1,null].includes(_)||u(-1))},[b,n]);const A=(0,g.useMemo)(()=>{let t=0,n=0;g.Children.forEach(e,e=>{if((0,g.isValidElement)(e)&&e.type===yi){let n=!1;if(b&&!x){const t=b.toLowerCase(),r=(e.props.label?.toLowerCase()||"").includes(t),i=g.Children.toArray(e.props.children).some(e=>!!(0,g.isValidElement)(e)&&(di(e.props.children)?.toLowerCase()).includes(t));n=r||i}else n=!0;n&&t++}}),n=Math.max(0,t-1);let r=0,i=0;return g.Children.map(e,e=>{if(!(0,g.isValidElement)(e))return null;if(e.type===yi){let t=!1;if(b&&!x){const n=b.toLowerCase();t=(e.props.label?.toLowerCase()||"").includes(n)}const o=g.Children.map(e.props.children,e=>{if(!(0,g.isValidElement)(e))return null;if(t){const t={...e.props,index:r++};return(0,g.cloneElement)(e,t)}if(b&&!x){const t=di(e.props.children)?.toLowerCase(),n=b.toLowerCase();if(!t?.includes(n))return null}const n={...e.props,index:r++};return(0,g.cloneElement)(e,n)});if(!o?.some(e=>null!==e))return null;const s={...e.props,children:o,index:i,totalGroups:n};return i++,(0,g.cloneElement)(e,s)}if(b&&!x){const t=di(e.props?.children)?.toLowerCase(),n=b.toLowerCase();if(!t?.includes(n))return null}return(0,g.cloneElement)(e,{...e.props,index:r++})})},[b,h,p,e,x]),N=g.Children.count(A);(0,g.useEffect)(()=>{v.current=[];let t=g.Children.toArray(e);t&&(0,g.isValidElement)(t[0])&&t[0].type===yi&&(t=g.Children.toArray(t).map(e=>(0,g.isValidElement)(e)?e.props.children:null).filter(Boolean)),g.Children.forEach(t,e=>{if(!(0,g.isValidElement)(e))return;const t=di(e.props?.children)?.toLowerCase();if(b&&!x){const e=b.toLowerCase();if(!t?.includes(e))return}v.current.push(t)})},[b,x]);const[L,P]=(0,g.useState)(!1),C=(0,g.useCallback)(async()=>{if(x&&"function"==typeof x&&!L){P(!0);try{await x(b)}catch(e){console.error(e)}finally{P(!1)}}},[b]),E=((e,t=500)=>{const n=(0,g.useRef)(null);return(0,g.useCallback)((...r)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>e(...r),t)},[e,t])})(C,k);return(0,g.useEffect)(()=>{"function"==typeof x&&E()},[E]),(0,f.jsx)(f.Fragment,{children:n&&(0,f.jsx)(f.Fragment,{children:(0,f.jsx)($r,{context:r,modal:!1,visuallyHiddenDismiss:!0,children:(0,f.jsxs)("div",{ref:i.setFloating,className:Pe("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg outline outline-1 outline-border-subtle",o&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",ai[c].dropdown,!o&&"h-auto",o?"overflow-hidden":"overflow-y-auto overflow-x-hidden",t),style:{...s,zIndex:1},...a(),children:[o&&(0,f.jsxs)("div",{className:Pe(ai[c].searchbarWrapper),children:[L?(0,f.jsx)(mi,{className:ai[c].searchbarIcon}):(0,f.jsx)(Me,{className:Pe("text-icon-secondary shrink-0",ai[c].searchbarIcon)}),(0,f.jsx)("input",{className:Pe("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",ai[c].searchbar),type:"search",name:"keyword",placeholder:w,onChange:e=>l(e.target.value),value:b,autoComplete:"off"})]}),(0,f.jsxs)("div",{className:Pe("overflow-y-auto overflow-x-hidden",!o&&"w-full h-full",ai[c].dropdownItemsWrapper),children:[!!N&&A,!N&&(0,f.jsx)("div",{className:Pe("p-2 text-center font-medium text-field-placeholder",ui[c]),children:"No items found"})]})]})})})})}function _i({children:e,root:t,id:n}){return(0,f.jsx)(Fr,{id:n,root:t,children:e})}function xi({value:e,selected:t,children:n,className:r,...i}){const{sizeValue:o,getItemProps:s,onKeyDownItem:a,onClickItem:c,activeIndex:l,selectedIndex:u,updateListRef:d,getValues:h,by:p,multiple:m}=bi(),{index:b}=i,v=(0,g.useRef)(b),y=(0,g.useMemo)(()=>{if(!m)return!1;const t=h();return!!t&&t.some(t=>null!==t&&null!==e&&"object"==typeof t?t[p]===e[p]:t===e)},[e,h]),w=(0,g.useMemo)(()=>"boolean"==typeof t?t:m?y:b===u,[y,u,t]);return(0,f.jsxs)("div",{className:Pe("w-full flex items-center justify-between text-text-primary hover:bg-button-tertiary-hover rounded-md transition-all duration-150 cursor-pointer focus:outline-none focus-within:outline-none outline-none",ui[o],b===l&&"bg-button-tertiary-hover",r),ref:e=>{d(b,e)},role:"option",tabIndex:b===l?0:-1,"aria-selected":w&&b===l,...s({onClick(){c(v.current,e)},onKeyDown(t){a(t,v.current,e)}}),children:[(0,f.jsx)("span",{className:"w-full truncate",children:n}),w&&(0,f.jsx)(De,{className:Pe("text-icon-on-color-disabled",{sm:"size-4",md:"size-4",lg:"size-5"}[o])})]})}const ki=({id:e,size:t="md",value:n,defaultValue:r,onChange:i,by:o="id",children:s,multiple:a=!1,combobox:c=!1,disabled:l=!1,searchPlaceholder:u="Search...",searchFn:d,debounceDelay:h=500})=>{const p=(0,g.useMemo)(()=>e||`select-${((e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t})()}`,[e]),m=(0,g.useMemo)(()=>typeof n<"u",[n]),[b,v]=(0,g.useState)(r),[y,w]=(0,g.useState)(""),_=(0,g.useCallback)(()=>m?n:b,[m,n,b]),[x,k]=(0,g.useState)(!1),[S,A]=(0,g.useState)(null),[N,L]=(0,g.useState)(null),P={sm:c?256:172,md:c?256:216,lg:c?256:216},{refs:C,floatingStyles:E,context:I}=Jr({strategy:"fixed",placement:"bottom-start",open:x,onOpenChange:k,whileElementsMounted:Pn,middleware:[Tn(5),Rn({padding:10}),Mn({apply({rects:e,elements:n,availableHeight:r}){Object.assign(n.floating.style,{maxHeight:`min(${r}px, ${P[t]}px)`,maxWidth:`${e.reference.width}px`})},padding:10})]}),O=(0,g.useRef)([]),j=(0,g.useRef)([]),z=(0,g.useRef)(!1),F=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:d=!0}=t,h=g.useRef(),f=g.useRef(!1),p=g.useMemo(()=>({onPointerDown(e){h.current=e.pointerType},onMouseDown(e){const t=h.current;0===e.button&&"click"!==a&&(vt(t,!0)&&l||(!n||!c||i.current.openEvent&&d&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=h.current;"mousedown"===a&&h.current?h.current=void 0:vt(t,!0)&&l||(!n||!c||i.current.openEvent&&d&&"click"!==i.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){h.current=void 0,e.defaultPrevented||!u||Wr(e)||(" "!==e.key||Zr(o)||(e.preventDefault(),f.current=!0),"Enter"===e.key&&r(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!u||Wr(e)||Zr(o)||" "===e.key&&f.current&&(f.current=!1,r(!n||!c,e.nativeEvent,"click"))}}),[i,o,a,l,u,r,n,d,c]);return g.useMemo(()=>s?{reference:p}:{},[s,p])}(I,{event:"mousedown"}),T=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:o}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:l="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:p}=t,m=dr(),b=qn("function"==typeof c?c:()=>!1),v="function"==typeof c?b:c,y=g.useRef(!1),w=g.useRef(!1),{escapeKey:_,outsidePress:x}=Gr(f),{escapeKey:k,outsidePress:S}=Gr(p),A=g.useRef(!1),N=qn(e=>{var t;if(!n||!s||!a||"Escape"!==e.key)return;if(A.current)return;const i=null==(t=o.current.floatingContext)?void 0:t.nodeId,c=m?gr(m.nodesRef.current,i):[];if(!_&&(e.stopPropagation(),c.length>0)){let e=!0;if(c.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),L=qn(e=>{var t;const n=()=>{var t;N(e),null==(t=_t(e))||t.removeEventListener("keydown",n)};null==(t=_t(e))||t.addEventListener("keydown",n)}),P=qn(e=>{var t;const n=y.current;y.current=!1;const s=w.current;if(w.current=!1,"click"===l&&s)return;if(n)return;if("function"==typeof v&&!v(e))return;const a=_t(e),c="["+hr("inert")+"]",u=yt(i.floating).querySelectorAll(c);let d=Ze(a)?a:null;for(;d&&!rt(d);){const e=st(d);if(rt(e)||!Ze(e))break;d=e}if(u.length&&Ze(a)&&!a.matches("html,body")&&!dt(a,i.floating)&&Array.from(u).every(e=>!dt(d,e)))return;if(He(a)&&I){const t=a.clientWidth>0&&a.scrollWidth>a.clientWidth,n=a.clientHeight>0&&a.scrollHeight>a.clientHeight;let r=n&&e.offsetX>a.clientWidth;if(n&&"rtl"===it(a).direction&&(r=e.offsetX<=a.offsetWidth-a.clientWidth),r||t&&e.offsetY>a.clientHeight)return}const h=null==(t=o.current.floatingContext)?void 0:t.nodeId,f=m&&gr(m.nodesRef.current,h).some(t=>{var n;return wt(e,null==(n=t.context)?void 0:n.elements.floating)});if(wt(e,i.floating)||wt(e,i.domReference)||f)return;const p=m?gr(m.nodesRef.current,h):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),C=qn(e=>{var t;const n=()=>{var t;P(e),null==(t=_t(e))||t.removeEventListener(l,n)};null==(t=_t(e))||t.addEventListener(l,n)});g.useEffect(()=>{if(!n||!s)return;o.current.__escapeKeyBubbles=_,o.current.__outsidePressBubbles=x;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function c(){window.clearTimeout(e),A.current=!0}function u(){e=window.setTimeout(()=>{A.current=!1},nt()?5:0)}const d=yt(i.floating);a&&(d.addEventListener("keydown",k?L:N,k),d.addEventListener("compositionstart",c),d.addEventListener("compositionend",u)),v&&d.addEventListener(l,S?C:P,S);let f=[];return h&&(Ze(i.domReference)&&(f=ct(i.domReference)),Ze(i.floating)&&(f=f.concat(ct(i.floating))),!Ze(i.reference)&&i.reference&&i.reference.contextElement&&(f=f.concat(ct(i.reference.contextElement)))),f=f.filter(e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)}),f.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{a&&(d.removeEventListener("keydown",k?L:N,k),d.removeEventListener("compositionstart",c),d.removeEventListener("compositionend",u)),v&&d.removeEventListener(l,S?C:P,S),f.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[o,i,a,v,l,n,r,h,s,_,x,N,k,L,P,S,C]),g.useEffect(()=>{y.current=!1},[v,l]);const E=g.useMemo(()=>({onKeyDown:N,[Hr[d]]:e=>{u&&r(!1,e.nativeEvent,"reference-press")}}),[N,r,u,d]),I=g.useMemo(()=>({onKeyDown:N,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[Vr[l]]:()=>{y.current=!0}}),[N,l]);return g.useMemo(()=>s?{reference:E,floating:I}:{},[s,E,I])}(I),R=function(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:i}=e,{enabled:o=!0,role:s="dialog"}=t,a=null!=(n=oi.get(s))?n:s,c=or(),l=null!=ur(),u=g.useMemo(()=>"tooltip"===a||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":r?i:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:c},..."menu"===a&&l&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[a,i,l,r,c,s]),d=g.useMemo(()=>{const e={id:i,...a&&{role:a}};return"tooltip"===a||"label"===s?e:{...e,..."menu"===a&&{"aria-labelledby":c}}},[a,i,c,s]),h=g.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(s){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}},[i,s]);return g.useMemo(()=>o?{reference:u,floating:d,item:h}:{},[o,u,d,h])}(I,{role:"listbox"}),M=ii(I,{listRef:O,activeIndex:S,selectedIndex:N,onNavigate:A,loop:!0}),D=function(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:s,onMatch:a,onTypingChange:c,enabled:l=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:h=[],selectedIndex:f=null}=t,p=g.useRef(),m=g.useRef(""),b=g.useRef(null!=(n=null!=f?f:s)?n:-1),v=g.useRef(null),y=qn(a),w=qn(c),_=fr(u),x=fr(h);er(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),er(()=>{var e;r&&""===m.current&&(b.current=null!=(e=null!=f?f:s)?e:-1)},[r,f,s]);const k=qn(e=>{e?i.current.typing||(i.current.typing=e,w(e)):i.current.typing&&(i.current.typing=e,w(e))}),S=qn(e=>{function t(e,t,n){const r=_.current?_.current(t,n):t.find(e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())));return r?e.indexOf(r):-1}const n=o.current;if(m.current.length>0&&" "!==m.current[0]&&(-1===t(n,n,m.current)?k(!1):" "===e.key&&kt(e)),null==n||x.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(kt(e),k(!0)),n.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&m.current===e.key&&(m.current="",b.current=v.current),m.current+=e.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",b.current=v.current,k(!1)},d);const i=b.current,s=t(n,[...n.slice((i||0)+1),...n.slice(0,(i||0)+1)],m.current);-1!==s?(y(s),v.current=s):" "!==e.key&&(m.current="",k(!1))}),A=g.useMemo(()=>({onKeyDown:S}),[S]),N=g.useMemo(()=>({onKeyDown:S,onKeyUp(e){" "===e.key&&k(!1)}}),[S,k]);return g.useMemo(()=>l?{reference:A,floating:N}:{},[l,A,N])}(I,{listRef:j,activeIndex:S,selectedIndex:N,onMatch:x?A:L,onTypingChange(e){z.current=e}}),{getReferenceProps:B,getFloatingProps:q,getItemProps:U}=function(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),i=g.useCallback(t=>Xr(t,e,"reference"),t),o=g.useCallback(t=>Xr(t,e,"floating"),n),s=g.useCallback(t=>Xr(t,e,"item"),r);return g.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:s}),[i,o,s])}([T,R,M,F,...c?[]:[D]]),$=(e,t)=>{if(a)return((e,t)=>{const n=[..._()??[]];-1===n.findIndex(e=>null!==e&&null!==t&&"object"==typeof e?e[o]===t[o]:e===t)&&(n.push(t),m||v(n),L(e),C.reference.current.focus(),k(!1),w(""),"function"==typeof i&&i(n))})(e,t);L(e),m||v(t),C.reference.current.focus(),k(!1),w(""),"function"==typeof i&&i(t)},W=(0,g.useCallback)((e,t)=>{O.current[e]=t},[]);return(0,f.jsx)(gi.Provider,{value:{selectedIndex:N,setSelectedIndex:L,activeIndex:S,setActiveIndex:A,selected:b,setSelected:v,handleSelect:$,combobox:c,sizeValue:t,multiple:a,onChange:i,isTypingRef:z,getItemProps:U,onClickItem:(e,t)=>{$(e,t)},onKeyDownItem:(e,t,n)=>{"Enter"===e.key&&(e.preventDefault(),$(t,n))," "===e.key&&!z.current&&(e.preventDefault(),$(t,n))},getValues:_,selectId:p,getReferenceProps:B,isOpen:x,value:n,updateListRef:W,refs:C,listContentRef:j,by:o,getFloatingProps:q,floatingStyles:E,context:I,searchKeyword:y,setSearchKeyword:w,disabled:l,isControlled:m,searchPlaceholder:u,searchFn:d,debounceDelay:h},children:s})};ki.displayName="Select";const Si=Object.assign(ki,{Portal:_i,Button:vi,Options:wi,Option:xi,OptionGroup:yi});_i.displayName="Select.Portal",vi.displayName="Select.Button",wi.displayName="Select.Options",xi.displayName="Select.Option",yi.displayName="Select.OptionGroup",(0,d.forwardRef)(({id:e,searchFn:t,size:n="md",combobox:r,multiple:i=!1,label:o,placeholder:s,value:a,onChange:c,options:l=[],by:u="value"},h)=>{const[p,g]=(0,d.useState)(l);(0,d.useEffect)(()=>{a&&g(e=>e.some(e=>e.value===a.value)?e:[a,...e])},[a]);const b=t?async e=>{const n=await t(e);g(n)}:void 0;return(0,f.jsxs)(Si,{id:e,size:n,by:u,combobox:r,multiple:i,value:a,onChange:c,...r&&"function"==typeof t&&{searchFn:b},children:[(0,f.jsx)(Si.Button,{label:o,render:e=>e?.label,placeholder:s,type:"button",ref:h}),(0,f.jsx)(Si.Options,{children:p.length>0?p.map(e=>(0,f.jsx)(Si.Option,{value:e,children:e.label},e.value)):(0,f.jsx)(Si.Option,{value:"",disabled:!0,children:(0,m.__)("No options available","surecookie")})})]})});let Ai=1;const Ni=new class{#e;#t;constructor(){this.#e=[],this.#t=[]}subscribe(e){return this.#t.push(e),()=>{this.#t=this.#t.filter(t=>t!==e)}}publish(e){this.#t.forEach(t=>t(e))}add(e){this.#e.push(e),this.publish(e)}remove(e){return this.#e=this.#e.filter(t=>t.id!==e),e}create(e){const{id:t,message:n="",jsx:r,...i}=e;if(!n&&"function"!=typeof r)return;const o="number"==typeof t?t:Ai++;return this.#e.find(e=>e.id===o)&&(this.#e=this.#e.map(e=>e.id===o?(this.publish({...e,title:n,jsx:r,...i}),{...e,title:n,jsx:r,...i}):e)),this.add({id:o,title:n,jsx:r,...i}),o}update(e,t){const{render:n}=t;let r=t;switch(typeof n){case"function":r={jsx:n,...t};break;case"string":r={title:n,...t}}this.#e=this.#e.map(t=>t.id===e?(this.publish({...t,...r}),{...t,...r}):t)}dismiss(e){return e||this.#e.forEach(e=>this.#t.forEach(t=>t({id:e.id,dismiss:!0}))),this.#t.forEach(t=>t({id:e,dismiss:!0})),e}history(){return this.#e}default(e="",t={}){return this.create({message:e,type:"neutral",...t})}success(e="",t={}){return this.create({message:e,type:"success",...t})}error(e="",t={}){return this.create({message:e,type:"error",...t})}warning(e="",t={}){return this.create({message:e,type:"warning",...t})}info(e="",t={}){return this.create({message:e,type:"info",...t})}custom(e,t={}){return this.create({jsx:e,type:"custom",...t})}},Li=Object.seal(Object.assign((e,t)=>Ni.default(e,t),{success:Ni.success.bind(Ni),error:Ni.error.bind(Ni),warning:Ni.warning.bind(Ni),info:Ni.info.bind(Ni),custom:Ni.custom.bind(Ni),dismiss:Ni.dismiss.bind(Ni),update:Ni.update.bind(Ni)},{getHistory:Ni.history.bind(Ni)}));(0,d.memo)(()=>((0,d.useEffect)(()=>{const e=new URLSearchParams(window.location.search),t=e.get("auth");if(!t)return;e.delete("auth");const n=e.toString(),r=window.location.pathname+(n?`?${n}`:"");let i;return window.history.replaceState({},document.title,r),"success"===t?(Li.success((0,m.__)("Authentication successful","surecookie"),{description:(0,m.__)("Authentication completed successfully. Closing tab in 3 seconds…","surecookie")}),i=setTimeout(()=>{window.close()},3e3)):"fail"===t&&Li.error((0,m.__)("Authentication failed","surecookie"),{description:(0,m.__)("Please return to the SureCookie dashboard and try again.","surecookie")}),()=>{i&&clearTimeout(i)}},[]),null)),E("auth_drawer_learn_more","docs/");class Pi extends d.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){this.setState({error:e,errorInfo:t})}render(){return this.state.hasError?(0,f.jsxs)("div",{className:"p-6 bg-red-50 border border-red-200 rounded-lg",children:[(0,f.jsx)("h2",{className:"text-lg font-medium text-red-800",children:"Something went wrong"}),(0,f.jsx)("p",{className:"text-red-600 mt-2",children:"An error occurred while loading this component. Please try refreshing the page."}),(0,f.jsx)("button",{className:"mt-4 px-4 py-2 bg-button-primary text-white rounded hover:bg-button-primary-hover",onClick:()=>{this.setState({hasError:!1,error:null,errorInfo:null}),window.location.reload()},children:"Reload Page"}),!1]}):this.props.children}}const Ci=Pi,Ei=({children:e,gap:t="lg",className:n,...r})=>(0,f.jsx)("div",{className:Pe("w-full box-border flex items-center justify-between bg-background-primary p-5 min-h-16",Ce(t),n),...r,children:e});Ei.displayName="Topbar";const Ii=({gap:e="sm",children:t,className:n})=>(0,f.jsx)("div",{className:Pe("flex items-center",Ce(e),n),children:t});Ii.displayName="Topbar.Left";const Oi=({gap:e="md",children:t,align:n="center",className:r})=>{const i={left:"justify-start",center:"justify-center",right:"justify-end"}[n];return(0,f.jsx)("div",{className:Pe("flex items-center grow",Ce(e),i,r),children:t})};Oi.displayName="Topbar.Middle";const ji=({gap:e="sm",children:t,className:n})=>(0,f.jsx)("div",{className:Pe("flex items-center",Ce(e),n),children:t});ji.displayName="Topbar.Right";const zi=({children:e,className:t})=>(0,f.jsx)("div",{className:Pe("flex items-center [&>svg]:block h-full",t),children:e});zi.displayName="Topbar.Item",Ei.Left=Ii,Ei.Middle=Oi,Ei.Right=ji,Ei.Item=zi,S("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),S("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),(0,d.createContext)();var Fi={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ti=new class{#n=Fi;#r=!1;setTimeoutProvider(e){this.#n=e}setTimeout(e,t){return this.#n.setTimeout(e,t)}clearTimeout(e){this.#n.clearTimeout(e)}setInterval(e,t){return this.#n.setInterval(e,t)}clearInterval(e){this.#n.clearInterval(e)}},Ri="undefined"==typeof window||"Deno"in globalThis;function Mi(){}function Di(e,t){return"function"==typeof e?e(t):e}function Bi(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s)if(r){if(t.queryHash!==Ui(s,t.options))return!1}else if(!Wi(t.queryKey,s))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function qi(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if($i(t.options.mutationKey)!==$i(o))return!1}else if(!Wi(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ui(e,t){return(t?.queryKeyHashFn||$i)(e)}function $i(e){return JSON.stringify(e,(e,t)=>Gi(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Wi(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(n=>Wi(e[n],t[n]))}var Zi=Object.prototype.hasOwnProperty;function Hi(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Vi(e)&&Vi(t);if(!(r||Gi(e)&&Gi(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),s=o.length,a=r?new Array(s):{};let c=0;for(let l=0;l<s;l++){const s=r?l:o[l],u=e[s],d=t[s];if(u===d){a[s]=u,(r?l<i:Zi.call(e,s))&&c++;continue}if(null===u||null===d||"object"!=typeof u||"object"!=typeof d){a[s]=d;continue}const h=Hi(u,d,n+1);a[s]=h,h===u&&c++}return i===s&&c===i?e:a}function Vi(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Gi(e){if(!Ji(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!Ji(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function Ji(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ki(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?Hi(e,t):t}function Yi(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Xi(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Qi=Symbol();function eo(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==Qi?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}var to=function(e){setTimeout(e,0)},no=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=to;const o=r=>{t?e.push(r):i(()=>{n(r)})};return{batch:o=>{let s;t++;try{s=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})})()}return s},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}(),ro=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},io=new class extends ro{#i;#o;#s;constructor(){super(),this.#s=e=>{if(!Ri&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#o||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#o?.(),this.#o=void 0)}setEventListener(e){this.#s=e,this.#o?.(),this.#o=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#i!==e&&(this.#i=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#i?this.#i:"hidden"!==globalThis.document?.visibilityState}},oo=new class extends ro{#a=!0;#o;#s;constructor(){super(),this.#s=e=>{if(!Ri&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#o||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#o?.(),this.#o=void 0)}setEventListener(e){this.#s=e,this.#o?.(),this.#o=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function so(e){return Math.min(1e3*2**e,3e4)}function ao(e){return"online"!==(e??"online")||oo.isOnline()}var co=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function lo(e){let t,n=!1,r=0;const i=function(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}(),o=()=>"pending"!==i.status,s=()=>io.isFocused()&&("always"===e.networkMode||oo.isOnline())&&e.canRun(),a=()=>ao(e.networkMode)&&e.canRun(),c=e=>{o()||(t?.(),i.resolve(e))},l=e=>{o()||(t?.(),i.reject(e))},u=()=>new Promise(n=>{t=e=>{(o()||s())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,o()||e.onContinue?.()}),d=()=>{if(o())return;let t;const i=0===r?e.initialPromise:void 0;try{t=i??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(c).catch(t=>{if(o())return;const i=e.retry??(Ri?0:3),a=e.retryDelay??so,c="function"==typeof a?a(r,t):a,h=!0===i||"number"==typeof i&&r<i||"function"==typeof i&&i(r,t);var f;!n&&h?(r++,e.onFail?.(r,t),(f=c,new Promise(e=>{Ti.setTimeout(e,f)})).then(()=>s()?void 0:u()).then(()=>{n?l(t):d()})):l(t)})};return{promise:i,status:()=>i.status,cancel:t=>{if(!o()){const n=new co(t);l(n),e.onCancel?.(n)}},continue:()=>(t?.(),i),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:a,start:()=>(a()?d():u().then(d),i)}}var uo=class{#c;destroy(){this.clearGcTimeout()}scheduleGc(){var e;this.clearGcTimeout(),"number"==typeof(e=this.gcTime)&&e>=0&&e!==1/0&&(this.#c=Ti.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ri?1/0:3e5))}clearGcTimeout(){this.#c&&(Ti.clearTimeout(this.#c),this.#c=void 0)}},ho=class extends uo{#l;#u;#d;#h;#f;#p;#m;constructor(e){super(),this.#m=!1,this.#p=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#h=e.client,this.#d=this.#h.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#l=po(this.options),this.state=e.state??this.#l,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#f?.promise}setOptions(e){if(this.options={...this.#p,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=po(this.options);void 0!==e.data&&(this.setState(fo(e.data,e.dataUpdatedAt)),this.#l=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#d.remove(this)}setData(e,t){const n=Ki(this.state.data,e,this.options);return this.#g({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#g({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#f?.promise;return this.#f?.cancel(e),t?t.then(Mi).catch(Mi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#l)}isActive(){return this.observers.some(e=>{return!1!==("function"==typeof(t=e.options.enabled)?t(this):t);var t})}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Qi||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===Di(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!function(e,t){return Math.max(e+(t||0)-Date.now(),0)}(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#f?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#f?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#d.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#f&&(this.#m?this.#f.cancel({revert:!0}):this.#f.cancelRetry()),this.scheduleGc()),this.#d.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#g({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#f?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#f)return this.#f.continueRetry(),this.#f.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#m=!0,n.signal)})},i=()=>{const e=eo(this.options,t),n=(()=>{const e={client:this.#h,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#m=!1,this.options.persister?this.options.persister(e,n,this):e(n)},o=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(o,this),this.#u=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#g({type:"fetch",meta:o.fetchOptions?.meta}),this.#f=lo({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof co&&e.revert&&this.setState({...this.#u,fetchStatus:"idle"}),n.abort()},onFail:(e,t)=>{this.#g({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#g({type:"pause"})},onContinue:()=>{this.#g({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const e=await this.#f.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#d.config.onSuccess?.(e,this),this.#d.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof co){if(e.silent)return this.#f.promise;if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#g({type:"error",error:e}),this.#d.config.onError?.(e,this),this.#d.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#g(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...(n=t.data,r=this.options,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ao(r.networkMode)?"fetching":"paused",...void 0===n&&{error:null,status:"pending"}}),fetchMeta:e.meta??null};case"success":const i={...t,...fo(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#u=e.manual?i:void 0,i;case"error":const o=e.error;return{...t,error:o,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}var n,r})(this.state),no.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#d.notify({query:this,type:"updated",action:e})})}};function fo(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function po(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var mo=class extends ro{constructor(e={}){super(),this.config=e,this.#b=new Map}#b;build(e,t,n){const r=t.queryKey,i=t.queryHash??Ui(r,t);let o=this.get(i);return o||(o=new ho({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#b.has(e.queryHash)||(this.#b.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#b.get(e.queryHash);t&&(e.destroy(),t===e&&this.#b.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){no.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#b.get(e)}getAll(){return[...this.#b.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>Bi(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Bi(e,t)):t}notify(e){no.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){no.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){no.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},go=class extends uo{#h;#v;#y;#f;constructor(e){super(),this.#h=e.client,this.mutationId=e.mutationId,this.#y=e.mutationCache,this.#v=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#v.includes(e)||(this.#v.push(e),this.clearGcTimeout(),this.#y.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#v=this.#v.filter(t=>t!==e),this.scheduleGc(),this.#y.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#v.length||("pending"===this.state.status?this.scheduleGc():this.#y.remove(this))}continue(){return this.#f?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#g({type:"continue"})},n={client:this.#h,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#f=lo({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#g({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#g({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#y.canRun(this)});const r="pending"===this.state.status,i=!this.#f.canStart();try{if(r)t();else{this.#g({type:"pending",variables:e,isPaused:i}),this.#y.config.onMutate&&await this.#y.config.onMutate(e,this,n);const t=await(this.options.onMutate?.(e,n));t!==this.state.context&&this.#g({type:"pending",context:t,variables:e,isPaused:i})}const o=await this.#f.start();return await(this.#y.config.onSuccess?.(o,e,this.state.context,this,n)),await(this.options.onSuccess?.(o,e,this.state.context,n)),await(this.#y.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n)),await(this.options.onSettled?.(o,null,e,this.state.context,n)),this.#g({type:"success",data:o}),o}catch(t){try{await(this.#y.config.onError?.(t,e,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onError?.(t,e,this.state.context,n))}catch(e){Promise.reject(e)}try{await(this.#y.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onSettled?.(void 0,t,e,this.state.context,n))}catch(e){Promise.reject(e)}throw this.#g({type:"error",error:t}),t}finally{this.#y.runNext(this)}}#g(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),no.batch(()=>{this.#v.forEach(t=>{t.onMutationUpdate(e)}),this.#y.notify({mutation:this,type:"updated",action:e})})}},bo=class extends ro{constructor(e={}){super(),this.config=e,this.#w=new Set,this.#_=new Map,this.#x=0}#w;#_;#x;build(e,t,n){const r=new go({client:e,mutationCache:this,mutationId:++this.#x,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#w.add(e);const t=vo(e);if("string"==typeof t){const n=this.#_.get(t);n?n.push(e):this.#_.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#w.delete(e)){const t=vo(e);if("string"==typeof t){const n=this.#_.get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#_.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=vo(e);if("string"==typeof t){const n=this.#_.get(t),r=n?.find(e=>"pending"===e.state.status);return!r||r===e}return!0}runNext(e){const t=vo(e);if("string"==typeof t){const n=this.#_.get(t)?.find(t=>t!==e&&t.state.isPaused);return n?.continue()??Promise.resolve()}return Promise.resolve()}clear(){no.batch(()=>{this.#w.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#w.clear(),this.#_.clear()})}getAll(){return Array.from(this.#w)}find(e){const t={exact:!0,...e};return this.getAll().find(e=>qi(t,e))}findAll(e={}){return this.getAll().filter(t=>qi(e,t))}notify(e){no.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return no.batch(()=>Promise.all(e.map(e=>e.continue().catch(Mi))))}};function vo(e){return e.options.scope?.id}function yo(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],s=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let n=!1;const l=e=>{!function(e,n,r){let i,o=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t.signal,o||(o=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)})}(e,0,()=>n=!0)},u=eo(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);const o=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?"backward":"forward",meta:t.options.meta};return l(e),e})(),s=await u(o),{maxPages:a}=t.options,c=i?Xi:Yi;return{pages:c(e.pages,s,a),pageParams:c(e.pageParams,r,a)}};if(i&&o.length){const e="backward"===i,t={pages:o,pageParams:s},n=(e?_o:wo)(r,t);a=await d(t,n,e)}else{const t=e??o.length;do{const e=0===c?s[0]??r.initialPageParam:wo(r,a);if(c>0&&null==e)break;a=await d(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function wo(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function _o(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}new class{#k;#y;#p;#S;#A;#N;#L;#P;constructor(e={}){this.#k=e.queryCache||new mo,this.#y=e.mutationCache||new bo,this.#p=e.defaultOptions||{},this.#S=new Map,this.#A=new Map,this.#N=0}mount(){this.#N++,1===this.#N&&(this.#L=io.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#k.onFocus())}),this.#P=oo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#k.onOnline())}))}unmount(){this.#N--,0===this.#N&&(this.#L?.(),this.#L=void 0,this.#P?.(),this.#P=void 0)}isFetching(e){return this.#k.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#y.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#k.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#k.build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Di(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#k.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=this.#k.get(r.queryHash),o=i?.state.data,s=function(e,t){return"function"==typeof e?e(t):e}(t,o);if(void 0!==s)return this.#k.build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return no.batch(()=>this.#k.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#k.get(t.queryHash)?.state}removeQueries(e){const t=this.#k;no.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const n=this.#k;return no.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=no.batch(()=>this.#k.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Mi).catch(Mi)}invalidateQueries(e,t={}){return no.batch(()=>(this.#k.findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=no.batch(()=>this.#k.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Mi)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(r).then(Mi)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=this.#k.build(this,t);return n.isStaleByTime(Di(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mi).catch(Mi)}fetchInfiniteQuery(e){return e.behavior=yo(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mi).catch(Mi)}ensureInfiniteQueryData(e){return e.behavior=yo(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return oo.isOnline()?this.#y.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#k}getMutationCache(){return this.#y}getDefaultOptions(){return this.#p}setDefaultOptions(e){this.#p=e}setQueryDefaults(e,t){this.#S.set($i(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#S.values()],n={};return t.forEach(t=>{Wi(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#A.set($i(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#A.values()],n={};return t.forEach(t=>{Wi(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#p.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ui(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Qi&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#p.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#k.clear(),this.#y.clear()}}({defaultOptions:{queries:{staleTime:6e4,gcTime:6e5,retry:2,retryDelay:e=>Math.min(1e3*2**e,3e4),refetchOnWindowFocus:!1},mutations:{retry:1}}});var xo=s(2284),ko=Uint8Array,So=Uint16Array,Ao=Int32Array,No=new ko([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]),Lo=new ko([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]),Po=new ko([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Co=function(e,t){for(var n=new So(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Ao(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},Eo=Co(No,2),Io=Eo.b,Oo=Eo.r;Io[28]=258,Oo[258]=28;for(var jo=Co(Lo,0),zo=(jo.b,jo.r),Fo=new So(32768),To=0;To<32768;++To){var Ro=(43690&To)>>1|(21845&To)<<1;Ro=(61680&(Ro=(52428&Ro)>>2|(13107&Ro)<<2))>>4|(3855&Ro)<<4,Fo[To]=((65280&Ro)>>8|(255&Ro)<<8)>>1}var Mo=function(e,t,n){for(var r=e.length,i=0,o=new So(t);i<r;++i)e[i]&&++o[e[i]-1];var s,a=new So(t);for(i=1;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new So(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)s[Fo[d]>>c]=l}else for(s=new So(r),i=0;i<r;++i)e[i]&&(s[i]=Fo[a[e[i]-1]++]>>15-e[i]);return s},Do=new ko(288);for(To=0;To<144;++To)Do[To]=8;for(To=144;To<256;++To)Do[To]=9;for(To=256;To<280;++To)Do[To]=7;for(To=280;To<288;++To)Do[To]=8;var Bo=new ko(32);for(To=0;To<32;++To)Bo[To]=5;var qo=Mo(Do,9,0),Uo=Mo(Bo,5,0),$o=function(e){return(e+7)/8|0},Wo=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Zo=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Ho=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:Qo,l:0};if(1==i){var s=new ko(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:a.f+c.f,l:a,r:c};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var f=new So(h+1),p=Vo(n[u-1],f,0);if(p>t){r=0;var m=0,g=p-t,b=1<<g;for(o.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r<i;++r){var v=o[r].s;if(!(f[v]>t))break;m+=b-(1<<p-f[v]),f[v]=t}for(m>>=g;m>0;){var y=o[r].s;f[y]<t?m-=1<<t-f[y]++-1:++r}for(;r>=0&&m;--r){var w=o[r].s;f[w]==t&&(--f[w],++m)}p=t}return{t:new ko(f),l:p}},Vo=function(e,t,n){return-1==e.s?Math.max(Vo(e.l,t,n+1),Vo(e.r,t,n+1)):t[e.s]=n},Go=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new So(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},Jo=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ko=function(e,t,n){var r=n.length,i=$o(t+2);e[i]=255&r,e[i+1]=r>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Yo=function(e,t,n,r,i,o,s,a,c,l,u){Wo(t,u++,n),++i[256];for(var d=Ho(i,15),h=d.t,f=d.l,p=Ho(o,15),m=p.t,g=p.l,b=Go(h),v=b.c,y=b.n,w=Go(m),_=w.c,x=w.n,k=new So(19),S=0;S<v.length;++S)++k[31&v[S]];for(S=0;S<_.length;++S)++k[31&_[S]];for(var A=Ho(k,7),N=A.t,L=A.l,P=19;P>4&&!N[Po[P-1]];--P);var C,E,I,O,j=l+5<<3,z=Jo(i,Do)+Jo(o,Bo)+s,F=Jo(i,h)+Jo(o,m)+s+14+3*P+Jo(k,N)+2*k[16]+3*k[17]+7*k[18];if(c>=0&&j<=z&&j<=F)return Ko(t,u,e.subarray(c,c+l));if(Wo(t,u,1+(F<z)),u+=2,F<z){C=Mo(h,f,0),E=h,I=Mo(m,g,0),O=m;var T=Mo(N,L,0);for(Wo(t,u,y-257),Wo(t,u+5,x-1),Wo(t,u+10,P-4),u+=14,S=0;S<P;++S)Wo(t,u+3*S,N[Po[S]]);u+=3*P;for(var R=[v,_],M=0;M<2;++M){var D=R[M];for(S=0;S<D.length;++S){var B=31&D[S];Wo(t,u,T[B]),u+=N[B],B>15&&(Wo(t,u,D[S]>>5&127),u+=D[S]>>12)}}}else C=qo,E=Do,I=Uo,O=Bo;for(S=0;S<a;++S){var q=r[S];if(q>255){Zo(t,u,C[257+(B=q>>18&31)]),u+=E[B+257],B>7&&(Wo(t,u,q>>23&31),u+=No[B]);var U=31&q;Zo(t,u,I[U]),u+=O[U],U>3&&(Zo(t,u,q>>5&8191),u+=Lo[U])}else Zo(t,u,C[q]),u+=E[q]}return Zo(t,u,C[256]),u+E[256]},Xo=new Ao([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Qo=new ko(0),es=function(e,t,n,r,i,o){var s=o.z||e.length,a=new ko(r+s+5*(1+Math.ceil(s/7e3))+i),c=a.subarray(r,a.length-i),l=o.l,u=7&(o.r||0);if(t){u&&(c[0]=o.r>>3);for(var d=Xo[t-1],h=d>>13,f=8191&d,p=(1<<n)-1,m=o.p||new So(32768),g=o.h||new So(p+1),b=Math.ceil(n/3),v=2*b,y=function(t){return(e[t]^e[t+1]<<b^e[t+2]<<v)&p},w=new Ao(25e3),_=new So(288),x=new So(32),k=0,S=0,A=o.i||0,N=0,L=o.w||0,P=0;A+2<s;++A){var C=y(A),E=32767&A,I=g[C];if(m[E]=I,g[C]=E,L<=A){var O=s-A;if((k>7e3||N>24576)&&(O>423||!l)){u=Yo(e,c,0,w,_,x,S,N,P,A-P,u),N=k=S=0,P=A;for(var j=0;j<286;++j)_[j]=0;for(j=0;j<30;++j)x[j]=0}var z=2,F=0,T=f,R=E-I&32767;if(O>2&&C==y(A-R))for(var M=Math.min(h,O)-1,D=Math.min(32767,A),B=Math.min(258,O);R<=D&&--T&&E!=I;){if(e[A+z]==e[A+z-R]){for(var q=0;q<B&&e[A+q]==e[A+q-R];++q);if(q>z){if(z=q,F=R,q>M)break;var U=Math.min(R,q-2),$=0;for(j=0;j<U;++j){var W=A-R+j&32767,Z=W-m[W]&32767;Z>$&&($=Z,I=W)}}}R+=(E=I)-(I=m[E])&32767}if(F){w[N++]=268435456|Oo[z]<<18|zo[F];var H=31&Oo[z],V=31&zo[F];S+=No[H]+Lo[V],++_[257+H],++x[V],L=A+z,++k}else w[N++]=e[A],++_[e[A]]}}for(A=Math.max(A,L);A<s;++A)w[N++]=e[A],++_[e[A]];u=Yo(e,c,l,w,_,x,S,N,P,A-P,u),l||(o.r=7&u|c[u/8|0]<<3,u-=7,o.h=g,o.p=m,o.i=A,o.w=L)}else{for(A=o.w||0;A<s+l;A+=65535){var G=A+65535;G>=s&&(c[u/8|0]=l,G=s),u=Ko(c,u+1,e.subarray(A,G))}o.i=s}return function(e,t,n){return(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length),new ko(e.subarray(t,n))}(a,0,r+$o(u)+i)},ts=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=0|n.length,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=r+=n[s];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}e=r,t=i},d:function(){return(255&(e%=65521))<<24|(65280&e)<<8|(255&(t%=65521))<<8|t>>8}}},ns=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function rs(e,t){t||(t={});var n=ts();n.p(e);var r=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new ko(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return es(e,null==t.level?6:t.level,null==t.mem?i.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,n,r,i)}(e,t,t.dictionary?6:2,4);return function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=ts();i.p(t.dictionary),ns(e,2,i.d())}}(r,t),ns(r,r.length-4,n.d()),r}var is="undefined"!=typeof TextDecoder&&new TextDecoder;try{is.decode(Qo,{stream:!0})}catch(Nd){}function os(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ss(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return os(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?os(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function as(e,t="utf8"){return new TextDecoder(t).decode(e)}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;const cs=new TextEncoder,ls=(()=>{const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])})(),us={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 ds{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(e=8192,t={}){let n=!1;"number"==typeof e?e=new ArrayBuffer(e):(n=!0,this.lastWrittenByte=e.byteLength);const r=t.offset?t.offset>>>0:0,i=e.byteLength-r;let o=r;(ArrayBuffer.isView(e)||e instanceof ds)&&(e.byteLength!==e.buffer.byteLength&&(o=e.byteOffset+r),e=e.buffer),this.lastWrittenByte=n?i:0,this.buffer=e,this.length=i,this.byteLength=i,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,i),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(void 0===e)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const t=2*(this.offset+e),n=new Uint8Array(t);n.set(new Uint8Array(this.buffer)),this.buffer=n.buffer,this.length=t,this.byteLength=t,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(e=1){return this.readArray(e,"uint8")}readArray(e,t){const n=us[t].BYTES_PER_ELEMENT*e,r=this.byteOffset+this.offset,i=this.buffer.slice(r,r+n);if(this.littleEndian===ls&&"uint8"!==t&&"int8"!==t){const e=new Uint8Array(this.buffer.slice(r,r+n));e.reverse();const i=new us[t](e.buffer);return this.offset+=n,i.reverse(),i}const o=new us[t](i);return this.offset+=n,o}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t="";for(let n=0;n<e;n++)t+=this.readChar();return t}readUtf8(e=1){return as(this.readBytes(e))}decodeText(e=1,t="utf8"){return as(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}writeUtf8(e){return this.writeBytes(function(e){return cs.encode(e)}(e))}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 hs(e){let t=e.length;for(;--t>=0;)e[t]=0}const fs=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]),ps=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]),ms=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),gs=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bs=new Array(576);hs(bs);const vs=new Array(60);hs(vs);const ys=new Array(512);hs(ys);const ws=new Array(256);hs(ws);const _s=new Array(29);hs(_s);const xs=new Array(30);function ks(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let Ss,As,Ns;function Ls(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}hs(xs);const Ps=e=>e<256?ys[e]:ys[256+(e>>>7)],Cs=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Es=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,Cs(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Is=(e,t,n)=>{Es(e,n[2*t],n[2*t+1])},Os=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},js=(e,t,n)=>{const r=new Array(16);let i,o,s=0;for(i=1;i<=15;i++)s=s+n[i-1]<<1,r[i]=s;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=Os(r[t]++,t))}},zs=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Fs=e=>{e.bi_valid>8?Cs(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Ts=(e,t,n,r)=>{const i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},Rs=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Ts(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Ts(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},Ms=(e,t,n)=>{let r,i,o,s,a=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+a++],r+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],0===r?Is(e,i,t):(o=ws[i],Is(e,o+256+1,t),s=fs[o],0!==s&&(i-=_s[o],Es(e,i,s)),r--,o=Ps(r),Is(e,o,n),s=ps[o],0!==s&&(r-=xs[o],Es(e,r,s)))}while(a<e.sym_next);Is(e,256,t)},Ds=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let s,a,c,l=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<o;s++)0!==n[2*s]?(e.heap[++e.heap_len]=l=s,e.depth[s]=0):n[2*s+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=l<2?++l:0,n[2*c]=1,e.depth[c]=0,e.opt_len--,i&&(e.static_len-=r[2*c+1]);for(t.max_code=l,s=e.heap_len>>1;s>=1;s--)Rs(e,n,s);c=o;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Rs(e,n,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,n[2*c]=n[2*s]+n[2*a],e.depth[c]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,n[2*s+1]=n[2*a+1]=c,e.heap[1]=c++,Rs(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,c=t.stat_desc.max_length;let l,u,d,h,f,p,m=0;for(h=0;h<=15;h++)e.bl_count[h]=0;for(n[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)u=e.heap[l],h=n[2*n[2*u+1]+1]+1,h>c&&(h=c,m++),n[2*u+1]=h,u>r||(e.bl_count[h]++,f=0,u>=a&&(f=s[u-a]),p=n[2*u],e.opt_len+=p*(h+f),o&&(e.static_len+=p*(i[2*u+1]+f)));if(0!==m){do{for(h=c-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,m-=2}while(m>0);for(h=c;0!==h;h--)for(u=e.bl_count[h];0!==u;)d=e.heap[--l],d>r||(n[2*d+1]!==h&&(e.opt_len+=(h-n[2*d+1])*n[2*d],n[2*d+1]=h),u--)}})(e,t),js(n,l,e.bl_count)},Bs=(e,t,n)=>{let r,i,o=-1,s=t[1],a=0,c=7,l=4;for(0===s&&(c=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=s,s=t[2*(r+1)+1],++a<c&&i===s||(a<l?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=i,0===s?(c=138,l=3):i===s?(c=6,l=3):(c=7,l=4))},qs=(e,t,n)=>{let r,i,o=-1,s=t[1],a=0,c=7,l=4;for(0===s&&(c=138,l=3),r=0;r<=n;r++)if(i=s,s=t[2*(r+1)+1],!(++a<c&&i===s)){if(a<l)do{Is(e,i,e.bl_tree)}while(0!==--a);else 0!==i?(i!==o&&(Is(e,i,e.bl_tree),a--),Is(e,16,e.bl_tree),Es(e,a-3,2)):a<=10?(Is(e,17,e.bl_tree),Es(e,a-3,3)):(Is(e,18,e.bl_tree),Es(e,a-11,7));a=0,o=i,0===s?(c=138,l=3):i===s?(c=6,l=3):(c=7,l=4)}};let Us=!1;const $s=(e,t,n,r)=>{Es(e,0+(r?1:0),3),Fs(e),Cs(e,n),Cs(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var Ws={_tr_init:e=>{Us||((()=>{let e,t,n,r,i;const o=new Array(16);for(n=0,r=0;r<28;r++)for(_s[r]=n,e=0;e<1<<fs[r];e++)ws[n++]=r;for(ws[n-1]=r,i=0,r=0;r<16;r++)for(xs[r]=i,e=0;e<1<<ps[r];e++)ys[i++]=r;for(i>>=7;r<30;r++)for(xs[r]=i<<7,e=0;e<1<<ps[r]-7;e++)ys[256+i++]=r;for(t=0;t<=15;t++)o[t]=0;for(e=0;e<=143;)bs[2*e+1]=8,e++,o[8]++;for(;e<=255;)bs[2*e+1]=9,e++,o[9]++;for(;e<=279;)bs[2*e+1]=7,e++,o[7]++;for(;e<=287;)bs[2*e+1]=8,e++,o[8]++;for(js(bs,287,o),e=0;e<30;e++)vs[2*e+1]=5,vs[2*e]=Os(e,5);Ss=new ks(bs,fs,257,286,15),As=new ks(vs,ps,0,30,15),Ns=new ks(new Array(0),ms,0,19,7)})(),Us=!0),e.l_desc=new Ls(e.dyn_ltree,Ss),e.d_desc=new Ls(e.dyn_dtree,As),e.bl_desc=new Ls(e.bl_tree,Ns),e.bi_buf=0,e.bi_valid=0,zs(e)},_tr_stored_block:$s,_tr_flush_block:(e,t,n,r)=>{let i,o,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Ds(e,e.l_desc),Ds(e,e.d_desc),s=(e=>{let t;for(Bs(e,e.dyn_ltree,e.l_desc.max_code),Bs(e,e.dyn_dtree,e.d_desc.max_code),Ds(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*gs[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==t?$s(e,t,n,r):4===e.strategy||o===i?(Es(e,2+(r?1:0),3),Ms(e,bs,vs)):(Es(e,4+(r?1:0),3),((e,t,n,r)=>{let i;for(Es(e,t-257,5),Es(e,n-1,5),Es(e,r-4,4),i=0;i<r;i++)Es(e,e.bl_tree[2*gs[i]+1],3);qs(e,e.dyn_ltree,t-1),qs(e,e.dyn_dtree,n-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),Ms(e,e.dyn_ltree,e.dyn_dtree)),zs(e),r&&Fs(e)},_tr_tally:(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(ws[n]+256+1)]++,e.dyn_dtree[2*Ps(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Es(e,2,3),Is(e,256,bs),(e=>{16===e.bi_valid?(Cs(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},Zs=(e,t,n,r)=>{let i=65535&e,o=e>>>16&65535,s=0;for(;0!==n;){s=n>2e3?2e3:n,n-=s;do{i=i+t[r++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16};const Hs=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var Vs=(e,t,n,r)=>{const i=Hs,o=r+n;e^=-1;for(let n=r;n<o;n++)e=e>>>8^i[255&(e^t[n])];return-1^e},Gs={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"},Js={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};const{_tr_init:Ks,_tr_stored_block:Ys,_tr_flush_block:Xs,_tr_tally:Qs,_tr_align:ea}=Ws,{Z_NO_FLUSH:ta,Z_PARTIAL_FLUSH:na,Z_FULL_FLUSH:ra,Z_FINISH:ia,Z_BLOCK:oa,Z_OK:sa,Z_STREAM_END:aa,Z_STREAM_ERROR:ca,Z_DATA_ERROR:la,Z_BUF_ERROR:ua,Z_DEFAULT_COMPRESSION:da,Z_FILTERED:ha,Z_HUFFMAN_ONLY:fa,Z_RLE:pa,Z_FIXED:ma,Z_DEFAULT_STRATEGY:ga,Z_UNKNOWN:ba,Z_DEFLATED:va}=Js,ya=258,wa=262,_a=42,xa=113,ka=666,Sa=(e,t)=>(e.msg=Gs[t],t),Aa=e=>2*e-(e>4?9:0),Na=e=>{let t=e.length;for(;--t>=0;)e[t]=0},La=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do{n=e.head[--r],e.head[r]=n>=i?n-i:0}while(--t);t=i,r=t;do{n=e.prev[--r],e.prev[r]=n>=i?n-i:0}while(--t)};let Pa=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const Ca=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},Ea=(e,t)=>{Xs(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ca(e.strm)},Ia=(e,t)=>{e.pending_buf[e.pending++]=t},Oa=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},ja=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=Zs(e.adler,t,i,n):2===e.state.wrap&&(e.adler=Vs(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},za=(e,t)=>{let n,r,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match;const c=e.strstart>e.w_size-wa?e.strstart-(e.w_size-wa):0,l=e.window,u=e.w_mask,d=e.prev,h=e.strstart+ya;let f=l[o+s-1],p=l[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(n=t,l[n+s]===p&&l[n+s-1]===f&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&o<h);if(r=ya-(h-o),o=h-ya,r>s){if(e.match_start=t,s=r,r>=a)break;f=l[o+s-1],p=l[o+s]}}}while((t=d[t&u])>c&&0!==--i);return s<=e.lookahead?s:e.lookahead},Fa=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-wa)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),La(e),r+=t),0===e.strm.avail_in)break;if(n=ja(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Pa(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Pa(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<wa&&0!==e.strm.avail_in)},Ta=(e,t)=>{let n,r,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;do{if(n=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,r=e.strstart-e.block_start,n>r+e.strm.avail_in&&(n=r+e.strm.avail_in),n>i&&(n=i),n<o&&(0===n&&t!==ia||t===ta||n!==r+e.strm.avail_in))break;s=t===ia&&n===r+e.strm.avail_in?1:0,Ys(e,0,0,s),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Ca(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(ja(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===s);return a-=e.strm.avail_in,a&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==ta&&t!==ia&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(ja(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,o=i>e.w_size?e.w_size:i,r=e.strstart-e.block_start,(r>=o||(r||t===ia)&&t!==ta&&0===e.strm.avail_in&&r<=i)&&(n=r>i?i:r,s=t===ia&&0===e.strm.avail_in&&n===r?1:0,Ys(e,e.block_start,n,s),e.block_start+=n,Ca(e.strm)),s?3:1)},Ra=(e,t)=>{let n,r;for(;;){if(e.lookahead<wa){if(Fa(e),e.lookahead<wa&&t===ta)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Pa(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-wa&&(e.match_length=za(e,n)),e.match_length>=3)if(r=Qs(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Pa(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!==--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Pa(e,e.ins_h,e.window[e.strstart+1]);else r=Qs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Ea(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===ia?(Ea(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ea(e,!1),0===e.strm.avail_out)?1:2},Ma=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<wa){if(Fa(e),e.lookahead<wa&&t===ta)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Pa(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-wa&&(e.match_length=za(e,n),e.match_length<=5&&(e.strategy===ha||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=Qs(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=Pa(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!==--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(Ea(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=Qs(e,0,e.window[e.strstart-1]),r&&Ea(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Qs(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===ia?(Ea(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ea(e,!1),0===e.strm.avail_out)?1:2};function Da(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const Ba=[new Da(0,0,0,0,Ta),new Da(4,4,8,4,Ra),new Da(4,5,16,8,Ra),new Da(4,6,32,32,Ra),new Da(4,4,16,16,Ma),new Da(8,16,32,32,Ma),new Da(8,16,128,128,Ma),new Da(8,32,128,256,Ma),new Da(32,128,258,1024,Ma),new Da(32,258,258,4096,Ma)];function qa(){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=va,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(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Na(this.dyn_ltree),Na(this.dyn_dtree),Na(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),Na(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Na(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}const Ua=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==_a&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==xa&&t.status!==ka?1:0},$a=e=>{if(Ua(e))return Sa(e,ca);e.total_in=e.total_out=0,e.data_type=ba;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?_a:xa,e.adler=2===t.wrap?0:1,t.last_flush=-2,Ks(t),sa},Wa=e=>{const t=$a(e);return t===sa&&(e=>{e.window_size=2*e.w_size,Na(e.head),e.max_lazy_match=Ba[e.level].max_lazy,e.good_match=Ba[e.level].good_length,e.nice_match=Ba[e.level].nice_length,e.max_chain_length=Ba[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0})(e.state),t},Za=(e,t,n,r,i,o)=>{if(!e)return ca;let s=1;if(t===da&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>9||n!==va||r<8||r>15||t<0||t>9||o<0||o>ma||8===r&&1!==s)return Sa(e,ca);8===r&&(r=9);const a=new qa;return e.state=a,a.strm=e,a.status=_a,a.wrap=s,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=o,a.method=n,Wa(e)};var Ha=Za,Va=(e,t)=>Ua(e)||2!==e.state.wrap?ca:(e.state.gzhead=t,sa),Ga=(e,t)=>{if(Ua(e)||t>oa||t<0)return e?Sa(e,ca):ca;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===ka&&t!==ia)return Sa(e,0===e.avail_out?ua:ca);const r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(Ca(e),0===e.avail_out)return n.last_flush=-1,sa}else if(0===e.avail_in&&Aa(t)<=Aa(r)&&t!==ia)return Sa(e,ua);if(n.status===ka&&0!==e.avail_in)return Sa(e,ua);if(n.status===_a&&0===n.wrap&&(n.status=xa),n.status===_a){let t=va+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=fa||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=r<<6,0!==n.strstart&&(t|=32),t+=31-t%31,Oa(n,t),0!==n.strstart&&(Oa(n,e.adler>>>16),Oa(n,65535&e.adler)),e.adler=1,n.status=xa,Ca(e),0!==n.pending)return n.last_flush=-1,sa}if(57===n.status)if(e.adler=0,Ia(n,31),Ia(n,139),Ia(n,8),n.gzhead)Ia(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ia(n,255&n.gzhead.time),Ia(n,n.gzhead.time>>8&255),Ia(n,n.gzhead.time>>16&255),Ia(n,n.gzhead.time>>24&255),Ia(n,9===n.level?2:n.strategy>=fa||n.level<2?4:0),Ia(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Ia(n,255&n.gzhead.extra.length),Ia(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Vs(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(Ia(n,0),Ia(n,0),Ia(n,0),Ia(n,0),Ia(n,0),Ia(n,9===n.level?2:n.strategy>=fa||n.level<2?4:0),Ia(n,3),n.status=xa,Ca(e),0!==n.pending)return n.last_flush=-1,sa;if(69===n.status){if(n.gzhead.extra){let t=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>t&&(e.adler=Vs(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,Ca(e),0!==n.pending)return n.last_flush=-1,sa;t=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>t&&(e.adler=Vs(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=Vs(e.adler,n.pending_buf,n.pending-r,r)),Ca(e),0!==n.pending)return n.last_flush=-1,sa;r=0}t=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,Ia(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=Vs(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=Vs(e.adler,n.pending_buf,n.pending-r,r)),Ca(e),0!==n.pending)return n.last_flush=-1,sa;r=0}t=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,Ia(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=Vs(e.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&&(Ca(e),0!==n.pending))return n.last_flush=-1,sa;Ia(n,255&e.adler),Ia(n,e.adler>>8&255),e.adler=0}if(n.status=xa,Ca(e),0!==n.pending)return n.last_flush=-1,sa}if(0!==e.avail_in||0!==n.lookahead||t!==ta&&n.status!==ka){let r=0===n.level?Ta(n,t):n.strategy===fa?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(Fa(e),0===e.lookahead)){if(t===ta)return 1;break}if(e.match_length=0,n=Qs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Ea(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===ia?(Ea(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ea(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===pa?((e,t)=>{let n,r,i,o;const s=e.window;for(;;){if(e.lookahead<=ya){if(Fa(e),e.lookahead<=ya&&t===ta)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){o=e.strstart+ya;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<o);e.match_length=ya-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=Qs(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Qs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Ea(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===ia?(Ea(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ea(e,!1),0===e.strm.avail_out)?1:2})(n,t):Ba[n.level].func(n,t);if(3!==r&&4!==r||(n.status=ka),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),sa;if(2===r&&(t===na?ea(n):t!==oa&&(Ys(n,0,0,!1),t===ra&&(Na(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Ca(e),0===e.avail_out))return n.last_flush=-1,sa}return t!==ia?sa:n.wrap<=0?aa:(2===n.wrap?(Ia(n,255&e.adler),Ia(n,e.adler>>8&255),Ia(n,e.adler>>16&255),Ia(n,e.adler>>24&255),Ia(n,255&e.total_in),Ia(n,e.total_in>>8&255),Ia(n,e.total_in>>16&255),Ia(n,e.total_in>>24&255)):(Oa(n,e.adler>>>16),Oa(n,65535&e.adler)),Ca(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?sa:aa)},Ja=e=>{if(Ua(e))return ca;const t=e.state.status;return e.state=null,t===xa?Sa(e,la):sa},Ka=(e,t)=>{let n=t.length;if(Ua(e))return ca;const r=e.state,i=r.wrap;if(2===i||1===i&&r.status!==_a||r.lookahead)return ca;if(1===i&&(e.adler=Zs(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===i&&(Na(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const o=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Fa(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=Pa(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,Fa(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,e.next_in=s,e.input=a,e.avail_in=o,r.wrap=i,sa};const Ya=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Xa=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)Ya(n,t)&&(e[t]=n[t])}}return e},Qa=e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;const n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n};let ec=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){ec=!1}const tc=new Uint8Array(256);for(let e=0;e<256;e++)tc[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;tc[254]=tc[254]=1;var nc=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,i,o,s=e.length,a=0;for(i=0;i<s;i++)n=e.charCodeAt(i),55296==(64512&n)&&i+1<s&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(a),o=0,i=0;o<a;i++)n=e.charCodeAt(i),55296==(64512&n)&&i+1<s&&(r=e.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},rc=(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,i;const o=new Array(2*n);for(i=0,r=0;r<n;){let t=e[r++];if(t<128){o[i++]=t;continue}let s=tc[t];if(s>4)o[i++]=65533,r+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&r<n;)t=t<<6|63&e[r++],s--;s>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&ec)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n})(o,i)},ic=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+tc[e[n]]>t?n:t},oc=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};const sc=Object.prototype.toString,{Z_NO_FLUSH:ac,Z_SYNC_FLUSH:cc,Z_FULL_FLUSH:lc,Z_FINISH:uc,Z_OK:dc,Z_STREAM_END:hc,Z_DEFAULT_COMPRESSION:fc,Z_DEFAULT_STRATEGY:pc,Z_DEFLATED:mc}=Js;function gc(e){this.options=Xa({level:fc,method:mc,chunkSize:16384,windowBits:15,memLevel:8,strategy:pc},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new oc,this.strm.avail_out=0;let n=Ha(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==dc)throw new Error(Gs[n]);if(t.header&&Va(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?nc(t.dictionary):"[object ArrayBuffer]"===sc.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=Ka(this.strm,e),n!==dc)throw new Error(Gs[n]);this._dict_set=!0}}function bc(e,t){const n=new gc(t);if(n.push(e,!0),n.err)throw n.msg||Gs[n.err];return n.result}gc.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?uc:ac,"string"==typeof e?n.input=nc(e):"[object ArrayBuffer]"===sc.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===cc||o===lc)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(i=Ga(n,o),i===hc)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Ja(this.strm),this.onEnd(i),this.ended=!0,i===dc;if(0!==n.avail_out){if(o>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},gc.prototype.onData=function(e){this.chunks.push(e)},gc.prototype.onEnd=function(e){e===dc&&(this.result=Qa(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var vc={Deflate:gc,deflate:bc,deflateRaw:function(e,t){return(t=t||{}).raw=!0,bc(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,bc(e,t)},constants:Js};const yc=16209;var wc=function(e,t){let n,r,i,o,s,a,c,l,u,d,h,f,p,m,g,b,v,y,w,_,x,k,S,A;const N=e.state;n=e.next_in,S=e.input,r=n+(e.avail_in-5),i=e.next_out,A=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),a=N.dmax,c=N.wsize,l=N.whave,u=N.wnext,d=N.window,h=N.hold,f=N.bits,p=N.lencode,m=N.distcode,g=(1<<N.lenbits)-1,b=(1<<N.distbits)-1;e:do{f<15&&(h+=S[n++]<<f,f+=8,h+=S[n++]<<f,f+=8),v=p[h&g];t:for(;;){if(y=v>>>24,h>>>=y,f-=y,y=v>>>16&255,0===y)A[i++]=65535&v;else{if(!(16&y)){if(64&y){if(32&y){N.mode=16191;break e}e.msg="invalid literal/length code",N.mode=yc;break e}v=p[(65535&v)+(h&(1<<y)-1)];continue t}for(w=65535&v,y&=15,y&&(f<y&&(h+=S[n++]<<f,f+=8),w+=h&(1<<y)-1,h>>>=y,f-=y),f<15&&(h+=S[n++]<<f,f+=8,h+=S[n++]<<f,f+=8),v=m[h&b];;){if(y=v>>>24,h>>>=y,f-=y,y=v>>>16&255,16&y){if(_=65535&v,y&=15,f<y&&(h+=S[n++]<<f,f+=8,f<y&&(h+=S[n++]<<f,f+=8)),_+=h&(1<<y)-1,_>a){e.msg="invalid distance too far back",N.mode=yc;break e}if(h>>>=y,f-=y,y=i-o,_>y){if(y=_-y,y>l&&N.sane){e.msg="invalid distance too far back",N.mode=yc;break e}if(x=0,k=d,0===u){if(x+=c-y,y<w){w-=y;do{A[i++]=d[x++]}while(--y);x=i-_,k=A}}else if(u<y){if(x+=c+u-y,y-=u,y<w){w-=y;do{A[i++]=d[x++]}while(--y);if(x=0,u<w){y=u,w-=y;do{A[i++]=d[x++]}while(--y);x=i-_,k=A}}}else if(x+=u-y,y<w){w-=y;do{A[i++]=d[x++]}while(--y);x=i-_,k=A}for(;w>2;)A[i++]=k[x++],A[i++]=k[x++],A[i++]=k[x++],w-=3;w&&(A[i++]=k[x++],w>1&&(A[i++]=k[x++]))}else{x=i-_;do{A[i++]=A[x++],A[i++]=A[x++],A[i++]=A[x++],w-=3}while(w>2);w&&(A[i++]=A[x++],w>1&&(A[i++]=A[x++]))}break}if(64&y){e.msg="invalid distance code",N.mode=yc;break e}v=m[(65535&v)+(h&(1<<y)-1)]}}break}}while(n<r&&i<s);w=f>>3,n-=w,f-=w<<3,h&=(1<<f)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=i<s?s-i+257:257-(i-s),N.hold=h,N.bits=f};const _c=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]),xc=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]),kc=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]),Sc=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 Ac=(e,t,n,r,i,o,s,a)=>{const c=a.bits;let l,u,d,h,f,p,m=0,g=0,b=0,v=0,y=0,w=0,_=0,x=0,k=0,S=0,A=null;const N=new Uint16Array(16),L=new Uint16Array(16);let P,C,E,I=null;for(m=0;m<=15;m++)N[m]=0;for(g=0;g<r;g++)N[t[n+g]]++;for(y=c,v=15;v>=1&&0===N[v];v--);if(y>v&&(y=v),0===v)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(b=1;b<v&&0===N[b];b++);for(y<b&&(y=b),x=1,m=1;m<=15;m++)if(x<<=1,x-=N[m],x<0)return-1;if(x>0&&(0===e||1!==v))return-1;for(L[1]=0,m=1;m<15;m++)L[m+1]=L[m]+N[m];for(g=0;g<r;g++)0!==t[n+g]&&(s[L[t[n+g]]++]=g);if(0===e?(A=I=s,p=20):1===e?(A=_c,I=xc,p=257):(A=kc,I=Sc,p=0),S=0,g=0,m=b,f=o,w=y,_=0,d=-1,k=1<<y,h=k-1,1===e&&k>852||2===e&&k>592)return 1;for(;;){P=m-_,s[g]+1<p?(C=0,E=s[g]):s[g]>=p?(C=I[s[g]-p],E=A[s[g]-p]):(C=96,E=0),l=1<<m-_,u=1<<w,b=u;do{u-=l,i[f+(S>>_)+u]=P<<24|C<<16|E}while(0!==u);for(l=1<<m-1;S&l;)l>>=1;if(0!==l?(S&=l-1,S+=l):S=0,g++,0===--N[m]){if(m===v)break;m=t[n+s[g]]}if(m>y&&(S&h)!==d){for(0===_&&(_=y),f+=b,w=m-_,x=1<<w;w+_<v&&(x-=N[w+_],!(x<=0));)w++,x<<=1;if(k+=1<<w,1===e&&k>852||2===e&&k>592)return 1;d=S&h,i[d]=y<<24|w<<16|f-o}}return 0!==S&&(i[f+S]=m-_<<24|64<<16),a.bits=y,0};const{Z_FINISH:Nc,Z_BLOCK:Lc,Z_TREES:Pc,Z_OK:Cc,Z_STREAM_END:Ec,Z_NEED_DICT:Ic,Z_STREAM_ERROR:Oc,Z_DATA_ERROR:jc,Z_MEM_ERROR:zc,Z_BUF_ERROR:Fc,Z_DEFLATED:Tc}=Js,Rc=16180,Mc=16190,Dc=16191,Bc=16192,qc=16194,Uc=16199,$c=16200,Wc=16206,Zc=16209,Hc=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Vc(){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}const Gc=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Rc||t.mode>16211?1:0},Jc=e=>{if(Gc(e))return Oc;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Rc,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Cc},Kc=e=>{if(Gc(e))return Oc;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Jc(e)},Yc=(e,t)=>{let n;if(Gc(e))return Oc;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Oc:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,Kc(e))},Xc=(e,t)=>{if(!e)return Oc;const n=new Vc;e.state=n,n.strm=e,n.window=null,n.mode=Rc;const r=Yc(e,t);return r!==Cc&&(e.state=null),r};let Qc,el,tl=!0;const nl=e=>{if(tl){Qc=new Int32Array(512),el=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ac(1,e.lens,0,288,Qc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ac(2,e.lens,0,32,el,0,e.work,{bits:5}),tl=!1}e.lencode=Qc,e.lenbits=9,e.distcode=el,e.distbits=5},rl=(e,t,n,r)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),(r-=i)?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var il=Kc,ol=Xc,sl=(e,t)=>{let n,r,i,o,s,a,c,l,u,d,h,f,p,m,g,b,v,y,w,_,x,k,S=0;const A=new Uint8Array(4);let N,L;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Gc(e)||!e.output||!e.input&&0!==e.avail_in)return Oc;n=e.state,n.mode===Dc&&(n.mode=Bc),s=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,r=e.input,a=e.avail_in,l=n.hold,u=n.bits,d=a,h=c,k=Cc;e:for(;;)switch(n.mode){case Rc:if(0===n.wrap){n.mode=Bc;break}for(;u<16;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}if(2&n.wrap&&35615===l){0===n.wbits&&(n.wbits=15),n.check=0,A[0]=255&l,A[1]=l>>>8&255,n.check=Vs(n.check,A,2,0),l=0,u=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Zc;break}if((15&l)!==Tc){e.msg="unknown compression method",n.mode=Zc;break}if(l>>>=4,u-=4,x=8+(15&l),0===n.wbits&&(n.wbits=x),x>15||x>n.wbits){e.msg="invalid window size",n.mode=Zc;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&l?16189:Dc,l=0,u=0;break;case 16181:for(;u<16;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}if(n.flags=l,(255&n.flags)!==Tc){e.msg="unknown compression method",n.mode=Zc;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Zc;break}n.head&&(n.head.text=l>>8&1),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=Vs(n.check,A,2,0)),l=0,u=0,n.mode=16182;case 16182:for(;u<32;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}n.head&&(n.head.time=l),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,n.check=Vs(n.check,A,4,0)),l=0,u=0,n.mode=16183;case 16183:for(;u<16;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}n.head&&(n.head.xflags=255&l,n.head.os=l>>8),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=Vs(n.check,A,2,0)),l=0,u=0,n.mode=16184;case 16184:if(1024&n.flags){for(;u<16;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),512&n.flags&&4&n.wrap&&(A[0]=255&l,A[1]=l>>>8&255,n.check=Vs(n.check,A,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(f=n.length,f>a&&(f=a),f&&(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(o,o+f),x)),512&n.flags&&4&n.wrap&&(n.check=Vs(n.check,r,f,o)),a-=f,o+=f,n.length-=f),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===a)break e;f=0;do{x=r[o+f++],n.head&&x&&n.length<65536&&(n.head.name+=String.fromCharCode(x))}while(x&&f<a);if(512&n.flags&&4&n.wrap&&(n.check=Vs(n.check,r,f,o)),a-=f,o+=f,x)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===a)break e;f=0;do{x=r[o+f++],n.head&&x&&n.length<65536&&(n.head.comment+=String.fromCharCode(x))}while(x&&f<a);if(512&n.flags&&4&n.wrap&&(n.check=Vs(n.check,r,f,o)),a-=f,o+=f,x)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;u<16;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}if(4&n.wrap&&l!==(65535&n.check)){e.msg="header crc mismatch",n.mode=Zc;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Dc;break;case 16189:for(;u<32;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}e.adler=n.check=Hc(l),l=0,u=0,n.mode=Mc;case Mc:if(0===n.havedict)return e.next_out=s,e.avail_out=c,e.next_in=o,e.avail_in=a,n.hold=l,n.bits=u,Ic;e.adler=n.check=1,n.mode=Dc;case Dc:if(t===Lc||t===Pc)break e;case Bc:if(n.last){l>>>=7&u,u-=7&u,n.mode=Wc;break}for(;u<3;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}switch(n.last=1&l,l>>>=1,u-=1,3&l){case 0:n.mode=16193;break;case 1:if(nl(n),n.mode=Uc,t===Pc){l>>>=2,u-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=Zc}l>>>=2,u-=2;break;case 16193:for(l>>>=7&u,u-=7&u;u<32;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Zc;break}if(n.length=65535&l,l=0,u=0,n.mode=qc,t===Pc)break e;case qc:n.mode=16195;case 16195:if(f=n.length,f){if(f>a&&(f=a),f>c&&(f=c),0===f)break e;i.set(r.subarray(o,o+f),s),a-=f,o+=f,c-=f,s+=f,n.length-=f;break}n.mode=Dc;break;case 16196:for(;u<14;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}if(n.nlen=257+(31&l),l>>>=5,u-=5,n.ndist=1+(31&l),l>>>=5,u-=5,n.ncode=4+(15&l),l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Zc;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;u<3;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}n.lens[P[n.have++]]=7&l,l>>>=3,u-=3}for(;n.have<19;)n.lens[P[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,N={bits:n.lenbits},k=Ac(0,n.lens,0,19,n.lencode,0,n.work,N),n.lenbits=N.bits,k){e.msg="invalid code lengths set",n.mode=Zc;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;S=n.lencode[l&(1<<n.lenbits)-1],g=S>>>24,b=S>>>16&255,v=65535&S,!(g<=u);){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}if(v<16)l>>>=g,u-=g,n.lens[n.have++]=v;else{if(16===v){for(L=g+2;u<L;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}if(l>>>=g,u-=g,0===n.have){e.msg="invalid bit length repeat",n.mode=Zc;break}x=n.lens[n.have-1],f=3+(3&l),l>>>=2,u-=2}else if(17===v){for(L=g+3;u<L;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}l>>>=g,u-=g,x=0,f=3+(7&l),l>>>=3,u-=3}else{for(L=g+7;u<L;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}l>>>=g,u-=g,x=0,f=11+(127&l),l>>>=7,u-=7}if(n.have+f>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Zc;break}for(;f--;)n.lens[n.have++]=x}}if(n.mode===Zc)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=Zc;break}if(n.lenbits=9,N={bits:n.lenbits},k=Ac(1,n.lens,0,n.nlen,n.lencode,0,n.work,N),n.lenbits=N.bits,k){e.msg="invalid literal/lengths set",n.mode=Zc;break}if(n.distbits=6,n.distcode=n.distdyn,N={bits:n.distbits},k=Ac(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,N),n.distbits=N.bits,k){e.msg="invalid distances set",n.mode=Zc;break}if(n.mode=Uc,t===Pc)break e;case Uc:n.mode=$c;case $c:if(a>=6&&c>=258){e.next_out=s,e.avail_out=c,e.next_in=o,e.avail_in=a,n.hold=l,n.bits=u,wc(e,h),s=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,r=e.input,a=e.avail_in,l=n.hold,u=n.bits,n.mode===Dc&&(n.back=-1);break}for(n.back=0;S=n.lencode[l&(1<<n.lenbits)-1],g=S>>>24,b=S>>>16&255,v=65535&S,!(g<=u);){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}if(b&&!(240&b)){for(y=g,w=b,_=v;S=n.lencode[_+((l&(1<<y+w)-1)>>y)],g=S>>>24,b=S>>>16&255,v=65535&S,!(y+g<=u);){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}l>>>=y,u-=y,n.back+=y}if(l>>>=g,u-=g,n.back+=g,n.length=v,0===b){n.mode=16205;break}if(32&b){n.back=-1,n.mode=Dc;break}if(64&b){e.msg="invalid literal/length code",n.mode=Zc;break}n.extra=15&b,n.mode=16201;case 16201:if(n.extra){for(L=n.extra;u<L;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;S=n.distcode[l&(1<<n.distbits)-1],g=S>>>24,b=S>>>16&255,v=65535&S,!(g<=u);){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}if(!(240&b)){for(y=g,w=b,_=v;S=n.distcode[_+((l&(1<<y+w)-1)>>y)],g=S>>>24,b=S>>>16&255,v=65535&S,!(y+g<=u);){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}l>>>=y,u-=y,n.back+=y}if(l>>>=g,u-=g,n.back+=g,64&b){e.msg="invalid distance code",n.mode=Zc;break}n.offset=v,n.extra=15&b,n.mode=16203;case 16203:if(n.extra){for(L=n.extra;u<L;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Zc;break}n.mode=16204;case 16204:if(0===c)break e;if(f=h-c,n.offset>f){if(f=n.offset-f,f>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Zc;break}f>n.wnext?(f-=n.wnext,p=n.wsize-f):p=n.wnext-f,f>n.length&&(f=n.length),m=n.window}else m=i,p=s-n.offset,f=n.length;f>c&&(f=c),c-=f,n.length-=f;do{i[s++]=m[p++]}while(--f);0===n.length&&(n.mode=$c);break;case 16205:if(0===c)break e;i[s++]=n.length,c--,n.mode=$c;break;case Wc:if(n.wrap){for(;u<32;){if(0===a)break e;a--,l|=r[o++]<<u,u+=8}if(h-=c,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?Vs(n.check,i,h,s-h):Zs(n.check,i,h,s-h)),h=c,4&n.wrap&&(n.flags?l:Hc(l))!==n.check){e.msg="incorrect data check",n.mode=Zc;break}l=0,u=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;u<32;){if(0===a)break e;a--,l+=r[o++]<<u,u+=8}if(4&n.wrap&&l!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=Zc;break}l=0,u=0}n.mode=16208;case 16208:k=Ec;break e;case Zc:k=jc;break e;case 16210:return zc;default:return Oc}return e.next_out=s,e.avail_out=c,e.next_in=o,e.avail_in=a,n.hold=l,n.bits=u,(n.wsize||h!==e.avail_out&&n.mode<Zc&&(n.mode<Wc||t!==Nc))&&rl(e,e.output,e.next_out,h-e.avail_out),d-=e.avail_in,h-=e.avail_out,e.total_in+=d,e.total_out+=h,n.total+=h,4&n.wrap&&h&&(e.adler=n.check=n.flags?Vs(n.check,i,h,e.next_out-h):Zs(n.check,i,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Dc?128:0)+(n.mode===Uc||n.mode===qc?256:0),(0===d&&0===h||t===Nc)&&k===Cc&&(k=Fc),k},al=e=>{if(Gc(e))return Oc;let t=e.state;return t.window&&(t.window=null),e.state=null,Cc},cl=(e,t)=>{if(Gc(e))return Oc;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Cc):Oc},ll=(e,t)=>{const n=t.length;let r,i,o;return Gc(e)?Oc:(r=e.state,0!==r.wrap&&r.mode!==Mc?Oc:r.mode===Mc&&(i=1,i=Zs(i,t,n,0),i!==r.check)?jc:(o=rl(e,t,n,n),o?(r.mode=16210,zc):(r.havedict=1,Cc)))},ul=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};const dl=Object.prototype.toString,{Z_NO_FLUSH:hl,Z_FINISH:fl,Z_OK:pl,Z_STREAM_END:ml,Z_NEED_DICT:gl,Z_STREAM_ERROR:bl,Z_DATA_ERROR:vl,Z_MEM_ERROR:yl}=Js;function wl(e){this.options=Xa({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new oc,this.strm.avail_out=0;let n=ol(this.strm,t.windowBits);if(n!==pl)throw new Error(Gs[n]);if(this.header=new ul,cl(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=nc(t.dictionary):"[object ArrayBuffer]"===dl.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=ll(this.strm,t.dictionary),n!==pl)))throw new Error(Gs[n])}function _l(e,t){const n=new wl(t);if(n.push(e),n.err)throw n.msg||Gs[n.err];return n.result}wl.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(s=t===~~t?t:!0===t?fl:hl,"[object ArrayBuffer]"===dl.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=sl(n,s),o===gl&&i&&(o=ll(n,i),o===pl?o=sl(n,s):o===vl&&(o=gl));n.avail_in>0&&o===ml&&n.state.wrap>0&&0!==e[n.next_in];)il(n),o=sl(n,s);switch(o){case bl:case vl:case gl:case yl:return this.onEnd(o),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(0===n.avail_out||o===ml))if("string"===this.options.to){let e=ic(n.output,n.next_out),t=n.next_out-e,i=rc(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(o!==pl||0!==a){if(o===ml)return o=al(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},wl.prototype.onData=function(e){this.chunks.push(e)},wl.prototype.onEnd=function(e){e===pl&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Qa(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var xl={Inflate:wl,inflate:_l,inflateRaw:function(e,t){return(t=t||{}).raw=!0,_l(e,t)},ungzip:_l,constants:Js};const{Deflate:kl,deflate:Sl,deflateRaw:Al,gzip:Nl}=vc,{Inflate:Ll,inflate:Pl,inflateRaw:Cl,ungzip:El}=xl;var Il=Ll,Ol=Pl;const jl=[];for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)1&t?t=3988292384^t>>>1:t>>>=1;jl[e]=t}const zl=4294967295;function Fl(e,t,n){const r=e.readUint32(),i=(o=new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),(function(e,t,n){let r=e;for(let e=0;e<n;e++)r=jl[255&(r^t[e])]^r>>>8;return r}(zl,o,t)^zl)>>>0);var o;if(i!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${i}`)}function Tl(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function Rl(e,t,n,r){let i=0;for(;i<r;i++)t[i]=e[i];for(;i<n;i++)t[i]=e[i]+t[i-r]&255}function Ml(e,t,n,r){let i=0;if(0===n.length)for(;i<r;i++)t[i]=e[i];else for(;i<r;i++)t[i]=e[i]+n[i]&255}function Dl(e,t,n,r,i){let o=0;if(0===n.length){for(;o<i;o++)t[o]=e[o];for(;o<r;o++)t[o]=e[o]+(t[o-i]>>1)&255}else{for(;o<i;o++)t[o]=e[o]+(n[o]>>1)&255;for(;o<r;o++)t[o]=e[o]+(t[o-i]+n[o]>>1)&255}}function Bl(e,t,n,r,i){let o=0;if(0===n.length){for(;o<i;o++)t[o]=e[o];for(;o<r;o++)t[o]=e[o]+t[o-i]&255}else{for(;o<i;o++)t[o]=e[o]+n[o]&255;for(;o<r;o++)t[o]=e[o]+ql(t[o-i],n[o],n[o-i])&255}}function ql(e,t,n){const r=e+t-n,i=Math.abs(r-e),o=Math.abs(r-t),s=Math.abs(r-n);return i<=o&&i<=s?e:o<=s?t:n}function Ul(e,t,n,r,i,o){switch(e){case 0:Tl(t,n,i);break;case 1:Rl(t,n,i,o);break;case 2:Ml(t,n,r,i);break;case 3:Dl(t,n,r,i,o);break;case 4:Bl(t,n,r,i,o);break;default:throw new Error(`Unsupported filter: ${e}`)}}const $l=new Uint16Array([255]),Wl=255===new Uint8Array($l.buffer)[0];function Zl(e){return(255&e)<<8|e>>8&255}const Hl=new Uint16Array([255]),Vl=255===new Uint8Array(Hl.buffer)[0],Gl=new Uint8Array(0);function Jl(e){const{data:t,width:n,height:r,channels:i,depth:o}=e,s=Math.ceil(o/8)*i,a=Math.ceil(o/8*i*n),c=new Uint8Array(r*a);let l,u,d=Gl,h=0;for(let e=0;e<r;e++){switch(l=t.subarray(h+1,h+1+a),u=c.subarray(e*a,(e+1)*a),t[h]){case 0:Tl(l,u,a);break;case 1:Rl(l,u,a,s);break;case 2:Ml(l,u,d,a);break;case 3:Dl(l,u,d,a,s);break;case 4:Bl(l,u,d,a,s);break;default:throw new Error(`Unsupported filter: ${t[h]}`)}d=u,h+=a+1}if(16===o){const e=new Uint16Array(c.buffer);if(Vl)for(let t=0;t<e.length;t++)e[t]=Kl(e[t]);return e}return c}function Kl(e){return(255&e)<<8|e>>8&255}const Yl=Uint8Array.of(137,80,78,71,13,10,26,10);function Xl(e){if(!function(e){if(e.length<Yl.length)return!1;for(let t=0;t<Yl.length;t++)if(e[t]!==Yl[t])return!1;return!0}(e.readBytes(Yl.length)))throw new Error("wrong PNG signature")}const Ql=new TextDecoder("latin1");function eu(e){if(function(e){if(!tu.test(e))throw new Error("invalid latin1 text")}(e),0===e.length||e.length>79)throw new Error("keyword length must be between 1 and 79")}const tu=/^[\u0000-\u00FF]*$/;function nu(e){for(e.mark();0!==e.readByte(););const t=e.offset;e.reset();const n=Ql.decode(e.readBytes(t-e.offset-1));return e.skip(1),eu(n),n}class ru extends ds{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(e,t={}){super(e);const{checkCrc:n=!1}=t;this._checkCrc=n,this._inflator=new Il,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(Xl(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeChunk(e,t)}return this.decodeImage(),this._png}decodeApng(){for(Xl(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(e,t)}return this.decodeApngImage(),this._apng}decodeChunk(e,t){const n=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case"tEXt":!function(e,t,n){const r=nu(t);e[r]=function(e,t){return Ql.decode(e.readBytes(t))}(t,n-r.length-1)}(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e)}if(this.offset-n!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?Fl(this,e+4,t):this.skip(4)}decodeApngChunk(e,t){const n=this.offset;switch("fdAT"!==t&&"IDAT"!==t&&this._writingDataChunks&&this.pushDataToFrame(),t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,t),this.offset=n+e}if(this.offset-n!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?Fl(this,e+4,t):this.skip(4)}decodeIHDR(){const e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=function(e){if(1!==e&&2!==e&&4!==e&&8!==e&&16!==e)throw new Error(`invalid bit depth: ${e}`);return e}(this.readUint8());const t=this.readUint8();let n;switch(this._colorType=t,t){case 0:case 3:n=1;break;case 2:n=3;break;case 4:n=2;break;case 6:n=4;break;default:throw new Error(`Unknown color type: ${t}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),0!==this._compressionMethod)throw new 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(){const e={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(e)}decodePLTE(e){if(e%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);const t=e/3;this._hasPalette=!0;const n=[];this._palette=n;for(let e=0;e<t;e++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;const t=e,n=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,n,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let t=e,n=this.offset+this.byteOffset;if(n+=4,t-=4,this._inflator.push(new Uint8Array(this.buffer,n,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodetRNS(e){switch(this._colorType){case 0:case 2:if(e%2!=0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let t=0;t<e/2;t++)this._transparency[t]=this.readUint16();break;case 3:{if(e>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let t=0;for(;t<e;t++){const e=this.readByte();this._palette[t].push(e)}for(;t<this._palette.length;t++)this._palette[t].push(255);break}default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){const t=nu(this),n=this.readUint8();if(0!==n)throw new Error(`Unsupported iCCP compression method: ${n}`);const r=this.readBytes(e-t.length-2);this._png.iccEmbeddedProfile={name:t,profile:Ol(r)}}decodepHYs(){const e=this.readUint32(),t=this.readUint32(),n=this.readByte();this._png.resolution={x:e,y:t,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 e=0;e<this._numberOfFrames;e++){const t={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].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(e);if(n){if(n.data=Jl({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===e||0===n.xOffset&&0===n.yOffset&&n.width===this._png.width&&n.height===this._png.height)t.data=n.data;else{const r=this._apng.frames.at(e-1);this.disposeFrame(n,r,t),this.addFrameDataToCanvas(t,n)}this._apng.frames.push(t)}}return this._apng}disposeFrame(e,t,n){switch(e.disposeOp){case 0:break;case 1:for(let t=0;t<this._png.height;t++)for(let r=0;r<this._png.width;r++){const i=(t*e.width+r)*this._png.channels;for(let e=0;e<this._png.channels;e++)n.data[i+e]=0}break;case 2:n.data.set(t.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(e,t){const n=1<<this._png.depth,r=(e,n)=>({index:((e+t.yOffset)*this._png.width+t.xOffset+n)*this._png.channels,frameIndex:(e*t.width+n)*this._png.channels});switch(t.blendOp){case 0:for(let n=0;n<t.height;n++)for(let i=0;i<t.width;i++){const{index:o,frameIndex:s}=r(n,i);for(let n=0;n<this._png.channels;n++)e.data[o+n]=t.data[s+n]}break;case 1:for(let i=0;i<t.height;i++)for(let o=0;o<t.width;o++){const{index:s,frameIndex:a}=r(i,o);for(let r=0;r<this._png.channels;r++){const i=t.data[a+this._png.channels-1]/n,o=r%(this._png.channels-1)==0?1:t.data[a+r],c=Math.floor(i*o+(1-i)*e.data[s+r]);e.data[s+r]+=c}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const e=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(0!==this._filterMethod)throw new Error(`Filter method ${this._filterMethod} not supported`);if(0===this._interlaceMethod)this._png.data=Jl({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else{if(1!==this._interlaceMethod)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._png.data=function(e){const{data:t,width:n,height:r,channels:i,depth:o}=e,s=[{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}],a=Math.ceil(o/8)*i,c=new Uint8Array(r*n*a);let l=0;for(let e=0;e<7;e++){const i=s[e],o=Math.ceil((n-i.x)/i.xStep),u=Math.ceil((r-i.y)/i.yStep);if(o<=0||u<=0)continue;const d=o*a,h=new Uint8Array(d);for(let e=0;e<u;e++){const s=t[l++],u=t.subarray(l,l+d);l+=d;const f=new Uint8Array(d);Ul(s,u,f,h,d,a),h.set(f);for(let t=0;t<o;t++){const o=i.x+t*i.xStep,s=i.y+e*i.yStep;if(!(o>=n||s>=r))for(let e=0;e<a;e++)c[(s*n+o)*a+e]=f[t*a+e]}}}if(16===o){const e=new Uint16Array(c.buffer);if(Wl)for(let t=0;t<e.length;t++)e[t]=Zl(e[t]);return e}return c}({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth})}this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const e=this._inflator.result,t=this._frames.at(-1);t?t.data=e: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:e}),this._inflator=new Il,this._writingDataChunks=!1}}var iu;!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"}(iu||(iu={}));var ou=function(){return"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this}();function su(){ou.console&&"function"==typeof ou.console.log&&ou.console.log.apply(ou.console,arguments)}var au={log:su,warn:function(e){ou.console&&("function"==typeof ou.console.warn?ou.console.warn.apply(ou.console,arguments):su.call(null,arguments))},error:function(e){ou.console&&("function"==typeof ou.console.error?ou.console.error.apply(ou.console,arguments):su(e))}};function cu(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){du(r.response,t,n)},r.onerror=function(){au.error("could not download file")},r.send()}function lu(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function uu(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var du=ou.saveAs||("object"!==("undefined"==typeof window?"undefined":(0,xo.A)(window))||window!==ou?function(){}:"undefined"!=typeof HTMLAnchorElement&&"download"in HTMLAnchorElement.prototype?function(e,t,n){var r=ou.URL||ou.webkitURL,i=document.createElement("a");t=t||e.name||"download",i.download=t,i.rel="noopener","string"==typeof e?(i.href=e,i.origin!==location.origin?lu(i.href)?cu(e,t,n):uu(i,i.target="_blank"):uu(i)):(i.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){uu(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download","string"==typeof e)if(lu(e))cu(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){uu(r)})}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!==(0,xo.A)(t)&&(au.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,n),t)}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return cu(e,t,n);var i="application/octet-stream"===e.type,o=/constructor/i.test(ou.HTMLElement)||ou.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||i&&o)&&"object"===("undefined"==typeof FileReader?"undefined":(0,xo.A)(FileReader))){var a=new FileReader;a.onloadend=function(){var e=a.result;e=s?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},a.readAsDataURL(e)}else{var c=ou.URL||ou.webkitURL,l=c.createObjectURL(e);r?r.location=l:location.href=l,r=null,setTimeout(function(){c.revokeObjectURL(l)},4e4)}});function hu(e){var t;e=e||"",this.ok=!1,"#"==e.charAt(0)&&(e=e.substr(1,6)),e={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"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;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(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,o=n[r].process,s=i.exec(e);s&&(t=o(s),this.r=t[0],this.g=t[1],this.b=t[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 e=this.r.toString(16),t=this.g.toString(16),n=this.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),"#"+e+t+n}}var fu=ou.atob.bind(ou),pu=ou.btoa.bind(ou);function mu(e,t){var n=e[0],r=e[1],i=e[2],o=e[3];n=bu(n,r,i,o,t[0],7,-680876936),o=bu(o,n,r,i,t[1],12,-389564586),i=bu(i,o,n,r,t[2],17,606105819),r=bu(r,i,o,n,t[3],22,-1044525330),n=bu(n,r,i,o,t[4],7,-176418897),o=bu(o,n,r,i,t[5],12,1200080426),i=bu(i,o,n,r,t[6],17,-1473231341),r=bu(r,i,o,n,t[7],22,-45705983),n=bu(n,r,i,o,t[8],7,1770035416),o=bu(o,n,r,i,t[9],12,-1958414417),i=bu(i,o,n,r,t[10],17,-42063),r=bu(r,i,o,n,t[11],22,-1990404162),n=bu(n,r,i,o,t[12],7,1804603682),o=bu(o,n,r,i,t[13],12,-40341101),i=bu(i,o,n,r,t[14],17,-1502002290),n=vu(n,r=bu(r,i,o,n,t[15],22,1236535329),i,o,t[1],5,-165796510),o=vu(o,n,r,i,t[6],9,-1069501632),i=vu(i,o,n,r,t[11],14,643717713),r=vu(r,i,o,n,t[0],20,-373897302),n=vu(n,r,i,o,t[5],5,-701558691),o=vu(o,n,r,i,t[10],9,38016083),i=vu(i,o,n,r,t[15],14,-660478335),r=vu(r,i,o,n,t[4],20,-405537848),n=vu(n,r,i,o,t[9],5,568446438),o=vu(o,n,r,i,t[14],9,-1019803690),i=vu(i,o,n,r,t[3],14,-187363961),r=vu(r,i,o,n,t[8],20,1163531501),n=vu(n,r,i,o,t[13],5,-1444681467),o=vu(o,n,r,i,t[2],9,-51403784),i=vu(i,o,n,r,t[7],14,1735328473),n=yu(n,r=vu(r,i,o,n,t[12],20,-1926607734),i,o,t[5],4,-378558),o=yu(o,n,r,i,t[8],11,-2022574463),i=yu(i,o,n,r,t[11],16,1839030562),r=yu(r,i,o,n,t[14],23,-35309556),n=yu(n,r,i,o,t[1],4,-1530992060),o=yu(o,n,r,i,t[4],11,1272893353),i=yu(i,o,n,r,t[7],16,-155497632),r=yu(r,i,o,n,t[10],23,-1094730640),n=yu(n,r,i,o,t[13],4,681279174),o=yu(o,n,r,i,t[0],11,-358537222),i=yu(i,o,n,r,t[3],16,-722521979),r=yu(r,i,o,n,t[6],23,76029189),n=yu(n,r,i,o,t[9],4,-640364487),o=yu(o,n,r,i,t[12],11,-421815835),i=yu(i,o,n,r,t[15],16,530742520),n=wu(n,r=yu(r,i,o,n,t[2],23,-995338651),i,o,t[0],6,-198630844),o=wu(o,n,r,i,t[7],10,1126891415),i=wu(i,o,n,r,t[14],15,-1416354905),r=wu(r,i,o,n,t[5],21,-57434055),n=wu(n,r,i,o,t[12],6,1700485571),o=wu(o,n,r,i,t[3],10,-1894986606),i=wu(i,o,n,r,t[10],15,-1051523),r=wu(r,i,o,n,t[1],21,-2054922799),n=wu(n,r,i,o,t[8],6,1873313359),o=wu(o,n,r,i,t[15],10,-30611744),i=wu(i,o,n,r,t[6],15,-1560198380),r=wu(r,i,o,n,t[13],21,1309151649),n=wu(n,r,i,o,t[4],6,-145523070),o=wu(o,n,r,i,t[11],10,-1120210379),i=wu(i,o,n,r,t[2],15,718787259),r=wu(r,i,o,n,t[9],21,-343485551),e[0]=Pu(n,e[0]),e[1]=Pu(r,e[1]),e[2]=Pu(i,e[2]),e[3]=Pu(o,e[3])}function gu(e,t,n,r,i,o){return t=Pu(Pu(t,e),Pu(r,o)),Pu(t<<i|t>>>32-i,n)}function bu(e,t,n,r,i,o,s){return gu(t&n|~t&r,e,t,i,o,s)}function vu(e,t,n,r,i,o,s){return gu(t&r|n&~r,e,t,i,o,s)}function yu(e,t,n,r,i,o,s){return gu(t^n^r,e,t,i,o,s)}function wu(e,t,n,r,i,o,s){return gu(n^(t|~r),e,t,i,o,s)}function _u(e){var t,n=e.length,r=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)mu(r,xu(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)i[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(mu(r,i),t=0;t<16;t++)i[t]=0;return i[14]=8*n,mu(r,i),r}function xu(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}var ku="0123456789abcdef".split("");function Su(e){for(var t="",n=0;n<4;n++)t+=ku[e>>8*n+4&15]+ku[e>>8*n&15];return t}function Au(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function Nu(e){return _u(e).map(Au).join("")}var Lu="5d41402abc4b2a76b9719d911017c592"!=function(e){for(var t=0;t<e.length;t++)e[t]=Su(e[t]);return e.join("")}(_u("hello"));function Pu(e,t){if(Lu){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}return e+t&4294967295}function Cu(e,t){var n,r,i,o;if(e!==n){for(var s=(i=e,o=1+(256/e.length|0),new Array(o+1).join(i)),a=[],c=0;c<256;c++)a[c]=c;var l=0;for(c=0;c<256;c++){var u=a[c];l=(l+u+s.charCodeAt(c))%256,a[c]=a[l],a[l]=u}n=e,r=a}else a=r;var d=t.length,h=0,f=0,p="";for(c=0;c<d;c++)f=(f+(u=a[h=(h+1)%256]))%256,a[h]=a[f],a[f]=u,s=a[(a[h]+a[f])%256],p+=String.fromCharCode(t.charCodeAt(c)^s);return p}var Eu={print:4,modify:8,copy:16,"annot-forms":32};function Iu(e,t,n,r){this.v=1,this.r=2;var i=192;e.forEach(function(e){if(void 0!==Eu.perm)throw new Error("Invalid permission: "+e);i+=Eu[e]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var o=(t+this.padding).substr(0,32),s=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(o,s),this.P=-(1+(255^i)),this.encryptionKey=Nu(o+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=Cu(this.encryptionKey,this.padding)}function Ou(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",n=e.length,r=0;r<n;r++){var i=e.charCodeAt(r);t+=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):e[r]}return t}function ju(e){if("object"!==(0,xo.A)(e))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(e,n,r){if(r=r||!1,"string"!=typeof e||"function"!=typeof n||"boolean"!=typeof r)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(e)||(t[e]={});var i=Math.random().toString(35);return t[e][i]=[n,!!r],i},this.unsubscribe=function(e){for(var n in t)if(t[n][e])return delete t[n][e],0===Object.keys(t[n]).length&&delete t[n],!0;return!1},this.publish=function(n){if(t.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var o in t[n]){var s=t[n][o];try{s[0].apply(e,r)}catch(e){ou.console&&au.error("jsPDF PubSub Error",e.message,e)}s[1]&&i.push(o)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function zu(e){if(!(this instanceof zu))return new zu(e);var t="opacity,stroke-opacity".split(",");for(var n in e)e.hasOwnProperty(n)&&t.indexOf(n)>=0&&(this[n]=e[n]);this.id="",this.objectNumber=-1}function Fu(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function Tu(e,t,n,r,i){if(!(this instanceof Tu))return new Tu(e,t,n,r,i);this.type="axial"===e?2:3,this.coords=t,this.colors=n,Fu.call(this,r,i)}function Ru(e,t,n,r,i){if(!(this instanceof Ru))return new Ru(e,t,n,r,i);this.boundingBox=e,this.xStep=t,this.yStep=n,this.stream="",this.cloneIndex=0,Fu.call(this,r,i)}function Mu(e){var t,n="string"==typeof arguments[0]?arguments[0]:"p",r=arguments[1],i=arguments[2],o=arguments[3],s=[],a=1,c=16,l="S",u=null;"object"===(0,xo.A)(e=e||{})&&(n=e.orientation,r=e.unit||r,i=e.format||i,o=e.compress||e.compressPdf||o,null!==(u=e.encryption||null)&&(u.userPassword=u.userPassword||"",u.ownerPassword=u.ownerPassword||"",u.userPermissions=u.userPermissions||[]),a="number"==typeof e.userUnit?Math.abs(e.userUnit):1,void 0!==e.precision&&(t=e.precision),void 0!==e.floatPrecision&&(c=e.floatPrecision),l=e.defaultPathOperation||"S"),s=e.filters||(!0===o?["FlateEncode"]:s),r=r||"mm",n=(""+(n||"P")).toLowerCase();var d=e.putOnlyUsedFonts||!1,h={},f={internal:{},__private__:{}};f.__private__.PubSub=ju;var p="1.3",m=f.__private__.getPdfVersion=function(){return p};f.__private__.setPdfVersion=function(e){p=e};var g={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]};f.__private__.getPageFormats=function(){return g};var b=f.__private__.getPageFormat=function(e){return g[e]};i=i||"a4";var v="compat",y="advanced",w=v;function _(){this.saveGraphicsState(),Y(new Ie(he,0,0,-he,0,fn()*he).toString()+" cm"),this.setFontSize(this.getFontSize()/he),l="n",w=y}function x(){this.restoreGraphicsState(),l="S",w=v}var k=f.__private__.combineFontStyleAndFontWeight=function(e,t){if("bold"==e&&"normal"==t||"bold"==e&&400==t||"normal"==e&&"italic"==t||"bold"==e&&"italic"==t)throw new Error("Invalid Combination of fontweight and fontstyle");return t&&(e=400==t||"normal"===t?"italic"===e?"italic":"normal":700!=t&&"bold"!==t||"normal"!==e?(700==t?"bold":t)+""+e:"bold"),e};f.advancedAPI=function(e){var t=w===v;return t&&_.call(this),"function"!=typeof e||(e(this),t&&x.call(this)),this},f.compatAPI=function(e){var t=w===y;return t&&x.call(this),"function"!=typeof e||(e(this),t&&_.call(this)),this},f.isAdvancedAPI=function(){return w===y};var S,A=function(e){if(w!==y)throw new Error(e+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},N=f.roundToPrecision=f.__private__.roundToPrecision=function(e,n){var r=t||n;if(isNaN(e)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return e.toFixed(r).replace(/0+$/,"")};S=f.hpf=f.__private__.hpf="number"==typeof c?function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return N(e,c)}:"smart"===c?function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return N(e,e>-1&&e<1?16:5)}:function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return N(e,16)};var L=f.f2=f.__private__.f2=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.f2");return N(e,2)},P=f.__private__.f3=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.f3");return N(e,3)},C=f.scale=f.__private__.scale=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.scale");return w===v?e*he:w===y?e:void 0},E=function(e){return C(function(e){return w===v?fn()-e:w===y?e:void 0}(e))};f.__private__.setPrecision=f.setPrecision=function(e){"number"==typeof parseInt(e,10)&&(t=parseInt(e,10))};var I,O="00000000000000000000000000000000",j=f.__private__.getFileId=function(){return O},z=f.__private__.setFileId=function(e){return O=void 0!==e&&/^[a-fA-F0-9]{32}$/.test(e)?e.toUpperCase():O.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),null!==u&&(vt=new Iu(u.userPermissions,u.userPassword,u.ownerPassword,O)),O};f.setFileId=function(e){return z(e),this},f.getFileId=function(){return j()};var F=f.__private__.convertDateToPDFDate=function(e){var t=e.getTimezoneOffset(),n=t<0?"+":"-",r=Math.floor(Math.abs(t/60)),i=Math.abs(t%60),o=[n,B(r),"'",B(i),"'"].join("");return["D:",e.getFullYear(),B(e.getMonth()+1),B(e.getDate()),B(e.getHours()),B(e.getMinutes()),B(e.getSeconds()),o].join("")},T=f.__private__.convertPDFDateToDate=function(e){var t=parseInt(e.substr(2,4),10),n=parseInt(e.substr(6,2),10)-1,r=parseInt(e.substr(8,2),10),i=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),s=parseInt(e.substr(14,2),10);return new Date(t,n,r,i,o,s,0)},R=f.__private__.setCreationDate=function(e){var t;if(void 0===e&&(e=new Date),e instanceof Date)t=F(e);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(e))throw new Error("Invalid argument passed to jsPDF.setCreationDate");t=e}return I=t},M=f.__private__.getCreationDate=function(e){var t=I;return"jsDate"===e&&(t=T(I)),t};f.setCreationDate=function(e){return R(e),this},f.getCreationDate=function(e){return M(e)};var D,B=f.__private__.padd2=function(e){return("0"+parseInt(e)).slice(-2)},q=f.__private__.padd2Hex=function(e){return("00"+(e=e.toString())).substr(e.length)},U=0,$=[],W=[],Z=0,H=[],V=[],G=!1,J=W;f.__private__.setCustomOutputDestination=function(e){G=!0,J=e};var K=function(e){G||(J=e)};f.__private__.resetCustomOutputDestination=function(){G=!1,J=W};var Y=f.__private__.out=function(e){return e=e.toString(),Z+=e.length+1,J.push(e),J},X=f.__private__.write=function(e){return Y(1===arguments.length?e.toString():Array.prototype.join.call(arguments," "))},Q=f.__private__.getArrayBuffer=function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n);t--;)r[t]=e.charCodeAt(t);return n},ee=[["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]];f.__private__.getStandardFonts=function(){return ee};var te=e.fontSize||16;f.__private__.setFontSize=f.setFontSize=function(e){return te=w===y?e/he:e,this};var ne,re=f.__private__.getFontSize=f.getFontSize=function(){return w===v?te:te*he},ie=e.R2L||!1;f.__private__.setR2L=f.setR2L=function(e){return ie=e,this},f.__private__.getR2L=f.getR2L=function(){return ie};var oe,se=f.__private__.setZoomMode=function(e){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(e))ne=e;else if(isNaN(e)){if(-1===[void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(e))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+e+'" is not recognized.');ne=e}else ne=parseInt(e,10)};f.__private__.getZoomMode=function(){return ne};var ae,ce=f.__private__.setPageMode=function(e){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(e))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+e+'" is not recognized.');oe=e};f.__private__.getPageMode=function(){return oe};var le=f.__private__.setLayoutMode=function(e){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(e))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+e+'" is not recognized.');ae=e};f.__private__.getLayoutMode=function(){return ae},f.__private__.setDisplayMode=f.setDisplayMode=function(e,t,n){return se(e),le(t),ce(n),this};var ue={title:"",subject:"",author:"",keywords:"",creator:""};f.__private__.getDocumentProperty=function(e){if(-1===Object.keys(ue).indexOf(e))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return ue[e]},f.__private__.getDocumentProperties=function(){return ue},f.__private__.setDocumentProperties=f.setProperties=f.setDocumentProperties=function(e){for(var t in ue)ue.hasOwnProperty(t)&&e[t]&&(ue[t]=e[t]);return this},f.__private__.setDocumentProperty=function(e,t){if(-1===Object.keys(ue).indexOf(e))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return ue[e]=t};var de,he,fe,pe,me,ge={},be={},ve=[],ye={},we={},_e={},xe={},ke=null,Se=0,Ae=[],Ne=new ju(f),Le=e.hotfixes||[],Pe={},Ce={},Ee=[],Ie=function e(t,n,r,i,o,s){if(!(this instanceof e))return new e(t,n,r,i,o,s);isNaN(t)&&(t=1),isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(i)&&(i=1),isNaN(o)&&(o=0),isNaN(s)&&(s=0),this._matrix=[t,n,r,i,o,s]};Object.defineProperty(Ie.prototype,"sx",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(Ie.prototype,"shy",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(Ie.prototype,"shx",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(Ie.prototype,"sy",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(Ie.prototype,"tx",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(Ie.prototype,"ty",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(Ie.prototype,"a",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(Ie.prototype,"b",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(Ie.prototype,"c",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(Ie.prototype,"d",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(Ie.prototype,"e",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(Ie.prototype,"f",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(Ie.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Ie.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Ie.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Ie.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),Ie.prototype.join=function(e){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(S).join(e)},Ie.prototype.multiply=function(e){var t=e.sx*this.sx+e.shy*this.shx,n=e.sx*this.shy+e.shy*this.sy,r=e.shx*this.sx+e.sy*this.shx,i=e.shx*this.shy+e.sy*this.sy,o=e.tx*this.sx+e.ty*this.shx+this.tx,s=e.tx*this.shy+e.ty*this.sy+this.ty;return new Ie(t,n,r,i,o,s)},Ie.prototype.decompose=function(){var e=this.sx,t=this.shy,n=this.shx,r=this.sy,i=this.tx,o=this.ty,s=Math.sqrt(e*e+t*t),a=(e/=s)*n+(t/=s)*r;n-=e*a,r-=t*a;var c=Math.sqrt(n*n+r*r);return a/=c,e*(r/=c)<t*(n/=c)&&(e=-e,t=-t,a=-a,s=-s),{scale:new Ie(s,0,0,c,0,0),translate:new Ie(1,0,0,1,i,o),rotate:new Ie(e,t,-t,e,0,0),skew:new Ie(1,0,a,1,0,0)}},Ie.prototype.toString=function(e){return this.join(" ")},Ie.prototype.inversed=function(){var e=this.sx,t=this.shy,n=this.shx,r=this.sy,i=this.tx,o=this.ty,s=1/(e*r-t*n),a=r*s,c=-t*s,l=-n*s,u=e*s;return new Ie(a,c,l,u,-a*i-l*o,-c*i-u*o)},Ie.prototype.applyToPoint=function(e){var t=e.x*this.sx+e.y*this.shx+this.tx,n=e.x*this.shy+e.y*this.sy+this.ty;return new tn(t,n)},Ie.prototype.applyToRectangle=function(e){var t=this.applyToPoint(e),n=this.applyToPoint(new tn(e.x+e.w,e.y+e.h));return new nn(t.x,t.y,n.x-t.x,n.y-t.y)},Ie.prototype.clone=function(){var e=this.sx,t=this.shy,n=this.shx,r=this.sy,i=this.tx,o=this.ty;return new Ie(e,t,n,r,i,o)},f.Matrix=Ie;var Oe=f.matrixMult=function(e,t){return t.multiply(e)},je=new Ie(1,0,0,1,0,0);f.unitMatrix=f.identityMatrix=je;var ze=function(e,t){if(!we[e]){var n=(t instanceof Tu?"Sh":"P")+(Object.keys(ye).length+1).toString(10);t.id=n,we[e]=n,ye[n]=t,Ne.publish("addPattern",t)}};f.ShadingPattern=Tu,f.TilingPattern=Ru,f.addShadingPattern=function(e,t){return A("addShadingPattern()"),ze(e,t),this},f.beginTilingPattern=function(e){A("beginTilingPattern()"),on(e.boundingBox[0],e.boundingBox[1],e.boundingBox[2]-e.boundingBox[0],e.boundingBox[3]-e.boundingBox[1],e.matrix)},f.endTilingPattern=function(e,t){A("endTilingPattern()"),t.stream=V[D].join("\n"),ze(e,t),Ne.publish("endTilingPattern",t),Ee.pop().restore()};var Fe,Te=f.__private__.newObject=function(){var e=Re();return Me(e,!0),e},Re=f.__private__.newObjectDeferred=function(){return U++,$[U]=function(){return Z},U},Me=function(e,t){return t="boolean"==typeof t&&t,$[e]=Z,t&&Y(e+" 0 obj"),e},De=f.__private__.newAdditionalObject=function(){var e={objId:Re(),content:""};return H.push(e),e},Be=Re(),qe=Re(),Ue=f.__private__.decodeColorString=function(e){var t=e.split(" ");if(2!==t.length||"g"!==t[1]&&"G"!==t[1])5!==t.length||"k"!==t[4]&&"K"!==t[4]||(t=[(1-t[0])*(1-t[3]),(1-t[1])*(1-t[3]),(1-t[2])*(1-t[3]),"r"]);else{var n=parseFloat(t[0]);t=[n,n,n,"r"]}for(var r="#",i=0;i<3;i++)r+=("0"+Math.floor(255*parseFloat(t[i])).toString(16)).slice(-2);return r},$e=f.__private__.encodeColorString=function(e){var t;"string"==typeof e&&(e={ch1:e});var n=e.ch1,r=e.ch2,i=e.ch3,o=e.ch4,s="draw"===e.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof n&&"#"!==n.charAt(0)){var a=new hu(n);if(a.ok)n=a.toHex();else if(!/^\d*\.?\d*$/.test(n))throw new 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 c=parseInt(n.substr(1),16);n=c>>16&255,r=c>>8&255,i=255&c}if(void 0===r||void 0===o&&n===r&&r===i)t="string"==typeof n?n+" "+s[0]:2===e.precision?L(n/255)+" "+s[0]:P(n/255)+" "+s[0];else if(void 0===o||"object"===(0,xo.A)(o)){if(o&&!isNaN(o.a)&&0===o.a)return["1.","1.","1.",s[1]].join(" ");t="string"==typeof n?[n,r,i,s[1]].join(" "):2===e.precision?[L(n/255),L(r/255),L(i/255),s[1]].join(" "):[P(n/255),P(r/255),P(i/255),s[1]].join(" ")}else t="string"==typeof n?[n,r,i,o,s[2]].join(" "):2===e.precision?[L(n),L(r),L(i),L(o),s[2]].join(" "):[P(n),P(r),P(i),P(o),s[2]].join(" ");return t},We=f.__private__.getFilters=function(){return s},Ze=f.__private__.putStream=function(e){var t=(e=e||{}).data||"",n=e.filters||We(),r=e.alreadyAppliedFilters||[],i=e.addLength1||!1,o=t.length,s=e.objectId,a=function(e){return e};if(null!==u&&void 0===s)throw new Error("ObjectId must be passed to putStream for file encryption");null!==u&&(a=vt.encryptor(s,0));var c={};!0===n&&(n=["FlateEncode"]);var l=e.additionalKeyValues||[],d=(c=void 0!==Mu.API.processDataByFilters?Mu.API.processDataByFilters(t,n):{data:t,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==c.data.length&&(l.push({key:"Length",value:c.data.length}),!0===i&&l.push({key:"Length1",value:o})),0!=d.length)if(d.split("/").length-1==1)l.push({key:"Filter",value:d});else{l.push({key:"Filter",value:"["+d+"]"});for(var h=0;h<l.length;h+=1)if("DecodeParms"===l[h].key){for(var f=[],p=0;p<c.reverseChain.split("/").length-1;p+=1)f.push("null");f.push(l[h].value),l[h].value="["+f.join(" ")+"]"}}Y("<<");for(var m=0;m<l.length;m++)Y("/"+l[m].key+" "+l[m].value);Y(">>"),0!==c.data.length&&(Y("stream"),Y(a(c.data)),Y("endstream"))},He=f.__private__.putPage=function(e){var t=e.number,n=e.data,r=e.objId,i=e.contentsObjId;Me(r,!0),Y("<</Type /Page"),Y("/Parent "+e.rootDictionaryObjId+" 0 R"),Y("/Resources "+e.resourceDictionaryObjId+" 0 R"),Y("/MediaBox ["+parseFloat(S(e.mediaBox.bottomLeftX))+" "+parseFloat(S(e.mediaBox.bottomLeftY))+" "+S(e.mediaBox.topRightX)+" "+S(e.mediaBox.topRightY)+"]"),null!==e.cropBox&&Y("/CropBox ["+S(e.cropBox.bottomLeftX)+" "+S(e.cropBox.bottomLeftY)+" "+S(e.cropBox.topRightX)+" "+S(e.cropBox.topRightY)+"]"),null!==e.bleedBox&&Y("/BleedBox ["+S(e.bleedBox.bottomLeftX)+" "+S(e.bleedBox.bottomLeftY)+" "+S(e.bleedBox.topRightX)+" "+S(e.bleedBox.topRightY)+"]"),null!==e.trimBox&&Y("/TrimBox ["+S(e.trimBox.bottomLeftX)+" "+S(e.trimBox.bottomLeftY)+" "+S(e.trimBox.topRightX)+" "+S(e.trimBox.topRightY)+"]"),null!==e.artBox&&Y("/ArtBox ["+S(e.artBox.bottomLeftX)+" "+S(e.artBox.bottomLeftY)+" "+S(e.artBox.topRightX)+" "+S(e.artBox.topRightY)+"]"),"number"==typeof e.userUnit&&1!==e.userUnit&&Y("/UserUnit "+e.userUnit),Ne.publish("putPage",{objId:r,pageContext:Ae[t],pageNumber:t,page:n}),Y("/Contents "+i+" 0 R"),Y(">>"),Y("endobj");var o=n.join("\n");return w===y&&(o+="\nQ"),Me(i,!0),Ze({data:o,filters:We(),objectId:i}),Y("endobj"),r},Ve=f.__private__.putPages=function(){var e,t,n=[];for(e=1;e<=Se;e++)Ae[e].objId=Re(),Ae[e].contentsObjId=Re();for(e=1;e<=Se;e++)n.push(He({number:e,data:V[e],objId:Ae[e].objId,contentsObjId:Ae[e].contentsObjId,mediaBox:Ae[e].mediaBox,cropBox:Ae[e].cropBox,bleedBox:Ae[e].bleedBox,trimBox:Ae[e].trimBox,artBox:Ae[e].artBox,userUnit:Ae[e].userUnit,rootDictionaryObjId:Be,resourceDictionaryObjId:qe}));Me(Be,!0),Y("<</Type /Pages");var r="/Kids [";for(t=0;t<Se;t++)r+=n[t]+" 0 R ";Y(r+"]"),Y("/Count "+Se),Y(">>"),Y("endobj"),Ne.publish("postPutPages")},Ge=function(e){Ne.publish("putFont",{font:e,out:Y,newObject:Te,putStream:Ze}),!0!==e.isAlreadyPutted&&(e.objectNumber=Te(),Y("<<"),Y("/Type /Font"),Y("/BaseFont /"+Ou(e.postScriptName)),Y("/Subtype /Type1"),"string"==typeof e.encoding&&Y("/Encoding /"+e.encoding),Y("/FirstChar 32"),Y("/LastChar 255"),Y(">>"),Y("endobj"))},Je=function(e){e.objectNumber=Te();var t=[];t.push({key:"Type",value:"/XObject"}),t.push({key:"Subtype",value:"/Form"}),t.push({key:"BBox",value:"["+[S(e.x),S(e.y),S(e.x+e.width),S(e.y+e.height)].join(" ")+"]"}),t.push({key:"Matrix",value:"["+e.matrix.toString()+"]"});var n=e.pages[1].join("\n");Ze({data:n,additionalKeyValues:t,objectId:e.objectNumber}),Y("endobj")},Ke=function(e,t){t||(t=21);var n=Te(),r=function(e,t){var n,r=[],i=1/(t-1);for(n=0;n<1;n+=i)r.push(n);if(r.push(1),0!=e[0].offset){var o={offset:0,color:e[0].color};e.unshift(o)}if(1!=e[e.length-1].offset){var s={offset:1,color:e[e.length-1].color};e.push(s)}for(var a="",c=0,l=0;l<r.length;l++){for(n=r[l];n>e[c+1].offset;)c++;var u=e[c].offset,d=(n-u)/(e[c+1].offset-u),h=e[c].color,f=e[c+1].color;a+=q(Math.round((1-d)*h[0]+d*f[0]).toString(16))+q(Math.round((1-d)*h[1]+d*f[1]).toString(16))+q(Math.round((1-d)*h[2]+d*f[2]).toString(16))}return a.trim()}(e.colors,t),i=[];i.push({key:"FunctionType",value:"0"}),i.push({key:"Domain",value:"[0.0 1.0]"}),i.push({key:"Size",value:"["+t+"]"}),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]"}),Ze({data:r,additionalKeyValues:i,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:n}),Y("endobj"),e.objectNumber=Te(),Y("<< /ShadingType "+e.type),Y("/ColorSpace /DeviceRGB");var o="/Coords ["+S(parseFloat(e.coords[0]))+" "+S(parseFloat(e.coords[1]))+" ";2===e.type?o+=S(parseFloat(e.coords[2]))+" "+S(parseFloat(e.coords[3])):o+=S(parseFloat(e.coords[2]))+" "+S(parseFloat(e.coords[3]))+" "+S(parseFloat(e.coords[4]))+" "+S(parseFloat(e.coords[5])),Y(o+="]"),e.matrix&&Y("/Matrix ["+e.matrix.toString()+"]"),Y("/Function "+n+" 0 R"),Y("/Extend [true true]"),Y(">>"),Y("endobj")},Ye=function(e,t){var n=Re(),r=Te();t.push({resourcesOid:n,objectOid:r}),e.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:"["+e.boundingBox.map(S).join(" ")+"]"}),i.push({key:"XStep",value:S(e.xStep)}),i.push({key:"YStep",value:S(e.yStep)}),i.push({key:"Resources",value:n+" 0 R"}),e.matrix&&i.push({key:"Matrix",value:"["+e.matrix.toString()+"]"}),Ze({data:e.stream,additionalKeyValues:i,objectId:e.objectNumber}),Y("endobj")},Xe=function(e){for(var t in e.objectNumber=Te(),Y("<<"),e)switch(t){case"opacity":Y("/ca "+L(e[t]));break;case"stroke-opacity":Y("/CA "+L(e[t]))}Y(">>"),Y("endobj")},Qe=function(e){Me(e.resourcesOid,!0),Y("<<"),Y("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var e in Y("/Font <<"),ge)ge.hasOwnProperty(e)&&(!1===d||!0===d&&h.hasOwnProperty(e))&&Y("/"+e+" "+ge[e].objectNumber+" 0 R");Y(">>")}(),function(){if(Object.keys(ye).length>0){for(var e in Y("/Shading <<"),ye)ye.hasOwnProperty(e)&&ye[e]instanceof Tu&&ye[e].objectNumber>=0&&Y("/"+e+" "+ye[e].objectNumber+" 0 R");Ne.publish("putShadingPatternDict"),Y(">>")}}(),function(e){if(Object.keys(ye).length>0){for(var t in Y("/Pattern <<"),ye)ye.hasOwnProperty(t)&&ye[t]instanceof f.TilingPattern&&ye[t].objectNumber>=0&&ye[t].objectNumber<e&&Y("/"+t+" "+ye[t].objectNumber+" 0 R");Ne.publish("putTilingPatternDict"),Y(">>")}}(e.objectOid),function(){if(Object.keys(_e).length>0){var e;for(e in Y("/ExtGState <<"),_e)_e.hasOwnProperty(e)&&_e[e].objectNumber>=0&&Y("/"+e+" "+_e[e].objectNumber+" 0 R");Ne.publish("putGStateDict"),Y(">>")}}(),function(){for(var e in Y("/XObject <<"),Pe)Pe.hasOwnProperty(e)&&Pe[e].objectNumber>=0&&Y("/"+e+" "+Pe[e].objectNumber+" 0 R");Ne.publish("putXobjectDict"),Y(">>")}(),Y(">>"),Y("endobj")},et=function(e){be[e.fontName]=be[e.fontName]||{},be[e.fontName][e.fontStyle]=e.id},tt=function(e,t,n,r,i){var o={id:"F"+(Object.keys(ge).length+1).toString(10),postScriptName:e,fontName:t,fontStyle:n,encoding:r,isStandardFont:i||!1,metadata:{}};return Ne.publish("addFont",{font:o,instance:this}),ge[o.id]=o,et(o),o.id},nt=f.__private__.pdfEscape=f.pdfEscape=function(e,t){return function(e,t){var n,r,i,o,s,a,c,l,u;if(i=(t=t||{}).sourceEncoding||"Unicode",s=t.outputEncoding,(t.autoencode||s)&&ge[de].metadata&&ge[de].metadata[i]&&ge[de].metadata[i].encoding&&(o=ge[de].metadata[i].encoding,!s&&ge[de].encoding&&(s=ge[de].encoding),!s&&o.codePages&&(s=o.codePages[0]),"string"==typeof s&&(s=o[s]),s)){for(c=!1,a=[],n=0,r=e.length;n<r;n++)(l=s[e.charCodeAt(n)])?a.push(String.fromCharCode(l)):a.push(e[n]),a[n].charCodeAt(0)>>8&&(c=!0);e=a.join("")}for(n=e.length;void 0===c&&0!==n;)e.charCodeAt(n-1)>>8&&(c=!0),n--;if(!c)return e;for(a=t.noBOM?[]:[254,255],n=0,r=e.length;n<r;n++){if((u=(l=e.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+e+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(u),a.push(l-(u<<8))}return String.fromCharCode.apply(void 0,a)}(e,t).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},rt=f.__private__.beginPage=function(e){V[++Se]=[],Ae[Se]={objId:0,contentsObjId:0,userUnit:Number(a),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(e[0]),topRightY:Number(e[1])}},st(Se),K(V[D])},it=function(e,t){var r,o,s;switch(n=t||n,"string"==typeof e&&(r=b(e.toLowerCase()),Array.isArray(r)&&(o=r[0],s=r[1])),Array.isArray(e)&&(o=e[0]*he,s=e[1]*he),isNaN(o)&&(o=i[0],s=i[1]),(o>14400||s>14400)&&(au.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),o=Math.min(14400,o),s=Math.min(14400,s)),i=[o,s],n.substr(0,1)){case"l":s>o&&(i=[s,o]);break;case"p":o>s&&(i=[s,o])}rt(i),Mt(Tt),Y(Ht),0!==Xt&&Y(Xt+" J"),0!==Qt&&Y(Qt+" j"),Ne.publish("addPage",{pageNumber:Se})},ot=function(e){e>0&&e<=Se&&(V.splice(e,1),Ae.splice(e,1),Se--,D>Se&&(D=Se),this.setPage(D))},st=function(e){e>0&&e<=Se&&(D=e)},at=f.__private__.getNumberOfPages=f.getNumberOfPages=function(){return V.length-1},ct=function(e,t,n){var r,i=void 0;return n=n||{},e=void 0!==e?e:ge[de].fontName,t=void 0!==t?t:ge[de].fontStyle,r=e.toLowerCase(),void 0!==be[r]&&void 0!==be[r][t]?i=be[r][t]:void 0!==be[e]&&void 0!==be[e][t]?i=be[e][t]:!1===n.disableWarning&&au.warn("Unable to look up font label for font '"+e+"', '"+t+"'. Refer to getFontList() for available fonts."),i||n.noFallback||null==(i=be.times[t])&&(i=be.times.normal),i},lt=f.__private__.putInfo=function(){var e=Te(),t=function(e){return e};for(var n in null!==u&&(t=vt.encryptor(e,0)),Y("<<"),Y("/Producer ("+nt(t("jsPDF "+Mu.version))+")"),ue)ue.hasOwnProperty(n)&&ue[n]&&Y("/"+n.substr(0,1).toUpperCase()+n.substr(1)+" ("+nt(t(ue[n]))+")");Y("/CreationDate ("+nt(t(I))+")"),Y(">>"),Y("endobj")},ut=f.__private__.putCatalog=function(e){var t=(e=e||{}).rootDictionaryObjId||Be;switch(Te(),Y("<<"),Y("/Type /Catalog"),Y("/Pages "+t+" 0 R"),ne||(ne="fullwidth"),ne){case"fullwidth":Y("/OpenAction [3 0 R /FitH null]");break;case"fullheight":Y("/OpenAction [3 0 R /FitV null]");break;case"fullpage":Y("/OpenAction [3 0 R /Fit]");break;case"original":Y("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+ne;"%"===n.substr(n.length-1)&&(ne=parseInt(ne)/100),"number"==typeof ne&&Y("/OpenAction [3 0 R /XYZ null null "+L(ne)+"]")}switch(ae||(ae="continuous"),ae){case"continuous":Y("/PageLayout /OneColumn");break;case"single":Y("/PageLayout /SinglePage");break;case"two":case"twoleft":Y("/PageLayout /TwoColumnLeft");break;case"tworight":Y("/PageLayout /TwoColumnRight")}oe&&Y("/PageMode /"+oe),Ne.publish("putCatalog"),Y(">>"),Y("endobj")},dt=f.__private__.putTrailer=function(){Y("trailer"),Y("<<"),Y("/Size "+(U+1)),Y("/Root "+U+" 0 R"),Y("/Info "+(U-1)+" 0 R"),null!==u&&Y("/Encrypt "+vt.oid+" 0 R"),Y("/ID [ <"+O+"> <"+O+"> ]"),Y(">>")},ht=f.__private__.putHeader=function(){Y("%PDF-"+p),Y("%ºß¬à")},ft=f.__private__.putXRef=function(){var e="0000000000";Y("xref"),Y("0 "+(U+1)),Y("0000000000 65535 f ");for(var t=1;t<=U;t++)"function"==typeof $[t]?Y((e+$[t]()).slice(-10)+" 00000 n "):void 0!==$[t]?Y((e+$[t]).slice(-10)+" 00000 n "):Y("0000000000 00000 n ")},pt=f.__private__.buildDocument=function(){var e;U=0,Z=0,W=[],$=[],H=[],Be=Re(),qe=Re(),K(W),Ne.publish("buildDocument"),ht(),Ve(),function(){Ne.publish("putAdditionalObjects");for(var e=0;e<H.length;e++){var t=H[e];Me(t.objId,!0),Y(t.content),Y("endobj")}Ne.publish("postPutAdditionalObjects")}(),e=[],function(){for(var e in ge)ge.hasOwnProperty(e)&&(!1===d||!0===d&&h.hasOwnProperty(e))&&Ge(ge[e])}(),function(){var e;for(e in _e)_e.hasOwnProperty(e)&&Xe(_e[e])}(),function(){for(var e in Pe)Pe.hasOwnProperty(e)&&Je(Pe[e])}(),function(e){var t;for(t in ye)ye.hasOwnProperty(t)&&(ye[t]instanceof Tu?Ke(ye[t]):ye[t]instanceof Ru&&Ye(ye[t],e))}(e),Ne.publish("putResources"),e.forEach(Qe),Qe({resourcesOid:qe,objectOid:Number.MAX_SAFE_INTEGER}),Ne.publish("postPutResources"),null!==u&&(vt.oid=Te(),Y("<<"),Y("/Filter /Standard"),Y("/V "+vt.v),Y("/R "+vt.r),Y("/U <"+vt.toHexString(vt.U)+">"),Y("/O <"+vt.toHexString(vt.O)+">"),Y("/P "+vt.P),Y(">>"),Y("endobj")),lt(),ut();var t=Z;return ft(),dt(),Y("startxref"),Y(""+t),Y("%%EOF"),K(V[D]),W.join("\n")},mt=f.__private__.getBlob=function(e){return new Blob([Q(e)],{type:"application/pdf"})},gt=f.output=f.__private__.output=(Fe=function(e,t){switch("string"==typeof(t=t||{})?t={filename:t}:t.filename=t.filename||"generated.pdf",e){case void 0:return pt();case"save":f.save(t.filename);break;case"arraybuffer":return Q(pt());case"blob":return mt(pt());case"bloburi":case"bloburl":if(void 0!==ou.URL&&"function"==typeof ou.URL.createObjectURL)return ou.URL&&ou.URL.createObjectURL(mt(pt()))||void 0;au.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var n="",r=pt();try{n=pu(r)}catch(e){n=pu(unescape(encodeURIComponent(r)))}return"data:application/pdf;filename="+t.filename+";base64,"+n;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(ou)){var i="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",o=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';t.pdfObjectUrl&&(i=t.pdfObjectUrl,o="");var s='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><script src="'+i+'"'+o+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(t)+");<\/script></body></html>",a=ou.open();return null!==a&&a.document.write(s),a}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(ou)){var c='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe id="pdfViewer" src="'+(t.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+t.filename+'" width="500px" height="400px" /></body></html>',l=ou.open();if(null!==l){l.document.write(c);var u=this;l.document.documentElement.querySelector("#pdfViewer").onload=function(){l.document.title=t.filename,l.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(u.output("bloburl"))}}return l}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(ou))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var d='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe src="'+this.output("datauristring",t)+'"></iframe></body></html>',h=ou.open();if(null!==h&&(h.document.write(d),h.document.title=t.filename),h||"undefined"==typeof safari)return h;break;case"datauri":case"dataurl":return ou.document.location.href=this.output("datauristring",t);default:return null}},Fe.foo=function(){try{return Fe.apply(this,arguments)}catch(n){var e=n.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var t="Error in function "+e.split("\n")[0].split("<")[0]+": "+n.message;if(!ou.console)throw new Error(t);ou.console.error(t,n),ou.alert&&alert(t)}},Fe.foo.bar=Fe,Fe.foo),bt=function(e){return!0===Array.isArray(Le)&&Le.indexOf(e)>-1};switch(r){case"pt":he=1;break;case"mm":he=72/25.4;break;case"cm":he=72/2.54;break;case"in":he=72;break;case"px":he=1==bt("px_scaling")?.75:96/72;break;case"pc":case"em":he=12;break;case"ex":he=6;break;default:if("number"!=typeof r)throw new Error("Invalid unit: "+r);he=r}var vt=null;R(),z();var yt=f.__private__.getPageInfo=f.getPageInfo=function(e){if(isNaN(e)||e%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Ae[e].objId,pageNumber:e,pageContext:Ae[e]}},wt=f.__private__.getPageInfoByObjId=function(e){if(isNaN(e)||e%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var t in Ae)if(Ae[t].objId===e)break;return yt(t)},_t=f.__private__.getCurrentPageInfo=f.getCurrentPageInfo=function(){return{objId:Ae[D].objId,pageNumber:D,pageContext:Ae[D]}};f.addPage=function(){return it.apply(this,arguments),this},f.setPage=function(){return st.apply(this,arguments),K.call(this,V[D]),this},f.insertPage=function(e){return this.addPage(),this.movePage(D,e),this},f.movePage=function(e,t){var n,r;if(e>t){n=V[e],r=Ae[e];for(var i=e;i>t;i--)V[i]=V[i-1],Ae[i]=Ae[i-1];V[t]=n,Ae[t]=r,this.setPage(t)}else if(e<t){n=V[e],r=Ae[e];for(var o=e;o<t;o++)V[o]=V[o+1],Ae[o]=Ae[o+1];V[t]=n,Ae[t]=r,this.setPage(t)}return this},f.deletePage=function(){return ot.apply(this,arguments),this},f.__private__.text=f.text=function(e,t,n,r,i){var o,s,a,c,l,u,d,f,p,m=(r=r||{}).scope||this;if("number"==typeof e&&"number"==typeof t&&("string"==typeof n||Array.isArray(n))){var g=n;n=t,t=e,e=g}if(arguments[3]instanceof Ie==0?(a=arguments[4],c=arguments[5],"object"===(0,xo.A)(d=arguments[3])&&null!==d||("string"==typeof a&&(c=a,a=null),"string"==typeof d&&(c=d,d=null),"number"==typeof d&&(a=d,d=null),r={flags:d,angle:a,align:c})):(A("The transform parameter of text() with a Matrix value"),p=i),isNaN(t)||isNaN(n)||null==e)throw new Error("Invalid arguments passed to jsPDF.text");if(0===e.length)return m;var b,v="",_="number"==typeof r.lineHeightFactor?r.lineHeightFactor:Ft,x=m.internal.scaleFactor;function k(e){return e=e.split("\t").join(Array(r.TabLen||9).join(" ")),nt(e,d)}function N(e){for(var t,n=e.concat(),r=[],i=n.length;i--;)"string"==typeof(t=n.shift())?r.push(t):Array.isArray(e)&&(1===t.length||void 0===t[1]&&void 0===t[2])?r.push(t[0]):r.push([t[0],t[1],t[2]]);return r}function L(e,t){var n;if("string"==typeof e)n=t(e)[0];else if(Array.isArray(e)){for(var r,i,o=e.concat(),s=[],a=o.length;a--;)"string"==typeof(r=o.shift())?s.push(t(r)[0]):Array.isArray(r)&&"string"==typeof r[0]&&(i=t(r[0],r[1],r[2]),s.push([i[0],i[1],i[2]]));n=s}return n}var P=!1,E=!0;if("string"==typeof e)P=!0;else if(Array.isArray(e)){var I=e.concat();s=[];for(var O,j=I.length;j--;)("string"!=typeof(O=I.shift())||Array.isArray(O)&&"string"!=typeof O[0])&&(E=!1);P=E}if(!1===P)throw new Error('Type of text must be string or Array. "'+e+'" is not recognized.');"string"==typeof e&&(e=e.match(/[\r?\n]/)?e.split(/\r\n|\r|\n/g):[e]);var z=te/m.internal.scaleFactor,F=z*(_-1);switch(r.baseline){case"bottom":n-=F;break;case"top":n+=z-F;break;case"hanging":n+=z-2*F;break;case"middle":n+=z/2-F}if((u=r.maxWidth||0)>0&&("string"==typeof e?e=m.splitTextToSize(e,u):"[object Array]"===Object.prototype.toString.call(e)&&(e=e.reduce(function(e,t){return e.concat(m.splitTextToSize(t,u))},[]))),o={text:e,x:t,y:n,options:r,mutex:{pdfEscape:nt,activeFontKey:de,fonts:ge,activeFontSize:te}},Ne.publish("preProcessText",o),e=o.text,a=(r=o.options).angle,p instanceof Ie==0&&a&&"number"==typeof a){a*=Math.PI/180,0===r.rotationDirection&&(a=-a),w===y&&(a=-a);var T=Math.cos(a),R=Math.sin(a);p=new Ie(T,R,-R,T,0,0)}else a&&a instanceof Ie&&(p=a);w!==y||p||(p=je),void 0!==(l=r.charSpace||Kt)&&(v+=S(C(l))+" Tc\n",this.setCharSpace(this.getCharSpace()||0)),void 0!==(f=r.horizontalScale)&&(v+=S(100*f)+" Tz\n"),r.lang;var M=-1,D=void 0!==r.renderingMode?r.renderingMode:r.stroke,B=m.internal.getCurrentPageInfo().pageContext;switch(D){case 0:case!1:case"fill":M=0;break;case 1:case!0:case"stroke":M=1;break;case 2:case"fillThenStroke":M=2;break;case 3:case"invisible":M=3;break;case 4:case"fillAndAddForClipping":M=4;break;case 5:case"strokeAndAddPathForClipping":M=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":M=6;break;case 7:case"addToPathForClipping":M=7}var q=void 0!==B.usedRenderingMode?B.usedRenderingMode:-1;-1!==M?v+=M+" Tr\n":-1!==q&&(v+="0 Tr\n"),-1!==M&&(B.usedRenderingMode=M),c=r.align||"left";var U,$=te*_,W=m.internal.pageSize.getWidth(),Z=ge[de];l=r.charSpace||Kt,u=r.maxWidth||0,d=Object.assign({autoencode:!0,noBOM:!0},r.flags);var H=[],V=function(e){return m.getStringUnitWidth(e,{font:Z,charSpace:l,fontSize:te,doKerning:!1})*te/x};if("[object Array]"===Object.prototype.toString.call(e)){var G;s=N(e),"left"!==c&&(U=s.map(V));var J,K=0;if("right"===c){t-=U[0],e=[],j=s.length;for(var X=0;X<j;X++)0===X?(J=Ut(t),G=$t(n)):(J=C(K-U[X]),G=-$),e.push([s[X],J,G]),K=U[X]}else if("center"===c){t-=U[0]/2,e=[],j=s.length;for(var Q=0;Q<j;Q++)0===Q?(J=Ut(t),G=$t(n)):(J=C((K-U[Q])/2),G=-$),e.push([s[Q],J,G]),K=U[Q]}else if("left"===c){e=[],j=s.length;for(var ee=0;ee<j;ee++)e.push(s[ee])}else if("justify"===c&&"Identity-H"===Z.encoding){e=[],j=s.length,u=0!==u?u:W;for(var ne=0,re=0;re<j;re++)if(G=0===re?$t(n):-$,J=0===re?Ut(t):ne,re<j-1){var oe=C((u-U[re])/(s[re].split(" ").length-1)),se=s[re].split(" ");e.push([se[0]+" ",J,G]),ne=0;for(var ae=1;ae<se.length;ae++){var ce=(V(se[ae-1]+" "+se[ae])-V(se[ae]))*x+oe;ae==se.length-1?e.push([se[ae],ce,0]):e.push([se[ae]+" ",ce,0]),ne-=ce}}else e.push([s[re],J,G]);e.push(["",ne,0])}else{if("justify"!==c)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(e=[],j=s.length,u=0!==u?u:W,re=0;re<j;re++){G=0===re?$t(n):-$,J=0===re?Ut(t):0;var le=s[re].split(" ").length-1,ue=le>0?(u-U[re])/le:0;re<j-1?H.push(S(C(ue))):H.push(0),e.push([s[re],J,G])}}}!0===("boolean"==typeof r.R2L?r.R2L:ie)&&(e=L(e,function(e,t,n){return[e.split("").reverse().join(""),t,n]})),o={text:e,x:t,y:n,options:r,mutex:{pdfEscape:nt,activeFontKey:de,fonts:ge,activeFontSize:te}},Ne.publish("postProcessText",o),e=o.text,b=o.mutex.isHex||!1;var he=ge[de].encoding;"WinAnsiEncoding"!==he&&"StandardEncoding"!==he||(e=L(e,function(e,t,n){return[k(e),t,n]})),s=N(e),e=[];for(var fe,pe,me,be=Array.isArray(s[0])?1:0,ve="",ye=function(e,t,n){var i="";return n instanceof Ie?(n="number"==typeof r.angle?Oe(n,new Ie(1,0,0,1,e,t)):Oe(new Ie(1,0,0,1,e,t),n),w===y&&(n=Oe(new Ie(1,0,0,-1,0,0),n)),i=n.join(" ")+" Tm\n"):i=S(e)+" "+S(t)+" Td\n",i},we=0;we<s.length;we++){switch(ve="",be){case 1:me=(b?"<":"(")+s[we][0]+(b?">":")"),fe=parseFloat(s[we][1]),pe=parseFloat(s[we][2]);break;case 0:me=(b?"<":"(")+s[we]+(b?">":")"),fe=Ut(t),pe=$t(n)}void 0!==H&&void 0!==H[we]&&(ve=H[we]+" Tw\n"),0===we?e.push(ve+ye(fe,pe,p)+me):0===be?e.push(ve+me):1===be&&e.push(ve+ye(fe,pe,p)+me)}e=0===be?e.join(" Tj\nT* "):e.join(" Tj\n"),e+=" Tj\n";var _e="BT\n/";return _e+=de+" "+te+" Tf\n",_e+=S(te*_)+" TL\n",_e+=Gt+"\n",_e+=v,_e+=e,Y(_e+="ET"),h[de]=!0,m};var xt=f.__private__.clip=f.clip=function(e){return Y("evenodd"===e?"W*":"W"),this};f.clipEvenOdd=function(){return xt("evenodd")},f.__private__.discardPath=f.discardPath=function(){return Y("n"),this};var kt=f.__private__.isValidStyle=function(e){var t=!1;return-1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(e)&&(t=!0),t};f.__private__.setDefaultPathOperation=f.setDefaultPathOperation=function(e){return kt(e)&&(l=e),this};var St=f.__private__.getStyle=f.getStyle=function(e){var t=l;switch(e){case"D":case"S":t="S";break;case"F":t="f";break;case"FD":case"DF":t="B";break;case"f":case"f*":case"B":case"B*":t=e}return t},At=f.close=function(){return Y("h"),this};f.stroke=function(){return Y("S"),this},f.fill=function(e){return Nt("f",e),this},f.fillEvenOdd=function(e){return Nt("f*",e),this},f.fillStroke=function(e){return Nt("B",e),this},f.fillStrokeEvenOdd=function(e){return Nt("B*",e),this};var Nt=function(e,t){"object"===(0,xo.A)(t)?Ct(t,e):Y(e)},Lt=function(e){null===e||w===y&&void 0===e||(e=St(e),Y(e))};function Pt(e,t,n,r,i){var o=new Ru(t||this.boundingBox,n||this.xStep,r||this.yStep,this.gState,i||this.matrix);o.stream=this.stream;var s=e+"$$"+this.cloneIndex+++"$$";return ze(s,o),o}var Ct=function(e,t){var n=we[e.key],r=ye[n];if(r instanceof Tu)Y("q"),Y(Et(t)),r.gState&&f.setGState(r.gState),Y(e.matrix.toString()+" cm"),Y("/"+n+" sh"),Y("Q");else if(r instanceof Ru){var i=new Ie(1,0,0,-1,0,fn());e.matrix&&(i=i.multiply(e.matrix||je),n=Pt.call(r,e.key,e.boundingBox,e.xStep,e.yStep,i).id),Y("q"),Y("/Pattern cs"),Y("/"+n+" scn"),r.gState&&f.setGState(r.gState),Y(t),Y("Q")}},Et=function(e){switch(e){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"}},It=f.moveTo=function(e,t){return Y(S(C(e))+" "+S(E(t))+" m"),this},Ot=f.lineTo=function(e,t){return Y(S(C(e))+" "+S(E(t))+" l"),this},jt=f.curveTo=function(e,t,n,r,i,o){return Y([S(C(e)),S(E(t)),S(C(n)),S(E(r)),S(C(i)),S(E(o)),"c"].join(" ")),this};f.__private__.line=f.line=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!kt(i))throw new Error("Invalid arguments passed to jsPDF.line");return w===v?this.lines([[n-e,r-t]],e,t,[1,1],i||"S"):this.lines([[n-e,r-t]],e,t,[1,1]).stroke()},f.__private__.lines=f.lines=function(e,t,n,r,i,o){var s,a,c,l,u,d,h,f,p,m,g,b;if("number"==typeof e&&(b=n,n=t,t=e,e=b),r=r||[1,1],o=o||!1,isNaN(t)||isNaN(n)||!Array.isArray(e)||!Array.isArray(r)||!kt(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(It(t,n),s=r[0],a=r[1],l=e.length,m=t,g=n,c=0;c<l;c++)2===(u=e[c]).length?(m=u[0]*s+m,g=u[1]*a+g,Ot(m,g)):(d=u[0]*s+m,h=u[1]*a+g,f=u[2]*s+m,p=u[3]*a+g,m=u[4]*s+m,g=u[5]*a+g,jt(d,h,f,p,m,g));return o&&At(),Lt(i),this},f.path=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.c;switch(n.op){case"m":It(r[0],r[1]);break;case"l":Ot(r[0],r[1]);break;case"c":jt.apply(this,r);break;case"h":At()}}return this},f.__private__.rect=f.rect=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!kt(i))throw new Error("Invalid arguments passed to jsPDF.rect");return w===v&&(r=-r),Y([S(C(e)),S(E(t)),S(C(n)),S(C(r)),"re"].join(" ")),Lt(i),this},f.__private__.triangle=f.triangle=function(e,t,n,r,i,o,s){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o)||!kt(s))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[n-e,r-t],[i-n,o-r],[e-i,t-o]],e,t,[1,1],s,!0),this},f.__private__.roundedRect=f.roundedRect=function(e,t,n,r,i,o,s){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o)||!kt(s))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var a=4/3*(Math.SQRT2-1);return i=Math.min(i,.5*n),o=Math.min(o,.5*r),this.lines([[n-2*i,0],[i*a,0,i,o-o*a,i,o],[0,r-2*o],[0,o*a,-i*a,o,-i,o],[2*i-n,0],[-i*a,0,-i,-o*a,-i,-o],[0,2*o-r],[0,-o*a,i*a,-o,i,-o]],e+i,t,[1,1],s,!0),this},f.__private__.ellipse=f.ellipse=function(e,t,n,r,i){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||!kt(i))throw new Error("Invalid arguments passed to jsPDF.ellipse");var o=4/3*(Math.SQRT2-1)*n,s=4/3*(Math.SQRT2-1)*r;return It(e+n,t),jt(e+n,t-s,e+o,t-r,e,t-r),jt(e-o,t-r,e-n,t-s,e-n,t),jt(e-n,t+s,e-o,t+r,e,t+r),jt(e+o,t+r,e+n,t+s,e+n,t),Lt(i),this},f.__private__.circle=f.circle=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||!kt(r))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(e,t,n,n,r)},f.setFont=function(e,t,n){return n&&(t=k(t,n)),de=ct(e,t,{disableWarning:!1}),this};var zt=f.__private__.getFont=f.getFont=function(){return ge[ct.apply(f,arguments)]};f.__private__.getFontList=f.getFontList=function(){var e,t,n={};for(e in be)if(be.hasOwnProperty(e))for(t in n[e]=[],be[e])be[e].hasOwnProperty(t)&&n[e].push(t);return n},f.addFont=function(e,t,n,r,i){var o=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&-1!==o.indexOf(arguments[3])?i=arguments[3]:arguments[3]&&-1==o.indexOf(arguments[3])&&(n=k(n,r)),tt.call(this,e,t,n,i=i||"Identity-H")};var Ft,Tt=e.lineWidth||.200025,Rt=f.__private__.getLineWidth=f.getLineWidth=function(){return Tt},Mt=f.__private__.setLineWidth=f.setLineWidth=function(e){return Tt=e,Y(S(C(e))+" w"),this};f.__private__.setLineDash=Mu.API.setLineDash=Mu.API.setLineDashPattern=function(e,t){if(e=e||[],t=t||0,isNaN(t)||!Array.isArray(e))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return e=e.map(function(e){return S(C(e))}).join(" "),t=S(C(t)),Y("["+e+"] "+t+" d"),this};var Dt=f.__private__.getLineHeight=f.getLineHeight=function(){return te*Ft};f.__private__.getLineHeight=f.getLineHeight=function(){return te*Ft};var Bt=f.__private__.setLineHeightFactor=f.setLineHeightFactor=function(e){return"number"==typeof(e=e||1.15)&&(Ft=e),this},qt=f.__private__.getLineHeightFactor=f.getLineHeightFactor=function(){return Ft};Bt(e.lineHeight);var Ut=f.__private__.getHorizontalCoordinate=function(e){return C(e)},$t=f.__private__.getVerticalCoordinate=function(e){return w===y?e:Ae[D].mediaBox.topRightY-Ae[D].mediaBox.bottomLeftY-C(e)},Wt=f.__private__.getHorizontalCoordinateString=f.getHorizontalCoordinateString=function(e){return S(Ut(e))},Zt=f.__private__.getVerticalCoordinateString=f.getVerticalCoordinateString=function(e){return S($t(e))},Ht=e.strokeColor||"0 G";f.__private__.getStrokeColor=f.getDrawColor=function(){return Ue(Ht)},f.__private__.setStrokeColor=f.setDrawColor=function(e,t,n,r){return Ht=$e({ch1:e,ch2:t,ch3:n,ch4:r,pdfColorType:"draw",precision:2}),Y(Ht),this};var Vt=e.fillColor||"0 g";f.__private__.getFillColor=f.getFillColor=function(){return Ue(Vt)},f.__private__.setFillColor=f.setFillColor=function(e,t,n,r){return Vt=$e({ch1:e,ch2:t,ch3:n,ch4:r,pdfColorType:"fill",precision:2}),Y(Vt),this};var Gt=e.textColor||"0 g",Jt=f.__private__.getTextColor=f.getTextColor=function(){return Ue(Gt)};f.__private__.setTextColor=f.setTextColor=function(e,t,n,r){return Gt=$e({ch1:e,ch2:t,ch3:n,ch4:r,pdfColorType:"text",precision:3}),this};var Kt=e.charSpace,Yt=f.__private__.getCharSpace=f.getCharSpace=function(){return parseFloat(Kt||0)};f.__private__.setCharSpace=f.setCharSpace=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Kt=e,this};var Xt=0;f.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},f.__private__.setLineCap=f.setLineCap=function(e){var t=f.CapJoinStyles[e];if(void 0===t)throw new Error("Line cap style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Xt=t,Y(t+" J"),this};var Qt=0;f.__private__.setLineJoin=f.setLineJoin=function(e){var t=f.CapJoinStyles[e];if(void 0===t)throw new Error("Line join style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Qt=t,Y(t+" j"),this},f.__private__.setLineMiterLimit=f.__private__.setMiterLimit=f.setLineMiterLimit=f.setMiterLimit=function(e){if(e=e||0,isNaN(e))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return Y(S(C(e))+" M"),this},f.GState=zu,f.setGState=function(e){(e="string"==typeof e?_e[xe[e]]:en(null,e)).equals(ke)||(Y("/"+e.id+" gs"),ke=e)};var en=function(e,t){if(!e||!xe[e]){var n=!1;for(var r in _e)if(_e.hasOwnProperty(r)&&_e[r].equals(t)){n=!0;break}if(n)t=_e[r];else{var i="GS"+(Object.keys(_e).length+1).toString(10);_e[i]=t,t.id=i}return e&&(xe[e]=t.id),Ne.publish("addGState",t),t}};f.addGState=function(e,t){return en(e,t),this},f.saveGraphicsState=function(){return Y("q"),ve.push({key:de,size:te,color:Gt}),this},f.restoreGraphicsState=function(){Y("Q");var e=ve.pop();return de=e.key,te=e.size,Gt=e.color,ke=null,this},f.setCurrentTransformationMatrix=function(e){return Y(e.toString()+" cm"),this},f.comment=function(e){return Y("#"+e),this};var tn=function(e,t){var n=e||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return n},set:function(e){isNaN(e)||(n=parseFloat(e))}});var r=t||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return r},set:function(e){isNaN(e)||(r=parseFloat(e))}});var i="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return i},set:function(e){i=e.toString()}}),this},nn=function(e,t,n,r){tn.call(this,e,t),this.type="rect";var i=n||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return i},set:function(e){isNaN(e)||(i=parseFloat(e))}});var o=r||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return o},set:function(e){isNaN(e)||(o=parseFloat(e))}}),this},rn=function(){this.page=Se,this.currentPage=D,this.pages=V.slice(0),this.pagesContext=Ae.slice(0),this.x=fe,this.y=pe,this.matrix=me,this.width=an(D),this.height=ln(D),this.outputDestination=J,this.id="",this.objectNumber=-1};rn.prototype.restore=function(){Se=this.page,D=this.currentPage,Ae=this.pagesContext,V=this.pages,fe=this.x,pe=this.y,me=this.matrix,cn(D,this.width),un(D,this.height),J=this.outputDestination};var on=function(e,t,n,r,i){Ee.push(new rn),Se=D=0,V=[],fe=e,pe=t,me=i,rt([n,r])};for(var sn in f.beginFormObject=function(e,t,n,r,i){return on(e,t,n,r,i),this},f.endFormObject=function(e){return function(e){if(Ce[e])Ee.pop().restore();else{var t=new rn,n="Xo"+(Object.keys(Pe).length+1).toString(10);t.id=n,Ce[e]=n,Pe[n]=t,Ne.publish("addFormObject",t),Ee.pop().restore()}}(e),this},f.doFormObject=function(e,t){var n=Pe[Ce[e]];return Y("q"),Y(t.toString()+" cm"),Y("/"+n.id+" Do"),Y("Q"),this},f.getFormObject=function(e){var t=Pe[Ce[e]];return{x:t.x,y:t.y,width:t.width,height:t.height,matrix:t.matrix}},f.save=function(e,t){return e=e||"generated.pdf",(t=t||{}).returnPromise=t.returnPromise||!1,!1===t.returnPromise?(du(mt(pt()),e),"function"==typeof du.unload&&ou.setTimeout&&setTimeout(du.unload,911),this):new Promise(function(t,n){try{var r=du(mt(pt()),e);"function"==typeof du.unload&&ou.setTimeout&&setTimeout(du.unload,911),t(r)}catch(e){n(e.message)}})},Mu.API)Mu.API.hasOwnProperty(sn)&&("events"===sn&&Mu.API.events.length?function(e,t){var n,r,i;for(i=t.length-1;-1!==i;i--)n=t[i][0],r=t[i][1],e.subscribe.apply(e,[n].concat("function"==typeof r?[r]:r))}(Ne,Mu.API.events):f[sn]=Mu.API[sn]);function an(e){return Ae[e].mediaBox.topRightX-Ae[e].mediaBox.bottomLeftX}function cn(e,t){Ae[e].mediaBox.topRightX=t+Ae[e].mediaBox.bottomLeftX}function ln(e){return Ae[e].mediaBox.topRightY-Ae[e].mediaBox.bottomLeftY}function un(e,t){Ae[e].mediaBox.topRightY=t+Ae[e].mediaBox.bottomLeftY}var dn=f.getPageWidth=function(e){return an(e=e||D)/he},hn=f.setPageWidth=function(e,t){cn(e,t*he)},fn=f.getPageHeight=function(e){return ln(e=e||D)/he},pn=f.setPageHeight=function(e,t){un(e,t*he)};return f.internal={pdfEscape:nt,getStyle:St,getFont:zt,getFontSize:re,getCharSpace:Yt,getTextColor:Jt,getLineHeight:Dt,getLineHeightFactor:qt,getLineWidth:Rt,write:X,getHorizontalCoordinate:Ut,getVerticalCoordinate:$t,getCoordinateString:Wt,getVerticalCoordinateString:Zt,collections:{},newObject:Te,newAdditionalObject:De,newObjectDeferred:Re,newObjectDeferredBegin:Me,getFilters:We,putStream:Ze,events:Ne,scaleFactor:he,pageSize:{getWidth:function(){return dn(D)},setWidth:function(e){hn(D,e)},getHeight:function(){return fn(D)},setHeight:function(e){pn(D,e)}},encryptionOptions:u,encryption:vt,getEncryptor:function(e){return null!==u?vt.encryptor(e,0):function(e){return e}},output:gt,getNumberOfPages:at,get pages(){return V},out:Y,f2:L,f3:P,getPageInfo:yt,getPageInfoByObjId:wt,getCurrentPageInfo:_t,getPDFVersion:m,Point:tn,Rectangle:nn,Matrix:Ie,hasHotfix:bt},Object.defineProperty(f.internal.pageSize,"width",{get:function(){return dn(D)},set:function(e){hn(D,e)},enumerable:!0,configurable:!0}),Object.defineProperty(f.internal.pageSize,"height",{get:function(){return fn(D)},set:function(e){pn(D,e)},enumerable:!0,configurable:!0}),function(e){for(var t=0,n=ee.length;t<n;t++){var r=tt.call(this,e[t][0],e[t][1],e[t][2],ee[t][3],!0);!1===d&&(h[r]=!0);var i=e[t][0].split("-");et({id:r,fontName:i[0],fontStyle:i[1]||""})}Ne.publish("addFonts",{fonts:ge,dictionary:be})}.call(f,ee),de="F1",it(i,n),Ne.publish("initialized"),f}Iu.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},Iu.prototype.toHexString=function(e){return e.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Iu.prototype.hexToBytes=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(String.fromCharCode(parseInt(e.substr(n,2),16)));return t.join("")},Iu.prototype.processOwnerPassword=function(e,t){return Cu(Nu(t).substr(0,5),e)},Iu.prototype.encryptor=function(e,t){var n=Nu(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(e){return Cu(n,e)}},zu.prototype.equals=function(e){var t,n="id,objectNumber,equals";if(!e||(0,xo.A)(e)!==(0,xo.A)(this))return!1;var r=0;for(t in this)if(!(n.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t))return!1;if(this[t]!==e[t])return!1;r++}for(t in e)e.hasOwnProperty(t)&&n.indexOf(t)<0&&r--;return 0===r},Mu.API={events:[]},Mu.version="4.2.0";var Du=Mu.API,Bu=1,qu=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Uu=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},$u=function(e){return e.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return"#"+(1===t.length?"0"+t:t)})},Wu=function(e){return e.toFixed(2)},Zu=function(e){return e.toFixed(5)};Du.__acroform__={};var Hu=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},Vu=function(e){return e*Bu},Gu=function(e){var t=new ud,n=Sd.internal.getHeight(e)||0,r=Sd.internal.getWidth(e)||0;return t.BBox=[0,0,Number(Wu(r)),Number(Wu(n))],t},Ju=Du.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<<t},Ku=Du.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&~(1<<t)},Yu=Du.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return e&1<<t?1:0},Xu=Du.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return Yu(e,t-1)},Qu=Du.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return Ju(e,t-1)},ed=Du.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return Ku(e,t-1)},td=Du.__acroform__.calculateCoordinates=function(e,t){var n=t.internal.getHorizontalCoordinate,r=t.internal.getVerticalCoordinate,i=e[0],o=e[1],s=e[2],a=e[3],c={};return c.lowerLeft_X=n(i)||0,c.lowerLeft_Y=r(o+a)||0,c.upperRight_X=n(i+s)||0,c.upperRight_Y=r(o)||0,[Number(Wu(c.lowerLeft_X)),Number(Wu(c.lowerLeft_Y)),Number(Wu(c.upperRight_X)),Number(Wu(c.upperRight_Y))]},nd=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],n=e._V||e.DV,r=rd(e,n),i=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+i+" "+Wu(r.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(r.text),t.push("ET"),t.push("Q"),t.push("EMC");var o=Gu(e);return o.scope=e.scope,o.stream=t.join("\n"),o}},rd=function(e,t){var n=0===e.fontSize?e.maxFontSize:e.fontSize,r={text:"",fontSize:""},i=(t=")"==(t="("==t.substr(0,1)?t.substr(1):t).substr(t.length-1)?t.substr(0,t.length-1):t).split(" ");i=e.multiline?i.map(function(e){return e.split("\n")}):i.map(function(e){return[e]});var o=n,s=Sd.internal.getHeight(e)||0;s=s<0?-s:s;var a=Sd.internal.getWidth(e)||0;a=a<0?-a:a;var c=function(t,n,r){if(t+1<i.length){var o=n+" "+i[t+1][0];return id(o,e,r).width<=a-4}return!1};o++;e:for(;o>0;){t="",o--;var l,u,d=id("3",e,o).height,h=e.multiline?s-o:(s-d)/2,f=h+=2,p=0,m=0,g=0;if(o<=0){t="(...) Tj\n",t+="% Width of Text: "+id(t,e,o=12).width+", FieldWidth:"+a+"\n";break}for(var b="",v=0,y=0;y<i.length;y++)if(i.hasOwnProperty(y)){var w=!1;if(1!==i[y].length&&g!==i[y].length-1){if((d+2)*(v+2)+2>s)continue e;b+=i[y][g],w=!0,m=y,y--}else{b=" "==(b+=i[y][g]+" ").substr(b.length-1)?b.substr(0,b.length-1):b;var _=parseInt(y),x=c(_,b,o),k=y>=i.length-1;if(x&&!k){b+=" ",g=0;continue}if(x||k){if(k)m=_;else if(e.multiline&&(d+2)*(v+2)+2>s)continue e}else{if(!e.multiline)continue e;if((d+2)*(v+2)+2>s)continue e;m=_}}for(var S="",A=p;A<=m;A++){var N=i[A];if(e.multiline){if(A===m){S+=N[g]+" ",g=(g+1)%N.length;continue}if(A===p){S+=N[N.length-1]+" ";continue}}S+=N[0]+" "}switch(S=" "==S.substr(S.length-1)?S.substr(0,S.length-1):S,u=id(S,e,o).width,e.textAlign){case"right":l=a-u-2;break;case"center":l=(a-u)/2;break;default:l=2}t+=Wu(l)+" "+Wu(f)+" Td\n",t+="("+qu(S)+") Tj\n",t+=-Wu(l)+" 0 Td\n",f=-(o+2),u=0,p=w?m:m+1,v++,b=""}break}return r.text=t,r.fontSize=o,r},id=function(e,t,n){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),i=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:t.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},od={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},sd=function(e,t){var n={type:"reference",object:e};void 0===t.internal.getPageInfo(e.page).pageContext.annotations.find(function(e){return e.type===n.type&&e.object===n.object})&&t.internal.getPageInfo(e.page).pageContext.annotations.push(n)},ad=Du.__acroform__.arrayToPdfArray=function(e,t,n){var r=function(e){return e};if(Array.isArray(e)){for(var i="[",o=0;o<e.length;o++)switch(0!==o&&(i+=" "),(0,xo.A)(e[o])){case"boolean":case"number":case"object":i+=e[o].toString();break;case"string":"/"===e[o].substr(0,1)?i+="/"+$u(e[o].substr(1)):(void 0!==t&&n&&(r=n.internal.getEncryptor(t)),i+="("+qu(r(e[o].toString()))+")")}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},cd=function(e,t,n){var r=function(e){return e};return void 0!==t&&n&&(r=n.internal.getEncryptor(t)),(e=e||"").toString(),"("+qu(r(e))+")"},ld=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(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};ld.prototype.toString=function(){return this.objId+" 0 R"},ld.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},ld.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(e){return"content"!=e&&"appearanceStreamContent"!=e&&"scope"!=e&&"objId"!=e&&"_"!=e.substring(0,1)});for(var n in t)if(!1===Object.getOwnPropertyDescriptor(this,t[n]).configurable){var r=t[n],i=this[r];i&&(Array.isArray(i)?e.push({key:r,value:ad(i,this.objId,this.scope)}):i instanceof ld?(i.scope=this.scope,e.push({key:r,value:i.objId+" 0 R"})):"function"!=typeof i&&e.push({key:r,value:i}))}return e};var ud=function(){ld.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 e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};Hu(ud,ld);var dd=function(){ld.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+qu(t(e))+")"}},set:function(t){e=t}})};Hu(dd,ld);var hd=function e(){ld.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute F supplied.');t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(t,3))},set:function(e){!0===Boolean(e)?this.F=Qu(t,3):this.F=ed(t,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute Ff supplied.');n=e}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==r.length)return r},set:function(e){r=void 0!==e?e:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(e){r[0]=e}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(e){r[1]=e}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(e){r[2]=e}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(e){r[3]=e}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(e){switch(e){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=e;break;default:throw new Error('Invalid value "'+e+'" for attribute FT supplied.')}}});var o=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!o||o.length<1){if(this instanceof wd)return;o="FieldObject"+e.FieldNum++}var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+qu(t(o))+")"},set:function(e){o=e.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return o},set:function(e){o=e}});var s="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return s},set:function(e){s=e}});var a="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return a},set:function(e){a=e}});var c=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return c},set:function(e){c=e}});var l=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return void 0===l?50/Bu:l},set:function(e){l=e}});var u="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return u},set:function(e){u=e}});var d="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!d||this instanceof wd||this instanceof xd))return cd(d,this.objId,this.scope)},set:function(e){e=e.toString(),d=e}});var h=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(h)return this instanceof bd==0?cd(h,this.objId,this.scope):h},set:function(e){e=e.toString(),h=this instanceof bd==0?"("===e.substr(0,1)?Uu(e.substr(1,e.length-2)):Uu(e):e}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof bd==1?Uu(h.substr(1,h.length-1)):h},set:function(e){e=e.toString(),h=this instanceof bd==1?"/"+$u(e):e}});var f=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(f)return f},set:function(e){this.V=e}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof bd==0?cd(f,this.objId,this.scope):f},set:function(e){e=e.toString(),f=this instanceof bd==0?"("===e.substr(0,1)?Uu(e.substr(1,e.length-2)):Uu(e):e}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof bd==1?Uu(f.substr(1,f.length-1)):f},set:function(e){e=e.toString(),f=this instanceof bd==1?"/"+$u(e):e}}),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,m=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return m},set:function(e){e=Boolean(e),m=e}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(p)return p},set:function(e){p=e}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,1))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,1):this.Ff=ed(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,2))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,2):this.Ff=ed(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,3))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,3):this.Ff=ed(this.Ff,3)}});var g=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==g)return g},set:function(e){if(-1===[0,1,2].indexOf(e))throw new Error('Invalid value "'+e+'" for attribute Q supplied.');g=e}}),Object.defineProperty(this,"textAlign",{get:function(){var e;switch(g){case 0:default:e="left";break;case 1:e="center";break;case 2:e="right"}return e},configurable:!0,enumerable:!0,set:function(e){switch(e){case"right":case 2:g=2;break;case"center":case 1:g=1;break;default:g=0}}})};Hu(hd,ld);var fd=function(){hd.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){e=t}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return ad(t,this.objId,this.scope)},set:function(e){var n,r;r=[],"string"==typeof(n=e)&&(r=function(e,t,n){n||(n=1);for(var r,i=[];r=t.exec(e);)i.push(r[n]);return i}(n,/\((.*?)\)/g)),t=r}}),this.getOptions=function(){return t},this.setOptions=function(e){t=e,this.sort&&t.sort()},this.addOption=function(e){e=(e=e||"").toString(),t.push(e),this.sort&&t.sort()},this.removeOption=function(e,n){for(n=n||!1,e=(e=e||"").toString();-1!==t.indexOf(e)&&(t.splice(t.indexOf(e),1),!1!==n););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,18))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,18):this.Ff=ed(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,19))},set:function(e){!0===this.combo&&(!0===Boolean(e)?this.Ff=Qu(this.Ff,19):this.Ff=ed(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,20))},set:function(e){!0===Boolean(e)?(this.Ff=Qu(this.Ff,20),t.sort()):this.Ff=ed(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,22))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,22):this.Ff=ed(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,23))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,23):this.Ff=ed(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,27))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,27):this.Ff=ed(this.Ff,27)}}),this.hasAppearanceStream=!1};Hu(fd,hd);var pd=function(){fd.call(this),this.fontName="helvetica",this.combo=!1};Hu(pd,fd);var md=function(){pd.call(this),this.combo=!0};Hu(md,pd);var gd=function(){md.call(this),this.edit=!0};Hu(gd,md);var bd=function(){hd.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,15))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,15):this.Ff=ed(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,16))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,16):this.Ff=ed(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,17))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,17):this.Ff=ed(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,26))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,26):this.Ff=ed(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};if(this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),0!==Object.keys(t).length){var n,r=[];for(n in r.push("<<"),t)r.push("/"+n+" ("+qu(e(t[n]))+")");return r.push(">>"),r.join("\n")}},set:function(e){"object"===(0,xo.A)(e)&&(t=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(e){"string"==typeof e&&(t.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){var n=null==t?"":t.toString();"/"===n.substr(0,1)&&(n=n.substr(1)),e="/"+$u(n)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+$u(t)}})};Hu(bd,hd);var vd=function(){bd.call(this),this.pushButton=!0};Hu(vd,bd);var yd=function(){bd.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};Hu(yd,bd);var wd=function(){var e,t;hd.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(e){t=e}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};this.scope&&(e=this.scope.internal.getEncryptor(this.objId));var t,n=[];for(t in n.push("<<"),r)n.push("/"+t+" ("+qu(e(r[t]))+")");return n.push(">>"),n.join("\n")},set:function(e){"object"===(0,xo.A)(e)&&(r=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(e){"string"==typeof e&&(r.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(e){var t=null==e?"":e.toString();"/"===t.substr(0,1)&&(t=t.substr(1)),n="/"+$u(t)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(e){var t=null==e?"":e.toString();"/"===t.substr(0,1)&&(t=t.substr(1)),n="/"+$u(t)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Sd.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Hu(wd,hd),yd.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var n=this.Kids[t];n.appearanceStreamContent=e.createAppearanceStream(n.optionName),n.caption=e.getCA()}},yd.prototype.createOption=function(e){var t=new wd;return t.Parent=this,t.optionName=e,this.Kids.push(t),Ld.call(this.scope,t),t};var _d=function(){bd.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Sd.CheckBox.createAppearanceStream()};Hu(_d,bd);var xd=function(){hd.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,13))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,13):this.Ff=ed(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,21))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,21):this.Ff=ed(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,23))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,23):this.Ff=ed(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,24))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,24):this.Ff=ed(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,25))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,25):this.Ff=ed(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,26))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,26):this.Ff=ed(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Hu(xd,hd);var kd=function(){xd.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(Xu(this.Ff,14))},set:function(e){!0===Boolean(e)?this.Ff=Qu(this.Ff,14):this.Ff=ed(this.Ff,14)}}),this.password=!0};Hu(kd,xd);var Sd={CheckBox:{createAppearanceStream:function(){return{N:{On:Sd.CheckBox.YesNormal},D:{On:Sd.CheckBox.YesPushDown,Off:Sd.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Gu(e);t.scope=e.scope;var n=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),o=rd(e,e.caption);return n.push("0.749023 g"),n.push("0 0 "+Wu(Sd.internal.getWidth(e))+" "+Wu(Sd.internal.getHeight(e))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+Wu(o.fontSize)+" Tf "+i),n.push("BT"),n.push(o.text),n.push("ET"),n.push("Q"),n.push("EMC"),t.stream=n.join("\n"),t},YesNormal:function(e){var t=Gu(e);t.scope=e.scope;var n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),i=[],o=Sd.internal.getHeight(e),s=Sd.internal.getWidth(e),a=rd(e,e.caption);return i.push("1 g"),i.push("0 0 "+Wu(s)+" "+Wu(o)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+Wu(s-1)+" "+Wu(o-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+Wu(a.fontSize)+" Tf "+r),i.push(a.text),i.push("ET"),i.push("Q"),t.stream=i.join("\n"),t},OffPushDown:function(e){var t=Gu(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Wu(Sd.internal.getWidth(e))+" "+Wu(Sd.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join("\n"),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Sd.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Sd.RadioButton.Circle.YesNormal,t.D[e]=Sd.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=Gu(e);t.scope=e.scope;var n=[],r=Sd.internal.getWidth(e)<=Sd.internal.getHeight(e)?Sd.internal.getWidth(e)/4:Sd.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Sd.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+Zu(Sd.internal.getWidth(e)/2)+" "+Zu(Sd.internal.getHeight(e)/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"),t.stream=n.join("\n"),t},YesPushDown:function(e){var t=Gu(e);t.scope=e.scope;var n=[],r=Sd.internal.getWidth(e)<=Sd.internal.getHeight(e)?Sd.internal.getWidth(e)/4:Sd.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),o=Number((i*Sd.internal.Bezier_C).toFixed(5)),s=Number((r*Sd.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+Zu(Sd.internal.getWidth(e)/2)+" "+Zu(Sd.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+Zu(Sd.internal.getWidth(e)/2)+" "+Zu(Sd.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join("\n"),t},OffPushDown:function(e){var t=Gu(e);t.scope=e.scope;var n=[],r=Sd.internal.getWidth(e)<=Sd.internal.getHeight(e)?Sd.internal.getWidth(e)/4:Sd.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),o=Number((i*Sd.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+Zu(Sd.internal.getWidth(e)/2)+" "+Zu(Sd.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join("\n"),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Sd.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Sd.RadioButton.Cross.YesNormal,t.D[e]=Sd.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=Gu(e);t.scope=e.scope;var n=[],r=Sd.internal.calculateCross(e);return n.push("q"),n.push("1 1 "+Wu(Sd.internal.getWidth(e)-2)+" "+Wu(Sd.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(Wu(r.x1.x)+" "+Wu(r.x1.y)+" m"),n.push(Wu(r.x2.x)+" "+Wu(r.x2.y)+" l"),n.push(Wu(r.x4.x)+" "+Wu(r.x4.y)+" m"),n.push(Wu(r.x3.x)+" "+Wu(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join("\n"),t},YesPushDown:function(e){var t=Gu(e);t.scope=e.scope;var n=Sd.internal.calculateCross(e),r=[];return r.push("0.749023 g"),r.push("0 0 "+Wu(Sd.internal.getWidth(e))+" "+Wu(Sd.internal.getHeight(e))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Wu(Sd.internal.getWidth(e)-2)+" "+Wu(Sd.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(Wu(n.x1.x)+" "+Wu(n.x1.y)+" m"),r.push(Wu(n.x2.x)+" "+Wu(n.x2.y)+" l"),r.push(Wu(n.x4.x)+" "+Wu(n.x4.y)+" m"),r.push(Wu(n.x3.x)+" "+Wu(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join("\n"),t},OffPushDown:function(e){var t=Gu(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Wu(Sd.internal.getWidth(e))+" "+Wu(Sd.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join("\n"),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+n}};Sd.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Sd.internal.getWidth(e),n=Sd.internal.getHeight(e),r=Math.min(t,n);return{x1:{x:(t-r)/2,y:(n-r)/2+r},x2:{x:(t-r)/2+r,y:(n-r)/2},x3:{x:(t-r)/2,y:(n-r)/2},x4:{x:(t-r)/2+r,y:(n-r)/2+r}}}},Sd.internal.getWidth=function(e){var t=0;return"object"===(0,xo.A)(e)&&(t=Vu(e.Rect[2])),t},Sd.internal.getHeight=function(e){var t=0;return"object"===(0,xo.A)(e)&&(t=Vu(e.Rect[3])),t};var Ad,Nd,Ld=Du.addField=function(e){if(function(e,t){if(t.scope=e,void 0!==e.internal&&(void 0===e.internal.acroformPlugin||!1===e.internal.acroformPlugin.isInitialized)){if(hd.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(od)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");Bu=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new dd,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){var t;(t=e).internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0}),e.internal.events.subscribe("buildDocument",function(){!function(e){e.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=e.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];r.objId=void 0,r.hasAnnotation&&sd(r,e)}}(e)}),e.internal.events.subscribe("putCatalog",function(){!function(e){if(void 0===e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");e.internal.write("/AcroForm "+e.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")}(e)}),e.internal.events.subscribe("postPutPages",function(t){!function(e,t){var n=!e;for(var r in e||(t.internal.newObjectDeferredBegin(t.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),t.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),e=e||t.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(e.hasOwnProperty(r)){var i=e[r],o=[],s=i.Rect;if(i.Rect&&(i.Rect=td(i.Rect,t)),t.internal.newObjectDeferredBegin(i.objId,!0),i.DA=Sd.createDefaultAppearanceStream(i),"object"===(0,xo.A)(i)&&"function"==typeof i.getKeyValueListForStream&&(o=i.getKeyValueListForStream()),i.Rect=s,i.hasAppearanceStream&&!i.appearanceStreamContent){var a=nd(i);o.push({key:"AP",value:"<</N "+a+">>"}),t.internal.acroformPlugin.xForms.push(a)}if(i.appearanceStreamContent){var c="";for(var l in i.appearanceStreamContent)if(i.appearanceStreamContent.hasOwnProperty(l)){var u=i.appearanceStreamContent[l];if(c+="/"+l+" ",c+="<<",Object.keys(u).length>=1||Array.isArray(u)){for(var r in u)if(u.hasOwnProperty(r)){var d=u[r];"function"==typeof d&&(d=d.call(t,i)),c+="/"+r+" "+d+" ",t.internal.acroformPlugin.xForms.indexOf(d)>=0||t.internal.acroformPlugin.xForms.push(d)}}else"function"==typeof(d=u)&&(d=d.call(t,i)),c+="/"+r+" "+d,t.internal.acroformPlugin.xForms.indexOf(d)>=0||t.internal.acroformPlugin.xForms.push(d);c+=">>"}o.push({key:"AP",value:"<<\n"+c+">>"})}t.internal.putStream({additionalKeyValues:o,objectId:i.objId}),t.internal.out("endobj")}n&&function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=n,i=e[n];t.internal.newObjectDeferredBegin(i.objId,!0),"object"===(0,xo.A)(i)&&"function"==typeof i.putStream&&i.putStream(),delete e[r]}}(t.internal.acroformPlugin.xForms,t)}(t,e)}),e.internal.acroformPlugin.isInitialized=!0}}(this,e),!(e instanceof hd))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};function Pd(e){return e.reduce(function(e,t,n){return e[t]=n,e},{})}Du.AcroFormChoiceField=fd,Du.AcroFormListBox=pd,Du.AcroFormComboBox=md,Du.AcroFormEditBox=gd,Du.AcroFormButton=bd,Du.AcroFormPushButton=vd,Du.AcroFormRadioButton=yd,Du.AcroFormCheckBox=_d,Du.AcroFormTextField=xd,Du.AcroFormPasswordField=kd,Du.AcroFormAppearance=Sd,Du.AcroForm={ChoiceField:fd,ListBox:pd,ComboBox:md,EditBox:gd,Button:bd,PushButton:vd,RadioButton:yd,CheckBox:_d,TextField:xd,PasswordField:kd,Appearance:Sd},Mu.AcroForm={ChoiceField:fd,ListBox:pd,ComboBox:md,EditBox:gd,Button:bd,PushButton:vd,RadioButton:yd,CheckBox:_d,TextField:xd,PasswordField:kd,Appearance:Sd},Mu.AcroForm,function(e){var t="addImage_";e.__addimage__={};var n="UNKNOWN",r={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]]},i=e.__addimage__.getImageFileTypeByImageData=function(e,t){var i,o,s,a,c,l=n;if("RGBA"===(t=t||n)||void 0!==e.data&&e.data instanceof Uint8ClampedArray&&"height"in e&&"width"in e)return"RGBA";if(x(e))for(c in r)for(s=r[c],i=0;i<s.length;i+=1){for(a=!0,o=0;o<s[i].length;o+=1)if(void 0!==s[i][o]&&s[i][o]!==e[o]){a=!1;break}if(!0===a){l=c;break}}else for(c in r)for(s=r[c],i=0;i<s.length;i+=1){for(a=!0,o=0;o<s[i].length;o+=1)if(void 0!==s[i][o]&&s[i][o]!==e.charCodeAt(o)){a=!1;break}if(!0===a){l=c;break}}return l===n&&t!==n&&(l=t),l},o=function e(t){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);t.objectId=this.internal.newObject();var o=[];if(o.push({key:"Type",value:"/XObject"}),o.push({key:"Subtype",value:"/Image"}),o.push({key:"Width",value:t.width}),o.push({key:"Height",value:t.height}),t.colorSpace===b.INDEXED?o.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(t.palette.length/3-1)+" "+("sMask"in t&&void 0!==t.sMask?t.objectId+2:t.objectId+1)+" 0 R]"}):(o.push({key:"ColorSpace",value:"/"+t.colorSpace}),t.colorSpace===b.DEVICE_CMYK&&o.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),o.push({key:"BitsPerComponent",value:t.bitsPerComponent}),"decodeParameters"in t&&void 0!==t.decodeParameters&&o.push({key:"DecodeParms",value:"<<"+t.decodeParameters+">>"}),"transparency"in t&&Array.isArray(t.transparency)&&t.transparency.length>0){for(var s="",a=0,c=t.transparency.length;a<c;a++)s+=t.transparency[a]+" "+t.transparency[a]+" ";o.push({key:"Mask",value:"["+s+"]"})}void 0!==t.sMask&&o.push({key:"SMask",value:t.objectId+1+" 0 R"});var l=void 0!==t.filter?["/"+t.filter]:void 0;if(r({data:t.data,additionalKeyValues:o,alreadyAppliedFilters:l,objectId:t.objectId}),n("endobj"),"sMask"in t&&void 0!==t.sMask){var u,d=null!==(u=t.sMaskBitsPerComponent)&&void 0!==u?u:t.bitsPerComponent,h={width:t.width,height:t.height,colorSpace:"DeviceGray",bitsPerComponent:d,data:t.sMask};"filter"in t&&(h.decodeParameters="/Predictor ".concat(t.predictor," /Colors 1 /BitsPerComponent ").concat(d," /Columns ").concat(t.width),h.filter=t.filter),e.call(this,h)}if(t.colorSpace===b.INDEXED){var f=this.internal.newObject();r({data:S(new Uint8Array(t.palette)),objectId:f}),n("endobj")}},s=function(){var e=this.internal.collections[t+"images"];for(var n in e)o.call(this,e[n])},a=function(){var e,n=this.internal.collections[t+"images"],r=this.internal.write;for(var i in n)r("/I"+(e=n[i]).index,e.objectId,"0","R")},c=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",s),this.internal.events.subscribe("putXobjectDict",a))},l=function(){var e=this.internal.collections[t+"images"];return c.call(this),e},u=function(){return Object.keys(this.internal.collections[t+"images"]).length},d=function(t){return"function"==typeof e["process"+t.toUpperCase()]},h=function(e){return"object"===(0,xo.A)(e)&&1===e.nodeType},f=function(t,n){if("IMG"===t.nodeName&&t.hasAttribute("src")){var r=""+t.getAttribute("src");if(0===r.indexOf("data:image/"))return fu(unescape(r).split("base64,").pop());var i=e.loadFile(r,!0);if(void 0!==i)return i}if("CANVAS"===t.nodeName){if(0===t.width||0===t.height)throw new Error("Given canvas must have data. Canvas width: "+t.width+", height: "+t.height);var o;switch(n){case"PNG":o="image/png";break;case"WEBP":o="image/webp";break;default:o="image/jpeg"}return fu(t.toDataURL(o,1).split("base64,").pop())}},p=function(e){var n=this.internal.collections[t+"images"];if(n)for(var r in n)if(e===n[r].alias)return n[r]},m=function(e,t,n){return e||t||(e=-96,t=-96),e<0&&(e=-1*n.width*72/e/this.internal.scaleFactor),t<0&&(t=-1*n.height*72/t/this.internal.scaleFactor),0===e&&(e=t*n.width/n.height),0===t&&(t=e*n.height/n.width),[e,t]},g=function(e,t,n,r,i,o){var s=m.call(this,n,r,i),a=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString,u=l.call(this);if(n=s[0],r=s[1],u[i.index]=i,o){o*=Math.PI/180;var d=Math.cos(o),h=Math.sin(o),f=function(e){return e.toFixed(4)},p=[f(d),f(h),f(-1*h),f(d),0,0,"cm"]}this.internal.write("q"),o?(this.internal.write([1,"0","0",1,a(e),c(t+r),"cm"].join(" ")),this.internal.write(p.join(" ")),this.internal.write([a(n),"0","0",a(r),"0","0","cm"].join(" "))):this.internal.write([a(n),"0","0",a(r),a(e),c(t+r),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+i.index+" Do"),this.internal.write("Q")},b=e.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"};e.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"};var v=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},y=e.__addimage__.sHashCode=function(e){var t,n,r=0;if("string"==typeof e)for(n=e.length,t=0;t<n;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;else if(x(e))for(n=e.byteLength/2,t=0;t<n;t++)r=(r<<5)-r+e[t],r|=0;return r},w=e.__addimage__.validateStringAsBase64=function(e){(e=e||"").toString().trim();var t=!0;return 0===e.length&&(t=!1),e.length%4!=0&&(t=!1),!1===/^[A-Za-z0-9+/]+$/.test(e.substr(0,e.length-2))&&(t=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(e.substr(-2))&&(t=!1),t},_=e.__addimage__.extractImageFromDataUrl=function(e){if(null==e)return null;if(!(e=e.trim()).startsWith("data:"))return null;var t=e.indexOf(",");return t<0?null:e.substring(0,t).trim().endsWith("base64")?e.substring(t+1):null};e.__addimage__.isArrayBuffer=function(e){return e instanceof ArrayBuffer};var x=e.__addimage__.isArrayBufferView=function(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array},k=e.__addimage__.binaryStringToUint8Array=function(e){for(var t=e.length,n=new Uint8Array(t),r=0;r<t;r++)n[r]=e.charCodeAt(r);return n},S=e.__addimage__.arrayBufferToBinaryString=function(e){for(var t="",n=x(e)?e:new Uint8Array(e),r=0;r<n.length;r+=8192)t+=String.fromCharCode.apply(null,n.subarray(r,r+8192));return t};e.addImage=function(){var e,t,r,i,o,s,a,l,u;if("number"==typeof arguments[1]?(t=n,r=arguments[1],i=arguments[2],o=arguments[3],s=arguments[4],a=arguments[5],l=arguments[6],u=arguments[7]):(t=arguments[1],r=arguments[2],i=arguments[3],o=arguments[4],s=arguments[5],a=arguments[6],l=arguments[7],u=arguments[8]),"object"===(0,xo.A)(e=arguments[0])&&!h(e)&&"imageData"in e){var d=e;e=d.imageData,t=d.format||t||n,r=d.x||r||0,i=d.y||i||0,o=d.w||d.width||o,s=d.h||d.height||s,a=d.alias||a,l=d.compression||l,u=d.rotation||d.angle||u}var f=this.internal.getFilters();if(void 0===l&&-1!==f.indexOf("FlateEncode")&&(l="SLOW"),isNaN(r)||isNaN(i))throw new Error("Invalid coordinates passed to jsPDF.addImage");c.call(this);var p=A.call(this,e,t,a,l);return g.call(this,r,i,o,s,p,u),this};var A=function(t,r,o,s){var a,c,l;if("string"==typeof t&&i(t)===n){t=unescape(t);var m=N(t,!1);(""!==m||void 0!==(m=e.loadFile(t,!0)))&&(t=m)}if(h(t)&&(t=f(t,r)),r=i(t,r),!d(r))throw new Error("addImage does not support files of type '"+r+"', please ensure that a plugin for '"+r+"' support is added.");if((null==(l=o)||0===l.length)&&(o=function(e){return"string"==typeof e||x(e)?y(e):x(e.data)?y(e.data):null}(t)),(a=p.call(this,o))||(t instanceof Uint8Array||"RGBA"===r||(c=t,t=k(t)),a=this["process"+r.toUpperCase()](t,u.call(this),o,function(t){return t&&"string"==typeof t&&(t=t.toUpperCase()),t in e.image_compression?t:v.NONE}(s),c)),!a)throw new Error("An unknown error occurred whilst processing the image.");return a},N=e.__addimage__.convertBase64ToBinaryString=function(e,t){t="boolean"!=typeof t||t;var n,r="";if("string"==typeof e){var i;n=null!==(i=_(e))&&void 0!==i?i:e;try{r=fu(n)}catch(e){if(t)throw w(n)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+e.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return r};e.getImageProperties=function(t){var r,o,s="";if(h(t)&&(t=f(t)),"string"==typeof t&&i(t)===n&&(""===(s=N(t,!1))&&(s=e.loadFile(t)||""),t=s),o=i(t),!d(o))throw new Error("addImage does not support files of type '"+o+"', please ensure that a plugin for '"+o+"' support is added.");if(t instanceof Uint8Array||(t=k(t)),!(r=this["process"+o.toUpperCase()](t)))throw new Error("An unknown error occurred whilst processing the image");return r.fileType=o,r}}(Mu.API),Ad=Mu.API,Nd=function(e){if(void 0!==e&&""!=e)return!0},Mu.API.events.push(["addPage",function(e){this.internal.getPageInfo(e.pageNumber).pageContext.annotations=[]}]),Ad.events.push(["putPage",function(e){for(var t,n,r,i=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,s=this.internal.getPageInfoByObjId(e.objId),a=e.pageContext.annotations,c=!1,l=0;l<a.length&&!c;l++)switch((t=a[l]).type){case"link":(Nd(t.options.url)||Nd(t.options.pageNumber))&&(c=!0);break;case"reference":case"text":case"freetext":c=!0}if(0!=c){this.internal.write("/Annots [");for(var u=0;u<a.length;u++){t=a[u];var d=this.internal.pdfEscape,h=this.internal.getEncryptor(e.objId);switch(t.type){case"reference":this.internal.write(" "+t.object.objId+" 0 R ");break;case"text":var f=this.internal.newAdditionalObject(),p=this.internal.newAdditionalObject(),m=this.internal.getEncryptor(f.objId),g=t.title||"Note";r="<</Type /Annot /Subtype /Text "+(n="/Rect ["+i(t.bounds.x)+" "+o(t.bounds.y+t.bounds.h)+" "+i(t.bounds.x+t.bounds.w)+" "+o(t.bounds.y)+"] ")+"/Contents ("+d(m(t.contents))+")",r+=" /Popup "+p.objId+" 0 R",r+=" /P "+s.objId+" 0 R",r+=" /T ("+d(m(g))+") >>",f.content=r;var b=f.objId+" 0 R";r="<</Type /Annot /Subtype /Popup "+(n="/Rect ["+i(t.bounds.x+30)+" "+o(t.bounds.y+t.bounds.h)+" "+i(t.bounds.x+t.bounds.w+30)+" "+o(t.bounds.y)+"] ")+" /Parent "+b,t.open&&(r+=" /Open true"),r+=" >>",p.content=r,this.internal.write(f.objId,"0 R",p.objId,"0 R");break;case"freetext":n="/Rect ["+i(t.bounds.x)+" "+o(t.bounds.y)+" "+i(t.bounds.x+t.bounds.w)+" "+o(t.bounds.y+t.bounds.h)+"] ";var v=t.color||"#000000";r="<</Type /Annot /Subtype /FreeText "+n+"/Contents ("+d(h(t.contents))+")",r+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+v+")",r+=" /Border [0 0 0]",r+=" >>",this.internal.write(r);break;case"link":if(t.options.name){var y=this.annotations._nameMap[t.options.name];t.options.pageNumber=y.page,t.options.top=y.y}else t.options.top||(t.options.top=0);if(n="/Rect ["+t.finalBounds.x+" "+t.finalBounds.y+" "+t.finalBounds.w+" "+t.finalBounds.h+"] ",r="",t.options.url)r="<</Type /Annot /Subtype /Link "+n+"/Border [0 0 0] /A <</S /URI /URI ("+d(h(t.options.url))+") >>";else if(t.options.pageNumber)switch(r="<</Type /Annot /Subtype /Link "+n+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(t.options.pageNumber).objId+" 0 R",t.options.magFactor=t.options.magFactor||"XYZ",t.options.magFactor){case"Fit":r+=" /Fit]";break;case"FitH":r+=" /FitH "+t.options.top+"]";break;case"FitV":t.options.left=t.options.left||0,r+=" /FitV "+t.options.left+"]";break;default:var w=o(t.options.top);t.options.left=t.options.left||0,void 0===t.options.zoom&&(t.options.zoom=0),r+=" /XYZ "+t.options.left+" "+w+" "+t.options.zoom+"]"}""!=r&&(r+=" >>",this.internal.write(r))}}this.internal.write("]")}}]),Ad.createAnnotation=function(e){var t=this.internal.getCurrentPageInfo();switch(e.type){case"link":this.link(e.bounds.x,e.bounds.y,e.bounds.w,e.bounds.h,e);break;case"text":case"freetext":t.pageContext.annotations.push(e)}},Ad.link=function(e,t,n,r,i){var o=this.internal.getCurrentPageInfo(),s=this.internal.getCoordinateString,a=this.internal.getVerticalCoordinateString;o.pageContext.annotations.push({finalBounds:{x:s(e),y:a(t),w:s(e+n),h:a(t+r)},options:i,type:"link"})},Ad.textWithLink=function(e,t,n,r){var i,o,s=this.getTextWidth(e),a=this.internal.getLineHeight()/this.internal.scaleFactor;if(void 0!==r.maxWidth){o=r.maxWidth;var c=this.splitTextToSize(e,o).length;i=Math.ceil(a*c)}else o=s,i=a;return this.text(e,t,n,r),n+=.2*a,"center"===r.align&&(t-=s/2),"right"===r.align&&(t-=s),this.link(t,n-a,o,i,r),s},Ad.getTextWidth=function(e){var t=this.internal.getFontSize();return this.getStringUnitWidth(e)*t/this.internal.scaleFactor},function(e){var t={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]},n={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}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];e.__arabicParser__={};var o=e.__arabicParser__.isInArabicSubstitutionA=function(e){return void 0!==t[e.charCodeAt(0)]},s=e.__arabicParser__.isArabicLetter=function(e){return"string"==typeof e&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(e)},a=e.__arabicParser__.isArabicEndLetter=function(e){return s(e)&&o(e)&&t[e.charCodeAt(0)].length<=2},c=e.__arabicParser__.isArabicAlfLetter=function(e){return s(e)&&i.indexOf(e.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(e){return s(e)&&o(e)&&t[e.charCodeAt(0)].length>=1};var l=e.__arabicParser__.arabicLetterHasFinalForm=function(e){return s(e)&&o(e)&&t[e.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(e){return s(e)&&o(e)&&t[e.charCodeAt(0)].length>=3};var u=e.__arabicParser__.arabicLetterHasMedialForm=function(e){return s(e)&&o(e)&&4==t[e.charCodeAt(0)].length},d=e.__arabicParser__.resolveLigatures=function(e){var t=0,r=n,i="",o=0;for(t=0;t<e.length;t+=1)void 0!==r[e.charCodeAt(t)]?(o++,"number"==typeof(r=r[e.charCodeAt(t)])&&(i+=String.fromCharCode(r),r=n,o=0),t===e.length-1&&(r=n,i+=e.charAt(t-(o-1)),t-=o-1,o=0)):(r=n,i+=e.charAt(t-o),t-=o,o=0);return i};e.__arabicParser__.isArabicDiacritic=function(e){return void 0!==e&&void 0!==r[e.charCodeAt(0)]};var h=e.__arabicParser__.getCorrectForm=function(e,t,n){return s(e)?!1===o(e)?-1:!l(e)||!s(t)&&!s(n)||!s(n)&&a(t)||a(e)&&!s(t)||a(e)&&c(t)||a(e)&&a(t)?0:u(e)&&s(t)&&!a(t)&&s(n)&&l(n)?3:a(e)||!s(n)?1:2:-1},f=function(e){var n=0,r=0,i=0,o="",a="",c="",l=(e=e||"").split("\\s+"),u=[];for(n=0;n<l.length;n+=1){for(u.push(""),r=0;r<l[n].length;r+=1)o=l[n][r],a=l[n][r-1],c=l[n][r+1],s(o)?(i=h(o,a,c),u[n]+=-1!==i?String.fromCharCode(t[o.charCodeAt(0)][i]):o):u[n]+=o;u[n]=d(u[n])}return u.join(" ")},p=e.__arabicParser__.processArabic=e.processArabic=function(){var e,t="string"==typeof arguments[0]?arguments[0]:arguments[0].text,n=[];if(Array.isArray(t)){var r=0;for(n=[],r=0;r<t.length;r+=1)Array.isArray(t[r])?n.push([f(t[r][0]),t[r][1],t[r][2]]):n.push([f(t[r])]);e=n}else e=f(t);return"string"==typeof arguments[0]?e:(arguments[0].text=e,arguments[0])};e.events.push(["preProcessText",p])}(Mu.API),Mu.API.autoPrint=function(e){var t;return(e=e||{}).variant=e.variant||"non-conform","javascript"===e.variant?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){t=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 "+t+" 0 R")})),this},function(e){var t=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:function(){return e},set:function(t){e=t}});var t=150;Object.defineProperty(this,"width",{get:function(){return t},set:function(e){t=isNaN(e)||!1===Number.isInteger(e)||e<0?150:e,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=t+1)}});var n=300;Object.defineProperty(this,"height",{get:function(){return n},set:function(e){n=isNaN(e)||!1===Number.isInteger(e)||e<0?300:e,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=n+1)}});var r=[];Object.defineProperty(this,"childNodes",{get:function(){return r},set:function(e){r=e}});var i={};Object.defineProperty(this,"style",{get:function(){return i},set:function(e){i=e}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(e,t){var n;if("2d"!==(e=e||"2d"))return null;for(n in t)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=t[n]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(Mu.API),function(e){var t={left:0,top:0,bottom:0,right:0},n=!1,r=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({},t),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new o,this.internal.__cell__.pages=1},o=function(){var e=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var t=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return t},set:function(e){t=e}});var n=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return n},set:function(e){n=e}});var r=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return r},set:function(e){r=e}});var i=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return i},set:function(e){i=e}});var o=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return o},set:function(e){o=e}});var s=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return s},set:function(e){s=e}}),this};o.prototype.clone=function(){return new o(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},o.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(e){return r.call(this),this.internal.__cell__.headerFunction="function"==typeof e?e:void 0,this},e.getTextDimensions=function(e,t){r.call(this);var n=(t=t||{}).fontSize||this.getFontSize(),i=t.font||this.getFont(),o=t.scaleFactor||this.internal.scaleFactor,s=0,a=0,c=0,l=this;if(!Array.isArray(e)&&"string"!=typeof e){if("number"!=typeof e)throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");e=String(e)}var u=t.maxWidth;u>0?"string"==typeof e?e=this.splitTextToSize(e,u):"[object Array]"===Object.prototype.toString.call(e)&&(e=e.reduce(function(e,t){return e.concat(l.splitTextToSize(t,u))},[])):e=Array.isArray(e)?e:[e];for(var d=0;d<e.length;d++)s<(c=this.getStringUnitWidth(e[d],{font:i})*n)&&(s=c);return 0!==s&&(a=e.length),{w:s/=o,h:Math.max((a*n*this.getLineHeightFactor()-n*(this.getLineHeightFactor()-1))/o,0)}},e.cellAddPage=function(){r.call(this),this.addPage();var e=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new o(e.left,e.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var s=e.cell=function(){var e;e=arguments[0]instanceof o?arguments[0]:new o(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),r.call(this);var i=this.internal.__cell__.lastCell,s=this.internal.__cell__.padding,a=this.internal.__cell__.margins||t,c=this.internal.__cell__.tableHeaderRow,l=this.internal.__cell__.printHeaders;return void 0!==i.lineNumber&&(i.lineNumber===e.lineNumber?(e.x=(i.x||0)+(i.width||0),e.y=i.y||0):i.y+i.height+e.height+a.bottom>this.getPageHeight()?(this.cellAddPage(),e.y=a.top,l&&c&&(this.printHeaderRow(e.lineNumber,!0),e.y+=c[0].height)):e.y=i.y+i.height||e.y),void 0!==e.text[0]&&(this.rect(e.x,e.y,e.width,e.height,!0===n?"FD":void 0),"right"===e.align?this.text(e.text,e.x+e.width-s,e.y+s,{align:"right",baseline:"top"}):"center"===e.align?this.text(e.text,e.x+e.width/2,e.y+s,{align:"center",baseline:"top",maxWidth:e.width-s-s}):this.text(e.text,e.x+s,e.y+s,{align:"left",baseline:"top",maxWidth:e.width-s-s})),this.internal.__cell__.lastCell=e,this};e.table=function(e,n,c,l,u){if(r.call(this),!c)throw new Error("No data for PDF table.");var d,h,f,p,m=[],g=[],b=[],v={},y={},w=[],_=[],x=(u=u||{}).autoSize||!1,k=!1!==u.printHeaders,S=u.css&&void 0!==u.css["font-size"]?16*u.css["font-size"]:u.fontSize||12,A=u.margins||Object.assign({width:this.getPageWidth()},t),N="number"==typeof u.padding?u.padding:3,L=u.headerBackgroundColor||"#c8c8c8",P=u.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=k,this.internal.__cell__.margins=A,this.internal.__cell__.table_font_size=S,this.internal.__cell__.padding=N,this.internal.__cell__.headerBackgroundColor=L,this.internal.__cell__.headerTextColor=P,this.setFontSize(S),null==l)g=m=Object.keys(c[0]),b=m.map(function(){return"left"});else if(Array.isArray(l)&&"object"===(0,xo.A)(l[0]))for(m=l.map(function(e){return e.name}),g=l.map(function(e){return e.prompt||e.name||""}),b=l.map(function(e){return e.align||"left"}),d=0;d<l.length;d+=1)y[l[d].name]=.7499990551181103*l[d].width;else Array.isArray(l)&&"string"==typeof l[0]&&(g=m=l,b=m.map(function(){return"left"}));if(x||Array.isArray(l)&&"string"==typeof l[0])for(d=0;d<m.length;d+=1){for(v[p=m[d]]=c.map(function(e){return e[p]}),this.setFont(void 0,"bold"),w.push(this.getTextDimensions(g[d],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),h=v[p],this.setFont(void 0,"normal"),f=0;f<h.length;f+=1)w.push(this.getTextDimensions(h[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);y[p]=Math.max.apply(null,w)+N+N,w=[]}if(k){var C={};for(d=0;d<m.length;d+=1)C[m[d]]={},C[m[d]].text=g[d],C[m[d]].align=b[d];var E=a.call(this,C,y);_=m.map(function(t){return new o(e,n,y[t],E,C[t].text,void 0,C[t].align)}),this.setTableHeaderRow(_),this.printHeaderRow(1,!1)}var I=l.reduce(function(e,t){return e[t.name]=t.align,e},{});for(d=0;d<c.length;d+=1){"rowStart"in u&&u.rowStart instanceof Function&&u.rowStart({row:d,data:c[d]},this);var O=a.call(this,c[d],y);for(f=0;f<m.length;f+=1){var j=c[d][m[f]];"cellStart"in u&&u.cellStart instanceof Function&&u.cellStart({row:d,col:f,data:j},this),s.call(this,new o(e,n,y[m[f]],O,j,d+2,I[m[f]]))}}return this.internal.__cell__.table_x=e,this.internal.__cell__.table_y=n,this};var a=function(e,t){var n=this.internal.__cell__.padding,r=this.internal.__cell__.table_font_size,i=this.internal.scaleFactor;return Object.keys(e).map(function(r){var i=e[r];return this.splitTextToSize(i.hasOwnProperty("text")?i.text:i,t[r]-n-n)},this).map(function(e){return this.getLineHeightFactor()*e.length*r/i+n+n},this).reduce(function(e,t){return Math.max(e,t)},0)};e.setTableHeaderRow=function(e){r.call(this),this.internal.__cell__.tableHeaderRow=e},e.printHeaderRow=function(e,t){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var i;if(n=!0,"function"==typeof this.internal.__cell__.headerFunction){var a=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new o(a[0],a[1],a[2],a[3],void 0,-1)}this.setFont(void 0,"bold");for(var c=[],l=0;l<this.internal.__cell__.tableHeaderRow.length;l+=1){i=this.internal.__cell__.tableHeaderRow[l].clone(),t&&(i.y=this.internal.__cell__.margins.top||0,c.push(i)),i.lineNumber=e;var u=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),s.call(this,i),this.setTextColor(u)}c.length>0&&this.setTableHeaderRow(c),this.setFont(void 0,"normal"),n=!1}}(Mu.API);var Cd={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},Ed=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Id=Pd(Ed),Od=[100,200,300,400,500,600,700,800,900],jd=Pd(Od);function zd(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),n=function(e){return Cd[e=e||"normal"]?e:"normal"}(e.style),r=function(e){return e?"number"==typeof e?e>=100&&e<=900&&e%100==0?e:400:/^\d00$/.test(e)?parseInt(e):"bold"===e?700:400:400}(e.weight),i=function(e){return"number"==typeof Id[e=e||"normal"]?e:"normal"}(e.stretch);return{family:t,style:n,weight:r,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,n,r].join(" ")}}}function Fd(e,t,n,r){var i;for(i=n;i>=0&&i<t.length;i+=r)if(e[t[i]])return e[t[i]];for(i=n;i>=0&&i<t.length;i-=r)if(e[t[i]])return e[t[i]]}var Td={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Rd={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Md(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function Dd(e){return e.trimLeft()}function Bd(e,t){for(var n=0;n<e.length;){if(e.charAt(n)===t)return[e.substring(0,n),e.substring(n+1)];n+=1}return null}function qd(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return null===t?null:[t[0],e.substring(t[0].length)]}var Ud,$d,Wd,Zd,Hd,Vd=["times"];function Gd(e,t,n,r,i){var o=4,s=Yd;switch(i){case Mu.API.image_compression.FAST:o=1,s=Kd;break;case Mu.API.image_compression.MEDIUM:o=6,s=Xd;break;case Mu.API.image_compression.SLOW:o=9,s=Qd}e=function(e,t,n,r){for(var i,o=e.length/t,s=new Uint8Array(e.length+o),a=[Jd,Kd,Yd,Xd,Qd],c=0;c<o;c+=1){var l=c*t,u=e.subarray(l,l+t);if(r)s.set(r(u,n,i),l+c);else{for(var d=a.length,h=[],f=0;f<d;f+=1)h[f]=a[f](u,n,i);var p=th(h.concat());s.set(h[p],l+c)}i=u}return s}(e,t,Math.ceil(n*r/8),s);var a=rs(e,{level:o});return Mu.API.__addimage__.arrayBufferToBinaryString(a)}function Jd(e){var t=Array.apply([],e);return t.unshift(0),t}function Kd(e,t){var n=e.length,r=[];r[0]=1;for(var i=0;i<n;i+=1){var o=e[i-t]||0;r[i+1]=e[i]-o+256&255}return r}function Yd(e,t,n){var r=e.length,i=[];i[0]=2;for(var o=0;o<r;o+=1){var s=n&&n[o]||0;i[o+1]=e[o]-s+256&255}return i}function Xd(e,t,n){var r=e.length,i=[];i[0]=3;for(var o=0;o<r;o+=1){var s=e[o-t]||0,a=n&&n[o]||0;i[o+1]=e[o]+256-(s+a>>>1)&255}return i}function Qd(e,t,n){var r=e.length,i=[];i[0]=4;for(var o=0;o<r;o+=1){var s=eh(e[o-t]||0,n&&n[o]||0,n&&n[o-t]||0);i[o+1]=e[o]-s+256&255}return i}function eh(e,t,n){if(e===t&&t===n)return e;var r=Math.abs(t-n),i=Math.abs(e-n),o=Math.abs(e+t-n-n);return r<=i&&r<=o?e:i<=o?t:n}function th(e){var t=e.map(function(e){return e.reduce(function(e,t){return e+Math.abs(t)},0)});return t.indexOf(Math.min.apply(null,t))}function nh(e,t,n){var r=t*n,i=Math.floor(r/8),o=16-(r-8*i+n),s=(1<<n)-1;return ih(e,i)>>o&s}function rh(e,t,n,r){var i=n*r,o=Math.floor(i/8),s=16-(i-8*o+r),a=(1<<r)-1,c=(t&a)<<s;!function(e,t,n){if(t+1<e.byteLength)e.setUint16(t,n,!1);else{var r=n>>8&255;e.setUint8(t,r)}}(e,o,ih(e,o)&~(a<<s)&65535|c)}function ih(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function oh(e){var t=0;if(71!==e[t++]||73!==e[t++]||70!==e[t++]||56!==e[t++]||56!=(e[t++]+1&253)||97!==e[t++])throw new Error("Invalid GIF 87a/89a header.");var n=e[t++]|e[t++]<<8,r=e[t++]|e[t++]<<8,i=e[t++],o=i>>7,s=1<<1+(7&i);e[t++],e[t++];var a=null,c=null;o&&(a=t,c=s,t+=3*s);var l=!0,u=[],d=0,h=null,f=0,p=null;for(this.width=n,this.height=r;l&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(11!==e[t]||78==e[t+1]&&69==e[t+2]&&84==e[t+3]&&83==e[t+4]&&67==e[t+5]&&65==e[t+6]&&80==e[t+7]&&69==e[t+8]&&50==e[t+9]&&46==e[t+10]&&48==e[t+11]&&3==e[t+12]&&1==e[t+13]&&0==e[t+16])t+=14,p=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((L=e[t++])>=0))throw Error("Invalid block size");if(0===L)break;t+=L}break;case 249:if(4!==e[t++]||0!==e[t+4])throw new Error("Invalid graphics extension block.");var m=e[t++];d=e[t++]|e[t++]<<8,h=e[t++],1&m||(h=null),f=m>>2&7,t++;break;case 254:for(;;){if(!((L=e[t++])>=0))throw Error("Invalid block size");if(0===L)break;t+=L}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var g=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,v=e[t++]|e[t++]<<8,y=e[t++]|e[t++]<<8,w=e[t++],_=w>>6&1,x=1<<1+(7&w),k=a,S=c,A=!1;w>>7&&(A=!0,k=t,S=x,t+=3*x);var N=t;for(t++;;){var L;if(!((L=e[t++])>=0))throw Error("Invalid block size");if(0===L)break;t+=L}u.push({x:g,y:b,width:v,height:y,has_local_palette:A,palette_offset:k,palette_size:S,data_offset:N,data_length:t-N,transparent_index:h,interlaced:!!_,delay:d,disposal:f});break;case 59:l=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return u.length},this.loopCount=function(){return p},this.frameInfo=function(e){if(e<0||e>=u.length)throw new Error("Frame index out of range.");return u[e]},this.decodeAndBlitFrameBGRA=function(t,r){var i=this.frameInfo(t),o=i.width*i.height;if(o>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var s=new Uint8Array(o);sh(e,i.data_offset,s,o);var a=i.palette_offset,c=i.transparent_index;null===c&&(c=256);var l=i.width,u=n-l,d=l,h=4*(i.y*n+i.x),f=4*((i.y+i.height)*n+i.x),p=h,m=4*u;!0===i.interlaced&&(m+=4*n*7);for(var g=8,b=0,v=s.length;b<v;++b){var y=s[b];if(0===d&&(d=l,(p+=m)>=f&&(m=4*u+4*n*(g-1),p=h+(l+u)*(g<<1),g>>=1)),y===c)p+=4;else{var w=e[a+3*y],_=e[a+3*y+1],x=e[a+3*y+2];r[p++]=x,r[p++]=_,r[p++]=w,r[p++]=255}--d}},this.decodeAndBlitFrameRGBA=function(t,r){var i=this.frameInfo(t),o=i.width*i.height;if(o>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var s=new Uint8Array(o);sh(e,i.data_offset,s,o);var a=i.palette_offset,c=i.transparent_index;null===c&&(c=256);var l=i.width,u=n-l,d=l,h=4*(i.y*n+i.x),f=4*((i.y+i.height)*n+i.x),p=h,m=4*u;!0===i.interlaced&&(m+=4*n*7);for(var g=8,b=0,v=s.length;b<v;++b){var y=s[b];if(0===d&&(d=l,(p+=m)>=f&&(m=4*u+4*n*(g-1),p=h+(l+u)*(g<<1),g>>=1)),y===c)p+=4;else{var w=e[a+3*y],_=e[a+3*y+1],x=e[a+3*y+2];r[p++]=w,r[p++]=_,r[p++]=x,r[p++]=255}--d}}}function sh(e,t,n,r){for(var i=e[t++],o=1<<i,s=o+1,a=s+1,c=i+1,l=(1<<c)-1,u=0,d=0,h=0,f=e[t++],p=new Int32Array(4096),m=null;;){for(;u<16&&0!==f;)d|=e[t++]<<u,u+=8,1===f?f=e[t++]:--f;if(u<c)break;var g=d&l;if(d>>=c,u-=c,g!==o){if(g===s)break;for(var b=g<a?g:m,v=0,y=b;y>o;)y=p[y]>>8,++v;var w=y;if(h+v+(b!==g?1:0)>r)return void au.log("Warning, gif stream longer than expected.");n[h++]=w;var _=h+=v;for(b!==g&&(n[h++]=w),y=b;v--;)y=p[y],n[--_]=255&y,y>>=8;null!==m&&a<4096&&(p[a++]=m<<8|w,a>=l+1&&c<12&&(++c,l=l<<1|1)),m=g}else a=s+1,l=(1<<(c=i+1))-1,m=null}return h!==r&&au.log("Warning, gif stream shorter than expected."),n}function ah(e){var t,n,r,i,o,s=Math.floor,a=new Array(64),c=new Array(64),l=new Array(64),u=new Array(64),d=new Array(65535),h=new Array(65535),f=new Array(64),p=new Array(64),m=[],g=0,b=7,v=new Array(64),y=new Array(64),w=new Array(64),_=new Array(256),x=new Array(2048),k=[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],S=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],A=[0,1,2,3,4,5,6,7,8,9,10,11],N=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],L=[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],P=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],C=[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 O(e,t){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var s=1;s<=e[o];s++)i[t[r]]=[],i[t[r]][0]=n,i[t[r]][1]=o,r++,n++;n*=2}return i}function j(e){for(var t=e[0],n=e[1]-1;n>=0;)t&1<<n&&(g|=1<<b),n--,--b<0&&(255==g?(z(255),z(0)):z(g),b=7,g=0)}function z(e){m.push(e)}function F(e){z(e>>8&255),z(255&e)}function T(e,t,n,r,i){for(var o,s=i[0],a=i[240],c=function(e,t){var n,r,i,o,s,a,c,l,u,d,h=0;for(u=0;u<8;++u){n=e[h],r=e[h+1],i=e[h+2],o=e[h+3],s=e[h+4],a=e[h+5],c=e[h+6];var p=n+(l=e[h+7]),m=n-l,g=r+c,b=r-c,v=i+a,y=i-a,w=o+s,_=o-s,x=p+w,k=p-w,S=g+v,A=g-v;e[h]=x+S,e[h+4]=x-S;var N=.707106781*(A+k);e[h+2]=k+N,e[h+6]=k-N;var L=.382683433*((x=_+y)-(A=b+m)),P=.5411961*x+L,C=1.306562965*A+L,E=.707106781*(S=y+b),I=m+E,O=m-E;e[h+5]=O+P,e[h+3]=O-P,e[h+1]=I+C,e[h+7]=I-C,h+=8}for(h=0,u=0;u<8;++u){n=e[h],r=e[h+8],i=e[h+16],o=e[h+24],s=e[h+32],a=e[h+40],c=e[h+48];var j=n+(l=e[h+56]),z=n-l,F=r+c,T=r-c,R=i+a,M=i-a,D=o+s,B=o-s,q=j+D,U=j-D,$=F+R,W=F-R;e[h]=q+$,e[h+32]=q-$;var Z=.707106781*(W+U);e[h+16]=U+Z,e[h+48]=U-Z;var H=.382683433*((q=B+M)-(W=T+z)),V=.5411961*q+H,G=1.306562965*W+H,J=.707106781*($=M+T),K=z+J,Y=z-J;e[h+40]=Y+V,e[h+24]=Y-V,e[h+8]=K+G,e[h+56]=K-G,h++}for(u=0;u<64;++u)d=e[u]*t[u],f[u]=d>0?d+.5|0:d-.5|0;return f}(e,t),l=0;l<64;++l)p[k[l]]=c[l];var u=p[0]-n;n=p[0],0==u?j(r[0]):(j(r[h[o=32767+u]]),j(d[o]));for(var m=63;m>0&&0==p[m];)m--;if(0==m)return j(s),n;for(var g,b=1;b<=m;){for(var v=b;0==p[b]&&b<=m;)++b;var y=b-v;if(y>=16){g=y>>4;for(var w=1;w<=g;++w)j(a);y&=15}o=32767+p[b],j(i[(y<<4)+h[o]]),j(d[o]),b++}return 63!=m&&j(s),n}function R(e){e=Math.min(Math.max(e,1),100),o!=e&&(function(e){for(var t=[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=s((t[n]*e+50)/100);r=Math.min(Math.max(r,1),255),a[k[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],o=0;o<64;o++){var d=s((i[o]*e+50)/100);d=Math.min(Math.max(d,1),255),c[k[o]]=d}for(var h=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],f=0,p=0;p<8;p++)for(var m=0;m<8;m++)l[f]=1/(a[k[f]]*h[p]*h[m]*8),u[f]=1/(c[k[f]]*h[p]*h[m]*8),f++}(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),o=e)}this.encode=function(e,o){o&&R(o),m=new Array,g=0,b=7,F(65496),F(65504),F(16),z(74),z(70),z(73),z(70),z(0),z(1),z(1),z(0),F(1),F(1),z(0),z(0),function(){F(65499),F(132),z(0);for(var e=0;e<64;e++)z(a[e]);z(1);for(var t=0;t<64;t++)z(c[t])}(),function(e,t){F(65472),F(17),z(8),F(t),F(e),z(3),z(1),z(17),z(0),z(2),z(17),z(1),z(3),z(17),z(1)}(e.width,e.height),function(){F(65476),F(418),z(0);for(var e=0;e<16;e++)z(S[e+1]);for(var t=0;t<=11;t++)z(A[t]);z(16);for(var n=0;n<16;n++)z(N[n+1]);for(var r=0;r<=161;r++)z(L[r]);z(1);for(var i=0;i<16;i++)z(P[i+1]);for(var o=0;o<=11;o++)z(C[o]);z(17);for(var s=0;s<16;s++)z(E[s+1]);for(var a=0;a<=161;a++)z(I[a])}(),F(65498),F(12),z(3),z(1),z(0),z(2),z(17),z(3),z(17),z(0),z(63),z(0);var s=0,d=0,h=0;g=0,b=7,this.encode.displayName="_encode_";for(var f,p,_,k,O,M,D,B,q,U=e.data,$=e.width,W=e.height,Z=4*$,H=0;H<W;){for(f=0;f<Z;){for(O=Z*H+f,D=-1,B=0,q=0;q<64;q++)M=O+(B=q>>3)*Z+(D=4*(7&q)),H+B>=W&&(M-=Z*(H+1+B-W)),f+D>=Z&&(M-=f+D-Z+4),p=U[M++],_=U[M++],k=U[M++],v[q]=(x[p]+x[_+256|0]+x[k+512|0]>>16)-128,y[q]=(x[p+768|0]+x[_+1024|0]+x[k+1280|0]>>16)-128,w[q]=(x[p+1280|0]+x[_+1536|0]+x[k+1792|0]>>16)-128;s=T(v,l,s,t,r),d=T(y,u,d,n,i),h=T(w,u,h,n,i),f+=32}H+=8}if(b>=0){var V=[];V[1]=b+1,V[0]=(1<<b+1)-1,j(V)}return F(65497),new Uint8Array(m)},e=e||50,function(){for(var e=String.fromCharCode,t=0;t<256;t++)_[t]=e(t)}(),t=O(S,A),n=O(P,C),r=O(N,L),i=O(E,I),function(){for(var e=1,t=2,n=1;n<=15;n++){for(var r=e;r<t;r++)h[32767+r]=n,d[32767+r]=[],d[32767+r][1]=n,d[32767+r][0]=r;for(var i=-(t-1);i<=-e;i++)h[32767+i]=n,d[32767+i]=[],d[32767+i][1]=n,d[32767+i][0]=t-1+i;e<<=1,t<<=1}}(),function(){for(var e=0;e<256;e++)x[e]=19595*e,x[e+256|0]=38470*e,x[e+512|0]=7471*e+32768,x[e+768|0]=-11059*e,x[e+1024|0]=-21709*e,x[e+1280|0]=32768*e+8421375,x[e+1536|0]=-27439*e,x[e+1792|0]=-5329*e}(),R(e)}function ch(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,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 new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function lh(e){function t(e){if(!e)throw Error("assert :P")}function n(e,t,n){for(var r=0;4>r;r++)if(e[t+r]!=n.charCodeAt(r))return!0;return!1}function r(e,t,n,r,i){for(var o=0;o<i;o++)e[t+o]=n[r+o]}function i(e,t,n,r){for(var i=0;i<r;i++)e[t+i]=n}function o(e){return new Int32Array(e)}function s(e,t){for(var n=[],r=0;r<e;r++)n.push(new t);return n}function a(e,t){var n=[];return function e(n,r,i){for(var o=i[r],s=0;s<o&&(n.push(i.length>r+1?[]:new t),!(i.length<r+1));s++)e(n[s],r+1,i)}(n,0,e),n}var c=function(){var e=this;function c(e,t){for(var n=1<<t-1>>>0;e&n;)n>>>=1;return n?(e&n-1)+n:e}function l(e,n,r,i,o){t(!(i%r));do{e[n+(i-=r)]=o}while(0<i)}function u(e,n,r,i,s){if(t(2328>=s),512>=s)var a=o(512);else if(null==(a=o(s)))return 0;return function(e,n,r,i,s,a){var u,h,f=n,p=1<<r,m=o(16),g=o(16);for(t(0!=s),t(null!=i),t(null!=e),t(0<r),h=0;h<s;++h){if(15<i[h])return 0;++m[i[h]]}if(m[0]==s)return 0;for(g[1]=0,u=1;15>u;++u){if(m[u]>1<<u)return 0;g[u+1]=g[u]+m[u]}for(h=0;h<s;++h)u=i[h],0<i[h]&&(a[g[u]++]=h);if(1==g[15])return(i=new d).g=0,i.value=a[0],l(e,f,1,p,i),p;var b,v=-1,y=p-1,w=0,_=1,x=1,k=1<<r;for(h=0,u=1,s=2;u<=r;++u,s<<=1){if(_+=x<<=1,0>(x-=m[u]))return 0;for(;0<m[u];--m[u])(i=new d).g=u,i.value=a[h++],l(e,f+w,s,k,i),w=c(w,u)}for(u=r+1,s=2;15>=u;++u,s<<=1){if(_+=x<<=1,0>(x-=m[u]))return 0;for(;0<m[u];--m[u]){if(i=new d,(w&y)!=v){for(f+=k,b=1<<(v=u)-r;15>v&&!(0>=(b-=m[v]));)++v,b<<=1;p+=k=1<<(b=v-r),e[n+(v=w&y)].g=b+r,e[n+v].value=f-n-v}i.g=u-r,i.value=a[h++],l(e,f+(w>>r),s,k,i),w=c(w,u)}}return _!=2*g[15]-1?0:p}(e,n,r,i,s,a)}function d(){this.value=this.g=0}function h(){this.value=this.g=0}function f(){this.G=s(5,d),this.H=o(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=s(Dn,h)}function p(e,n,r,i){t(null!=e),t(null!=n),t(2147483648>i),e.Ca=254,e.I=0,e.b=-8,e.Ka=0,e.oa=n,e.pa=r,e.Jd=n,e.Yc=r+i,e.Zc=4<=i?r+i-4+1:r,N(e)}function m(e,t){for(var n=0;0<t--;)n|=P(e,128)<<t;return n}function g(e,t){var n=m(e,t);return L(e)?-n:n}function b(e,n,r,i){var o,s=0;for(t(null!=e),t(null!=n),t(4294967288>i),e.Sb=i,e.Ra=0,e.u=0,e.h=0,4<i&&(i=4),o=0;o<i;++o)s+=n[r+o]<<8*o;e.Ra=s,e.bb=i,e.oa=n,e.pa=r}function v(e){for(;8<=e.u&&e.bb<e.Sb;)e.Ra>>>=8,e.Ra+=e.oa[e.pa+e.bb]<<Un-8>>>0,++e.bb,e.u-=8;k(e)&&(e.h=1,e.u=0)}function y(e,n){if(t(0<=n),!e.h&&n<=qn){var r=x(e)&Bn[n];return e.u+=n,v(e),r}return e.h=1,e.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(e){return e.Ra>>>(e.u&Un-1)>>>0}function k(e){return t(e.bb<=e.Sb),e.h||e.bb==e.Sb&&e.u>Un}function S(e,t){e.u=t,e.h=k(e)}function A(e){e.u>=$n&&(t(e.u>=$n),v(e))}function N(e){t(null!=e&&null!=e.oa),e.pa<e.Zc?(e.I=(e.oa[e.pa++]|e.I<<8)>>>0,e.b+=8):(t(null!=e&&null!=e.oa),e.pa<e.Yc?(e.b+=8,e.I=e.oa[e.pa++]|e.I<<8):e.Ka?e.b=0:(e.I<<=8,e.b+=8,e.Ka=1))}function L(e){return m(e,1)}function P(e,t){var n=e.Ca;0>e.b&&N(e);var r=e.b,i=n*t>>>8,o=(e.I>>>r>i)+0;for(o?(n-=i,e.I-=i+1<<r>>>0):n=i+1,r=n,i=0;256<=r;)i+=8,r>>=8;return r=7^i+Wn[r],e.b-=r,e.Ca=(n<<r)-1,o}function C(e,t,n){e[t+0]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}function E(e,t){return e[t+0]|e[t+1]<<8}function I(e,t){return E(e,t)|e[t+2]<<16}function O(e,t){return E(e,t)|E(e,t+2)<<16}function j(e,n){var r=1<<n;return t(null!=e),t(0<n),e.X=o(r),null==e.X?0:(e.Mb=32-n,e.Xa=n,1)}function z(e,n){t(null!=e),t(null!=n),t(e.Xa==n.Xa),r(n.X,0,e.X,0,1<<n.Xa)}function F(){this.X=[],this.Xa=this.Mb=0}function T(e,n,r,i){t(null!=r),t(null!=i);var o=r[0],s=i[0];return 0==o&&(o=(e*s+n/2)/n),0==s&&(s=(n*o+e/2)/e),0>=o||0>=s?0:(r[0]=o,i[0]=s,1)}function R(e,t){return e+(1<<t)-1>>>t}function M(e,t){return((4278255360&e)+(4278255360&t)>>>0&4278255360)+((16711935&e)+(16711935&t)>>>0&16711935)>>>0}function D(t,n){e[n]=function(n,r,i,o,s,a,c){var l;for(l=0;l<s;++l){var u=e[t](a[c+l-1],i,o+l);a[c+l]=M(n[r+l],u)}}}function B(){this.ud=this.hd=this.jd=0}function q(e,t){return((4278124286&(e^t))>>>1)+(e&t)>>>0}function U(e){return 0<=e&&256>e?e:0>e?0:255<e?255:void 0}function $(e,t){return U(e+(e-t+.5>>1))}function W(e,t,n){return Math.abs(t-n)-Math.abs(e-n)}function Z(e,t,n,r,i,o,s){for(r=o[s-1],n=0;n<i;++n)o[s+n]=r=M(e[t+n],r)}function H(e,t,n,r,i){var o;for(o=0;o<n;++o){var s=e[t+o],a=s>>8&255,c=16711935&(c=(c=16711935&s)+((a<<16)+a));r[i+o]=(4278255360&s)+c>>>0}}function V(e,t){t.jd=255&e,t.hd=e>>8&255,t.ud=e>>16&255}function G(e,t,n,r,i,o){var s;for(s=0;s<r;++s){var a=t[n+s],c=a>>>8,l=a,u=255&(u=(u=a>>>16)+((e.jd<<24>>24)*(c<<24>>24)>>>5));l=255&(l=(l+=(e.hd<<24>>24)*(c<<24>>24)>>>5)+((e.ud<<24>>24)*(u<<24>>24)>>>5)),i[o+s]=(4278255360&a)+(u<<16)+l}}function J(t,n,r,i,o){e[n]=function(e,t,n,r,s,a,c,l,u){for(r=c;r<l;++r)for(c=0;c<u;++c)s[a++]=o(n[i(e[t++])])},e[t]=function(t,n,s,a,c,l,u){var d=8>>t.b,h=t.Ea,f=t.K[0],p=t.w;if(8>d)for(t=(1<<t.b)-1,p=(1<<d)-1;n<s;++n){var m,g=0;for(m=0;m<h;++m)m&t||(g=i(a[c++])),l[u++]=o(f[g&p]),g>>=d}else e["VP8LMapColor"+r](a,c,f,p,l,u,n,s,h)}}function K(e,t,n,r,i){for(n=t+n;t<n;){var o=e[t++];r[i++]=o>>16&255,r[i++]=o>>8&255,r[i++]=255&o}}function Y(e,t,n,r,i){for(n=t+n;t<n;){var o=e[t++];r[i++]=o>>16&255,r[i++]=o>>8&255,r[i++]=255&o,r[i++]=o>>24&255}}function X(e,t,n,r,i){for(n=t+n;t<n;){var o=(s=e[t++])>>16&240|s>>12&15,s=240&s|s>>28&15;r[i++]=o,r[i++]=s}}function Q(e,t,n,r,i){for(n=t+n;t<n;){var o=(s=e[t++])>>16&248|s>>13&7,s=s>>5&224|s>>3&31;r[i++]=o,r[i++]=s}}function ee(e,t,n,r,i){for(n=t+n;t<n;){var o=e[t++];r[i++]=255&o,r[i++]=o>>8&255,r[i++]=o>>16&255}}function te(e,t,n,i,o,s){if(0==s)for(n=t+n;t<n;)C(i,((s=e[t++])[0]>>24|s[1]>>8&65280|s[2]<<8&16711680|s[3]<<24)>>>0),o+=32;else r(i,o,e,t,n)}function ne(t,n){e[n][0]=e[t+"0"],e[n][1]=e[t+"1"],e[n][2]=e[t+"2"],e[n][3]=e[t+"3"],e[n][4]=e[t+"4"],e[n][5]=e[t+"5"],e[n][6]=e[t+"6"],e[n][7]=e[t+"7"],e[n][8]=e[t+"8"],e[n][9]=e[t+"9"],e[n][10]=e[t+"10"],e[n][11]=e[t+"11"],e[n][12]=e[t+"12"],e[n][13]=e[t+"13"],e[n][14]=e[t+"0"],e[n][15]=e[t+"0"]}function re(e){return e==Ur||e==$r||e==Wr||e==Zr}function ie(){this.eb=[],this.size=this.A=this.fb=0}function oe(){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 se(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new ie,this.f.kb=new oe,this.sd=null}function ae(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function ce(){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 le(e){return alert("todo:WebPSamplerProcessPlane"),e.T}function ue(e,t){var n=e.T,i=t.ba.f.RGBA,o=i.eb,s=i.fb+e.ka*i.A,a=gi[t.ba.S],c=e.y,l=e.O,u=e.f,d=e.N,h=e.ea,f=e.W,p=t.cc,m=t.dc,g=t.Mc,b=t.Nc,v=e.ka,y=e.ka+e.T,w=e.U,_=w+1>>1;for(0==v?a(c,l,null,null,u,d,h,f,u,d,h,f,o,s,null,null,w):(a(t.ec,t.fc,c,l,p,m,g,b,u,d,h,f,o,s-i.A,o,s,w),++n);v+2<y;v+=2)p=u,m=d,g=h,b=f,d+=e.Rc,f+=e.Rc,s+=2*i.A,a(c,(l+=2*e.fa)-e.fa,c,l,p,m,g,b,u,d,h,f,o,s-i.A,o,s,w);return l+=e.fa,e.j+y<e.o?(r(t.ec,t.fc,c,l,w),r(t.cc,t.dc,u,d,_),r(t.Mc,t.Nc,h,f,_),n--):1&y||a(c,l,null,null,u,d,h,f,u,d,h,f,o,s+i.A,null,null,w),n}function de(e,n,r){var i=e.F,o=[e.J];if(null!=i){var s=e.U,a=n.ba.S,c=a==Dr||a==Wr;n=n.ba.f.RGBA;var l=[0],u=e.ka;l[0]=e.T,e.Kb&&(0==u?--l[0]:(--u,o[0]-=e.width),e.j+e.ka+e.T==e.o&&(l[0]=e.o-e.j-u));var d=n.eb;u=n.fb+u*n.A,e=Ar(i,o[0],e.width,s,l,d,u+(c?0:3),n.A),t(r==l),e&&re(a)&&kr(d,u,c,s,l,n.A)}return 0}function he(e){var t=e.ma,n=t.ba.S,r=11>n,i=n==Tr||n==Mr||n==Dr||n==Br||12==n||re(n);if(t.memory=null,t.Ib=null,t.Jb=null,t.Nd=null,!Tn(t.Oa,e,i?11:12))return 0;if(i&&re(n)&&vn(),e.da)alert("todo:use_scaling");else{if(r){if(t.Ib=le,e.Kb){if(n=e.U+1>>1,t.memory=o(e.U+2*n),null==t.memory)return 0;t.ec=t.memory,t.fc=0,t.cc=t.ec,t.dc=t.fc+e.U,t.Mc=t.cc,t.Nc=t.dc+n,t.Ib=ue,vn()}}else alert("todo:EmitYUV");i&&(t.Jb=de,r&&gn())}if(r&&!Ei){for(e=0;256>e;++e)Ii[e]=89858*(e-128)+Ai>>Si,zi[e]=-22014*(e-128)+Ai,ji[e]=-45773*(e-128),Oi[e]=113618*(e-128)+Ai>>Si;for(e=Ni;e<Li;++e)t=76283*(e-16)+Ai>>Si,Fi[e-Ni]=Ze(t,255),Ti[e-Ni]=Ze(t+8>>4,15);Ei=1}return 1}function fe(e){var n=e.ma,r=e.U,i=e.T;return t(!(1&e.ka)),0>=r||0>=i?0:(r=n.Ib(e,n),null!=n.Jb&&n.Jb(e,n,r),n.Dc+=r,1)}function pe(e){e.ma.memory=null}function me(e,t,n,r){return 47!=y(e,8)?0:(t[0]=y(e,14)+1,n[0]=y(e,14)+1,r[0]=y(e,1),0!=y(e,3)?0:!e.h)}function ge(e,t){if(4>e)return e+1;var n=e-2>>1;return(2+(1&e)<<n)+y(t,n)+1}function be(e,t){return 120<t?t-120:1<=(n=((n=Yr[t-1])>>4)*e+(8-(15&n)))?n:1;var n}function ve(e,t,n){var r=x(n),i=e[t+=255&r].g-8;return 0<i&&(S(n,n.u+8),r=x(n),t+=e[t].value,t+=r&(1<<i)-1),S(n,n.u+e[t].g),e[t].value}function ye(e,n,r){return r.g+=e.g,r.value+=e.value<<n>>>0,t(8>=r.g),e.g}function we(e,n,r){var i=e.xc;return t((n=0==i?0:e.vc[e.md*(r>>i)+(n>>i)])<e.Wb),e.Ya[n]}function _e(e,n,i,o){var s=e.ab,a=e.c*n,c=e.C;n=c+n;var l=i,u=o;for(o=e.Ta,i=e.Ua;0<s--;){var d=e.gc[s],h=c,f=n,p=l,m=u,g=(u=o,l=i,d.Ea);switch(t(h<f),t(f<=d.nc),d.hc){case 2:Vn(p,m,(f-h)*g,u,l);break;case 0:var b=h,v=f,y=u,w=l,_=(N=d).Ea;0==b&&(Zn(p,m,null,null,1,y,w),Z(p,m+1,0,0,_-1,y,w+1),m+=_,w+=_,++b);for(var x=1<<N.b,k=x-1,S=R(_,N.b),A=N.K,N=N.w+(b>>N.b)*S;b<v;){var L=A,P=N,C=1;for(Hn(p,m,y,w-_,1,y,w);C<_;){var E=(C&~k)+x;E>_&&(E=_),(0,Xn[L[P++]>>8&15])(p,m+ +C,y,w+C-_,E-C,y,w+C),C=E}m+=_,w+=_,++b&k||(N+=S)}f!=d.nc&&r(u,l-g,u,l+(f-h-1)*g,g);break;case 1:for(g=p,v=m,_=(p=d.Ea)-(w=p&~(y=(m=1<<d.b)-1)),b=R(p,d.b),x=d.K,d=d.w+(h>>d.b)*b;h<f;){for(k=x,S=d,A=new B,N=v+w,L=v+p;v<N;)V(k[S++],A),Qn(A,g,v,m,u,l),v+=m,l+=m;v<L&&(V(k[S++],A),Qn(A,g,v,_,u,l),v+=_,l+=_),++h&y||(d+=b)}break;case 3:if(p==u&&m==l&&0<d.b){for(v=u,p=g=l+(f-h)*g-(w=(f-h)*R(d.Ea,d.b)),m=u,y=l,b=[],w=(_=w)-1;0<=w;--w)b[w]=m[y+w];for(w=_-1;0<=w;--w)v[p+w]=b[w];Gn(d,h,f,u,g,u,l)}else Gn(d,h,f,p,m,u,l)}l=o,u=i}u!=i&&r(o,i,l,u,a)}function xe(e,n){var r=e.V,i=e.Ba+e.c*e.C,o=n-e.C;if(t(n<=e.l.o),t(16>=o),0<o){var s=e.l,a=e.Ta,c=e.Ua,l=s.width;if(_e(e,o,r,i),o=c=[c],t((r=e.C)<(i=n)),t(s.v<s.va),i>s.o&&(i=s.o),r<s.j){var u=s.j-r;r=s.j,o[0]+=u*l}if(r>=i?r=0:(o[0]+=4*s.v,s.ka=r-s.j,s.U=s.va-s.v,s.T=i-r,r=1),r){if(c=c[0],11>(r=e.ca).S){var d=r.f.RGBA,h=(i=r.S,o=s.U,s=s.T,u=d.eb,d.A),f=s;for(d=d.fb+e.Ma*d.A;0<f--;){var p=a,m=c,g=o,b=u,v=d;switch(i){case Fr:er(p,m,g,b,v);break;case Tr:tr(p,m,g,b,v);break;case Ur:tr(p,m,g,b,v),kr(b,v,0,g,1,0);break;case Rr:ir(p,m,g,b,v);break;case Mr:te(p,m,g,b,v,1);break;case $r:te(p,m,g,b,v,1),kr(b,v,0,g,1,0);break;case Dr:te(p,m,g,b,v,0);break;case Wr:te(p,m,g,b,v,0),kr(b,v,1,g,1,0);break;case Br:nr(p,m,g,b,v);break;case Zr:nr(p,m,g,b,v),Sr(b,v,g,1,0);break;case qr:rr(p,m,g,b,v);break;default:t(0)}c+=l,d+=h}e.Ma+=s}else alert("todo:EmitRescaledRowsYUVA");t(e.Ma<=r.height)}}e.C=n,t(e.C<=e.i)}function ke(e){var t;if(0<e.ua)return 0;for(t=0;t<e.Wb;++t){var n=e.Ya[t].G,r=e.Ya[t].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 Se(e,n,r,i,o,s){if(0!=e.Z){var a=e.qd,c=e.rd;for(t(null!=mi[e.Z]);n<r;++n)mi[e.Z](a,c,i,o,i,o,s),a=i,c=o,o+=s;e.qd=a,e.rd=c}}function Ae(e,n){var r=e.l.ma,i=0==r.Z||1==r.Z?e.l.j:e.C;if(i=e.C<i?i:e.C,t(n<=e.l.o),n>i){var o=e.l.width,s=r.ca,a=r.tb+o*i,c=e.V,l=e.Ba+e.c*i,u=e.gc;t(1==e.ab),t(3==u[0].hc),Kn(u[0],i,n,c,l,s,a),Se(r,i,n,s,a,o)}e.C=e.Ma=n}function Ne(e,n,r,i,o,s,a){var c=e.$/i,l=e.$%i,u=e.m,d=e.s,h=r+e.$,f=h;o=r+i*o;var p=r+i*s,m=280+d.ua,g=e.Pb?c:16777216,b=0<d.ua?d.Wa:null,v=d.wc,y=h<p?we(d,l,c):null;t(e.C<s),t(p<=o);var w=!1;e:for(;;){for(;w||h<p;){var _=0;if(c>=g){var N=h-r;t((g=e).Pb),g.wd=g.m,g.xd=N,0<g.s.ua&&z(g.s.Wa,g.s.vb),g=c+Qr}if(l&v||(y=we(d,l,c)),t(null!=y),y.Qb&&(n[h]=y.qb,w=!0),!w)if(A(u),y.jc){_=u,N=n;var L=h,P=y.pd[x(_)&Dn-1];t(y.jc),256>P.g?(S(_,_.u+P.g),N[L]=P.value,_=0):(S(_,_.u+P.g-256),t(256<=P.value),_=P.value),0==_&&(w=!0)}else _=ve(y.G[0],y.H[0],u);if(u.h)break;if(w||256>_){if(!w)if(y.nd)n[h]=(y.qb|_<<8)>>>0;else{if(A(u),w=ve(y.G[1],y.H[1],u),A(u),N=ve(y.G[2],y.H[2],u),L=ve(y.G[3],y.H[3],u),u.h)break;n[h]=(L<<24|w<<16|_<<8|N)>>>0}if(w=!1,++h,++l>=i&&(l=0,++c,null!=a&&c<=s&&!(c%16)&&a(e,c),null!=b))for(;f<h;)_=n[f++],b.X[(506832829*_&4294967295)>>>b.Mb]=_}else if(280>_){if(_=ge(_-256,u),N=ve(y.G[4],y.H[4],u),A(u),N=be(i,N=ge(N,u)),u.h)break;if(h-r<N||o-h<_)break e;for(L=0;L<_;++L)n[h+L]=n[h+L-N];for(h+=_,l+=_;l>=i;)l-=i,++c,null!=a&&c<=s&&!(c%16)&&a(e,c);if(t(h<=o),l&v&&(y=we(d,l,c)),null!=b)for(;f<h;)_=n[f++],b.X[(506832829*_&4294967295)>>>b.Mb]=_}else{if(!(_<m))break e;for(w=_-280,t(null!=b);f<h;)_=n[f++],b.X[(506832829*_&4294967295)>>>b.Mb]=_;_=h,t(!(w>>>(N=b).Xa)),n[_]=N.X[w],w=!0}w||t(u.h==k(u))}if(e.Pb&&u.h&&h<o)t(e.m.h),e.a=5,e.m=e.wd,e.$=e.xd,0<e.s.ua&&z(e.s.vb,e.s.Wa);else{if(u.h)break e;null!=a&&a(e,c>s?s:c),e.a=0,e.$=h-r}return 1}return e.a=3,0}function Le(e){t(null!=e),e.vc=null,e.yc=null,e.Ya=null;var n=e.Wa;null!=n&&(n.X=null),e.vb=null,t(null!=e)}function Pe(){var t=new sn;return null==t?null:(t.a=0,t.xb=pi,ne("Predictor","VP8LPredictors"),ne("Predictor","VP8LPredictors_C"),ne("PredictorAdd","VP8LPredictorsAdd"),ne("PredictorAdd","VP8LPredictorsAdd_C"),Vn=H,Qn=G,er=K,tr=Y,nr=X,rr=Q,ir=ee,e.VP8LMapColor32b=Jn,e.VP8LMapColor8b=Yn,t)}function Ce(e,n,r,a,c){var l=1,h=[e],p=[n],m=a.m,g=a.s,b=null,v=0;e:for(;;){if(r)for(;l&&y(m,1);){var w=h,_=p,k=a,N=1,L=k.m,P=k.gc[k.ab],C=y(L,2);if(k.Oc&1<<C)l=0;else{switch(k.Oc|=1<<C,P.hc=C,P.Ea=w[0],P.nc=_[0],P.K=[null],++k.ab,t(4>=k.ab),C){case 0:case 1:P.b=y(L,3)+2,N=Ce(R(P.Ea,P.b),R(P.nc,P.b),0,k,P.K),P.K=P.K[0];break;case 3:var E,I=y(L,8)+1,O=16<I?0:4<I?1:2<I?2:3;if(w[0]=R(P.Ea,O),P.b=O,E=N=Ce(I,1,0,k,P.K)){var z,F=I,T=P,D=1<<(8>>T.b),B=o(D);if(null==B)E=0;else{var q=T.K[0],U=T.w;for(B[0]=T.K[0][0],z=1;z<1*F;++z)B[z]=M(q[U+z],B[z-1]);for(;z<4*D;++z)B[z]=0;T.K[0]=null,T.K[0]=B,E=1}}N=E;break;case 2:break;default:t(0)}l=N}}if(h=h[0],p=p[0],l&&y(m,1)&&!(l=1<=(v=y(m,4))&&11>=v)){a.a=3;break e}var $;if($=l)t:{var W,Z,H,V=a,G=h,J=p,K=v,Y=r,X=V.m,Q=V.s,ee=[null],te=1,ne=0,re=Xr[K];n:for(;;){if(Y&&y(X,1)){var ie=y(X,3)+2,oe=R(G,ie),se=R(J,ie),ae=oe*se;if(!Ce(oe,se,0,V,ee))break n;for(ee=ee[0],Q.xc=ie,W=0;W<ae;++W){var ce=ee[W]>>8&65535;ee[W]=ce,ce>=te&&(te=ce+1)}}if(X.h)break n;for(Z=0;5>Z;++Z){var le=Gr[Z];!Z&&0<K&&(le+=1<<K),ne<le&&(ne=le)}var ue=s(te*re,d),de=te,he=s(de,f);if(null==he)var fe=null;else t(65536>=de),fe=he;var pe=o(ne);if(null==fe||null==pe||null==ue){V.a=1;break n}var me=ue;for(W=H=0;W<te;++W){var ge=fe[W],be=ge.G,ve=ge.H,we=0,_e=1,xe=0;for(Z=0;5>Z;++Z){le=Gr[Z],be[Z]=me,ve[Z]=H,!Z&&0<K&&(le+=1<<K);r:{var ke,Se=le,Ae=V,Pe=pe,Ee=me,Ie=H,Oe=0,je=Ae.m,ze=y(je,1);if(i(Pe,0,0,Se),ze){var Fe=y(je,1)+1,Te=y(je,1),Re=y(je,0==Te?1:8);Pe[Re]=1,2==Fe&&(Pe[Re=y(je,8)]=1);var Me=1}else{var De=o(19),Be=y(je,4)+4;if(19<Be){Ae.a=3;var qe=0;break r}for(ke=0;ke<Be;++ke)De[Kr[ke]]=y(je,3);var Ue=void 0,$e=void 0,We=Ae,Ze=De,He=Se,Ve=Pe,Ge=0,Je=We.m,Ke=8,Ye=s(128,d);i:for(;u(Ye,0,7,Ze,19);){if(y(Je,1)){var Xe=2+2*y(Je,3);if((Ue=2+y(Je,Xe))>He)break i}else Ue=He;for($e=0;$e<He&&Ue--;){A(Je);var Qe=Ye[0+(127&x(Je))];S(Je,Je.u+Qe.g);var et=Qe.value;if(16>et)Ve[$e++]=et,0!=et&&(Ke=et);else{var tt=16==et,nt=et-16,rt=Vr[nt],it=y(Je,Hr[nt])+rt;if($e+it>He)break i;for(var ot=tt?Ke:0;0<it--;)Ve[$e++]=ot}}Ge=1;break i}Ge||(We.a=3),Me=Ge}(Me=Me&&!je.h)&&(Oe=u(Ee,Ie,8,Pe,Se)),Me&&0!=Oe?qe=Oe:(Ae.a=3,qe=0)}if(0==qe)break n;if(_e&&1==Jr[Z]&&(_e=0==me[H].g),we+=me[H].g,H+=qe,3>=Z){var st,at=pe[0];for(st=1;st<le;++st)pe[st]>at&&(at=pe[st]);xe+=at}}if(ge.nd=_e,ge.Qb=0,_e&&(ge.qb=(be[3][ve[3]+0].value<<24|be[1][ve[1]+0].value<<16|be[2][ve[2]+0].value)>>>0,0==we&&256>be[0][ve[0]+0].value&&(ge.Qb=1,ge.qb+=be[0][ve[0]+0].value<<8)),ge.jc=!ge.Qb&&6>xe,ge.jc){var ct,lt=ge;for(ct=0;ct<Dn;++ct){var ut=ct,dt=lt.pd[ut],ht=lt.G[0][lt.H[0]+ut];256<=ht.value?(dt.g=ht.g+256,dt.value=ht.value):(dt.g=0,dt.value=0,ut>>=ye(ht,8,dt),ut>>=ye(lt.G[1][lt.H[1]+ut],16,dt),ut>>=ye(lt.G[2][lt.H[2]+ut],0,dt),ye(lt.G[3][lt.H[3]+ut],24,dt))}}}Q.vc=ee,Q.Wb=te,Q.Ya=fe,Q.yc=ue,$=1;break t}$=0}if(!(l=$)){a.a=3;break e}if(0<v){if(g.ua=1<<v,!j(g.Wa,v)){a.a=1,l=0;break e}}else g.ua=0;var ft=a,pt=h,mt=p,gt=ft.s,bt=gt.xc;if(ft.c=pt,ft.i=mt,gt.md=R(pt,bt),gt.wc=0==bt?-1:(1<<bt)-1,r){a.xb=fi;break e}if(null==(b=o(h*p))){a.a=1,l=0;break e}l=(l=Ne(a,b,0,h,p,p,null))&&!m.h;break e}return l?(null!=c?c[0]=b:(t(null==b),t(r)),a.$=0,r||Le(g)):Le(g),l}function Ee(e,n){var r=e.c*e.i,i=r+n+16*n;return t(e.c<=n),e.V=o(i),null==e.V?(e.Ta=null,e.Ua=0,e.a=1,0):(e.Ta=e.V,e.Ua=e.Ba+r+n,1)}function Ie(e,n){var r=e.C,i=n-r,o=e.V,s=e.Ba+e.c*r;for(t(n<=e.l.o);0<i;){var a=16<i?16:i,c=e.l.ma,l=e.l.width,u=l*a,d=c.ca,h=c.tb+l*r,f=e.Ta,p=e.Ua;_e(e,a,o,s),Nr(f,p,d,h,u),Se(c,r,r+a,d,h,l),i-=a,o+=a*e.c,r+=a}t(r==n),e.C=e.Ma=n}function Oe(){this.ub=this.yd=this.td=this.Rb=0}function je(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function ze(){this.Fb=this.Bb=this.Cb=0,this.Zb=o(4),this.Lb=o(4)}function Fe(){this.Yb=function(){var e=[];return function e(t,n,r){for(var i=r[n],o=0;o<i&&(t.push(r.length>n+1?[]:0),!(r.length<n+1));o++)e(t[o],n+1,r)}(e,0,[3,11]),e}()}function Te(){this.jb=o(3),this.Wc=a([4,8],Fe),this.Xc=a([4,17],Fe)}function Re(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new o(4),this.od=new o(4)}function Me(){this.ld=this.La=this.dd=this.tc=0}function De(){this.Na=this.la=0}function Be(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function qe(){this.ad=o(384),this.Za=0,this.Ob=o(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Ue(){this.uc=this.M=this.Nb=0,this.wa=Array(new Me),this.Y=0,this.ya=Array(new qe),this.aa=0,this.l=new He}function $e(){this.y=o(16),this.f=o(8),this.ea=o(8)}function We(){this.cb=this.a=0,this.sc="",this.m=new w,this.Od=new Oe,this.Kc=new je,this.ed=new Re,this.Qa=new ze,this.Ic=this.$c=this.Aa=0,this.D=new Ue,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=s(8,w),this.ia=0,this.pb=s(4,Be),this.Pa=new Te,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new $e),this.Hd=0,this.rb=Array(new De),this.sb=0,this.wa=Array(new Me),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 qe),this.L=this.aa=0,this.gd=a([4,2],Me),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 Ze(e,t){return 0>e?0:e>t?t:e}function He(){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 Ve(){var e=new We;return null!=e&&(e.a=0,e.sc="OK",e.cb=0,e.Xb=0,ni||(ni=Ye)),e}function Ge(e,t,n){return 0==e.a&&(e.a=t,e.sc=n,e.cb=0),0}function Je(e,t,n){return 3<=n&&157==e[t+0]&&1==e[t+1]&&42==e[t+2]}function Ke(e,n){if(null==e)return 0;if(e.a=0,e.sc="OK",null==n)return Ge(e,2,"null VP8Io passed to VP8GetHeaders()");var r=n.data,o=n.w,s=n.ha;if(4>s)return Ge(e,7,"Truncated header.");var a=r[o+0]|r[o+1]<<8|r[o+2]<<16,c=e.Od;if(c.Rb=!(1&a),c.td=a>>1&7,c.yd=a>>4&1,c.ub=a>>5,3<c.td)return Ge(e,3,"Incorrect keyframe parameters.");if(!c.yd)return Ge(e,4,"Frame not displayable.");o+=3,s-=3;var l=e.Kc;if(c.Rb){if(7>s)return Ge(e,7,"cannot parse picture header");if(!Je(r,o,s))return Ge(e,3,"Bad code word");l.c=16383&(r[o+4]<<8|r[o+3]),l.Td=r[o+4]>>6,l.i=16383&(r[o+6]<<8|r[o+5]),l.Ud=r[o+6]>>6,o+=7,s-=7,e.za=l.c+15>>4,e.Ub=l.i+15>>4,n.width=l.c,n.height=l.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((a=e.Pa).jb,0,255,a.jb.length),t(null!=(a=e.Qa)),a.Cb=0,a.Bb=0,a.Fb=1,i(a.Zb,0,0,a.Zb.length),i(a.Lb,0,0,a.Lb)}if(c.ub>s)return Ge(e,7,"bad partition length");p(a=e.m,r,o,c.ub),o+=c.ub,s-=c.ub,c.Rb&&(l.Ld=L(a),l.Kd=L(a)),l=e.Qa;var u,d=e.Pa;if(t(null!=a),t(null!=l),l.Cb=L(a),l.Cb){if(l.Bb=L(a),L(a)){for(l.Fb=L(a),u=0;4>u;++u)l.Zb[u]=L(a)?g(a,7):0;for(u=0;4>u;++u)l.Lb[u]=L(a)?g(a,6):0}if(l.Bb)for(u=0;3>u;++u)d.jb[u]=L(a)?m(a,8):255}else l.Bb=0;if(a.Ka)return Ge(e,3,"cannot parse segment header");if((l=e.ed).zd=L(a),l.Tb=m(a,6),l.wb=m(a,3),l.Pc=L(a),l.Pc&&L(a)){for(d=0;4>d;++d)L(a)&&(l.vd[d]=g(a,6));for(d=0;4>d;++d)L(a)&&(l.od[d]=g(a,6))}if(e.L=0==l.Tb?0:l.zd?1:2,a.Ka)return Ge(e,3,"cannot parse filter header");var h=s;if(s=u=o,o=u+h,l=h,e.Xb=(1<<m(e.m,2))-1,h<3*(d=e.Xb))r=7;else{for(u+=3*d,l-=3*d,h=0;h<d;++h){var f=r[s+0]|r[s+1]<<8|r[s+2]<<16;f>l&&(f=l),p(e.Jc[+h],r,u,f),u+=f,l-=f,s+=3}p(e.Jc[+d],r,u,l),r=u<o?0:5}if(0!=r)return Ge(e,r,"cannot parse partitions");for(r=m(u=e.m,7),s=L(u)?g(u,4):0,o=L(u)?g(u,4):0,l=L(u)?g(u,4):0,d=L(u)?g(u,4):0,u=L(u)?g(u,4):0,h=e.Qa,f=0;4>f;++f){if(h.Cb){var b=h.Zb[f];h.Fb||(b+=r)}else{if(0<f){e.pb[f]=e.pb[0];continue}b=r}var v=e.pb[f];v.Sc[0]=ei[Ze(b+s,127)],v.Sc[1]=ti[Ze(b+0,127)],v.Eb[0]=2*ei[Ze(b+o,127)],v.Eb[1]=101581*ti[Ze(b+l,127)]>>16,8>v.Eb[1]&&(v.Eb[1]=8),v.Qc[0]=ei[Ze(b+d,117)],v.Qc[1]=ti[Ze(b+u,127)],v.lc=b+u}if(!c.Rb)return Ge(e,4,"Not a key frame.");for(L(a),c=e.Pa,r=0;4>r;++r){for(s=0;8>s;++s)for(o=0;3>o;++o)for(l=0;11>l;++l)d=P(a,ci[r][s][o][l])?m(a,8):si[r][s][o][l],c.Wc[r][s].Yb[o][l]=d;for(s=0;17>s;++s)c.Xc[r][s]=c.Wc[r][li[s]]}return e.kc=L(a),e.kc&&(e.Bd=m(a,8)),e.cb=1}function Ye(e,t,n,r,i,o,s){var a=t[i].Yb[n];for(n=0;16>i;++i){if(!P(e,a[n+0]))return i;for(;!P(e,a[n+1]);)if(a=t[++i].Yb[0],n=0,16==i)return 16;var c=t[i+1].Yb;if(P(e,a[n+2])){var l=e,u=0;if(P(l,(h=a)[(d=n)+3]))if(P(l,h[d+6])){for(a=0,d=2*(u=P(l,h[d+8]))+(h=P(l,h[d+9+u])),u=0,h=ri[d];h[a];++a)u+=u+P(l,h[a]);u+=3+(8<<d)}else P(l,h[d+7])?(u=7+2*P(l,165),u+=P(l,145)):u=5+P(l,159);else u=P(l,h[d+4])?3+P(l,h[d+5]):2;a=c[2]}else u=1,a=c[1];c=s+ii[i],0>(l=e).b&&N(l);var d,h=l.b,f=(d=l.Ca>>1)-(l.I>>h)>>31;--l.b,l.Ca+=f,l.Ca|=1,l.I-=(d+1&f)<<h,o[c]=((u^f)-f)*r[(0<i)+0]}return 16}function Xe(e){var t=e.rb[e.sb-1];t.la=0,t.Na=0,i(e.zc,0,0,e.zc.length),e.ja=0}function Qe(e,t,n,r,i){i=e[t+n+32*r]+(i>>3),e[t+n+32*r]=-256&i?0>i?0:255:i}function et(e,t,n,r,i,o){Qe(e,t,0,n,r+i),Qe(e,t,1,n,r+o),Qe(e,t,2,n,r-o),Qe(e,t,3,n,r-i)}function tt(e){return(20091*e>>16)+e}function nt(e,t,n,r){var i,s=0,a=o(16);for(i=0;4>i;++i){var c=e[t+0]+e[t+8],l=e[t+0]-e[t+8],u=(35468*e[t+4]>>16)-tt(e[t+12]),d=tt(e[t+4])+(35468*e[t+12]>>16);a[s+0]=c+d,a[s+1]=l+u,a[s+2]=l-u,a[s+3]=c-d,s+=4,t++}for(i=s=0;4>i;++i)c=(e=a[s+0]+4)+a[s+8],l=e-a[s+8],u=(35468*a[s+4]>>16)-tt(a[s+12]),Qe(n,r,0,0,c+(d=tt(a[s+4])+(35468*a[s+12]>>16))),Qe(n,r,1,0,l+u),Qe(n,r,2,0,l-u),Qe(n,r,3,0,c-d),s++,r+=32}function rt(e,t,n,r){var i=e[t+0]+4,o=35468*e[t+4]>>16,s=tt(e[t+4]),a=35468*e[t+1]>>16;et(n,r,0,i+s,e=tt(e[t+1]),a),et(n,r,1,i+o,e,a),et(n,r,2,i-o,e,a),et(n,r,3,i-s,e,a)}function it(e,t,n,r,i){nt(e,t,n,r),i&&nt(e,t+16,n,r+4)}function ot(e,t,n,r){sr(e,t+0,n,r,1),sr(e,t+32,n,r+128,1)}function st(e,t,n,r){var i;for(e=e[t+0]+4,i=0;4>i;++i)for(t=0;4>t;++t)Qe(n,r,t,i,e)}function at(e,t,n,r){e[t+0]&&lr(e,t+0,n,r),e[t+16]&&lr(e,t+16,n,r+4),e[t+32]&&lr(e,t+32,n,r+128),e[t+48]&&lr(e,t+48,n,r+128+4)}function ct(e,t,n,r){var i,s=o(16);for(i=0;4>i;++i){var a=e[t+0+i]+e[t+12+i],c=e[t+4+i]+e[t+8+i],l=e[t+4+i]-e[t+8+i],u=e[t+0+i]-e[t+12+i];s[0+i]=a+c,s[8+i]=a-c,s[4+i]=u+l,s[12+i]=u-l}for(i=0;4>i;++i)a=(e=s[0+4*i]+3)+s[3+4*i],c=s[1+4*i]+s[2+4*i],l=s[1+4*i]-s[2+4*i],u=e-s[3+4*i],n[r+0]=a+c>>3,n[r+16]=u+l>>3,n[r+32]=a-c>>3,n[r+48]=u-l>>3,r+=64}function lt(e,t,n){var r,i=t-32,o=jr,s=255-e[i-1];for(r=0;r<n;++r){var a,c=o,l=s+e[t-1];for(a=0;a<n;++a)e[t+a]=c[l+e[i+a]];t+=32}}function ut(e,t){lt(e,t,4)}function dt(e,t){lt(e,t,8)}function ht(e,t){lt(e,t,16)}function ft(e,t){var n;for(n=0;16>n;++n)r(e,t+32*n,e,t-32,16)}function pt(e,t){var n;for(n=16;0<n;--n)i(e,t,e[t-1],16),t+=32}function mt(e,t,n){var r;for(r=0;16>r;++r)i(t,n+32*r,e,16)}function gt(e,t){var n,r=16;for(n=0;16>n;++n)r+=e[t-1+32*n]+e[t+n-32];mt(r>>5,e,t)}function bt(e,t){var n,r=8;for(n=0;16>n;++n)r+=e[t-1+32*n];mt(r>>4,e,t)}function vt(e,t){var n,r=8;for(n=0;16>n;++n)r+=e[t+n-32];mt(r>>4,e,t)}function yt(e,t){mt(128,e,t)}function wt(e,t,n){return e+2*t+n+2>>2}function _t(e,t){var n,i=t-32;for(i=new Uint8Array([wt(e[i-1],e[i+0],e[i+1]),wt(e[i+0],e[i+1],e[i+2]),wt(e[i+1],e[i+2],e[i+3]),wt(e[i+2],e[i+3],e[i+4])]),n=0;4>n;++n)r(e,t+32*n,i,0,i.length)}function xt(e,t){var n=e[t-1],r=e[t-1+32],i=e[t-1+64],o=e[t-1+96];C(e,t+0,16843009*wt(e[t-1-32],n,r)),C(e,t+32,16843009*wt(n,r,i)),C(e,t+64,16843009*wt(r,i,o)),C(e,t+96,16843009*wt(i,o,o))}function kt(e,t){var n,r=4;for(n=0;4>n;++n)r+=e[t+n-32]+e[t-1+32*n];for(r>>=3,n=0;4>n;++n)i(e,t+32*n,r,4)}function St(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],o=e[t-1-32],s=e[t+0-32],a=e[t+1-32],c=e[t+2-32],l=e[t+3-32];e[t+0+96]=wt(r,i,e[t-1+96]),e[t+1+96]=e[t+0+64]=wt(n,r,i),e[t+2+96]=e[t+1+64]=e[t+0+32]=wt(o,n,r),e[t+3+96]=e[t+2+64]=e[t+1+32]=e[t+0+0]=wt(s,o,n),e[t+3+64]=e[t+2+32]=e[t+1+0]=wt(a,s,o),e[t+3+32]=e[t+2+0]=wt(c,a,s),e[t+3+0]=wt(l,c,a)}function At(e,t){var n=e[t+1-32],r=e[t+2-32],i=e[t+3-32],o=e[t+4-32],s=e[t+5-32],a=e[t+6-32],c=e[t+7-32];e[t+0+0]=wt(e[t+0-32],n,r),e[t+1+0]=e[t+0+32]=wt(n,r,i),e[t+2+0]=e[t+1+32]=e[t+0+64]=wt(r,i,o),e[t+3+0]=e[t+2+32]=e[t+1+64]=e[t+0+96]=wt(i,o,s),e[t+3+32]=e[t+2+64]=e[t+1+96]=wt(o,s,a),e[t+3+64]=e[t+2+96]=wt(s,a,c),e[t+3+96]=wt(a,c,c)}function Nt(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],o=e[t-1-32],s=e[t+0-32],a=e[t+1-32],c=e[t+2-32],l=e[t+3-32];e[t+0+0]=e[t+1+64]=o+s+1>>1,e[t+1+0]=e[t+2+64]=s+a+1>>1,e[t+2+0]=e[t+3+64]=a+c+1>>1,e[t+3+0]=c+l+1>>1,e[t+0+96]=wt(i,r,n),e[t+0+64]=wt(r,n,o),e[t+0+32]=e[t+1+96]=wt(n,o,s),e[t+1+32]=e[t+2+96]=wt(o,s,a),e[t+2+32]=e[t+3+96]=wt(s,a,c),e[t+3+32]=wt(a,c,l)}function Lt(e,t){var n=e[t+0-32],r=e[t+1-32],i=e[t+2-32],o=e[t+3-32],s=e[t+4-32],a=e[t+5-32],c=e[t+6-32],l=e[t+7-32];e[t+0+0]=n+r+1>>1,e[t+1+0]=e[t+0+64]=r+i+1>>1,e[t+2+0]=e[t+1+64]=i+o+1>>1,e[t+3+0]=e[t+2+64]=o+s+1>>1,e[t+0+32]=wt(n,r,i),e[t+1+32]=e[t+0+96]=wt(r,i,o),e[t+2+32]=e[t+1+96]=wt(i,o,s),e[t+3+32]=e[t+2+96]=wt(o,s,a),e[t+3+64]=wt(s,a,c),e[t+3+96]=wt(a,c,l)}function Pt(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],o=e[t-1+96];e[t+0+0]=n+r+1>>1,e[t+2+0]=e[t+0+32]=r+i+1>>1,e[t+2+32]=e[t+0+64]=i+o+1>>1,e[t+1+0]=wt(n,r,i),e[t+3+0]=e[t+1+32]=wt(r,i,o),e[t+3+32]=e[t+1+64]=wt(i,o,o),e[t+3+64]=e[t+2+64]=e[t+0+96]=e[t+1+96]=e[t+2+96]=e[t+3+96]=o}function Ct(e,t){var n=e[t-1+0],r=e[t-1+32],i=e[t-1+64],o=e[t-1+96],s=e[t-1-32],a=e[t+0-32],c=e[t+1-32],l=e[t+2-32];e[t+0+0]=e[t+2+32]=n+s+1>>1,e[t+0+32]=e[t+2+64]=r+n+1>>1,e[t+0+64]=e[t+2+96]=i+r+1>>1,e[t+0+96]=o+i+1>>1,e[t+3+0]=wt(a,c,l),e[t+2+0]=wt(s,a,c),e[t+1+0]=e[t+3+32]=wt(n,s,a),e[t+1+32]=e[t+3+64]=wt(r,n,s),e[t+1+64]=e[t+3+96]=wt(i,r,n),e[t+1+96]=wt(o,i,r)}function Et(e,t){var n;for(n=0;8>n;++n)r(e,t+32*n,e,t-32,8)}function It(e,t){var n;for(n=0;8>n;++n)i(e,t,e[t-1],8),t+=32}function Ot(e,t,n){var r;for(r=0;8>r;++r)i(t,n+32*r,e,8)}function jt(e,t){var n,r=8;for(n=0;8>n;++n)r+=e[t+n-32]+e[t-1+32*n];Ot(r>>4,e,t)}function zt(e,t){var n,r=4;for(n=0;8>n;++n)r+=e[t+n-32];Ot(r>>3,e,t)}function Ft(e,t){var n,r=4;for(n=0;8>n;++n)r+=e[t-1+32*n];Ot(r>>3,e,t)}function Tt(e,t){Ot(128,e,t)}function Rt(e,t,n){var r=e[t-n],i=e[t+0],o=3*(i-r)+Ir[1020+e[t-2*n]-e[t+n]],s=Or[112+(o+4>>3)];e[t-n]=jr[255+r+Or[112+(o+3>>3)]],e[t+0]=jr[255+i-s]}function Mt(e,t,n,r){var i=e[t+0],o=e[t+n];return zr[255+e[t-2*n]-e[t-n]]>r||zr[255+o-i]>r}function Dt(e,t,n,r){return 4*zr[255+e[t-n]-e[t+0]]+zr[255+e[t-2*n]-e[t+n]]<=r}function Bt(e,t,n,r,i){var o=e[t-3*n],s=e[t-2*n],a=e[t-n],c=e[t+0],l=e[t+n],u=e[t+2*n],d=e[t+3*n];return 4*zr[255+a-c]+zr[255+s-l]>r?0:zr[255+e[t-4*n]-o]<=i&&zr[255+o-s]<=i&&zr[255+s-a]<=i&&zr[255+d-u]<=i&&zr[255+u-l]<=i&&zr[255+l-c]<=i}function qt(e,t,n,r){var i=2*r+1;for(r=0;16>r;++r)Dt(e,t+r,n,i)&&Rt(e,t+r,n)}function Ut(e,t,n,r){var i=2*r+1;for(r=0;16>r;++r)Dt(e,t+r*n,1,i)&&Rt(e,t+r*n,1)}function $t(e,t,n,r){var i;for(i=3;0<i;--i)qt(e,t+=4*n,n,r)}function Wt(e,t,n,r){var i;for(i=3;0<i;--i)Ut(e,t+=4,n,r)}function Zt(e,t,n,r,i,o,s,a){for(o=2*o+1;0<i--;){if(Bt(e,t,n,o,s))if(Mt(e,t,n,a))Rt(e,t,n);else{var c=e,l=t,u=n,d=c[l-2*u],h=c[l-u],f=c[l+0],p=c[l+u],m=c[l+2*u],g=27*(v=Ir[1020+3*(f-h)+Ir[1020+d-p]])+63>>7,b=18*v+63>>7,v=9*v+63>>7;c[l-3*u]=jr[255+c[l-3*u]+v],c[l-2*u]=jr[255+d+b],c[l-u]=jr[255+h+g],c[l+0]=jr[255+f-g],c[l+u]=jr[255+p-b],c[l+2*u]=jr[255+m-v]}t+=r}}function Ht(e,t,n,r,i,o,s,a){for(o=2*o+1;0<i--;){if(Bt(e,t,n,o,s))if(Mt(e,t,n,a))Rt(e,t,n);else{var c=e,l=t,u=n,d=c[l-u],h=c[l+0],f=c[l+u],p=Or[112+(4+(m=3*(h-d))>>3)],m=Or[112+(m+3>>3)],g=p+1>>1;c[l-2*u]=jr[255+c[l-2*u]+g],c[l-u]=jr[255+d+m],c[l+0]=jr[255+h-p],c[l+u]=jr[255+f-g]}t+=r}}function Vt(e,t,n,r,i,o){Zt(e,t,n,1,16,r,i,o)}function Gt(e,t,n,r,i,o){Zt(e,t,1,n,16,r,i,o)}function Jt(e,t,n,r,i,o){var s;for(s=3;0<s;--s)Ht(e,t+=4*n,n,1,16,r,i,o)}function Kt(e,t,n,r,i,o){var s;for(s=3;0<s;--s)Ht(e,t+=4,1,n,16,r,i,o)}function Yt(e,t,n,r,i,o,s,a){Zt(e,t,i,1,8,o,s,a),Zt(n,r,i,1,8,o,s,a)}function Xt(e,t,n,r,i,o,s,a){Zt(e,t,1,i,8,o,s,a),Zt(n,r,1,i,8,o,s,a)}function Qt(e,t,n,r,i,o,s,a){Ht(e,t+4*i,i,1,8,o,s,a),Ht(n,r+4*i,i,1,8,o,s,a)}function en(e,t,n,r,i,o,s,a){Ht(e,t+4,1,i,8,o,s,a),Ht(n,r+4,1,i,8,o,s,a)}function tn(){this.ba=new se,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new ce,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function nn(){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 rn(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function on(){this.ua=0,this.Wa=new F,this.vb=new F,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new f,this.yc=new d}function sn(){this.xb=this.a=0,this.l=new He,this.ca=new se,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 on,this.ab=0,this.gc=s(4,rn),this.Oc=0}function an(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new He,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function cn(e,t,n,r,i,o,s){for(e=null==e?0:e[t+0],t=0;t<s;++t)i[o+t]=e+n[r+t]&255,e=i[o+t]}function ln(e,t,n,r,i,o,s){var a;if(null==e)cn(null,null,n,r,i,o,s);else for(a=0;a<s;++a)i[o+a]=e[t+a]+n[r+a]&255}function un(e,t,n,r,i,o,s){if(null==e)cn(null,null,n,r,i,o,s);else{var a,c=e[t+0],l=c,u=c;for(a=0;a<s;++a)l=u+(c=e[t+a])-l,u=n[r+a]+(-256&l?0>l?0:255:l)&255,l=c,i[o+a]=u}}function dn(e,n,i,s){var a=n.width,c=n.o;if(t(null!=e&&null!=n),0>i||0>=s||i+s>c)return null;if(!e.Cc){if(null==e.ga){var l;if(e.ga=new an,(l=null==e.ga)||(l=n.width*n.o,t(0==e.Gb.length),e.Gb=o(l),e.Uc=0,null==e.Gb?l=0:(e.mb=e.Gb,e.nb=e.Uc,e.rc=null,l=1),l=!l),!l){l=e.ga;var u=e.Fa,d=e.P,h=e.qc,f=e.mb,p=e.nb,m=d+1,g=h-1,v=l.l;if(t(null!=u&&null!=f&&null!=n),mi[0]=null,mi[1]=cn,mi[2]=ln,mi[3]=un,l.ca=f,l.tb=p,l.c=n.width,l.i=n.height,t(0<l.c&&0<l.i),1>=h)n=0;else if(l.$a=3&u[d+0],l.Z=u[d+0]>>2&3,l.Lc=u[d+0]>>4&3,d=u[d+0]>>6&3,0>l.$a||1<l.$a||4<=l.Z||1<l.Lc||d)n=0;else if(v.put=fe,v.ac=he,v.bc=pe,v.ma=l,v.width=n.width,v.height=n.height,v.Da=n.Da,v.v=n.v,v.va=n.va,v.j=n.j,v.o=n.o,l.$a)e:{t(1==l.$a),n=Pe();t:for(;;){if(null==n){n=0;break e}if(t(null!=l),l.mc=n,n.c=l.c,n.i=l.i,n.l=l.l,n.l.ma=l,n.l.width=l.c,n.l.height=l.i,n.a=0,b(n.m,u,m,g),!Ce(l.c,l.i,1,n,null))break t;if(1==n.ab&&3==n.gc[0].hc&&ke(n.s)?(l.ic=1,u=n.c*n.i,n.Ta=null,n.Ua=0,n.V=o(u),n.Ba=0,null==n.V?(n.a=1,n=0):n=1):(l.ic=0,n=Ee(n,l.c)),!n)break t;n=1;break e}l.mc=null,n=0}else n=g>=l.c*l.i;l=!n}if(l)return null;1!=e.ga.Lc?e.Ga=0:s=c-i}t(null!=e.ga),t(i+s<=c);e:{if(n=(u=e.ga).c,c=u.l.o,0==u.$a){if(m=e.rc,g=e.Vc,v=e.Fa,d=e.P+1+i*n,h=e.mb,f=e.nb+i*n,t(d<=e.P+e.qc),0!=u.Z)for(t(null!=mi[u.Z]),l=0;l<s;++l)mi[u.Z](m,g,v,d,h,f,n),m=h,g=f,f+=n,d+=n;else for(l=0;l<s;++l)r(h,f,v,d,n),m=h,g=f,f+=n,d+=n;e.rc=m,e.Vc=g}else{if(t(null!=u.mc),n=i+s,t(null!=(l=u.mc)),t(n<=l.i),l.C>=n)n=1;else if(u.ic||gn(),u.ic){u=l.V,m=l.Ba,g=l.c;var y=l.i,w=(v=1,d=l.$/g,h=l.$%g,f=l.m,p=l.s,l.$),_=g*y,x=g*n,S=p.wc,N=w<x?we(p,h,d):null;t(w<=_),t(n<=y),t(ke(p));t:for(;;){for(;!f.h&&w<x;){if(h&S||(N=we(p,h,d)),t(null!=N),A(f),256>(y=ve(N.G[0],N.H[0],f)))u[m+w]=y,++w,++h>=g&&(h=0,++d<=n&&!(d%16)&&Ae(l,d));else{if(!(280>y)){v=0;break t}y=ge(y-256,f);var L,P=ve(N.G[4],N.H[4],f);if(A(f),!(w>=(P=be(g,P=ge(P,f)))&&_-w>=y)){v=0;break t}for(L=0;L<y;++L)u[m+w+L]=u[m+w+L-P];for(w+=y,h+=y;h>=g;)h-=g,++d<=n&&!(d%16)&&Ae(l,d);w<x&&h&S&&(N=we(p,h,d))}t(f.h==k(f))}Ae(l,d>n?n:d);break t}!v||f.h&&w<_?(v=0,l.a=f.h?5:3):l.$=w,n=v}else n=Ne(l,l.V,l.Ba,l.c,l.i,n,Ie);if(!n){s=0;break e}}i+s>=c&&(e.Cc=1),s=1}if(!s)return null;if(e.Cc&&(null!=(s=e.ga)&&(s.mc=null),e.ga=null,0<e.Ga))return alert("todo:WebPDequantizeLevels"),null}return e.nb+i*a}function hn(e,t,n,r,i,o){for(;0<i--;){var s,a=e,c=t+(n?1:0),l=e,u=t+(n?0:3);for(s=0;s<r;++s){var d=l[u+4*s];255!=d&&(d*=32897,a[c+4*s+0]=a[c+4*s+0]*d>>23,a[c+4*s+1]=a[c+4*s+1]*d>>23,a[c+4*s+2]=a[c+4*s+2]*d>>23)}t+=o}}function fn(e,t,n,r,i){for(;0<r--;){var o;for(o=0;o<n;++o){var s=e[t+2*o+0],a=15&(l=e[t+2*o+1]),c=4369*a,l=(240&l|l>>4)*c>>16;e[t+2*o+0]=(240&s|s>>4)*c>>16&240|(15&s|s<<4)*c>>16>>4&15,e[t+2*o+1]=240&l|a}t+=i}}function pn(e,t,n,r,i,o,s,a){var c,l,u=255;for(l=0;l<i;++l){for(c=0;c<r;++c){var d=e[t+c];o[s+4*c]=d,u&=d}t+=n,s+=a}return 255!=u}function mn(e,t,n,r,i){var o;for(o=0;o<i;++o)n[r+o]=e[t+o]>>8}function gn(){kr=hn,Sr=fn,Ar=pn,Nr=mn}function bn(n,r,i){e[n]=function(e,n,o,s,a,c,l,u,d,h,f,p,m,g,b,v,y){var w,_=y-1>>1,x=a[c+0]|l[u+0]<<16,k=d[h+0]|f[p+0]<<16;t(null!=e);var S=3*x+k+131074>>2;for(r(e[n+0],255&S,S>>16,m,g),null!=o&&(S=3*k+x+131074>>2,r(o[s+0],255&S,S>>16,b,v)),w=1;w<=_;++w){var A=a[c+w]|l[u+w]<<16,N=d[h+w]|f[p+w]<<16,L=x+A+k+N+524296,P=L+2*(A+k)>>3;S=P+x>>1,x=(L=L+2*(x+N)>>3)+A>>1,r(e[n+2*w-1],255&S,S>>16,m,g+(2*w-1)*i),r(e[n+2*w-0],255&x,x>>16,m,g+(2*w-0)*i),null!=o&&(S=L+k>>1,x=P+N>>1,r(o[s+2*w-1],255&S,S>>16,b,v+(2*w-1)*i),r(o[s+2*w+0],255&x,x>>16,b,v+(2*w+0)*i)),x=A,k=N}1&y||(S=3*x+k+131074>>2,r(e[n+y-1],255&S,S>>16,m,g+(y-1)*i),null!=o&&(S=3*k+x+131074>>2,r(o[s+y-1],255&S,S>>16,b,v+(y-1)*i)))}}function vn(){gi[Fr]=bi,gi[Tr]=yi,gi[Rr]=vi,gi[Mr]=wi,gi[Dr]=_i,gi[Br]=xi,gi[qr]=ki,gi[Ur]=yi,gi[$r]=wi,gi[Wr]=_i,gi[Zr]=xi}function yn(e){return e&~Ci?0>e?0:255:e>>Pi}function wn(e,t){return yn((19077*e>>8)+(26149*t>>8)-14234)}function xn(e,t,n){return yn((19077*e>>8)-(6419*t>>8)-(13320*n>>8)+8708)}function kn(e,t){return yn((19077*e>>8)+(33050*t>>8)-17685)}function Sn(e,t,n,r,i){r[i+0]=wn(e,n),r[i+1]=xn(e,t,n),r[i+2]=kn(e,t)}function An(e,t,n,r,i){r[i+0]=kn(e,t),r[i+1]=xn(e,t,n),r[i+2]=wn(e,n)}function Nn(e,t,n,r,i){var o=xn(e,t,n);t=o<<3&224|kn(e,t)>>3,r[i+0]=248&wn(e,n)|o>>5,r[i+1]=t}function Ln(e,t,n,r,i){var o=240&kn(e,t)|15;r[i+0]=240&wn(e,n)|xn(e,t,n)>>4,r[i+1]=o}function Pn(e,t,n,r,i){r[i+0]=255,Sn(e,t,n,r,i+1)}function Cn(e,t,n,r,i){An(e,t,n,r,i),r[i+3]=255}function En(e,t,n,r,i){Sn(e,t,n,r,i),r[i+3]=255}function In(t,n,r){e[t]=function(e,t,i,o,s,a,c,l,u){for(var d=l+(-2&u)*r;l!=d;)n(e[t+0],i[o+0],s[a+0],c,l),n(e[t+1],i[o+0],s[a+0],c,l+r),t+=2,++o,++a,l+=2*r;1&u&&n(e[t+0],i[o+0],s[a+0],c,l)}}function On(e,t,n){return 0==n?0==e?0==t?6:5:0==t?4:0:n}function jn(e,t,n,r,i){switch(e>>>30){case 3:sr(t,n,r,i,0);break;case 2:ar(t,n,r,i);break;case 1:lr(t,n,r,i)}}function zn(e,t){var n,o,s=t.M,a=t.Nb,c=e.oc,l=e.pc+40,u=e.oc,d=e.pc+584,h=e.oc,f=e.pc+600;for(n=0;16>n;++n)c[l+32*n-1]=129;for(n=0;8>n;++n)u[d+32*n-1]=129,h[f+32*n-1]=129;for(0<s?c[l-1-32]=u[d-1-32]=h[f-1-32]=129:(i(c,l-32-1,127,21),i(u,d-32-1,127,9),i(h,f-32-1,127,9)),o=0;o<e.za;++o){var p=t.ya[t.aa+o];if(0<o){for(n=-1;16>n;++n)r(c,l+32*n-4,c,l+32*n+12,4);for(n=-1;8>n;++n)r(u,d+32*n-4,u,d+32*n+4,4),r(h,f+32*n-4,h,f+32*n+4,4)}var m=e.Gd,g=e.Hd+o,b=p.ad,v=p.Hc;if(0<s&&(r(c,l-32,m[g].y,0,16),r(u,d-32,m[g].f,0,8),r(h,f-32,m[g].ea,0,8)),p.Za){var y=c,w=l-32+16;for(0<s&&(o>=e.za-1?i(y,w,m[g].y[15],4):r(y,w,m[g+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,v<<=2)y=c,w=l+Ri[n],di[p.Ob[n]](y,w),jn(v,b,16*+n,y,w)}else if(y=On(o,s,p.Ob[0]),ui[y](c,l),0!=v)for(n=0;16>n;++n,v<<=2)jn(v,b,16*+n,c,l+Ri[n]);for(n=p.Gc,y=On(o,s,p.Dd),hi[y](u,d),hi[y](h,f),v=b,y=u,w=d,255&(p=0|n)&&(170&p?cr(v,256,y,w):ur(v,256,y,w)),p=h,v=f,255&(n>>=8)&&(170&n?cr(b,320,p,v):ur(b,320,p,v)),s<e.Ub-1&&(r(m[g].y,0,c,l+480,16),r(m[g].f,0,u,d+224,8),r(m[g].ea,0,h,f+224,8)),n=8*a*e.B,m=e.sa,g=e.ta+16*o+16*a*e.R,b=e.qa,p=e.ra+8*o+n,v=e.Ha,y=e.Ia+8*o+n,n=0;16>n;++n)r(m,g+n*e.R,c,l+32*n,16);for(n=0;8>n;++n)r(b,p+n*e.B,u,d+32*n,8),r(v,y+n*e.B,h,f+32*n,8)}}function Fn(e,r,i,o,s,a,c,l,u){var d=[0],h=[0],f=0,p=null!=u?u.kd:0,m=null!=u?u:new nn;if(null==e||12>i)return 7;m.data=e,m.w=r,m.ha=i,r=[r],i=[i],m.gb=[m.gb];e:{var g=r,v=i,y=m.gb;if(t(null!=e),t(null!=v),t(null!=y),y[0]=0,12<=v[0]&&!n(e,g[0],"RIFF")){if(n(e,g[0]+8,"WEBP")){y=3;break e}var w=O(e,g[0]+4);if(12>w||4294967286<w){y=3;break e}if(p&&w>v[0]-8){y=7;break e}y[0]=w,g[0]+=12,v[0]-=12}y=0}if(0!=y)return y;for(w=0<m.gb[0],i=i[0];;){e:{var x=e;v=r,y=i;var k=d,S=h,A=g=[0];if((P=f=[f])[0]=0,8>y[0])y=7;else{if(!n(x,v[0],"VP8X")){if(10!=O(x,v[0]+4)){y=3;break e}if(18>y[0]){y=7;break e}var N=O(x,v[0]+8),L=1+I(x,v[0]+12);if(2147483648<=L*(x=1+I(x,v[0]+15))){y=3;break e}null!=A&&(A[0]=N),null!=k&&(k[0]=L),null!=S&&(S[0]=x),v[0]+=18,y[0]-=18,P[0]=1}y=0}}if(f=f[0],g=g[0],0!=y)return y;if(v=!!(2&g),!w&&f)return 3;if(null!=a&&(a[0]=!!(16&g)),null!=c&&(c[0]=v),null!=l&&(l[0]=0),c=d[0],g=h[0],f&&v&&null==u){y=0;break}if(4>i){y=7;break}if(w&&f||!w&&!f&&!n(e,r[0],"ALPH")){i=[i],m.na=[m.na],m.P=[m.P],m.Sa=[m.Sa];e:{N=e,y=r,w=i;var P=m.gb;k=m.na,S=m.P,A=m.Sa,L=22,t(null!=N),t(null!=w),x=y[0];var C=w[0];for(t(null!=k),t(null!=A),k[0]=null,S[0]=null,A[0]=0;;){if(y[0]=x,w[0]=C,8>C){y=7;break e}var E=O(N,x+4);if(4294967286<E){y=3;break e}var j=8+E+1&-2;if(L+=j,0<P&&L>P){y=3;break e}if(!n(N,x,"VP8 ")||!n(N,x,"VP8L")){y=0;break e}if(C[0]<j){y=7;break e}n(N,x,"ALPH")||(k[0]=N,S[0]=x+8,A[0]=E),x+=j,C-=j}}if(i=i[0],m.na=m.na[0],m.P=m.P[0],m.Sa=m.Sa[0],0!=y)break}i=[i],m.Ja=[m.Ja],m.xa=[m.xa];e:if(P=e,y=r,w=i,k=m.gb[0],S=m.Ja,A=m.xa,N=y[0],x=!n(P,N,"VP8 "),L=!n(P,N,"VP8L"),t(null!=P),t(null!=w),t(null!=S),t(null!=A),8>w[0])y=7;else{if(x||L){if(P=O(P,N+4),12<=k&&P>k-12){y=3;break e}if(p&&P>w[0]-8){y=7;break e}S[0]=P,y[0]+=8,w[0]-=8,A[0]=L}else A[0]=5<=w[0]&&47==P[N+0]&&!(P[N+4]>>5),S[0]=w[0];y=0}if(i=i[0],m.Ja=m.Ja[0],m.xa=m.xa[0],r=r[0],0!=y)break;if(4294967286<m.Ja)return 3;if(null==l||v||(l[0]=m.xa?2:1),c=[c],g=[g],m.xa){if(5>i){y=7;break}l=c,p=g,v=a,null==e||5>i?e=0:5<=i&&47==e[r+0]&&!(e[r+4]>>5)?(w=[0],P=[0],k=[0],b(S=new _,e,r,i),me(S,w,P,k)?(null!=l&&(l[0]=w[0]),null!=p&&(p[0]=P[0]),null!=v&&(v[0]=k[0]),e=1):e=0):e=0}else{if(10>i){y=7;break}l=g,null==e||10>i||!Je(e,r+3,i-3)?e=0:(p=e[r+0]|e[r+1]<<8|e[r+2]<<16,v=16383&(e[r+7]<<8|e[r+6]),e=16383&(e[r+9]<<8|e[r+8]),1&p||3<(p>>1&7)||!(p>>4&1)||p>>5>=m.Ja||!v||!e?e=0:(c&&(c[0]=v),l&&(l[0]=e),e=1))}if(!e)return 3;if(c=c[0],g=g[0],f&&(d[0]!=c||h[0]!=g))return 3;null!=u&&(u[0]=m,u.offset=r-u.w,t(4294967286>r-u.w),t(u.offset==u.ha-i));break}return 0==y||7==y&&f&&null==u?(null!=a&&(a[0]|=null!=m.na&&0<m.na.length),null!=o&&(o[0]=c),null!=s&&(s[0]=g),0):y}function Tn(e,t,n){var r=t.width,i=t.height,o=0,s=0,a=r,c=i;if(t.Da=null!=e&&0<e.Da,t.Da&&(a=e.cd,c=e.bd,o=e.v,s=e.j,11>n||(o&=-2,s&=-2),0>o||0>s||0>=a||0>=c||o+a>r||s+c>i))return 0;if(t.v=o,t.j=s,t.va=o+a,t.o=s+c,t.U=a,t.T=c,t.da=null!=e&&0<e.da,t.da){if(!T(a,c,n=[e.ib],o=[e.hb]))return 0;t.ib=n[0],t.hb=o[0]}return t.ob=null!=e&&e.ob,t.Kb=null==e||!e.Sd,t.da&&(t.ob=t.ib<3*r/4&&t.hb<3*i/4,t.Kb=0),1}function Rn(e){if(null==e)return 2;if(11>e.S){var t=e.f.RGBA;t.fb+=(e.height-1)*t.A,t.A=-t.A}else t=e.f.kb,e=e.height,t.O+=(e-1)*t.fa,t.fa=-t.fa,t.N+=(e-1>>1)*t.Ab,t.Ab=-t.Ab,t.W+=(e-1>>1)*t.Db,t.Db=-t.Db,null!=t.F&&(t.J+=(e-1)*t.lb,t.lb=-t.lb);return 0}function Mn(e,t,n,r){if(null==r||0>=e||0>=t)return 2;if(null!=n){if(n.Da){var i=n.cd,s=n.bd,a=-2&n.v,c=-2&n.j;if(0>a||0>c||0>=i||0>=s||a+i>e||c+s>t)return 2;e=i,t=s}if(n.da){if(!T(e,t,i=[n.ib],s=[n.hb]))return 2;e=i[0],t=s[0]}}r.width=e,r.height=t;e:{var l=r.width,u=r.height;if(e=r.S,0>=l||0>=u||!(e>=Fr&&13>e))e=2;else{if(0>=r.Rd&&null==r.sd){a=s=i=t=0;var d=(c=l*Bi[e])*u;if(11>e||(s=(u+1)/2*(t=(l+1)/2),12==e&&(a=(i=l)*u)),null==(u=o(d+2*s+a))){e=1;break e}r.sd=u,11>e?((l=r.f.RGBA).eb=u,l.fb=0,l.A=c,l.size=d):((l=r.f.kb).y=u,l.O=0,l.fa=c,l.Fd=d,l.f=u,l.N=0+d,l.Ab=t,l.Cd=s,l.ea=u,l.W=0+d+s,l.Db=t,l.Ed=s,12==e&&(l.F=u,l.J=0+d+2*s),l.Tc=a,l.lb=i)}if(t=1,i=r.S,s=r.width,a=r.height,i>=Fr&&13>i)if(11>i)e=r.f.RGBA,t&=(c=Math.abs(e.A))*(a-1)+s<=e.size,t&=c>=s*Bi[i],t&=null!=e.eb;else{e=r.f.kb,c=(s+1)/2,d=(a+1)/2,l=Math.abs(e.fa),u=Math.abs(e.Ab);var h=Math.abs(e.Db),f=Math.abs(e.lb),p=f*(a-1)+s;t&=l*(a-1)+s<=e.Fd,t&=u*(d-1)+c<=e.Cd,t=(t&=h*(d-1)+c<=e.Ed)&l>=s&u>=c&h>=c,t&=null!=e.y,t&=null!=e.f,t&=null!=e.ea,12==i&&(t&=f>=s,t&=p<=e.Tc,t&=null!=e.F)}else t=0;e=t?0:2}}return 0!=e||null!=n&&n.fd&&(e=Rn(r)),e}var Dn=64,Bn=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],qn=24,Un=32,$n=8,Wn=[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"),e.Predictor0=function(){return 4278190080},e.Predictor1=function(e){return e},e.Predictor2=function(e,t,n){return t[n+0]},e.Predictor3=function(e,t,n){return t[n+1]},e.Predictor4=function(e,t,n){return t[n-1]},e.Predictor5=function(e,t,n){return q(q(e,t[n+1]),t[n+0])},e.Predictor6=function(e,t,n){return q(e,t[n-1])},e.Predictor7=function(e,t,n){return q(e,t[n+0])},e.Predictor8=function(e,t,n){return q(t[n-1],t[n+0])},e.Predictor9=function(e,t,n){return q(t[n+0],t[n+1])},e.Predictor10=function(e,t,n){return q(q(e,t[n-1]),q(t[n+0],t[n+1]))},e.Predictor11=function(e,t,n){var r=t[n+0];return 0>=W(r>>24&255,e>>24&255,(t=t[n-1])>>24&255)+W(r>>16&255,e>>16&255,t>>16&255)+W(r>>8&255,e>>8&255,t>>8&255)+W(255&r,255&e,255&t)?r:e},e.Predictor12=function(e,t,n){var r=t[n+0];return(U((e>>24&255)+(r>>24&255)-((t=t[n-1])>>24&255))<<24|U((e>>16&255)+(r>>16&255)-(t>>16&255))<<16|U((e>>8&255)+(r>>8&255)-(t>>8&255))<<8|U((255&e)+(255&r)-(255&t)))>>>0},e.Predictor13=function(e,t,n){var r=t[n-1];return($((e=q(e,t[n+0]))>>24&255,r>>24&255)<<24|$(e>>16&255,r>>16&255)<<16|$(e>>8&255,r>>8&255)<<8|$(255&e,255&r))>>>0};var Zn=e.PredictorAdd0;e.PredictorAdd1=Z,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 Hn=e.PredictorAdd2;J("ColorIndexInverseTransform","MapARGB","32b",function(e){return e>>8&255},function(e){return e}),J("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(e){return e},function(e){return e>>8&255});var Vn,Gn=e.ColorIndexInverseTransform,Jn=e.MapARGB,Kn=e.VP8LColorIndexInverseTransformAlpha,Yn=e.MapAlpha,Xn=e.VP8LPredictorsAdd=[];Xn.length=16,(e.VP8LPredictors=[]).length=16,(e.VP8LPredictorsAdd_C=[]).length=16,(e.VP8LPredictors_C=[]).length=16;var Qn,er,tr,nr,rr,ir,or,sr,ar,cr,lr,ur,dr,hr,fr,pr,mr,gr,br,vr,yr,wr,_r,xr,kr,Sr,Ar,Nr,_n=o(511),Lr=o(2041),Pr=o(225),Cr=o(767),Er=0,Ir=Lr,Or=Pr,jr=Cr,zr=_n,Fr=0,Tr=1,Rr=2,Mr=3,Dr=4,Br=5,qr=6,Ur=7,$r=8,Wr=9,Zr=10,Hr=[2,3,7],Vr=[3,3,11],Gr=[280,256,256,256,40],Jr=[0,1,1,1,0],Kr=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Yr=[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],Xr=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Qr=8,ei=[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],ti=[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],ni=null,ri=[[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]],ii=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],oi=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],si=[[[[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]]]],ai=[[[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]]],ci=[[[[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]]]],li=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ui=[],di=[],hi=[],fi=1,pi=2,mi=[],gi=[];bn("UpsampleRgbLinePair",Sn,3),bn("UpsampleBgrLinePair",An,3),bn("UpsampleRgbaLinePair",En,4),bn("UpsampleBgraLinePair",Cn,4),bn("UpsampleArgbLinePair",Pn,4),bn("UpsampleRgba4444LinePair",Ln,2),bn("UpsampleRgb565LinePair",Nn,2);var bi=e.UpsampleRgbLinePair,vi=e.UpsampleBgrLinePair,yi=e.UpsampleRgbaLinePair,wi=e.UpsampleBgraLinePair,_i=e.UpsampleArgbLinePair,xi=e.UpsampleRgba4444LinePair,ki=e.UpsampleRgb565LinePair,Si=16,Ai=1<<Si-1,Ni=-227,Li=482,Pi=6,Ci=(256<<Pi)-1,Ei=0,Ii=o(256),Oi=o(256),ji=o(256),zi=o(256),Fi=o(Li-Ni),Ti=o(Li-Ni);In("YuvToRgbRow",Sn,3),In("YuvToBgrRow",An,3),In("YuvToRgbaRow",En,4),In("YuvToBgraRow",Cn,4),In("YuvToArgbRow",Pn,4),In("YuvToRgba4444Row",Ln,2),In("YuvToRgb565Row",Nn,2);var Ri=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Mi=[0,2,8],Di=[8,7,6,4,4,2,2,2,1,1,1,1];this.WebPDecodeRGBA=function(e,n,a,c,l){var u=Tr,d=new tn,h=new se;d.ba=h,h.S=u,h.width=[h.width],h.height=[h.height];var f=h.width,p=h.height,m=new ae;if(null==m||null==e)var g=2;else t(null!=m),g=Fn(e,n,a,m.width,m.height,m.Pd,m.Qd,m.format,null);if(0!=g?f=0:(null!=f&&(f[0]=m.width[0]),null!=p&&(p[0]=m.height[0]),f=1),f){h.width=h.width[0],h.height=h.height[0],null!=c&&(c[0]=h.width),null!=l&&(l[0]=h.height);e:{if(c=new He,(l=new nn).data=e,l.w=n,l.ha=a,l.kd=1,n=[0],t(null!=l),(0==(e=Fn(l.data,l.w,l.ha,null,null,null,n,null,l))||7==e)&&n[0]&&(e=4),0==(n=e)){if(t(null!=d),c.data=l.data,c.w=l.w+l.offset,c.ha=l.ha-l.offset,c.put=fe,c.ac=he,c.bc=pe,c.ma=d,l.xa){if(null==(e=Pe())){d=1;break e}if(function(e,n){var r=[0],i=[0],o=[0];t:for(;;){if(null==e)return 0;if(null==n)return e.a=2,0;if(e.l=n,e.a=0,b(e.m,n.data,n.w,n.ha),!me(e.m,r,i,o)){e.a=3;break t}if(e.xb=pi,n.width=r[0],n.height=i[0],!Ce(r[0],i[0],1,e,null))break t;return 1}return t(0!=e.a),0}(e,c)){if(c=0==(n=Mn(c.width,c.height,d.Oa,d.ba))){t:{c=e;n:for(;;){if(null==c){c=0;break t}if(t(null!=c.s.yc),t(null!=c.s.Ya),t(0<c.s.Wb),t(null!=(a=c.l)),t(null!=(l=a.ma)),0!=c.xb){if(c.ca=l.ba,c.tb=l.tb,t(null!=c.ca),!Tn(l.Oa,a,Mr)){c.a=2;break n}if(!Ee(c,a.width))break n;if(a.da)break n;if((a.da||re(c.ca.S))&&gn(),11>c.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=c.ca.f.kb.F&&gn()),c.Pb&&0<c.s.ua&&null==c.s.vb.X&&!j(c.s.vb,c.s.Wa.Xa)){c.a=1;break n}c.xb=0}if(!Ne(c,c.V,c.Ba,c.c,c.i,a.o,xe))break n;l.Dc=c.Ma,c=1;break t}t(0!=c.a),c=0}c=!c}c&&(n=e.a)}else n=e.a}else{if(null==(e=new Ve)){d=1;break e}if(e.Fa=l.na,e.P=l.P,e.qc=l.Sa,Ke(e,c)){if(0==(n=Mn(c.width,c.height,d.Oa,d.ba))){if(e.Aa=0,a=d.Oa,t(null!=(l=e)),null!=a){if(0<(f=0>(f=a.Md)?0:100<f?255:255*f/100)){for(p=m=0;4>p;++p)12>(g=l.pb[p]).lc&&(g.ia=f*Di[0>g.lc?0:g.lc]>>3),m|=g.ia;m&&(alert("todo:VP8InitRandom"),l.ia=1)}l.Ga=a.Id,100<l.Ga?l.Ga=100:0>l.Ga&&(l.Ga=0)}(function(e,n){if(null==e)return 0;if(null==n)return Ge(e,2,"NULL VP8Io parameter in VP8Decode().");if(!e.cb&&!Ke(e,n))return 0;if(t(e.cb),null==n.ac||n.ac(n)){n.ob&&(e.L=0);var a=Mi[e.L];if(2==e.L?(e.yb=0,e.zb=0):(e.yb=n.v-a>>4,e.zb=n.j-a>>4,0>e.yb&&(e.yb=0),0>e.zb&&(e.zb=0)),e.Va=n.o+15+a>>4,e.Hb=n.va+15+a>>4,e.Hb>e.za&&(e.Hb=e.za),e.Va>e.Ub&&(e.Va=e.Ub),0<e.L){var c=e.ed;for(a=0;4>a;++a){var l;if(e.Qa.Cb){var u=e.Qa.Lb[a];e.Qa.Fb||(u+=c.Tb)}else u=c.Tb;for(l=0;1>=l;++l){var d=e.gd[a][l],h=u;if(c.Pc&&(h+=c.vd[0],l&&(h+=c.od[0])),0<(h=0>h?0:63<h?63:h)){var f=h;0<c.wb&&(f=4<c.wb?f>>2:f>>1)>9-c.wb&&(f=9-c.wb),1>f&&(f=1),d.dd=f,d.tc=2*h+f,d.ld=40<=h?2:15<=h?1:0}else d.tc=0;d.La=l}}}a=0}else Ge(e,6,"Frame setup failed"),a=e.a;if(a=0==a){if(a){e.$c=0,0<e.Aa||(e.Ic=1);t:{a=e.Ic,c=4*(f=e.za);var p=32*f,m=f+1,g=0<e.L?f*(0<e.Aa?2:1):0,b=(2==e.Aa?2:1)*f;if((d=c+832+(l=3*(16*a+Mi[e.L])/2*p)+(u=null!=e.Fa&&0<e.Fa.length?e.Kc.c*e.Kc.i:0))!=d)a=0;else{if(d>e.Vb){if(e.Vb=0,e.Ec=o(d),e.Fc=0,null==e.Ec){a=Ge(e,1,"no memory during frame initialization.");break t}e.Vb=d}d=e.Ec,h=e.Fc,e.Ac=d,e.Bc=h,h+=c,e.Gd=s(p,$e),e.Hd=0,e.rb=s(m+1,De),e.sb=1,e.wa=g?s(g,Me):null,e.Y=0,e.D.Nb=0,e.D.wa=e.wa,e.D.Y=e.Y,0<e.Aa&&(e.D.Y+=f),t(!0),e.oc=d,e.pc=h,h+=832,e.ya=s(b,qe),e.aa=0,e.D.ya=e.ya,e.D.aa=e.aa,2==e.Aa&&(e.D.aa+=f),e.R=16*f,e.B=8*f,f=(p=Mi[e.L])*e.R,p=p/2*e.B,e.sa=d,e.ta=h+f,e.qa=e.sa,e.ra=e.ta+16*a*e.R+p,e.Ha=e.qa,e.Ia=e.ra+8*a*e.B+p,e.$c=0,h+=l,e.mb=u?d:null,e.nb=u?h:null,t(h+u<=e.Fc+e.Vb),Xe(e),i(e.Ac,e.Bc,0,c),a=1}}if(a){if(n.ka=0,n.y=e.sa,n.O=e.ta,n.f=e.qa,n.N=e.ra,n.ea=e.Ha,n.Vd=e.Ia,n.fa=e.R,n.Rc=e.B,n.F=null,n.J=0,!Er){for(a=-255;255>=a;++a)_n[255+a]=0>a?-a:a;for(a=-1020;1020>=a;++a)Lr[1020+a]=-128>a?-128:127<a?127:a;for(a=-112;112>=a;++a)Pr[112+a]=-16>a?-16:15<a?15:a;for(a=-255;510>=a;++a)Cr[255+a]=0>a?0:255<a?255:a;Er=1}or=ct,sr=it,cr=ot,lr=st,ur=at,ar=rt,dr=Vt,hr=Gt,fr=Yt,pr=Xt,mr=Jt,gr=Kt,br=Qt,vr=en,yr=qt,wr=Ut,_r=$t,xr=Wt,di[0]=kt,di[1]=ut,di[2]=_t,di[3]=xt,di[4]=St,di[5]=Nt,di[6]=At,di[7]=Lt,di[8]=Ct,di[9]=Pt,ui[0]=gt,ui[1]=ht,ui[2]=ft,ui[3]=pt,ui[4]=bt,ui[5]=vt,ui[6]=yt,hi[0]=jt,hi[1]=dt,hi[2]=Et,hi[3]=It,hi[4]=Ft,hi[5]=zt,hi[6]=Tt,a=1}else a=0}a&&(a=function(e,n){for(e.M=0;e.M<e.Va;++e.M){var s,a=e.Jc[e.M&e.Xb],c=e.m,l=e;for(s=0;s<l.za;++s){var u=c,d=l,h=d.Ac,f=d.Bc+4*s,p=d.zc,m=d.ya[d.aa+s];if(d.Qa.Bb?m.$b=P(u,d.Pa.jb[0])?2+P(u,d.Pa.jb[2]):P(u,d.Pa.jb[1]):m.$b=0,d.kc&&(m.Ad=P(u,d.Bd)),m.Za=!P(u,145)+0,m.Za){var g=m.Ob,b=0;for(d=0;4>d;++d){var v,y=p[0+d];for(v=0;4>v;++v){y=ai[h[f+v]][y];for(var w=oi[P(u,y[0])];0<w;)w=oi[2*w+P(u,y[w])];y=-w,h[f+v]=y}r(g,b,h,f,4),b+=4,p[0+d]=y}}else y=P(u,156)?P(u,128)?1:3:P(u,163)?2:0,m.Ob[0]=y,i(h,f,y,4),i(p,0,y,4);m.Dd=P(u,142)?P(u,114)?P(u,183)?1:3:2:0}if(l.m.Ka)return Ge(e,7,"Premature end-of-partition0 encountered.");for(;e.ja<e.za;++e.ja){if(l=a,u=(c=e).rb[c.sb-1],h=c.rb[c.sb+c.ja],s=c.ya[c.aa+c.ja],f=c.kc?s.Ad:0)u.la=h.la=0,s.Za||(u.Na=h.Na=0),s.Hc=0,s.Gc=0,s.ia=0;else{var _,x;if(u=h,h=l,f=c.Pa.Xc,p=c.ya[c.aa+c.ja],m=c.pb[p.$b],d=p.ad,g=0,b=c.rb[c.sb-1],y=v=0,i(d,g,0,384),p.Za)var k=0,S=f[3];else{w=o(16);var A=u.Na+b.Na;if(A=ni(h,f[1],A,m.Eb,0,w,0),u.Na=b.Na=(0<A)+0,1<A)or(w,0,d,g);else{var N=w[0]+3>>3;for(w=0;256>w;w+=16)d[g+w]=N}k=1,S=f[0]}var L=15&u.la,C=15&b.la;for(w=0;4>w;++w){var E=1&C;for(N=x=0;4>N;++N)L=L>>1|(E=(A=ni(h,S,A=E+(1&L),m.Sc,k,d,g))>k)<<7,x=x<<2|(3<A?3:1<A?2:0!=d[g+0]),g+=16;L>>=4,C=C>>1|E<<7,v=(v<<8|x)>>>0}for(S=L,k=C>>4,_=0;4>_;_+=2){for(x=0,L=u.la>>4+_,C=b.la>>4+_,w=0;2>w;++w){for(E=1&C,N=0;2>N;++N)A=E+(1&L),L=L>>1|(E=0<(A=ni(h,f[2],A,m.Qc,0,d,g)))<<3,x=x<<2|(3<A?3:1<A?2:0!=d[g+0]),g+=16;L>>=2,C=C>>1|E<<5}y|=x<<4*_,S|=L<<4<<_,k|=(240&C)<<_}u.la=S,b.la=k,p.Hc=v,p.Gc=y,p.ia=43690&y?0:m.ia,f=!(v|y)}if(0<c.L&&(c.wa[c.Y+c.ja]=c.gd[s.$b][s.Za],c.wa[c.Y+c.ja].La|=!f),l.Ka)return Ge(e,7,"Premature end-of-file encountered.")}if(Xe(e),c=n,l=1,s=(a=e).D,u=0<a.L&&a.M>=a.zb&&a.M<=a.Va,0==a.Aa)t:{if(s.M=a.M,s.uc=u,zn(a,s),l=1,s=(x=a.D).Nb,u=(y=Mi[a.L])*a.R,h=y/2*a.B,w=16*s*a.R,N=8*s*a.B,f=a.sa,p=a.ta-u+w,m=a.qa,d=a.ra-h+N,g=a.Ha,b=a.Ia-h+N,C=0==(L=x.M),v=L>=a.Va-1,2==a.Aa&&zn(a,x),x.uc)for(E=(A=a).D.M,t(A.D.uc),x=A.yb;x<A.Hb;++x){k=x,S=E;var I=(O=(q=A).D).Nb;_=q.R;var O=O.wa[O.Y+k],j=q.sa,z=q.ta+16*I*_+16*k,F=O.dd,T=O.tc;if(0!=T)if(t(3<=T),1==q.L)0<k&&wr(j,z,_,T+4),O.La&&xr(j,z,_,T),0<S&&yr(j,z,_,T+4),O.La&&_r(j,z,_,T);else{var R=q.B,M=q.qa,D=q.ra+8*I*R+8*k,B=q.Ha,q=q.Ia+8*I*R+8*k;I=O.ld,0<k&&(hr(j,z,_,T+4,F,I),pr(M,D,B,q,R,T+4,F,I)),O.La&&(gr(j,z,_,T,F,I),vr(M,D,B,q,R,T,F,I)),0<S&&(dr(j,z,_,T+4,F,I),fr(M,D,B,q,R,T+4,F,I)),O.La&&(mr(j,z,_,T,F,I),br(M,D,B,q,R,T,F,I))}}if(a.ia&&alert("todo:DitherRow"),null!=c.put){if(x=16*L,L=16*(L+1),C?(c.y=a.sa,c.O=a.ta+w,c.f=a.qa,c.N=a.ra+N,c.ea=a.Ha,c.W=a.Ia+N):(x-=y,c.y=f,c.O=p,c.f=m,c.N=d,c.ea=g,c.W=b),v||(L-=y),L>c.o&&(L=c.o),c.F=null,c.J=null,null!=a.Fa&&0<a.Fa.length&&x<L&&(c.J=dn(a,c,x,L-x),c.F=a.mb,null==c.F&&0==c.F.length)){l=Ge(a,3,"Could not decode alpha data.");break t}x<c.j&&(y=c.j-x,x=c.j,t(!(1&y)),c.O+=a.R*y,c.N+=a.B*(y>>1),c.W+=a.B*(y>>1),null!=c.F&&(c.J+=c.width*y)),x<L&&(c.O+=c.v,c.N+=c.v>>1,c.W+=c.v>>1,null!=c.F&&(c.J+=c.v),c.ka=x-c.j,c.U=c.va-c.v,c.T=L-x,l=c.put(c))}s+1!=a.Ic||v||(r(a.sa,a.ta-u,f,p+16*a.R,u),r(a.qa,a.ra-h,m,d+8*a.B,h),r(a.Ha,a.Ia-h,g,b+8*a.B,h))}if(!l)return Ge(e,6,"Output aborted.")}return 1}(e,n)),null!=n.bc&&n.bc(n),a&=1}return a?(e.cb=0,a):0})(e,c)||(n=e.a)}}else n=e.a}0==n&&null!=d.Oa&&d.Oa.fd&&(n=Rn(d.ba))}d=n}u=0!=d?null:11>u?h.f.RGBA.eb:h.f.kb.y}else u=null;return u};var Bi=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function l(e,t){for(var n="",r=0;r<4;r++)n+=String.fromCharCode(e[t++]);return n}function u(e,t){return e[t+0]|e[t+1]<<8}function d(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16)>>>0}function h(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}new c;var f=[0],p=[0],m=[],g=new c,b=e,v=function(e,t){var n={},r=0,i=!1,o=0,s=0;if(n.frames=[],!function(e,t){for(var n=0;n<4;n++)if(e[t+n]!="RIFF".charCodeAt(n))return!0;return!1}(e,t)){for(h(e,t+=4),t+=8;t<e.length;){var a=l(e,t),c=h(e,t+=4);t+=4;var f=c+(1&c);switch(a){case"VP8 ":case"VP8L":void 0===n.frames[r]&&(n.frames[r]={}),(g=n.frames[r]).src_off=i?s:t-8,g.src_size=o+c+8,r++,i&&(i=!1,o=0,s=0);break;case"VP8X":(g=n.header={}).feature_flags=e[t];var p=t+4;g.canvas_width=1+d(e,p),p+=3,g.canvas_height=1+d(e,p),p+=3;break;case"ALPH":i=!0,o=f+8,s=t-8;break;case"ANIM":(g=n.header).bgcolor=h(e,t),p=t+4,g.loop_count=u(e,p),p+=2;break;case"ANMF":var m,g;(g=n.frames[r]={}).offset_x=2*d(e,t),t+=3,g.offset_y=2*d(e,t),t+=3,g.width=1+d(e,t),t+=3,g.height=1+d(e,t),t+=3,g.duration=d(e,t),t+=3,m=e[t++],g.dispose=1&m,g.blend=m>>1&1}"ANMF"!=a&&(t+=f)}return n}}(b,0);v.response=b,v.rgbaoutput=!0,v.dataurl=!1;var y=v.header?v.header:null,w=v.frames?v.frames:null;if(y){y.loop_counter=y.loop_count,f=[y.canvas_height],p=[y.canvas_width];for(var _=0;_<w.length&&0!=w[_].blend;_++);}var x=w[0],k=g.WebPDecodeRGBA(b,x.src_off,x.src_size,p,f);x.rgba=k,x.imgwidth=p[0],x.imgheight=f[0];for(var S=0;S<p[0]*f[0]*4;S++)m[S]=k[S];return this.width=p,this.height=f,this.data=m,this}function uh(){var e,t=this.internal.__metadata__.metadata,n=unescape(encodeURIComponent(t));e=this.internal.__metadata__.rawXml?n:'<x:xmpmeta xmlns:x="adobe:ns:meta/"><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>'+n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")+"</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>",this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+e.length+" >>"),this.internal.write("stream"),this.internal.write(e),this.internal.write("endstream"),this.internal.write("endobj")}function dh(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}!function(e){var t,n,r,i,o,s,a,c,l,u=function(e){return e=e||{},this.isStrokeTransparent=e.isStrokeTransparent||!1,this.strokeOpacity=e.strokeOpacity||1,this.strokeStyle=e.strokeStyle||"#000000",this.fillStyle=e.fillStyle||"#000000",this.isFillTransparent=e.isFillTransparent||!1,this.fillOpacity=e.fillOpacity||1,this.font=e.font||"10px sans-serif",this.textBaseline=e.textBaseline||"alphabetic",this.textAlign=e.textAlign||"left",this.lineWidth=e.lineWidth||1,this.lineJoin=e.lineJoin||"miter",this.lineCap=e.lineCap||"butt",this.path=e.path||[],this.transform=void 0!==e.transform?e.transform.clone():new c,this.globalCompositeOperation=e.globalCompositeOperation||"normal",this.globalAlpha=e.globalAlpha||1,this.clip_path=e.clip_path||[],this.currentPoint=e.currentPoint||new s,this.miterLimit=e.miterLimit||10,this.lastPoint=e.lastPoint||new s,this.lineDashOffset=e.lineDashOffset||0,this.lineDash=e.lineDash||[],this.margin=e.margin||[0,0,0,0],this.prevPageLastElemOffset=e.prevPageLastElemOffset||0,this.ignoreClearRect="boolean"!=typeof e.ignoreClearRect||e.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new d(this),t=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,o=this.internal.getVerticalCoordinate,s=this.internal.Point,a=this.internal.Rectangle,c=this.internal.Matrix,l=new u}]);var d=function(e){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var t=e;Object.defineProperty(this,"pdf",{get:function(){return t}});var n=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return n},set:function(e){n=Boolean(e)}});var r=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return r},set:function(e){r=Boolean(e)}});var i=0;Object.defineProperty(this,"posX",{get:function(){return i},set:function(e){isNaN(e)||(i=e)}});var o=0;Object.defineProperty(this,"posY",{get:function(){return o},set:function(e){isNaN(e)||(o=e)}}),Object.defineProperty(this,"margin",{get:function(){return l.margin},set:function(e){var t;"number"==typeof e?t=[e,e,e,e]:((t=new Array(4))[0]=e[0],t[1]=e.length>=2?e[1]:t[0],t[2]=e.length>=3?e[2]:t[0],t[3]=e.length>=4?e[3]:t[1]),l.margin=t}});var s=!1;Object.defineProperty(this,"autoPaging",{get:function(){return s},set:function(e){s=e}});var a=0;Object.defineProperty(this,"lastBreak",{get:function(){return a},set:function(e){a=e}});var c=[];Object.defineProperty(this,"pageBreaks",{get:function(){return c},set:function(e){c=e}}),Object.defineProperty(this,"ctx",{get:function(){return l},set:function(e){e instanceof u&&(l=e)}}),Object.defineProperty(this,"path",{get:function(){return l.path},set:function(e){l.path=e}});var d=[];Object.defineProperty(this,"ctxStack",{get:function(){return d},set:function(e){d=e}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(e){var t;t=h(e),this.ctx.fillStyle=t.style,this.ctx.isFillTransparent=0===t.a,this.ctx.fillOpacity=t.a,this.pdf.setFillColor(t.r,t.g,t.b,{a:t.a}),this.pdf.setTextColor(t.r,t.g,t.b,{a:t.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(e){var t=h(e);this.ctx.strokeStyle=t.style,this.ctx.isStrokeTransparent=0===t.a,this.ctx.strokeOpacity=t.a,0===t.a?this.pdf.setDrawColor(255,255,255):(t.a,this.pdf.setDrawColor(t.r,t.g,t.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(e){-1!==["butt","round","square"].indexOf(e)&&(this.ctx.lineCap=e,this.pdf.setLineCap(e))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(e){isNaN(e)||(this.ctx.lineWidth=e,this.pdf.setLineWidth(e))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(e){-1!==["bevel","round","miter"].indexOf(e)&&(this.ctx.lineJoin=e,this.pdf.setLineJoin(e))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(e){isNaN(e)||(this.ctx.miterLimit=e,this.pdf.setMiterLimit(e))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(e){this.ctx.textBaseline=e}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(e){-1!==["right","end","center","left","start"].indexOf(e)&&(this.ctx.textAlign=e)}});var f=null,p=null,m=null;Object.defineProperty(this,"fontFaces",{get:function(){return m},set:function(e){f=null,p=null,m=e}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(e){var t;if(this.ctx.font=e,null!==(t=/^\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(e))){var n=t[1];t[2];var r=t[3],i=t[4];t[5];var o=t[6],s=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(i)[2];i="px"===s?Math.floor(parseFloat(i)*this.pdf.internal.scaleFactor):"em"===s?Math.floor(parseFloat(i)*this.pdf.getFontSize()):Math.floor(parseFloat(i)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(i);var a=function(e){var t,n,r=[],i=e.trim();if(""===i)return Vd;if(i in Rd)return[Rd[i]];for(;""!==i;){switch(n=null,t=(i=Dd(i)).charAt(0)){case'"':case"'":n=Bd(i.substring(1),t);break;default:n=qd(i)}if(null===n)return Vd;if(r.push(n[0]),""!==(i=Dd(n[1]))&&","!==i.charAt(0))return Vd;i=i.replace(/^,/,"")}return r}(o);if(this.fontFaces){var c=function(e,t){var n=e.getFontList(),r=JSON.stringify(n);if(null===f||p!==r){var i=function(e){var t=[];return Object.keys(e).forEach(function(n){e[n].forEach(function(e){var r=null;switch(e){case"bold":r={family:n,weight:"bold"};break;case"italic":r={family:n,style:"italic"};break;case"bolditalic":r={family:n,weight:"bold",style:"italic"};break;case"":case"normal":r={family:n}}null!==r&&(r.ref={name:n,style:e},t.push(r))})}),t}(n);f=function(e){for(var t={},n=0;n<e.length;++n){var r=zd(e[n]),i=r.family,o=r.stretch,s=r.style,a=r.weight;t[i]=t[i]||{},t[i][o]=t[i][o]||{},t[i][o][s]=t[i][o][s]||{},t[i][o][s][a]=r}return t}(i.concat(t)),p=r}return f}(this.pdf,this.fontFaces),l=a.map(function(e){return{family:e,stretch:"normal",weight:r,style:n}}),u=function(e,t,n){for(var r=(n=n||{}).defaultFontFamily||"times",i=Object.assign({},Td,n.genericFontFamilies||{}),o=null,s=null,a=0;a<t.length;++a)if(i[(o=zd(t[a])).family]&&(o.family=i[o.family]),e.hasOwnProperty(o.family)){s=e[o.family];break}if(!(s=s||e[r]))throw new Error("Could not find a font-family for the rule '"+Md(o)+"' and default family '"+r+"'.");if(s=function(e,t){if(t[e])return t[e];var n=Id[e],r=n<=Id.normal?-1:1,i=Fd(t,Ed,n,r);if(!i)throw new Error("Could not find a matching font-stretch value for "+e);return i}(o.stretch,s),s=function(e,t){if(t[e])return t[e];for(var n=Cd[e],r=0;r<n.length;++r)if(t[n[r]])return t[n[r]];throw new Error("Could not find a matching font-style for "+e)}(o.style,s),!(s=function(e,t){if(t[e])return t[e];if(400===e&&t[500])return t[500];if(500===e&&t[400])return t[400];var n=jd[e],r=Fd(t,Od,n,e<400?-1:1);if(!r)throw new Error("Could not find a matching font-weight for value "+e);return r}(o.weight,s)))throw new Error("Failed to resolve a font for the rule '"+Md(o)+"'.");return s}(c,l);this.pdf.setFont(u.ref.name,u.ref.style)}else{var d="";("bold"===r||parseInt(r,10)>=700||"bold"===n)&&(d="bold"),"italic"===n&&(d+="italic"),0===d.length&&(d="normal");for(var h="",m={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"},g=0;g<a.length;g++){if(void 0!==this.pdf.internal.getFont(a[g],d,{noFallback:!0,disableWarning:!0})){h=a[g];break}if("bolditalic"===d&&void 0!==this.pdf.internal.getFont(a[g],"bold",{noFallback:!0,disableWarning:!0}))h=a[g],d="bold";else if(void 0!==this.pdf.internal.getFont(a[g],"normal",{noFallback:!0,disableWarning:!0})){h=a[g],d="normal";break}}if(""===h)for(var b=0;b<a.length;b++)if(m[a[b]]){h=m[a[b]];break}h=""===h?"Times":h,this.pdf.setFont(h,d)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(e){this.ctx.globalCompositeOperation=e}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(e){this.ctx.globalAlpha=e}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(e){this.ctx.lineDashOffset=e,R.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(e){this.ctx.lineDash=e,R.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(e){this.ctx.ignoreClearRect=Boolean(e)}})};d.prototype.setLineDash=function(e){this.lineDash=e},d.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},d.prototype.fill=function(){w.call(this,"fill",!1)},d.prototype.stroke=function(){w.call(this,"stroke",!1)},d.prototype.beginPath=function(){this.path=[{type:"begin"}]},d.prototype.moveTo=function(e,t){if(isNaN(e)||isNaN(t))throw au.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var n=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"mt",x:n.x,y:n.y}),this.ctx.lastPoint=new s(e,t)},d.prototype.closePath=function(){var e=new s(0,0),t=0;for(t=this.path.length-1;-1!==t;t--)if("begin"===this.path[t].type&&"object"===(0,xo.A)(this.path[t+1])&&"number"==typeof this.path[t+1].x){e=new s(this.path[t+1].x,this.path[t+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new s(e.x,e.y)},d.prototype.lineTo=function(e,t){if(isNaN(e)||isNaN(t))throw au.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var n=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"lt",x:n.x,y:n.y}),this.ctx.lastPoint=new s(n.x,n.y)},d.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),w.call(this,null,!0)},d.prototype.quadraticCurveTo=function(e,t,n,r){if(isNaN(n)||isNaN(r)||isNaN(e)||isNaN(t))throw au.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var i=this.ctx.transform.applyToPoint(new s(n,r)),o=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"qct",x1:o.x,y1:o.y,x:i.x,y:i.y}),this.ctx.lastPoint=new s(i.x,i.y)},d.prototype.bezierCurveTo=function(e,t,n,r,i,o){if(isNaN(i)||isNaN(o)||isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw au.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var a=this.ctx.transform.applyToPoint(new s(i,o)),c=this.ctx.transform.applyToPoint(new s(e,t)),l=this.ctx.transform.applyToPoint(new s(n,r));this.path.push({type:"bct",x1:c.x,y1:c.y,x2:l.x,y2:l.y,x:a.x,y:a.y}),this.ctx.lastPoint=new s(a.x,a.y)},d.prototype.arc=function(e,t,n,r,i,o){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i))throw au.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(o=Boolean(o),!this.ctx.transform.isIdentity){var a=this.ctx.transform.applyToPoint(new s(e,t));e=a.x,t=a.y;var c=this.ctx.transform.applyToPoint(new s(0,n)),l=this.ctx.transform.applyToPoint(new s(0,0));n=Math.sqrt(Math.pow(c.x-l.x,2)+Math.pow(c.y-l.y,2))}Math.abs(i-r)>=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:e,y:t,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},d.prototype.arcTo=function(e,t,n,r,i){throw new Error("arcTo not implemented.")},d.prototype.rect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw au.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.lineTo(e,t),this.lineTo(e+n,t),this.lineTo(e,t)},d.prototype.fillRect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw au.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.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(e,t,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},d.prototype.strokeRect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw au.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");p.call(this)||(this.beginPath(),this.rect(e,t,n,r),this.stroke())},d.prototype.clearRect=function(e,t,n,r){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r))throw au.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(e,t,n,r))},d.prototype.save=function(e){e="boolean"!=typeof e||e;for(var t=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(t),e){this.ctx.fontSize=this.pdf.internal.getFontSize();var r=new u(this.ctx);this.ctxStack.push(this.ctx),this.ctx=r}},d.prototype.restore=function(e){e="boolean"!=typeof e||e;for(var t=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(t),e&&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)},d.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var h=function(e){var t,n,r,i;if(!0===e.isCanvasGradient&&(e=e.getColor()),!e)return{r:0,g:0,b:0,a:0,style:e};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(e))t=0,n=0,r=0,i=0;else{var o=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(null!==o)t=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3]),i=1;else if(null!==(o=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(e)))t=parseInt(o[1]),n=parseInt(o[2]),r=parseInt(o[3]),i=parseFloat(o[4]);else{if(i=1,"string"==typeof e&&"#"!==e.charAt(0)){var s=new hu(e);e=s.ok?s.toHex():"#000000"}4===e.length?(t=e.substring(1,2),t+=t,n=e.substring(2,3),n+=n,r=e.substring(3,4),r+=r):(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7)),t=parseInt(t,16),n=parseInt(n,16),r=parseInt(r,16)}}return{r:t,g:n,b:r,a:i,style:e}},f=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},p=function(){return Boolean(this.ctx.isStrokeTransparent||0==this.globalAlpha)};d.prototype.fillText=function(e,t,n,r){if(isNaN(t)||isNaN(n)||"string"!=typeof e)throw au.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(r=isNaN(r)?void 0:r,!f.call(this)){var i=z(this.ctx.transform.rotation),o=this.ctx.transform.scaleX;P.call(this,{text:e,x:t,y:n,scale:o,angle:i,align:this.textAlign,maxWidth:r})}},d.prototype.strokeText=function(e,t,n,r){if(isNaN(t)||isNaN(n)||"string"!=typeof e)throw au.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!p.call(this)){r=isNaN(r)?void 0:r;var i=z(this.ctx.transform.rotation),o=this.ctx.transform.scaleX;P.call(this,{text:e,x:t,y:n,scale:o,renderingMode:"stroke",angle:i,align:this.textAlign,maxWidth:r})}},d.prototype.measureText=function(e){if("string"!=typeof e)throw au.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var t=this.pdf,n=this.pdf.internal.scaleFactor,r=t.internal.getFontSize(),i=t.getStringUnitWidth(e)*r/t.internal.scaleFactor;return new function(e){var t=(e=e||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return t}}),this}({width:i*=Math.round(96*n/72*1e4)/1e4})},d.prototype.scale=function(e,t){if(isNaN(e)||isNaN(t))throw au.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var n=new c(e,0,0,t,0,0);this.ctx.transform=this.ctx.transform.multiply(n)},d.prototype.rotate=function(e){if(isNaN(e))throw au.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var t=new c(Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0);this.ctx.transform=this.ctx.transform.multiply(t)},d.prototype.translate=function(e,t){if(isNaN(e)||isNaN(t))throw au.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var n=new c(1,0,0,1,e,t);this.ctx.transform=this.ctx.transform.multiply(n)},d.prototype.transform=function(e,t,n,r,i,o){if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(r)||isNaN(i)||isNaN(o))throw au.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var s=new c(e,t,n,r,i,o);this.ctx.transform=this.ctx.transform.multiply(s)},d.prototype.setTransform=function(e,t,n,r,i,o){e=isNaN(e)?1:e,t=isNaN(t)?0:t,n=isNaN(n)?0:n,r=isNaN(r)?1:r,i=isNaN(i)?0:i,o=isNaN(o)?0:o,this.ctx.transform=new c(e,t,n,r,i,o)};var m=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};d.prototype.drawImage=function(e,t,n,r,i,o,s,l,u){var d=this.pdf.getImageProperties(e),h=1,f=1,p=1,b=1;void 0!==r&&void 0!==l&&(p=l/r,b=u/i,h=d.width/r*l/r,f=d.height/i*u/i),void 0===o&&(o=t,s=n,t=0,n=0),void 0!==r&&void 0===l&&(l=r,u=i),void 0===r&&void 0===l&&(l=d.width,u=d.height);var w=this.ctx.transform.decompose(),x=z(w.rotate.shx),k=new c,S=(k=(k=(k=k.multiply(w.translate)).multiply(w.skew)).multiply(w.scale)).applyToRectangle(new a(o-t*p,s-n*b,r*h,i*f));if(this.autoPaging){for(var A,N=g.call(this,S),L=[],P=0;P<N.length;P+=1)-1===L.indexOf(N[P])&&L.push(N[P]);y(L);for(var C=L[0],E=L[L.length-1],I=C;I<E+1;I++){this.pdf.setPage(I);var O=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],j=1===I?this.posY+this.margin[0]:this.margin[0],F=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],T=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],R=1===I?0:F+(I-2)*T;if(0!==this.ctx.clip_path.length){var M=this.path;A=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(A,this.posX+this.margin[3],-R+j+this.ctx.prevPageLastElemOffset),_.call(this,"fill",!0),this.path=M}var D=JSON.parse(JSON.stringify(S));D=v([D],this.posX+this.margin[3],-R+j+this.ctx.prevPageLastElemOffset)[0];var B=(I>C||I<E)&&m.call(this);B&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],O,T,null).clip().discardPath()),this.pdf.addImage(e,"JPEG",D.x,D.y,D.w,D.h,null,null,x),B&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(e,"JPEG",S.x,S.y,S.w,S.h,null,null,x)};var g=function(e,t,n){var r=[];t=t||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(e.type){default:case"mt":case"lt":r.push(Math.floor((e.y+i)/n)+1);break;case"arc":r.push(Math.floor((e.y+i-e.radius)/n)+1),r.push(Math.floor((e.y+i+e.radius)/n)+1);break;case"qct":var o=F(this.ctx.lastPoint.x,this.ctx.lastPoint.y,e.x1,e.y1,e.x,e.y);r.push(Math.floor((o.y+i)/n)+1),r.push(Math.floor((o.y+o.h+i)/n)+1);break;case"bct":var s=T(this.ctx.lastPoint.x,this.ctx.lastPoint.y,e.x1,e.y1,e.x2,e.y2,e.x,e.y);r.push(Math.floor((s.y+i)/n)+1),r.push(Math.floor((s.y+s.h+i)/n)+1);break;case"rect":r.push(Math.floor((e.y+i)/n)+1),r.push(Math.floor((e.y+e.h+i)/n)+1)}for(var a=0;a<r.length;a+=1)for(;this.pdf.internal.getNumberOfPages()<r[a];)b.call(this);return r},b=function(){var e=this.fillStyle,t=this.strokeStyle,n=this.font,r=this.lineCap,i=this.lineWidth,o=this.lineJoin;this.pdf.addPage(),this.fillStyle=e,this.strokeStyle=t,this.font=n,this.lineCap=r,this.lineWidth=i,this.lineJoin=o},v=function(e,t,n){for(var r=0;r<e.length;r++)switch(e[r].type){case"bct":e[r].x2+=t,e[r].y2+=n;case"qct":e[r].x1+=t,e[r].y1+=n;default:e[r].x+=t,e[r].y+=n}return e},y=function(e){return e.sort(function(e,t){return e-t})},w=function(e,t){var n=this.fillStyle,r=this.strokeStyle,i=this.lineCap,o=this.lineWidth,s=Math.abs(o*this.ctx.transform.scaleX),a=this.lineJoin;if(this.autoPaging){for(var c,l,u=JSON.parse(JSON.stringify(this.path)),d=JSON.parse(JSON.stringify(this.path)),h=[],f=0;f<d.length;f++)if(void 0!==d[f].x)for(var p=g.call(this,d[f]),w=0;w<p.length;w+=1)-1===h.indexOf(p[w])&&h.push(p[w]);for(var x=0;x<h.length;x++)for(;this.pdf.internal.getNumberOfPages()<h[x];)b.call(this);y(h);for(var k=h[0],S=h[h.length-1],A=k;A<S+1;A++){this.pdf.setPage(A),this.fillStyle=n,this.strokeStyle=r,this.lineCap=i,this.lineWidth=s,this.lineJoin=a;var N=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],L=1===A?this.posY+this.margin[0]:this.margin[0],P=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],E=1===A?0:P+(A-2)*C;if(0!==this.ctx.clip_path.length){var I=this.path;c=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(c,this.posX+this.margin[3],-E+L+this.ctx.prevPageLastElemOffset),_.call(this,e,!0),this.path=I}if(l=JSON.parse(JSON.stringify(u)),this.path=v(l,this.posX+this.margin[3],-E+L+this.ctx.prevPageLastElemOffset),!1===t||0===A){var O=(A>k||A<S)&&m.call(this);O&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],N,C,null).clip().discardPath()),_.call(this,e,t),O&&this.pdf.restoreGraphicsState()}this.lineWidth=o}this.path=u}else this.lineWidth=s,_.call(this,e,t),this.lineWidth=o},_=function(e,t){if(("stroke"!==e||t||!p.call(this))&&("stroke"===e||t||!f.call(this))){for(var n,r,i=[],o=this.path,s=0;s<o.length;s++){var a=o[s];switch(a.type){case"begin":i.push({begin:!0});break;case"close":i.push({close:!0});break;case"mt":i.push({start:a,deltas:[],abs:[]});break;case"lt":var c=i.length;if(o[s-1]&&!isNaN(o[s-1].x)&&(n=[a.x-o[s-1].x,a.y-o[s-1].y],c>0))for(;c>=0;c--)if(!0!==i[c-1].close&&!0!==i[c-1].begin){i[c-1].deltas.push(n),i[c-1].abs.push(a);break}break;case"bct":n=[a.x1-o[s-1].x,a.y1-o[s-1].y,a.x2-o[s-1].x,a.y2-o[s-1].y,a.x-o[s-1].x,a.y-o[s-1].y],i[i.length-1].deltas.push(n);break;case"qct":var l=o[s-1].x+2/3*(a.x1-o[s-1].x),u=o[s-1].y+2/3*(a.y1-o[s-1].y),d=a.x+2/3*(a.x1-a.x),h=a.y+2/3*(a.y1-a.y),m=a.x,g=a.y;n=[l-o[s-1].x,u-o[s-1].y,d-o[s-1].x,h-o[s-1].y,m-o[s-1].x,g-o[s-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(a)}}r=t?null:"stroke"===e?"stroke":"fill";for(var b=!1,v=0;v<i.length;v++)if(i[v].arc)for(var y=i[v].abs,w=0;w<y.length;w++){var _=y[w];"arc"===_.type?S.call(this,_.x,_.y,_.radius,_.startAngle,_.endAngle,_.counterclockwise,void 0,t,!b):C.call(this,_.x,_.y),b=!0}else if(!0===i[v].close)this.pdf.internal.out("h"),b=!1;else if(!0!==i[v].begin){var x=i[v].start.x,k=i[v].start.y;E.call(this,i[v].deltas,x,k),b=!0}r&&A.call(this,r),t&&N.call(this)}},x=function(e){var t=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,n=t*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return e-n;case"top":return e+t-n;case"hanging":return e+t-2*n;case"middle":return e+t/2-n;default:return e}},k=function(e){return e+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};d.prototype.createLinearGradient=function(){var e=function(){};return e.colorStops=[],e.addColorStop=function(e,t){this.colorStops.push([e,t])},e.getColor=function(){return 0===this.colorStops.length?"#000000":this.colorStops[0][1]},e.isCanvasGradient=!0,e},d.prototype.createPattern=function(){return this.createLinearGradient()},d.prototype.createRadialGradient=function(){return this.createLinearGradient()};var S=function(e,t,n,r,i,o,s,a,c){for(var l=O.call(this,n,r,i,o),u=0;u<l.length;u++){var d=l[u];0===u&&(c?L.call(this,d.x1+e,d.y1+t):C.call(this,d.x1+e,d.y1+t)),I.call(this,e,t,d.x2,d.y2,d.x3,d.y3,d.x4,d.y4)}a?N.call(this):A.call(this,s)},A=function(e){switch(e){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},N=function(){this.pdf.clip(),this.pdf.discardPath()},L=function(e,t){this.pdf.internal.out(n(e)+" "+r(t)+" m")},P=function(e){var t;switch(e.align){case"right":case"end":t="right";break;case"center":t="center";break;default:t="left"}var n,r,i,o=this.pdf.getTextDimensions(e.text),l=x.call(this,e.y),u=k.call(this,l)-o.h,d=this.ctx.transform.applyToPoint(new s(e.x,l));if(this.autoPaging){var h=this.ctx.transform.decompose(),f=new c;f=(f=(f=f.multiply(h.translate)).multiply(h.skew)).multiply(h.scale);for(var p=this.ctx.transform.applyToRectangle(new a(e.x,l,o.w,o.h)),b=f.applyToRectangle(new a(e.x,u,o.w,o.h)),w=g.call(this,b),S=[],A=0;A<w.length;A+=1)-1===S.indexOf(w[A])&&S.push(w[A]);y(S);for(var N=S[0],L=S[S.length-1],P=N;P<L+1;P++){this.pdf.setPage(P);var C=1===P?this.posY+this.margin[0]:this.margin[0],E=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],I=this.pdf.internal.pageSize.height-this.margin[2],O=I-this.margin[0],j=this.pdf.internal.pageSize.width-this.margin[1],z=j-this.margin[3],F=1===P?0:E+(P-2)*O;if(0!==this.ctx.clip_path.length){var T=this.path;n=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(n,this.posX+this.margin[3],-1*F+C),_.call(this,"fill",!0),this.path=T}var R=v([JSON.parse(JSON.stringify(b))],this.posX+this.margin[3],-F+C+this.ctx.prevPageLastElemOffset)[0];e.scale>=.01&&(r=this.pdf.internal.getFontSize(),this.pdf.setFontSize(r*e.scale),i=this.lineWidth,this.lineWidth=i*e.scale);var M="text"!==this.autoPaging;if(M||R.y+R.h<=I){if(M||R.y>=C&&R.x<=j){var D=M?e.text:this.pdf.splitTextToSize(e.text,e.maxWidth||j-R.x)[0],B=v([JSON.parse(JSON.stringify(p))],this.posX+this.margin[3],-F+C+this.ctx.prevPageLastElemOffset)[0],q=M&&(P>N||P<L)&&m.call(this);q&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],z,O,null).clip().discardPath()),this.pdf.text(D,B.x,B.y,{angle:e.angle,align:t,renderingMode:e.renderingMode}),q&&this.pdf.restoreGraphicsState()}}else R.y<I&&(this.ctx.prevPageLastElemOffset+=I-R.y);e.scale>=.01&&(this.pdf.setFontSize(r),this.lineWidth=i)}}else e.scale>=.01&&(r=this.pdf.internal.getFontSize(),this.pdf.setFontSize(r*e.scale),i=this.lineWidth,this.lineWidth=i*e.scale),this.pdf.text(e.text,d.x+this.posX,d.y+this.posY,{angle:e.angle,align:t,renderingMode:e.renderingMode,maxWidth:e.maxWidth}),e.scale>=.01&&(this.pdf.setFontSize(r),this.lineWidth=i)},C=function(e,t,i,o){i=i||0,o=o||0,this.pdf.internal.out(n(e+i)+" "+r(t+o)+" l")},E=function(e,t,n){return this.pdf.lines(e,t,n,null,null)},I=function(e,n,r,s,a,c,l,u){this.pdf.internal.out([t(i(r+e)),t(o(s+n)),t(i(a+e)),t(o(c+n)),t(i(l+e)),t(o(u+n)),"c"].join(" "))},O=function(e,t,n,r){for(var i=2*Math.PI,o=Math.PI/2;t>n;)t-=i;var s=Math.abs(n-t);s<i&&r&&(s=i-s);for(var a=[],c=r?-1:1,l=t;s>1e-5;){var u=l+c*Math.min(s,o);a.push(j.call(this,e,l,u)),s-=Math.abs(u-l),l=u}return a},j=function(e,t,n){var r=(n-t)/2,i=e*Math.cos(r),o=e*Math.sin(r),s=i,a=-o,c=s*s+a*a,l=c+s*i+a*o,u=4/3*(Math.sqrt(2*c*l)-l)/(s*o-a*i),d=s-u*a,h=a+u*s,f=d,p=-h,m=r+t,g=Math.cos(m),b=Math.sin(m);return{x1:e*Math.cos(t),y1:e*Math.sin(t),x2:d*g-h*b,y2:d*b+h*g,x3:f*g-p*b,y3:f*b+p*g,x4:e*Math.cos(n),y4:e*Math.sin(n)}},z=function(e){return 180*e/Math.PI},F=function(e,t,n,r,i,o){var s=e+.5*(n-e),c=t+.5*(r-t),l=i+.5*(n-i),u=o+.5*(r-o),d=Math.min(e,i,s,l),h=Math.max(e,i,s,l),f=Math.min(t,o,c,u),p=Math.max(t,o,c,u);return new a(d,f,h-d,p-f)},T=function(e,t,n,r,i,o,s,c){var l,u,d,h,f,p,m,g,b,v,y,w,_,x,k=n-e,S=r-t,A=i-n,N=o-r,L=s-i,P=c-o;for(u=0;u<41;u++)b=(m=(d=e+(l=u/40)*k)+l*((f=n+l*A)-d))+l*(f+l*(i+l*L-f)-m),v=(g=(h=t+l*S)+l*((p=r+l*N)-h))+l*(p+l*(o+l*P-p)-g),0==u?(y=b,w=v,_=b,x=v):(y=Math.min(y,b),w=Math.min(w,v),_=Math.max(_,b),x=Math.max(x,v));return new a(Math.round(y),Math.round(w),Math.round(_-y),Math.round(x-w))},R=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var e,t,n=(e=this.ctx.lineDash,t=this.ctx.lineDashOffset,JSON.stringify({lineDash:e,lineDashOffset:t}));this.prevLineDash!==n&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=n)}}}(Mu.API),function(e){var t=function(e){var t,n,r,i,o,s,a,c,l,u;for(/[^\x00-\xFF]/.test(e),n=[],r=0,i=(e+=t="\0\0\0\0".slice(e.length%4||4)).length;i>r;r+=4)0!==(o=(e.charCodeAt(r)<<24)+(e.charCodeAt(r+1)<<16)+(e.charCodeAt(r+2)<<8)+e.charCodeAt(r+3))?(s=(o=((o=((o=((o=(o-(u=o%85))/85)-(l=o%85))/85)-(c=o%85))/85)-(a=o%85))/85)%85,n.push(s+33,a+33,c+33,l+33,u+33)):n.push(122);return function(e,t){for(var n=t;n>0;n--)e.pop()}(n,t.length),String.fromCharCode.apply(String,n)+"~>"},n=function(e){var t,n,r,i,o,s=String,a="length",c=255,l="charCodeAt",u="slice",d="replace";for(e[u](-2),e=e[u](0,-2)[d](/\s/g,"")[d]("z","!!!!!"),r=[],i=0,o=(e+=t="uuuuu"[u](e[a]%5||5))[a];o>i;i+=5)n=52200625*(e[l](i)-33)+614125*(e[l](i+1)-33)+7225*(e[l](i+2)-33)+85*(e[l](i+3)-33)+(e[l](i+4)-33),r.push(c&n>>24,c&n>>16,c&n>>8,c&n);return function(e,t){for(var n=t;n>0;n--)e.pop()}(r,t[a]),s.fromCharCode.apply(s,r)},r=function(e){return e.split("").map(function(e){return("0"+e.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(e){var t=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(e=e.replace(/\s/g,"")).indexOf(">")&&(e=e.substr(0,e.indexOf(">"))),e.length%2&&(e+="0"),!1===t.test(e))return"";for(var n="",r=0;r<e.length;r+=2)n+=String.fromCharCode("0x"+(e[r]+e[r+1]));return n},o=function(e){for(var t=new Uint8Array(e.length),n=e.length;n--;)t[n]=e.charCodeAt(n);return(t=rs(t)).reduce(function(e,t){return e+String.fromCharCode(t)},"")};e.processDataByFilters=function(e,s){var a=0,c=e||"",l=[];for("string"==typeof(s=s||[])&&(s=[s]),a=0;a<s.length;a+=1)switch(s[a]){case"ASCII85Decode":case"/ASCII85Decode":c=n(c),l.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":c=t(c),l.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":c=i(c),l.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":c=r(c),l.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":c=o(c),l.push("/FlateDecode");break;default:throw new Error('The filter: "'+s[a]+'" is not implemented')}return{data:c,reverseChain:l.reverse().join(" ")}}}(Mu.API),function(e){e.loadFile=function(e,t,n){return function(e,t,n){t=!1!==t,n="function"==typeof n?n:function(){};var r=void 0;try{r=function(e,t,n){var r=new XMLHttpRequest,i=0,o=function(e){var t=e.length,n=[],r=String.fromCharCode;for(i=0;i<t;i+=1)n.push(r(255&e.charCodeAt(i)));return n.join("")};if(r.open("GET",e,!t),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===t&&(r.onload=function(){200===r.status?n(o(this.responseText)):n(void 0)}),r.send(null),t&&200===r.status)return o(r.responseText)}(e,t,n)}catch(e){}return r}(e,t,n)},e.allowFsRead=void 0,e.loadImageFile=e.loadFile}(Mu.API),function(e){function t(){return(ou.html2canvas?Promise.resolve(ou.html2canvas):s.e(354).then(s.t.bind(s,354,23))).catch(function(e){return Promise.reject(new Error("Could not load html2canvas: "+e))}).then(function(e){return e.default?e.default:e})}function n(){return(ou.DOMPurify?Promise.resolve(ou.DOMPurify):s.e(418).then(s.bind(s,9418))).catch(function(e){return Promise.reject(new Error("Could not load dompurify: "+e))}).then(function(e){return e.default?e.default:e})}var r=function(e){var t=(0,xo.A)(e);return"undefined"===t?"undefined":"string"===t||e instanceof String?"string":"number"===t||e instanceof Number?"number":"function"===t||e instanceof Function?"function":e&&e.constructor===Array?"array":e&&1===e.nodeType?"element":"object"===t?"object":"unknown"},i=function(e,t){var n=document.createElement(e);for(var r in t.className&&(n.className=t.className),t.innerHTML&&t.dompurify&&(n.innerHTML=t.dompurify.sanitize(t.innerHTML)),t.style)n.style[r]=t.style[r];return n},o=function e(t,n){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),i=t.firstChild;i;i=i.nextSibling)!0!==n&&1===i.nodeType&&"SCRIPT"===i.nodeName||r.appendChild(e(i,n));return 1===t.nodeType&&("CANVAS"===t.nodeName?(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0)):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(r.value=t.value),r.addEventListener("load",function(){r.scrollTop=t.scrollTop,r.scrollLeft=t.scrollLeft},!0)),r},a=function e(t){var n=Object.assign(e.convert(Promise.resolve()),JSON.parse(JSON.stringify(e.template))),r=e.convert(Promise.resolve(),n);return(r=r.setProgress(1,e,1,[e])).set(t)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(e,t){return e.__proto__=t||a.prototype,e},a.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"}},a.prototype.from=function(e,t){return this.then(function(){switch(t=t||function(e){switch(r(e)){case"string":return"string";case"element":return"canvas"===e.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(e),t){case"string":return this.then(n).then(function(t){return this.set({src:i("div",{innerHTML:e,dompurify:t})})});case"element":return this.set({src:e});case"canvas":return this.set({canvas:e});case"img":return this.set({img:e});default:return this.error("Unknown source type.")}})},a.prototype.to=function(e){switch(e){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.")}},a.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 e={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},t=o(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===t.tagName&&(e.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:e}),this.prop.container.appendChild(t),this.prop.container.firstChild.appendChild(i("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"})},a.prototype.toCanvas=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then(function(e){var t=Object.assign({},this.opt.html2canvas);return delete t.onrendered,e(this.prop.container,t)}).then(function(e){(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then(function(e){var t=this.opt.jsPDF,n=this.opt.fontFaces,r="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,i=Object.assign({async:!0,allowTaint:!0,scale:r,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 i.onrendered,t.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,t.context2d.margin=this.opt.margin,t.context2d.fontFaces=n,n)for(var o=0;o<n.length;++o){var s=n[o],a=s.src.find(function(e){return"truetype"===e.format});a&&t.addFont(a.url,s.ref.name,s.ref.style)}return i.windowHeight=i.windowHeight||0,i.windowHeight=0==i.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):i.windowHeight,t.context2d.save(!0),e(this.prop.container,i)}).then(function(e){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var e=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=e})},a.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},a.prototype.output=function(e,t,n){return"img"===(n=n||"pdf").toLowerCase()||"image"===n.toLowerCase()?this.outputImg(e,t):this.outputPdf(e,t)},a.prototype.outputPdf=function(e,t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(e,t)})},a.prototype.outputImg=function(e){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(e){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 "'+e+'" is not supported.'}})},a.prototype.save=function(e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(e?{filename:e}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},a.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},a.prototype.set=function(e){if("object"!==r(e))return this;var t=Object.keys(e||{}).map(function(t){if(t in a.template.prop)return function(){this.prop[t]=e[t]};switch(t){case"margin":return this.setMargin.bind(this,e.margin);case"jsPDF":return function(){return this.opt.jsPDF=e.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,e.pageSize);default:return function(){this.opt[t]=e[t]}}},this);return this.then(function(){return this.thenList(t)})},a.prototype.get=function(e,t){return this.then(function(){var n=e in a.template.prop?this.prop[e]:this.opt[e];return t?t(n):n})},a.prototype.setMargin=function(e){return this.then(function(){switch(r(e)){case"number":e=[e,e,e,e];case"array":if(2===e.length&&(e=[e[0],e[1],e[0],e[1]]),4===e.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=e}).then(this.setPageSize)},a.prototype.setPageSize=function(e){function t(e,t){return Math.floor(e*t/72*96)}return this.then(function(){(e=e||Mu.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(e.inner={width:e.width-this.opt.margin[1]-this.opt.margin[3],height:e.height-this.opt.margin[0]-this.opt.margin[2]},e.inner.px={width:t(e.inner.width,e.k),height:t(e.inner.height,e.k)},e.inner.ratio=e.inner.height/e.inner.width),this.prop.pageSize=e})},a.prototype.setProgress=function(e,t,n,r){return null!=e&&(this.progress.val=e),null!=t&&(this.progress.state=t),null!=n&&(this.progress.n=n),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(e,t,n,r){return this.setProgress(e?this.progress.val+e:null,t||null,n?this.progress.n+n:null,r?this.progress.stack.concat(r):null)},a.prototype.then=function(e,t){var n=this;return this.thenCore(e,t,function(e,t){return n.updateProgress(null,null,1,[e]),Promise.prototype.then.call(this,function(t){return n.updateProgress(null,e),t}).then(e,t).then(function(e){return n.updateProgress(1),e})})},a.prototype.thenCore=function(e,t,n){n=n||Promise.prototype.then;var r=this;e&&(e=e.bind(r)),t&&(t=t.bind(r));var i=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?r:a.convert(Object.assign({},r),Promise.prototype),o=n.call(i,e,t);return a.convert(o,r.__proto__)},a.prototype.thenExternal=function(e,t){return Promise.prototype.then.call(this,e,t)},a.prototype.thenList=function(e){var t=this;return e.forEach(function(e){t=t.thenCore(e)}),t},a.prototype.catch=function(e){e&&(e=e.bind(this));var t=Promise.prototype.catch.call(this,e);return a.convert(t,this)},a.prototype.catchExternal=function(e){return Promise.prototype.catch.call(this,e)},a.prototype.error=function(e){return this.then(function(){throw new Error(e)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,Mu.getPageSize=function(e,t,n){if("object"===(0,xo.A)(e)){var r=e;e=r.orientation,t=r.unit||t,n=r.format||n}t=t||"mm",n=n||"a4",e=(""+(e||"P")).toLowerCase();var i,o=(""+n).toLowerCase(),s={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(t){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: "+t}var a,c=0,l=0;if(s.hasOwnProperty(o))c=s[o][1]/i,l=s[o][0]/i;else try{c=n[1],l=n[0]}catch(e){throw new Error("Invalid format: "+n)}if("p"===e||"portrait"===e)e="p",l>c&&(a=l,l=c,c=a);else{if("l"!==e&&"landscape"!==e)throw"Invalid orientation: "+e;e="l",c>l&&(a=l,l=c,c=a)}return{width:l,height:c,unit:t,k:i,orientation:e}},e.html=function(e,t){(t=t||{}).callback=t.callback||function(){},t.html2canvas=t.html2canvas||{},t.html2canvas.canvas=t.html2canvas.canvas||this.canvas,t.jsPDF=t.jsPDF||this,t.fontFaces=t.fontFaces?t.fontFaces.map(zd):null;var n=new a(t);return t.worker?n:n.from(e).doCallback()}}(Mu.API),Mu.API.addJS=function(e){var t,n,r=function(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if("("===r||")"===r){for(var i=0,o=n-1;o>=0&&"\\"===e[o];o--)i++;t+=i%2==0?"\\"+r:r}else t+=r}return t}(e);return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(t+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),n=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+r+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==t&&void 0!==n&&this.internal.out("/Names <</JavaScript "+t+" 0 R>>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var e=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var r=e.outline.render().split(/\r\n/),i=0;i<r.length;i++){var o=r[i],s=n.exec(o);if(null!=s){var a=s[1];e.internal.newObjectDeferredBegin(a,!1)}e.internal.write(o)}if(this.outline.createNamedDestinations){var c=this.internal.pages.length,l=[];for(i=0;i<c;i++){var u=e.internal.newObject();l.push(u);var d=e.internal.getPageInfo(i+1);e.internal.write("<< /D["+d.objId+" 0 R /XYZ null null null]>> endobj")}var h=e.internal.newObject();for(e.internal.write("<< /Names [ "),i=0;i<l.length;i++)e.internal.write("(page_"+(i+1)+")"+l[i]+" 0 R");e.internal.write(" ] >>","endobj"),t=e.internal.newObject(),e.internal.write("<< /Dests "+h+" 0 R"),e.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){var e=this;e.outline.root.children.length>0&&(e.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&e.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var e=this;e.outline={createNamedDestinations:!1,root:{children:[]}},e.outline.add=function(e,t,n){var r={title:t,options:n,children:[]};return null==e&&(e=this.root),e.children.push(r),r},e.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=e,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},e.outline.genIds_r=function(t){t.id=e.internal.newObjectDeferred();for(var n=0;n<t.children.length;n++)this.genIds_r(t.children[n])},e.outline.renderRoot=function(e){this.objStart(e),this.line("/Type /Outlines"),e.children.length>0&&(this.line("/First "+this.makeRef(e.children[0])),this.line("/Last "+this.makeRef(e.children[e.children.length-1]))),this.line("/Count "+this.count_r({count:0},e)),this.objEnd()},e.outline.renderItems=function(t){for(var n=this.ctx.pdf.internal.getVerticalCoordinateString,r=0;r<t.children.length;r++){var i=t.children[r];this.objStart(i),this.line("/Title "+this.makeString(i.title)),this.line("/Parent "+this.makeRef(t)),r>0&&this.line("/Prev "+this.makeRef(t.children[r-1])),r<t.children.length-1&&this.line("/Next "+this.makeRef(t.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 o=this.count=this.count_r({count:0},i);if(o>0&&this.line("/Count "+o),i.options&&i.options.pageNumber){var s=e.internal.getPageInfo(i.options.pageNumber);this.line("/Dest ["+s.objId+" 0 R /XYZ 0 "+n(0)+" 0]")}this.objEnd()}for(var a=0;a<t.children.length;a++)this.renderItems(t.children[a])},e.outline.line=function(e){this.ctx.val+=e+"\r\n"},e.outline.makeRef=function(e){return e.id+" 0 R"},e.outline.makeString=function(t){return"("+e.internal.pdfEscape(t)+")"},e.outline.objStart=function(e){this.ctx.val+="\r\n"+e.id+" 0 obj\r\n<<\r\n"},e.outline.objEnd=function(){this.ctx.val+=">> \r\nendobj\r\n"},e.outline.count_r=function(e,t){for(var n=0;n<t.children.length;n++)e.count++,this.count_r(e,t.children[n]);return e.count}}])}(Mu.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(e,n,r,i,o,s){var a,c=this.decode.DCT_DECODE,l=null;if("string"==typeof e||this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e)){switch(e=o||e,e=this.__addimage__.isArrayBuffer(e)?new Uint8Array(e):e,a=function(e){for(var n,r=256*e.charCodeAt(4)+e.charCodeAt(5),i=e.length,o={width:0,height:0,numcomponents:1},s=4;s<i;s+=2){if(s+=r,-1!==t.indexOf(e.charCodeAt(s+1))){n=256*e.charCodeAt(s+5)+e.charCodeAt(s+6),o={width:256*e.charCodeAt(s+7)+e.charCodeAt(s+8),height:n,numcomponents:e.charCodeAt(s+9)};break}r=256*e.charCodeAt(s+2)+e.charCodeAt(s+3)}return o}(e=this.__addimage__.isArrayBufferView(e)?this.__addimage__.arrayBufferToBinaryString(e):e),a.numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}l={data:e,width:a.width,height:a.height,colorSpace:s,bitsPerComponent:8,filter:c,index:n,alias:r}}return l}}(Mu.API),Mu.API.processPNG=function(e,t,n,r){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var i,o=new ru(e,{checkCrc:!0}).decode(),s=o.width,a=o.height,c=o.channels,l=o.palette,u=o.depth;i=l&&1===c?function(e){for(var t=e.width,n=e.height,r=e.data,i=e.palette,o=e.depth,s=!1,a=[],c=[],l=void 0,u=!1,d=0,h=0;h<i.length;h++){var f=ss(i[h],4),p=f[0],m=f[1],g=f[2],b=f[3];a.push(p,m,g),null!=b&&(0===b?(d++,c.length<1&&c.push(h)):b<255&&(u=!0))}if(u||d>1){s=!0,c=void 0;var v=t*n;l=new Uint8Array(v);for(var y=new DataView(r.buffer),w=0;w<v;w++){var _=ss(i[nh(y,w,o)],4)[3];l[w]=_}}else 0===d&&(c=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:s?8:void 0,colorBytes:r,alphaBytes:l,needSMask:s,palette:a,mask:c}}(o):2===c||4===c?function(e){for(var t=e.data,n=e.width,r=e.height,i=e.channels,o=e.depth,s=2===i?"DeviceGray":"DeviceRGB",a=i-1,c=n*r,l=a,u=c*l,d=1*c,h=Math.ceil(u*o/8),f=Math.ceil(d*o/8),p=new Uint8Array(h),m=new Uint8Array(f),g=new DataView(t.buffer),b=new DataView(p.buffer),v=new DataView(m.buffer),y=!1,w=0;w<c;w++){for(var _=w*i,x=0;x<l;x++)rh(b,nh(g,_+x,o),w*l+x,o);var k=nh(g,_+l,o);k<(1<<o)-1&&(y=!0),rh(v,k,1*w,o)}return{colorSpace:s,colorsPerPixel:a,sMaskBitsPerComponent:y?o:void 0,colorBytes:p,alphaBytes:m,needSMask:y}}(o):function(e){var t=e.data,n=1===e.channels?"DeviceGray":"DeviceRGB";return{colorSpace:n,colorsPerPixel:"DeviceGray"===n?1:3,colorBytes:t instanceof Uint16Array?function(e){for(var t=e.length,n=new Uint8Array(2*t),r=new DataView(n.buffer,n.byteOffset,n.byteLength),i=0;i<t;i++)r.setUint16(2*i,e[i],!1);return n}(t):t,needSMask:!1}}(o);var d,h,f,p=i,m=p.colorSpace,g=p.colorsPerPixel,b=p.sMaskBitsPerComponent,v=p.colorBytes,y=p.alphaBytes,w=p.needSMask,_=p.palette,x=p.mask,k=null;return r!==Mu.API.image_compression.NONE?(k=function(e){var t;switch(e){case Mu.API.image_compression.FAST:t=11;break;case Mu.API.image_compression.MEDIUM:t=13;break;case Mu.API.image_compression.SLOW:t=14;break;default:t=12}return t}(r),d=this.decode.FLATE_DECODE,h="/Predictor ".concat(k," /Colors ").concat(g," /BitsPerComponent ").concat(u," /Columns ").concat(s),e=Gd(v,Math.ceil(s*g*u/8),g,u,r),w&&(f=Gd(y,Math.ceil(s*b/8),1,b,r))):(d=void 0,h=void 0,e=v,w&&(f=y)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(f&&this.__addimage__.isArrayBuffer(f)||this.__addimage__.isArrayBufferView(f))&&(f=this.__addimage__.arrayBufferToBinaryString(f)),{alias:n,data:e,index:t,filter:d,decodeParameters:h,transparency:x,palette:_,sMask:f,predictor:k,width:s,height:a,bitsPerComponent:u,sMaskBitsPerComponent:b,colorSpace:m}}},function(e){e.processGIF89A=function(t,n,r,i){var o=new oh(t),s=o.width,a=o.height,c=[];o.decodeAndBlitFrameRGBA(0,c);var l={data:c,width:s,height:a},u=new ah(100).encode(l,100);return e.processJPEG.call(this,u,n,r,i)},e.processGIF87A=e.processGIF89A}(Mu.API),ch.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 e=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:i,green:r,blue:n,quad:o}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},ch.prototype.parseBGR=function(){this.pos=this.offset;var e="bit"+this.bitPP,t=this.width*this.height*4;if(t>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");this.data=new Uint8Array(t);try{this[e]()}catch(e){au.log("bit decode error:"+e)}},ch.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),n=t%4;for(e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,i=0;i<t;i++)for(var o=this.datav.getUint8(this.pos++,!0),s=r*this.width*4+8*i*4,a=0;a<8&&8*i+a<this.width;a++){var c=this.palette[o>>7-a&1];this.data[s+4*a]=c.blue,this.data[s+4*a+1]=c.green,this.data[s+4*a+2]=c.red,this.data[s+4*a+3]=255}0!==n&&(this.pos+=4-n)}},ch.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<e;i++){var o=this.datav.getUint8(this.pos++,!0),s=r*this.width*4+2*i*4,a=o>>4,c=15&o,l=this.palette[a];if(this.data[s]=l.blue,this.data[s+1]=l.green,this.data[s+2]=l.red,this.data[s+3]=255,2*i+1>=this.width)break;l=this.palette[c],this.data[s+4]=l.blue,this.data[s+4+1]=l.green,this.data[s+4+2]=l.red,this.data[s+4+3]=255}0!==t&&(this.pos+=4-t)}},ch.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+4*r;if(i<this.palette.length){var s=this.palette[i];this.data[o]=s.red,this.data[o+1]=s.green,this.data[o+2]=s.blue,this.data[o+3]=255}else this.data[o]=255,this.data[o+1]=255,this.data[o+2]=255,this.data[o+3]=255}0!==e&&(this.pos+=4-e)}},ch.prototype.bit15=function(){for(var e=this.width%3,t=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 o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&t)/t*255|0,a=(o>>5&t)/t*255|0,c=(o>>10&t)/t*255|0,l=o>>15?255:0,u=r*this.width*4+4*i;this.data[u]=c,this.data[u+1]=a,this.data[u+2]=s,this.data[u+3]=l}this.pos+=e}},ch.prototype.bit16=function(){for(var e=this.width%3,t=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,o=0;o<this.width;o++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(s&t)/t*255|0,c=(s>>5&n)/n*255|0,l=(s>>11)/t*255|0,u=i*this.width*4+4*o;this.data[u]=l,this.data[u+1]=c,this.data[u+2]=a,this.data[u+3]=255}this.pos+=e}},ch.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=t*this.width*4+4*n;this.data[s]=o,this.data[s+1]=i,this.data[s+2]=r,this.data[s+3]=255}this.pos+=this.width%4}},ch.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=t*this.width*4+4*n;this.data[a]=o,this.data[a+1]=i,this.data[a+2]=r,this.data[a+3]=s}},ch.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,n,r,i){var o=new ch(t,!1),s=o.width,a=o.height,c={data:o.getData(),width:s,height:a},l=new ah(100).encode(c,100);return e.processJPEG.call(this,l,n,r,i)}}(Mu.API),lh.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,n,r,i){var o=new lh(t),s=o.width,a=o.height,c={data:o.getData(),width:s,height:a},l=new ah(100).encode(c,100);return e.processJPEG.call(this,l,n,r,i)}}(Mu.API),Mu.API.processRGBA=function(e,t,n){for(var r=e.data,i=r.length,o=new Uint8Array(i/4*3),s=new Uint8Array(i/4),a=0,c=0,l=0;l<i;l+=4){var u=r[l],d=r[l+1],h=r[l+2],f=r[l+3];o[a++]=u,o[a++]=d,o[a++]=h,s[c++]=f}var p=this.__addimage__.arrayBufferToBinaryString(o);return{alpha:this.__addimage__.arrayBufferToBinaryString(s),data:p,index:t,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},Mu.API.setLanguage=function(e){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"}[e]&&(this.internal.languageSettings.languageCode=e,!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},Ud=Mu.API,$d=Ud.getCharWidthsArray=function(e,t){var n,r,i=(t=t||{}).font||this.internal.getFont(),o=t.fontSize||this.internal.getFontSize(),s=t.charSpace||this.internal.getCharSpace(),a=t.widths?t.widths:i.metadata.Unicode.widths,c=a.fof?a.fof:1,l=t.kerning?t.kerning:i.metadata.Unicode.kerning,u=l.fof?l.fof:1,d=!1!==t.doKerning,h=0,f=e.length,p=0,m=a[0]||c,g=[];for(n=0;n<f;n++)r=e.charCodeAt(n),"function"==typeof i.metadata.widthOfString?g.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+s*(1e3/o)||0)/1e3):(h=d&&"object"===(0,xo.A)(l[r])&&!isNaN(parseInt(l[r][p],10))?l[r][p]/u:0,g.push((a[r]||m)/c+h)),p=r;return g},Wd=Ud.getStringUnitWidth=function(e,t){var n=(t=t||{}).fontSize||this.internal.getFontSize(),r=t.font||this.internal.getFont(),i=t.charSpace||this.internal.getCharSpace();return Ud.processArabic&&(e=Ud.processArabic(e)),"function"==typeof r.metadata.widthOfString?r.metadata.widthOfString(e,n,i)/n:$d.apply(this,arguments).reduce(function(e,t){return e+t},0)},Zd=function(e,t,n,r){for(var i=[],o=0,s=e.length,a=0;o!==s&&a+t[o]<n;)a+=t[o],o++;i.push(e.slice(0,o));var c=o;for(a=0;o!==s;)a+t[o]>r&&(i.push(e.slice(c,o)),a=0,c=o),a+=t[o],o++;return c!==o&&i.push(e.slice(c,o)),i},Hd=function(e,t,n){n||(n={});var r,i,o,s,a,c,l,u=[],d=[u],h=n.textIndent||0,f=0,p=0,m=e.split(" "),g=$d.apply(this,[" ",n])[0];if(c=-1===n.lineIndent?m[0].length+2:n.lineIndent||0){var b=Array(c).join(" "),v=[];m.map(function(e){(e=e.split(/\s*\n/)).length>1?v=v.concat(e.map(function(e,t){return(t&&e.length?"\n":"")+e})):v.push(e[0])}),m=v,c=Wd.apply(this,[b,n])}for(o=0,s=m.length;o<s;o++){var y=0;if(r=m[o],c&&"\n"==r[0]&&(r=r.substr(1),y=1),h+f+(p=(i=$d.apply(this,[r,n])).reduce(function(e,t){return e+t},0))>t||y){if(p>t){for(a=Zd.apply(this,[r,i,t-(h+f),t]),u.push(a.shift()),u=[a.pop()];a.length;)d.push([a.shift()]);p=i.slice(r.length-(u[0]?u[0].length:0)).reduce(function(e,t){return e+t},0)}else u=[r];d.push(u),h=p+c,f=g}else u.push(r),h+=f+p,f=g}return l=c?function(e,t){return(t?b:"")+e.join(" ")}:function(e){return e.join(" ")},d.map(l)},Ud.splitTextToSize=function(e,t,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),o=function(e){if(e.widths&&e.kerning)return{widths:e.widths,kerning:e.kerning};var t=this.internal.getFont(e.fontName,e.fontStyle),n="Unicode";return t.metadata[n]?{widths:t.metadata[n].widths||{0:1},kerning:t.metadata[n].kerning||{}}:{font:t.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var s=1*this.internal.scaleFactor*t/i;o.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,o.lineIndent=n.lineIndent;var a,c,l=[];for(a=0,c=r.length;a<c;a++)l=l.concat(Hd.apply(this,[r[a],s,o]));return l},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",n="klmnopqrstuvwxyz",r={},i={},o=0;o<16;o++)r[n[o]]=t[o],i[t[o]]=n[o];var s=function(e){return"0x"+parseInt(e,10).toString(16)},a=e.__fontmetrics__.compress=function(e){var t,n,r,o,c=["{"];for(var l in e){if(t=e[l],isNaN(parseInt(l,10))?n="'"+l+"'":(l=parseInt(l,10),n=(n=s(l).slice(2)).slice(0,-1)+i[n.slice(-1)]),"number"==typeof t)t<0?(r=s(t).slice(3),o="-"):(r=s(t).slice(2),o=""),r=o+r.slice(0,-1)+i[r.slice(-1)];else{if("object"!==(0,xo.A)(t))throw new Error("Don't know what to do with value type "+(0,xo.A)(t)+".");r=a(t)}c.push(n+r)}return c.push("}"),c.join("")},c=e.__fontmetrics__.uncompress=function(e){if("string"!=typeof e)throw new Error("Invalid argument passed to uncompress.");for(var t,n,i,o,s={},a=1,c=s,l=[],u="",d="",h=e.length-1,f=1;f<h;f+=1)"'"==(o=e[f])?t?(i=t.join(""),t=void 0):t=[]:t?t.push(o):"{"==o?(l.push([c,i]),c={},i=void 0):"}"==o?((n=l.pop())[0][n[1]]=c,i=void 0,c=n[0]):"-"==o?a=-1:void 0===i?r.hasOwnProperty(o)?(u+=r[o],i=parseInt(u,16)*a,a=1,u=""):u+=o:r.hasOwnProperty(o)?(d+=r[o],c[i]=parseInt(d,16)*a,a=1,i=void 0,d=""):d+=o;return s},l={codePages:["WinAnsiEncoding"],WinAnsiEncoding:c("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},u={Unicode:{Courier:l,"Courier-Bold":l,"Courier-BoldOblique":l,"Courier-Oblique":l,Helvetica:l,"Helvetica-Bold":l,"Helvetica-BoldOblique":l,"Helvetica-Oblique":l,"Times-Roman":l,"Times-Bold":l,"Times-BoldItalic":l,"Times-Italic":l}},d={Unicode:{"Courier-Oblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":c("{'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":c("{'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:c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":c("{'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:c("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:c("{'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":c("{'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:c("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":c("{'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":c("{'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":c("{'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}}}")}};e.events.push(["addFont",function(e){var t=e.font,n=d.Unicode[t.postScriptName];n&&(t.metadata.Unicode={},t.metadata.Unicode.widths=n.widths,t.metadata.Unicode.kerning=n.kerning);var r=u.Unicode[t.postScriptName];r&&(t.metadata.Unicode.encoding=r,t.encoding=r.codePages[0])}])}(Mu.API),function(e){var t=function(e){for(var t=e.length,n=new Uint8Array(t),r=0;r<t;r++)n[r]=e.charCodeAt(r);return n};e.API.events.push(["addFont",function(n){var r=void 0,i=n.font,o=n.instance;if(!i.isStandardFont){if(void 0===o)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if("string"!=typeof(r=!1===o.existsFileInVFS(i.postScriptName)?o.loadFile(i.postScriptName):o.getFileFromVFS(i.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");!function(n,r){r=/^\x00\x01\x00\x00/.test(r)?t(r):t(fu(r)),n.metadata=e.API.TTFFont.open(r),n.metadata.Unicode=n.metadata.Unicode||{encoding:{},kerning:{},widths:[]},n.metadata.glyIdsUsed=[0]}(i,r)}}])}(Mu),Mu.API.addSvgAsImage=function(e,t,n,r,i,o,a,c){if(isNaN(t)||isNaN(n))throw au.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw au.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=r,l.height=i;var u=l.getContext("2d");u.fillStyle="#fff",u.fillRect(0,0,l.width,l.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},h=this;return(ou.canvg?Promise.resolve(ou.canvg):s.e(661).then(s.bind(s,661))).catch(function(e){return Promise.reject(new Error("Could not load canvg: "+e))}).then(function(e){return e.default?e.default:e}).then(function(t){return t.fromString(u,e,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(e){return e.render(d)}).then(function(){h.addImage(l.toDataURL("image/jpeg",1),t,n,r,i,a,c)})},Mu.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,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(t,n);return this},Mu.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,i,o,s={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}},a=Object.keys(s),c=[],l=0,u=0,d=0;function h(e,t){var n,r=!1;for(n=0;n<e.length;n+=1)e[n]===t&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===t){var f=a.length;for(d=0;d<f;d+=1)n[a[d]].value=n[a[d]].defaultValue,n[a[d]].explicitSet=!1}if("object"===(0,xo.A)(e))for(i in e)if(o=e[i],h(a,i)&&void 0!==o){if("boolean"===n[i].type&&"boolean"==typeof o)n[i].value=o;else if("name"===n[i].type&&h(n[i].valueSet,o))n[i].value=o;else if("integer"===n[i].type&&Number.isInteger(o))n[i].value=o;else if("array"===n[i].type){for(l=0;l<o.length;l+=1)if(r=!0,1===o[l].length&&"number"==typeof o[l][0])c.push(String(o[l]-1));else if(o[l].length>1){for(u=0;u<o[l].length;u+=1)"number"!=typeof o[l][u]&&(r=!1);!0===r&&c.push([o[l][0]-1,o[l][1]-1].join(" "))}n[i].value="["+c.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 e,t=[];for(e in n)!0===n[e].explicitSet&&("name"===n[e].type?t.push("/"+e+" /"+n[e].value):t.push("/"+e+" "+n[e].value));0!==t.length&&this.internal.write("/ViewerPreferences\n<<\n"+t.join("\n")+"\n>>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},Mu.API.addMetadata=function(e,t){return void 0===this.internal.__metadata__&&(this.internal.__metadata__={metadata:e,namespaceUri:null!=t?t:"http://jspdf.default.namespaceuri/",rawXml:"boolean"==typeof t&&t},this.internal.events.subscribe("putCatalog",dh),this.internal.events.subscribe("postPutResources",uh)),this},function(e){var t=e.API,n=t.pdfEscape16=function(e,t){for(var n,r=t.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],s=0,a=e.length;s<a;++s){if(n=t.metadata.characterToGlyph(e.charCodeAt(s)),t.metadata.glyIdsUsed.push(n),t.metadata.toUnicode[n]=e.charCodeAt(s),-1==r.indexOf(n)&&(r.push(n),r.push([parseInt(t.metadata.widthOfGlyph(n),10)])),"0"==n)return o.join("");n=n.toString(16),o.push(i[4-n.length],n)}return o.join("")},r=function(e){var t,n,r,i,o,s,a;for(o="/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=[],s=0,a=(n=Object.keys(e).sort(function(e,t){return e-t})).length;s<a;s++)t=n[s],r.length>=100&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),void 0!==e[t]&&null!==e[t]&&"function"==typeof e[t].toString&&(i=("0000"+e[t].toString(16)).slice(-4),t=("0000"+(+t).toString(16)).slice(-4),r.push("<"+t+"><"+i+">"));return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};t.events.push(["putFont",function(t){!function(t){var n=t.font,i=t.out,o=t.newObject,s=t.putStream;if(n.metadata instanceof e.API.TTFFont&&"Identity-H"===n.encoding){for(var a=n.metadata.Unicode.widths,c=n.metadata.subset.encode(n.metadata.glyIdsUsed,1),l="",u=0;u<c.length;u++)l+=String.fromCharCode(c[u]);var d=o();s({data:l,addLength1:!0,objectId:d}),i("endobj");var h=o();s({data:r(n.metadata.toUnicode),addLength1:!0,objectId:h}),i("endobj");var f=o();i("<<"),i("/Type /FontDescriptor"),i("/FontName /"+Ou(n.fontName)),i("/FontFile2 "+d+" 0 R"),i("/FontBBox "+e.API.PDFObject.convert(n.metadata.bbox)),i("/Flags "+n.metadata.flags),i("/StemV "+n.metadata.stemV),i("/ItalicAngle "+n.metadata.italicAngle),i("/Ascent "+n.metadata.ascender),i("/Descent "+n.metadata.decender),i("/CapHeight "+n.metadata.capHeight),i(">>"),i("endobj");var p=o();i("<<"),i("/Type /Font"),i("/BaseFont /"+Ou(n.fontName)),i("/FontDescriptor "+f+" 0 R"),i("/W "+e.API.PDFObject.convert(a)),i("/CIDToGIDMap /Identity"),i("/DW 1000"),i("/Subtype /CIDFontType2"),i("/CIDSystemInfo"),i("<<"),i("/Supplement 0"),i("/Registry (Adobe)"),i("/Ordering ("+n.encoding+")"),i(">>"),i(">>"),i("endobj"),n.objectNumber=o(),i("<<"),i("/Type /Font"),i("/Subtype /Type0"),i("/ToUnicode "+h+" 0 R"),i("/BaseFont /"+Ou(n.fontName)),i("/Encoding /"+n.encoding),i("/DescendantFonts ["+p+" 0 R]"),i(">>"),i("endobj"),n.isAlreadyPutted=!0}}(t)}]),t.events.push(["putFont",function(t){!function(t){var n=t.font,i=t.out,o=t.newObject,s=t.putStream;if(n.metadata instanceof e.API.TTFFont&&"WinAnsiEncoding"===n.encoding){for(var a=n.metadata.rawData,c="",l=0;l<a.length;l++)c+=String.fromCharCode(a[l]);var u=o();s({data:c,addLength1:!0,objectId:u}),i("endobj");var d=o();s({data:r(n.metadata.toUnicode),addLength1:!0,objectId:d}),i("endobj");var h=o();i("<<"),i("/Descent "+n.metadata.decender),i("/CapHeight "+n.metadata.capHeight),i("/StemV "+n.metadata.stemV),i("/Type /FontDescriptor"),i("/FontFile2 "+u+" 0 R"),i("/Flags 96"),i("/FontBBox "+e.API.PDFObject.convert(n.metadata.bbox)),i("/FontName /"+Ou(n.fontName)),i("/ItalicAngle "+n.metadata.italicAngle),i("/Ascent "+n.metadata.ascender),i(">>"),i("endobj"),n.objectNumber=o();for(var f=0;f<n.metadata.hmtx.widths.length;f++)n.metadata.hmtx.widths[f]=parseInt(n.metadata.hmtx.widths[f]*(1e3/n.metadata.head.unitsPerEm));i("<</Subtype/TrueType/Type/Font/ToUnicode "+d+" 0 R/BaseFont/"+Ou(n.fontName)+"/FontDescriptor "+h+" 0 R/Encoding/"+n.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(n.metadata.hmtx.widths)+">>"),i("endobj"),n.isAlreadyPutted=!0}}(t)}]);var i=function(e){var t,r=e.text||"",i=e.x,o=e.y,s=e.options||{},a=e.mutex||{},c=a.pdfEscape,l=a.activeFontKey,u=a.fonts,d=l,h="",f=0,p="",m=u[d].encoding;if("Identity-H"!==u[d].encoding)return{text:r,x:i,y:o,options:s,mutex:a};for(p=r,d=l,Array.isArray(r)&&(p=r[0]),f=0;f<p.length;f+=1)u[d].metadata.hasOwnProperty("cmap")&&(t=u[d].metadata.cmap.unicode.codeMap[p[f].charCodeAt(0)]),t||p[f].charCodeAt(0)<256&&u[d].metadata.hasOwnProperty("Unicode")?h+=p[f]:h+="";var g="";return parseInt(d.slice(1))<14||"WinAnsiEncoding"===m?g=c(h,d).split("").map(function(e){return e.charCodeAt(0).toString(16)}).join(""):"Identity-H"===m&&(g=n(h,u[d])),a.isHex=!0,{text:g,x:i,y:o,options:s,mutex:a}};t.events.push(["postProcessText",function(e){var t=e.text||"",n=[],r={text:t,x:e.x,y:e.y,options:e.options,mutex:e.mutex};if(Array.isArray(t)){var o=0;for(o=0;o<t.length;o+=1)Array.isArray(t[o])&&3===t[o].length?n.push([i(Object.assign({},r,{text:t[o][0]})).text,t[o][1],t[o][2]]):n.push(i(Object.assign({},r,{text:t[o]})).text);e.text=n}else e.text=i(Object.assign({},r,{text:t})).text}])}(Mu),function(e){var t=function(){return void 0===this.internal.vFS&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(e){return t.call(this),void 0!==this.internal.vFS[e]},e.addFileToVFS=function(e,n){return t.call(this),this.internal.vFS[e]=n,this},e.getFileFromVFS=function(e){return t.call(this),void 0!==this.internal.vFS[e]?this.internal.vFS[e]:null}}(Mu.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(e){var n,r,i,o,s,a,c,l=t,u=[[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]],d=[[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]],h={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},f={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},p=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],m=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)$/),g=!1,b=0;this.__bidiEngine__={};var v=function(e){var t=e.charCodeAt(),n=t>>8,r=f[n];return void 0!==r?l[256*r+(255&t)]:252===n||253===n?"AL":m.test(n)?"L":8===n?"R":"N"},y=function(e){for(var t,n=0;n<e.length;n++){if("L"===(t=v(e.charAt(n))))return!1;if("R"===t)return!0}return!1},w=function(e,t,s,a){var c,l,u,d,h=t[a];switch(h){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":g=!1;break;case"N":case"AN":break;case"EN":g&&(h="AN");break;case"AL":g=!0,h="R";break;case"WS":case"BN":h="N";break;case"CS":a<1||a+1>=t.length||"EN"!==(c=s[a-1])&&"AN"!==c||"EN"!==(l=t[a+1])&&"AN"!==l?h="N":g&&(l="AN"),h=l===c?l:"N";break;case"ES":h="EN"===(c=a>0?s[a-1]:"B")&&a+1<t.length&&"EN"===t[a+1]?"EN":"N";break;case"ET":if(a>0&&"EN"===s[a-1]){h="EN";break}if(g){h="N";break}for(u=a+1,d=t.length;u<d&&"ET"===t[u];)u++;h=u<d&&"EN"===t[u]?"EN":"N";break;case"NSM":if(i&&!o){for(d=t.length,u=a+1;u<d&&"NSM"===t[u];)u++;if(u<d){var f=e[a],p=f>=1425&&f<=2303||64286===f;if(c=t[u],p&&("R"===c||"AL"===c)){h="R";break}}}h=a<1||"B"===(c=t[a-1])?"N":s[a-1];break;case"B":g=!1,n=!0,h=b;break;case"S":r=!0,h="N"}return h},_=function(e,t,n){var r=e.split("");return n&&x(r,n,{hiLevel:b}),r.reverse(),t&&t.reverse(),r.join("")},x=function(e,t,i){var o,s,a,c,l,f=-1,p=e.length,m=0,y=[],_=b?d:u,x=[];for(g=!1,n=!1,r=!1,s=0;s<p;s++)x[s]=v(e[s]);for(a=0;a<p;a++){if(l=m,y[a]=w(e,x,y,a),o=240&(m=_[l][h[y[a]]]),m&=15,t[a]=c=_[m][5],o>0)if(16===o){for(s=f;s<a;s++)t[s]=1;f=-1}else f=-1;if(_[m][6])-1===f&&(f=a);else if(f>-1){for(s=f;s<a;s++)t[s]=c;f=-1}"B"===x[a]&&(t[a]=0),i.hiLevel|=c}r&&function(e,t,n){for(var r=0;r<n;r++)if("S"===e[r]){t[r]=b;for(var i=r-1;i>=0&&"WS"===e[i];i--)t[i]=b}}(x,t,p)},k=function(e,t,r,i,o){if(!(o.hiLevel<e)){if(1===e&&1===b&&!n)return t.reverse(),void(r&&r.reverse());for(var s,a,c,l,u=t.length,d=0;d<u;){if(i[d]>=e){for(c=d+1;c<u&&i[c]>=e;)c++;for(l=d,a=c-1;l<a;l++,a--)s=t[l],t[l]=t[a],t[a]=s,r&&(s=r[l],r[l]=r[a],r[a]=s);d=c}d++}}},S=function(e,t,n){var r=e.split(""),i={hiLevel:b};return n||(n=[]),x(r,n,i),function(e,t,n){if(0!==n.hiLevel&&c)for(var r,i=0;i<e.length;i++)1===t[i]&&(r=p.indexOf(e[i]))>=0&&(e[i]=p[r+1])}(r,n,i),k(2,r,t,n,i),k(1,r,t,n,i),r.join("")};return this.__bidiEngine__.doBidiReorder=function(e,t,n){if(function(e,t){if(t)for(var n=0;n<e.length;n++)t[n]=n;void 0===o&&(o=y(e)),void 0===a&&(a=y(e))}(e,t),i||!s||a)if(i&&s&&o^a)b=o?1:0,e=_(e,t,n);else if(!i&&s&&a)b=o?1:0,e=S(e,t,n),e=_(e,t);else if(!i||o||s||a){if(i&&!s&&o^a)e=_(e,t),o?(b=0,e=S(e,t,n)):(b=1,e=S(e,t,n),e=_(e,t));else if(i&&o&&!s&&a)b=1,e=S(e,t,n),e=_(e,t);else if(!i&&!s&&o^a){var r=c;o?(b=1,e=S(e,t,n),b=0,c=!1,e=S(e,t,n),c=r):(b=0,e=S(e,t,n),e=_(e,t),b=1,c=!1,e=S(e,t,n),c=r,e=_(e,t))}}else b=0,e=S(e,t,n);else b=o?1:0,e=S(e,t,n);return e},this.__bidiEngine__.setOptions=function(e){e&&(i=e.isInputVisual,s=e.isOutputVisual,o=e.isInputRtl,a=e.isOutputRtl,c=e.isSymmetricSwapping)},this.__bidiEngine__.setOptions(e),this.__bidiEngine__};var t=["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"],n=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(e){var t=e.text;e.x,e.y;var r=e.options||{};e.mutex,r.lang;var i=[];if(r.isInputVisual="boolean"!=typeof r.isInputVisual||r.isInputVisual,n.setOptions(r),"[object Array]"===Object.prototype.toString.call(t)){var o=0;for(i=[],o=0;o<t.length;o+=1)"[object Array]"===Object.prototype.toString.call(t[o])?i.push([n.doBidiReorder(t[o][0]),t[o][1],t[o][2]]):i.push([n.doBidiReorder(t[o])]);e.text=i}else e.text=n.doBidiReorder(t);n.setOptions({isInputVisual:!0})}])}(Mu),Mu.API.TTFFont=function(){function e(e){var t;if(this.rawData=e,t=this.contents=new fh(e),this.contents.pos=4,"ttcf"===t.readString(4))throw new Error("TTCF not supported.");t.pos=0,this.parse(),this.subset=new Oh(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new ph(this.contents),this.head=new bh(this),this.name=new Sh(this),this.cmap=new yh(this),this.toUnicode={},this.hhea=new wh(this),this.maxp=new Ah(this),this.hmtx=new Nh(this),this.post=new xh(this),this.os2=new _h(this),this.loca=new Ih(this),this.glyf=new Ph(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]},e.prototype.registerTTF=function(){var e,t,n,r,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,n,r,i;for(i=[],t=0,n=(r=this.bbox).length;t<n;t++)e=r[t],i.push(Math.round(e*this.scaleFactor));return i}.call(this),this.stemV=0,this.post.exists?(n=255&(r=this.post.italic_angle),32768&(t=r>>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+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 new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(e){var t;return(null!=(t=this.cmap.unicode)?t.codeMap[e]:void 0)||0},e.prototype.widthOfGlyph=function(e){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*t},e.prototype.widthOfString=function(e,t,n){var r,i,o,s;for(o=0,i=0,s=(e=""+e).length;0<=s?i<s:i>s;i=0<=s?++i:--i)r=e.charCodeAt(i),o+=this.widthOfGlyph(this.characterToGlyph(r))+n*(1e3/t)||0;return o*(t/1e3)},e.prototype.lineHeight=function(e,t){var n;return null==t&&(t=!1),n=t?this.lineGap:0,(this.ascender+n-this.decender)/1e3*e},e}();var hh,fh=function(){function e(e){this.data=null!=e?e:[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(e){return this.data[this.pos++]=e},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},e.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},e.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},e.prototype.readString=function(e){var t,n;for(n=[],t=0;0<=e?t<e:t>e;t=0<=e?++t:--t)n[t]=String.fromCharCode(this.readByte());return n.join("")},e.prototype.writeString=function(e){var t,n,r;for(r=[],t=0,n=e.length;0<=n?t<n:t>n;t=0<=n?++t:--t)r.push(this.writeByte(e.charCodeAt(t)));return r},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(e){return this.writeInt16(e)},e.prototype.readLongLong=function(){var e,t,n,r,i,o,s,a;return e=this.readByte(),t=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),o=this.readByte(),s=this.readByte(),a=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^n)+4294967296*(255^r)+16777216*(255^i)+65536*(255^o)+256*(255^s)+(255^a)+1):72057594037927940*e+281474976710656*t+1099511627776*n+4294967296*r+16777216*i+65536*o+256*s+a},e.prototype.writeLongLong=function(e){var t,n;return t=Math.floor(e/4294967296),n=4294967295&e,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(e){return this.writeInt32(e)},e.prototype.read=function(e){var t,n;for(t=[],n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)t.push(this.readByte());return t},e.prototype.write=function(e){var t,n,r,i;for(i=[],n=0,r=e.length;n<r;n++)t=e[n],i.push(this.writeByte(t));return i},e}(),ph=function(){var e;function t(e){var t,n,r;for(this.scalarType=e.readInt(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),this.tables={},n=0,r=this.tableCount;0<=r?n<r:n>r;n=0<=r?++n:--n)t={tag:e.readString(4),checksum:e.readInt(),offset:e.readInt(),length:e.readInt()},this.tables[t.tag]=t}return t.prototype.encode=function(t){var n,r,i,o,s,a,c,l,u,d,h,f,p;for(p in h=Object.keys(t).length,a=Math.log(2),u=16*Math.floor(Math.log(h)/a),o=Math.floor(u/a),l=16*h-u,(r=new fh).writeInt(this.scalarType),r.writeShort(h),r.writeShort(u),r.writeShort(o),r.writeShort(l),i=16*h,c=r.pos+i,s=null,f=[],t)for(d=t[p],r.writeString(p),r.writeInt(e(d)),r.writeInt(c),r.writeInt(d.length),f=f.concat(d),"head"===p&&(s=c),c+=d.length;c%4;)f.push(0),c++;return r.write(f),n=2981146554-e(r.data),r.pos=s+8,r.writeUInt32(n),r.data},e=function(e){var t,n,r,i;for(e=Lh.call(e);e.length%4;)e.push(0);for(r=new fh(e),n=0,t=0,i=e.length;t<i;t=t+=4)n+=r.readUInt32();return 4294967295&n},t}(),mh={}.hasOwnProperty,gh=function(e,t){for(var n in t)mh.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};hh=function(){function e(e){var t;this.file=e,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var bh=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return gh(e,hh),e.prototype.tag="head",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},e.prototype.encode=function(e){var t;return(t=new fh).writeInt(this.version),t.writeInt(this.revision),t.writeInt(this.checkSumAdjustment),t.writeInt(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.writeLongLong(this.created),t.writeLongLong(this.modified),t.writeShort(this.xMin),t.writeShort(this.yMin),t.writeShort(this.xMax),t.writeShort(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort(this.fontDirectionHint),t.writeShort(e),t.writeShort(this.glyphDataFormat),t.data},e}(),vh=function(){function e(e,t){var n,r,i,o,s,a,c,l,u,d,h,f,p,m,g,b,v;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=t+e.readInt(),u=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.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(a=0;a<256;++a)this.codeMap[a]=e.readByte();break;case 4:for(h=e.readUInt16(),d=h/2,e.pos+=6,i=function(){var t,n;for(n=[],a=t=0;0<=d?t<d:t>d;a=0<=d?++t:--t)n.push(e.readUInt16());return n}(),e.pos+=2,p=function(){var t,n;for(n=[],a=t=0;0<=d?t<d:t>d;a=0<=d?++t:--t)n.push(e.readUInt16());return n}(),c=function(){var t,n;for(n=[],a=t=0;0<=d?t<d:t>d;a=0<=d?++t:--t)n.push(e.readUInt16());return n}(),l=function(){var t,n;for(n=[],a=t=0;0<=d?t<d:t>d;a=0<=d?++t:--t)n.push(e.readUInt16());return n}(),r=(this.length-e.pos+this.offset)/2,s=function(){var t,n;for(n=[],a=t=0;0<=r?t<r:t>r;a=0<=r?++t:--t)n.push(e.readUInt16());return n}(),a=g=0,v=i.length;g<v;a=++g)for(m=i[a],n=b=f=p[a];f<=m?b<=m:b>=m;n=f<=m?++b:--b)0===l[a]?o=n+c[a]:0!==(o=s[l[a]/2+(n-f)-(d-a)]||0)&&(o+=c[a]),this.codeMap[n]=65535&o}e.pos=u}return e.encode=function(e,t){var n,r,i,o,s,a,c,l,u,d,h,f,p,m,g,b,v,y,w,_,x,k,S,A,N,L,P,C,E,I,O,j,z,F,T,R,M,D,B,q,U,$,W,Z,H,V;switch(C=new fh,o=Object.keys(e).sort(function(e,t){return e-t}),t){case"macroman":for(p=0,m=function(){var e=[];for(f=0;f<256;++f)e.push(0);return e}(),b={0:0},i={},E=0,z=o.length;E<z;E++)null==b[W=e[r=o[E]]]&&(b[W]=++p),i[r]={old:e[r],new:b[e[r]]},m[r]=b[e[r]];return C.writeUInt16(1),C.writeUInt16(0),C.writeUInt32(12),C.writeUInt16(0),C.writeUInt16(262),C.writeUInt16(0),C.write(m),{charMap:i,subtable:C.data,maxGlyphID:p+1};case"unicode":for(L=[],u=[],v=0,b={},n={},g=c=null,I=0,F=o.length;I<F;I++)null==b[w=e[r=o[I]]]&&(b[w]=++v),n[r]={old:w,new:b[w]},s=b[w]-r,null!=g&&s===c||(g&&u.push(g),L.push(r),c=s),g=r;for(g&&u.push(g),u.push(65535),L.push(65535),A=2*(S=L.length),k=2*Math.pow(Math.log(S)/Math.LN2,2),d=Math.log(k/2)/Math.LN2,x=2*S-k,a=[],_=[],h=[],f=O=0,T=L.length;O<T;f=++O){if(N=L[f],l=u[f],65535===N){a.push(0),_.push(0);break}if(N-(P=n[N].new)>=32768)for(a.push(0),_.push(2*(h.length+S-f)),r=j=N;N<=l?j<=l:j>=l;r=N<=l?++j:--j)h.push(n[r].new);else a.push(P-N),_.push(0)}for(C.writeUInt16(3),C.writeUInt16(1),C.writeUInt32(12),C.writeUInt16(4),C.writeUInt16(16+8*S+2*h.length),C.writeUInt16(0),C.writeUInt16(A),C.writeUInt16(k),C.writeUInt16(d),C.writeUInt16(x),U=0,R=u.length;U<R;U++)r=u[U],C.writeUInt16(r);for(C.writeUInt16(0),$=0,M=L.length;$<M;$++)r=L[$],C.writeUInt16(r);for(Z=0,D=a.length;Z<D;Z++)s=a[Z],C.writeUInt16(s);for(H=0,B=_.length;H<B;H++)y=_[H],C.writeUInt16(y);for(V=0,q=h.length;V<q;V++)p=h[V],C.writeUInt16(p);return{charMap:n,subtable:C.data,maxGlyphID:v+1}}},e}(),yh=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return gh(e,hh),e.prototype.tag="cmap",e.prototype.parse=function(e){var t,n,r;for(e.pos=this.offset,this.version=e.readUInt16(),r=e.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=r?n<r:n>r;n=0<=r?++n:--n)t=new vh(e,this.offset),this.tables.push(t),t.isUnicode&&null==this.unicode&&(this.unicode=t);return!0},e.encode=function(e,t){var n,r;return null==t&&(t="macroman"),n=vh.encode(e,t),(r=new fh).writeUInt16(0),r.writeUInt16(1),n.table=r.data.concat(n.subtable),n},e}(),wh=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return gh(e,hh),e.prototype.tag="hhea",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},e}(),_h=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return gh(e,hh),e.prototype.tag="OS/2",e.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var t,n;for(n=[],t=0;t<10;++t)n.push(e.readByte());return n}(),this.charRange=function(){var t,n;for(n=[],t=0;t<4;++t)n.push(e.readInt());return n}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var t,n;for(n=[],t=0;t<2;t=++t)n.push(e.readInt());return n}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},e}(),xh=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return gh(e,hh),e.prototype.tag="post",e.prototype.parse=function(e){var t,n,r;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var i;for(n=e.readUInt16(),this.glyphNameIndex=[],i=0;0<=n?i<n:i>n;i=0<=n?++i:--i)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],r=[];e.pos<this.offset+this.length;)t=e.readByte(),r.push(this.names.push(e.readString(t)));return r;case 151552:return n=e.readUInt16(),this.offsets=e.read(n);case 262144:return this.map=function(){var t,n,r;for(r=[],i=t=0,n=this.file.maxp.numGlyphs;0<=n?t<n:t>n;i=0<=n?++t:--t)r.push(e.readUInt32());return r}.call(this)}},e}(),kh=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},Sh=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return gh(e,hh),e.prototype.tag="name",e.prototype.parse=function(e){var t,n,r,i,o,s,a,c,l,u,d;for(e.pos=this.offset,e.readShort(),t=e.readShort(),s=e.readShort(),n=[],i=0;0<=t?i<t:i>t;i=0<=t?++i:--i)n.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+s+e.readShort()});for(a={},i=l=0,u=n.length;l<u;i=++l)r=n[i],e.pos=r.offset,c=e.readString(r.length),o=new kh(c,r),null==a[d=r.nameID]&&(a[d]=[]),a[r.nameID].push(o);this.strings=a,this.copyright=a[0],this.fontFamily=a[1],this.fontSubfamily=a[2],this.uniqueSubfamily=a[3],this.fontName=a[4],this.version=a[5];try{this.postscriptName=a[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(e){this.postscriptName=a[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=a[7],this.manufacturer=a[8],this.designer=a[9],this.description=a[10],this.vendorUrl=a[11],this.designerUrl=a[12],this.license=a[13],this.licenseUrl=a[14],this.preferredFamily=a[15],this.preferredSubfamily=a[17],this.compatibleFull=a[18],this.sampleText=a[19]},e}(),Ah=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return gh(e,hh),e.prototype.tag="maxp",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},e}(),Nh=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return gh(e,hh),e.prototype.tag="hmtx",e.prototype.parse=function(e){var t,n,r,i,o,s,a;for(e.pos=this.offset,this.metrics=[],t=0,s=this.file.hhea.numberOfMetrics;0<=s?t<s:t>s;t=0<=s?++t:--t)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(r=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var n,i;for(i=[],t=n=0;0<=r?n<r:n>r;t=0<=r?++n:--n)i.push(e.readInt16());return i}(),this.widths=function(){var e,t,n,r;for(r=[],e=0,t=(n=this.metrics).length;e<t;e++)i=n[e],r.push(i.advance);return r}.call(this),n=this.widths[this.widths.length-1],a=[],t=o=0;0<=r?o<r:o>r;t=0<=r?++o:--o)a.push(this.widths.push(n));return a},e.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},e}(),Lh=[].slice,Ph=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return gh(e,hh),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(e){var t,n,r,i,o,s,a,c,l,u;return e in this.cache?this.cache[e]:(i=this.file.loca,t=this.file.contents,n=i.indexOf(e),0===(r=i.lengthOf(e))?this.cache[e]=null:(t.pos=this.offset+n,o=(s=new fh(t.read(r))).readShort(),c=s.readShort(),u=s.readShort(),a=s.readShort(),l=s.readShort(),this.cache[e]=-1===o?new Eh(s,c,u,a,l):new Ch(s,o,c,u,a,l),this.cache[e]))},e.prototype.encode=function(e,t,n){var r,i,o,s,a;for(o=[],i=[],s=0,a=t.length;s<a;s++)r=e[t[s]],i.push(o.length),r&&(o=o.concat(r.encode(n)));return i.push(o.length),{table:o,offsets:i}},e}(),Ch=function(){function e(e,t,n,r,i,o){this.raw=e,this.numberOfContours=t,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=o,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),Eh=function(){function e(e,t,n,r,i){var o,s;for(this.raw=e,this.xMin=t,this.yMin=n,this.xMax=r,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;s=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&s;)o.pos+=1&s?4:2,128&s?o.pos+=8:64&s?o.pos+=4:8&s&&(o.pos+=2)}return e.prototype.encode=function(){var e,t,n;for(t=new fh(Lh.call(this.raw.data)),e=0,n=this.glyphIDs.length;e<n;++e)t.pos=this.glyphOffsets[e];return t.data},e}(),Ih=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return gh(e,hh),e.prototype.tag="loca",e.prototype.parse=function(e){var t,n;return e.pos=this.offset,t=this.file.head.indexToLocFormat,this.offsets=0===t?function(){var t,r;for(r=[],n=0,t=this.length;n<t;n+=2)r.push(2*e.readUInt16());return r}.call(this):function(){var t,r;for(r=[],n=0,t=this.length;n<t;n+=4)r.push(e.readUInt32());return r}.call(this)},e.prototype.indexOf=function(e){return this.offsets[e]},e.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},e.prototype.encode=function(e,t){for(var n=new Uint32Array(this.offsets.length),r=0,i=0,o=0;o<n.length;++o)if(n[o]=r,i<t.length&&t[i]==o){++i,n[o]=r;var s=this.offsets[o],a=this.offsets[o+1]-s;a>0&&(r+=a)}for(var c=new Array(4*n.length),l=0;l<n.length;++l)c[4*l+3]=255&n[l],c[4*l+2]=(65280&n[l])>>8,c[4*l+1]=(16711680&n[l])>>16,c[4*l]=(4278190080&n[l])>>24;return c},e}(),Oh=function(){function e(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var e,t,n,r,i;for(t in r=this.font.cmap.tables[0].codeMap,e={},i=this.subset)n=i[t],e[t]=r[n];return e},e.prototype.glyphsFor=function(e){var t,n,r,i,o,s,a;for(r={},o=0,s=e.length;o<s;o++)r[i=e[o]]=this.font.glyf.glyphFor(i);for(i in t=[],r)(null!=(n=r[i])?n.compound:void 0)&&t.push.apply(t,n.glyphIDs);if(t.length>0)for(i in a=this.glyphsFor(t))n=a[i],r[i]=n;return r},e.prototype.encode=function(e,t){var n,r,i,o,s,a,c,l,u,d,h,f,p,m,g;for(r in n=yh.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(e),h={0:0},g=n.charMap)h[(a=g[r]).old]=a.new;for(f in d=n.maxGlyphID,o)f in h||(h[f]=d++);return l=function(e){var t,n;for(t in n={},e)n[e[t]]=t;return n}(h),u=Object.keys(l).sort(function(e,t){return e-t}),p=function(){var e,t,n;for(n=[],e=0,t=u.length;e<t;e++)s=u[e],n.push(l[s]);return n}(),i=this.font.glyf.encode(o,p,h),c=this.font.loca.encode(i.offsets,p),m={cmap:this.font.cmap.raw(),glyf:i.table,loca:c,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(t)},this.font.os2.exists&&(m["OS/2"]=this.font.os2.raw()),this.font.directory.encode(m)},e}();function jh(e,t,n,r,i){r=r||{};var o=i.internal.scaleFactor,s=i.internal.getFontSize()/o,a=s*(i.getLineHeightFactor?i.getLineHeightFactor():1.15),c="",l=1;if("middle"!==r.valign&&"bottom"!==r.valign&&"center"!==r.halign&&"right"!==r.halign||(l=(c="string"==typeof e?e.split(/\r\n|\r|\n/g):e).length||1),n+=s*(2-1.15),"middle"===r.valign?n-=l/2*a:"bottom"===r.valign&&(n-=l*a),"center"===r.halign||"right"===r.halign){var u=s;if("center"===r.halign&&(u*=.5),c&&l>=1){for(var d=0;d<c.length;d++)i.text(c[d],t-i.getStringUnitWidth(c[d])*u,n),n+=a;return i}t-=i.getStringUnitWidth(e)*u}return"justify"===r.halign?i.text(e,t,n,{maxWidth:r.maxWidth||100,align:"justify"}):i.text(e,t,n),i}Mu.API.PDFObject=function(){var e;function t(){}return e=function(e,t){return(Array(t+1).join("0")+e).slice(-t)},t.convert=function(n){var r,i,o,s;if(Array.isArray(n))return"["+function(){var e,i,o;for(o=[],e=0,i=n.length;e<i;e++)r=n[e],o.push(t.convert(r));return o}().join(" ")+"]";if("string"==typeof n)return"/"+n;if(null!=n?n.isString:void 0)return"("+n+")";if(n instanceof Date)return"(D:"+e(n.getUTCFullYear(),4)+e(n.getUTCMonth(),2)+e(n.getUTCDate(),2)+e(n.getUTCHours(),2)+e(n.getUTCMinutes(),2)+e(n.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(n)){for(i in o=["<<"],n)s=n[i],o.push("/"+i+" "+t.convert(s));return o.push(">>"),o.join("\n")}return""+n},t}();var zh={},Fh=function(){function e(e){this.jsPDFDocument=e,this.userStyles={textColor:e.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:e.internal.getFontSize(),fontStyle:e.internal.getFont().fontStyle,font:e.internal.getFont().fontName,lineWidth:e.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:e.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return e.setDefaults=function(e,t){void 0===t&&(t=null),t?t.__autoTableDocumentDefaults=e:zh=e},e.unifyColor=function(e){return Array.isArray(e)?e:"number"==typeof e?[e,e,e]:"string"==typeof e?[e]:null},e.prototype.applyStyles=function(t,n){var r,i,o;void 0===n&&(n=!1),t.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(t.fontStyle);var s=this.jsPDFDocument.internal.getFont(),a=s.fontStyle,c=s.fontName;if(t.font&&(c=t.font),t.fontStyle){a=t.fontStyle;var l=this.getFontList()[c];l&&-1===l.indexOf(a)&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(l[0]),a=l[0])}if(this.jsPDFDocument.setFont(c,a),t.fontSize&&this.jsPDFDocument.setFontSize(t.fontSize),!n){var u=e.unifyColor(t.fillColor);u&&(r=this.jsPDFDocument).setFillColor.apply(r,u),(u=e.unifyColor(t.textColor))&&(i=this.jsPDFDocument).setTextColor.apply(i,u),(u=e.unifyColor(t.lineColor))&&(o=this.jsPDFDocument).setDrawColor.apply(o,u),"number"==typeof t.lineWidth&&this.jsPDFDocument.setLineWidth(t.lineWidth)}},e.prototype.splitTextToSize=function(e,t,n){return this.jsPDFDocument.splitTextToSize(e,t,n)},e.prototype.rect=function(e,t,n,r,i){return this.jsPDFDocument.rect(e,t,n,r,i)},e.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},e.prototype.getTextWidth=function(e){return this.jsPDFDocument.getTextWidth(e)},e.prototype.getDocument=function(){return this.jsPDFDocument},e.prototype.setPage=function(e){this.jsPDFDocument.setPage(e)},e.prototype.addPage=function(){return this.jsPDFDocument.addPage()},e.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},e.prototype.getGlobalOptions=function(){return zh||{}},e.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},e.prototype.pageSize=function(){var e=this.jsPDFDocument.internal.pageSize;return null==e.width&&(e={width:e.getWidth(),height:e.getHeight()}),e},e.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},e.prototype.getLineHeightFactor=function(){var e=this.jsPDFDocument;return e.getLineHeightFactor?e.getLineHeightFactor():1.15},e.prototype.getLineHeight=function(e){return e/this.scaleFactor()*this.getLineHeightFactor()},e.prototype.pageNumber=function(){var e=this.jsPDFDocument.internal.getCurrentPageInfo();return e?e.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},e}(),Th=function(e,t){return Th=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Th(e,t)};function Rh(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}Th(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}"function"==typeof SuppressedError&&SuppressedError;var Mh=function(e){function t(t){var n=e.call(this)||this;return n._element=t,n}return Rh(t,e),t}(Array);function Dh(e,t,n){n.applyStyles(t,!0);var r=(Array.isArray(e)?e:[e]).map(function(e){return n.getTextWidth(e)}).reduce(function(e,t){return Math.max(e,t)},0);return r}function Bh(e,t,n,r){var i=t.settings.tableLineWidth,o=t.settings.tableLineColor;e.applyStyles({lineWidth:i,lineColor:o});var s=qh(i,!1);s&&e.rect(n.x,n.y,t.getWidth(e.pageSize().width),r.y-n.y,s)}function qh(e,t){var n=e>0,r=t||0===t;return n&&r?"DF":n?"S":r?"F":null}function Uh(e,t){var n,r,i,o;if(e=e||t,Array.isArray(e)){if(e.length>=4)return{top:e[0],right:e[1],bottom:e[2],left:e[3]};if(3===e.length)return{top:e[0],right:e[1],bottom:e[2],left:e[1]};if(2===e.length)return{top:e[0],right:e[1],bottom:e[0],left:e[1]};e=1===e.length?e[0]:t}return"object"==typeof e?("number"==typeof e.vertical&&(e.top=e.vertical,e.bottom=e.vertical),"number"==typeof e.horizontal&&(e.right=e.horizontal,e.left=e.horizontal),{left:null!==(n=e.left)&&void 0!==n?n:t,top:null!==(r=e.top)&&void 0!==r?r:t,right:null!==(i=e.right)&&void 0!==i?i:t,bottom:null!==(o=e.bottom)&&void 0!==o?o:t}):("number"!=typeof e&&(e=t),{top:e,right:e,bottom:e,left:e})}function $h(e,t){var n=Uh(t.settings.margin,0);return e.pageSize().width-(n.left+n.right)}function Wh(e,t,n,r,i){var o={},s=96/72,a=Zh(t,function(e){return i.getComputedStyle(e).backgroundColor});null!=a&&(o.fillColor=a);var c=Zh(t,function(e){return i.getComputedStyle(e).color});null!=c&&(o.textColor=c);var l=function(e,t){var n=[e.paddingTop,e.paddingRight,e.paddingBottom,e.paddingLeft],r=96/(72/t),i=(parseInt(e.lineHeight)-parseInt(e.fontSize))/t/2,o=Uh(n.map(function(e){return parseInt(e||"0")/r}),0);return i>o.top&&(o.top=i),i>o.bottom&&(o.bottom=i),o}(r,n);l&&(o.cellPadding=l);var u="borderTopColor",d=s*n,h=r.borderTopWidth;if(r.borderBottomWidth===h&&r.borderRightWidth===h&&r.borderLeftWidth===h){var f=(parseFloat(h)||0)/d;f&&(o.lineWidth=f)}else o.lineWidth={top:(parseFloat(r.borderTopWidth)||0)/d,right:(parseFloat(r.borderRightWidth)||0)/d,bottom:(parseFloat(r.borderBottomWidth)||0)/d,left:(parseFloat(r.borderLeftWidth)||0)/d},o.lineWidth.top||(o.lineWidth.right?u="borderRightColor":o.lineWidth.bottom?u="borderBottomColor":o.lineWidth.left&&(u="borderLeftColor"));var p=Zh(t,function(e){return i.getComputedStyle(e)[u]});null!=p&&(o.lineColor=p);var m=["left","right","center","justify"];-1!==m.indexOf(r.textAlign)&&(o.halign=r.textAlign),-1!==(m=["middle","bottom","top"]).indexOf(r.verticalAlign)&&(o.valign=r.verticalAlign);var g=parseInt(r.fontSize||"");isNaN(g)||(o.fontSize=g/s);var b=function(e){var t="";return("bold"===e.fontWeight||"bolder"===e.fontWeight||parseInt(e.fontWeight)>=700)&&(t="bold"),"italic"!==e.fontStyle&&"oblique"!==e.fontStyle||(t+="italic"),t}(r);b&&(o.fontStyle=b);var v=(r.fontFamily||"").toLowerCase();return-1!==e.indexOf(v)&&(o.font=v),o}function Zh(e,t){var n=Hh(e,t);if(!n)return null;var r=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var i=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])];return 0===parseInt(r[4])||isNaN(i[0])||isNaN(i[1])||isNaN(i[2])?null:i}function Hh(e,t){var n=t(e);return"rgba(0, 0, 0, 0)"===n||"transparent"===n||"initial"===n||"inherit"===n?null==e.parentElement?null:Hh(e.parentElement,t):n}function Vh(e,t,n,r,i){var o,s,a;void 0===r&&(r=!1),void 0===i&&(i=!1),a="string"==typeof t?n.document.querySelector(t):t;var c=Object.keys(e.getFontList()),l=e.scaleFactor(),u=[],d=[],h=[];if(!a)return console.error("Html table could not be found with input: ",t),{head:u,body:d,foot:h};for(var f=0;f<a.rows.length;f++){var p=a.rows[f],m=null===(s=null===(o=null==p?void 0:p.parentElement)||void 0===o?void 0:o.tagName)||void 0===s?void 0:s.toLowerCase(),g=Gh(c,l,n,p,r,i);g&&("thead"===m?u.push(g):"tfoot"===m?h.push(g):d.push(g))}return{head:u,body:d,foot:h}}function Gh(e,t,n,r,i,o){for(var s=new Mh(r),a=0;a<r.cells.length;a++){var c=r.cells[a],l=n.getComputedStyle(c);if(i||"none"!==l.display){var u=void 0;o&&(u=Wh(e,c,t,l,n)),s.push({rowSpan:c.rowSpan,colSpan:c.colSpan,styles:u,_element:c,content:Jh(c)})}}var d=n.getComputedStyle(r);if(s.length>0&&(i||"none"!==d.display))return s}function Jh(e){var t=e.cloneNode(!0);return t.innerHTML=t.innerHTML.replace(/\n/g,"").replace(/ +/g," "),t.innerHTML=t.innerHTML.split(/<br.*?>/).map(function(e){return e.trim()}).join("\n"),t.innerText||t.textContent||""}function Kh(e,t,n,r,i){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(e),s=1;s<arguments.length;s++){var a=arguments[s];if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(o[c]=a[c])}return o}var Yh,Xh=function(e,t,n){this.table=t,this.pageNumber=t.pageNumber,this.settings=t.settings,this.cursor=n,this.doc=e.getDocument()},Qh=function(e){function t(t,n,r,i,o,s){var a=e.call(this,t,n,s)||this;return a.cell=r,a.row=i,a.column=o,a.section=i.section,a}return Rh(t,e),t}(Xh),ef=function(){function e(e,t){this.pageNumber=1,this.id=e.id,this.settings=e.settings,this.styles=e.styles,this.hooks=e.hooks,this.columns=t.columns,this.head=t.head,this.body=t.body,this.foot=t.foot}return e.prototype.getHeadHeight=function(e){return this.head.reduce(function(t,n){return t+n.getMaxCellHeight(e)},0)},e.prototype.getFootHeight=function(e){return this.foot.reduce(function(t,n){return t+n.getMaxCellHeight(e)},0)},e.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},e.prototype.callCellHooks=function(e,t,n,r,i,o){for(var s=0,a=t;s<a.length;s++){var c=!1===(0,a[s])(new Qh(e,this,n,r,i,o));if(n.text=Array.isArray(n.text)?n.text:[n.text],c)return!1}return!0},e.prototype.callEndPageHooks=function(e,t){e.applyStyles(e.userStyles);for(var n=0,r=this.hooks.didDrawPage;n<r.length;n++)(0,r[n])(new Xh(e,this,t))},e.prototype.callWillDrawPageHooks=function(e,t){for(var n=0,r=this.hooks.willDrawPage;n<r.length;n++)(0,r[n])(new Xh(e,this,t))},e.prototype.getWidth=function(e){if("number"==typeof this.settings.tableWidth)return this.settings.tableWidth;if("wrap"===this.settings.tableWidth)return this.columns.reduce(function(e,t){return e+t.wrappedWidth},0);var t=this.settings.margin;return e-t.left-t.right},e}(),tf=function(){function e(e,t,n,r,i){void 0===i&&(i=!1),this.height=0,this.raw=e,e instanceof Mh&&(this.raw=e._element,this.element=e._element),this.index=t,this.section=n,this.cells=r,this.spansMultiplePages=i}return e.prototype.getMaxCellHeight=function(e){var t=this;return e.reduce(function(e,n){var r;return Math.max(e,(null===(r=t.cells[n.index])||void 0===r?void 0:r.height)||0)},0)},e.prototype.hasRowSpan=function(e){var t=this;return e.filter(function(e){var n=t.cells[e.index];return!!n&&n.rowSpan>1}).length>0},e.prototype.canEntireRowFit=function(e,t){return this.getMaxCellHeight(t)<=e},e.prototype.getMinimumRowHeight=function(e,t){var n=this;return e.reduce(function(e,r){var i=n.cells[r.index];if(!i)return 0;var o=t.getLineHeight(i.styles.fontSize),s=i.padding("vertical")+o;return s>e?s:e},0)},e}(),nf=function(){function e(e,t,n){var r;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.x=0,this.y=0,this.styles=t,this.section=n,this.raw=e;var i=e;null==e||"object"!=typeof e||Array.isArray(e)?(this.rowSpan=1,this.colSpan=1):(this.rowSpan=e.rowSpan||1,this.colSpan=e.colSpan||1,i=null!==(r=e.content)&&void 0!==r?r:e,e._element&&(this.raw=e._element));var o=null!=i?""+i:"";this.text=o.split(/\r\n|\r|\n/g)}return e.prototype.getTextPos=function(){var e,t;if("top"===this.styles.valign)e=this.y+this.padding("top");else if("bottom"===this.styles.valign)e=this.y+this.height-this.padding("bottom");else{var n=this.height-this.padding("vertical");e=this.y+n/2+this.padding("top")}if("right"===this.styles.halign)t=this.x+this.width-this.padding("right");else if("center"===this.styles.halign){var r=this.width-this.padding("horizontal");t=this.x+r/2+this.padding("left")}else t=this.x+this.padding("left");return{x:t,y:e}},e.prototype.getContentHeight=function(e,t){void 0===t&&(t=1.15);var n=(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/e*t)+this.padding("vertical");return Math.max(n,this.styles.minCellHeight)},e.prototype.padding=function(e){var t=Uh(this.styles.cellPadding,0);return"vertical"===e?t.top+t.bottom:"horizontal"===e?t.left+t.right:t[e]},e}(),rf=function(){function e(e,t,n){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=e,this.raw=t,this.index=n}return e.prototype.getMaxCustomCellWidth=function(e){for(var t=0,n=0,r=e.allRows();n<r.length;n++){var i=r[n].cells[this.index];i&&"number"==typeof i.styles.cellWidth&&(t=Math.max(t,i.styles.cellWidth))}return t},e}();function of(e,t,n){for(var r=t,i=e.reduce(function(e,t){return e+t.wrappedWidth},0),o=0;o<e.length;o++){var s=e[o],a=r*(s.wrappedWidth/i),c=s.width+a,l=n(s),u=c<l?l:c;t-=u-s.width,s.width=u}if(t=Math.round(1e10*t)/1e10){var d=e.filter(function(e){return!(t<0)||e.width>n(e)});d.length&&(t=of(d,t,n))}return t}function sf(e,t,n,r,i){return e.map(function(e){return function(e,t,n,r,i){var o=1e4*r.scaleFactor();if((t=Math.ceil(t*o)/o)>=Dh(e,n,r))return e;for(;t<Dh(e+i,n,r)&&!(e.length<=1);)e=e.substring(0,e.length-1);return e.trim()+i}(e,t,n,r,i)})}function af(e,t){var n=new Fh(e),r=function(e,t){var n,r=e.content,i=function(e){return e.map(function(e,t){var n,r;return r="object"==typeof e&&null!==(n=e.dataKey)&&void 0!==n?n:t,new rf(r,e,t)})}(r.columns);(0===r.head.length&&(n=lf(i,"head"))&&r.head.push(n),0===r.foot.length)&&((n=lf(i,"foot"))&&r.foot.push(n));var o=e.settings.theme,s=e.styles;return{columns:i,head:cf("head",r.head,i,s,o,t),body:cf("body",r.body,i,s,o,t),foot:cf("foot",r.foot,i,s,o,t)}}(t,n.scaleFactor()),i=new ef(t,r);return function(e,t){!function(e,t){var n=e.scaleFactor(),r=t.settings.horizontalPageBreak,i=$h(e,t);t.allRows().forEach(function(o){for(var s=0,a=t.columns;s<a.length;s++){var c=a[s],l=o.cells[c.index];if(l){var u=t.hooks.didParseCell;t.callCellHooks(e,u,l,o,c,null);var d=l.padding("horizontal");l.contentWidth=Dh(l.text,l.styles,e)+d;var h=Dh(l.text.join(" ").split(/[^\S\u00A0]+/),l.styles,e);if(l.minReadableWidth=h+l.padding("horizontal"),"number"==typeof l.styles.cellWidth)l.minWidth=l.styles.cellWidth,l.wrappedWidth=l.styles.cellWidth;else if("wrap"===l.styles.cellWidth||!0===r)l.contentWidth>i?(l.minWidth=i,l.wrappedWidth=i):(l.minWidth=l.contentWidth,l.wrappedWidth=l.contentWidth);else{var f=10/n;l.minWidth=l.styles.minCellWidth||f,l.wrappedWidth=l.contentWidth,l.minWidth>l.wrappedWidth&&(l.wrappedWidth=l.minWidth)}}}}),t.allRows().forEach(function(e){for(var n=0,r=t.columns;n<r.length;n++){var i=r[n],o=e.cells[i.index];if(o&&1===o.colSpan)i.wrappedWidth=Math.max(i.wrappedWidth,o.wrappedWidth),i.minWidth=Math.max(i.minWidth,o.minWidth),i.minReadableWidth=Math.max(i.minReadableWidth,o.minReadableWidth);else{var s=t.styles.columnStyles[i.dataKey]||t.styles.columnStyles[i.index]||{},a=s.cellWidth||s.minCellWidth;a&&"number"==typeof a&&(i.minWidth=a,i.wrappedWidth=a)}o&&(o.colSpan>1&&!i.minWidth&&(i.minWidth=o.minWidth),o.colSpan>1&&!i.wrappedWidth&&(i.wrappedWidth=o.minWidth))}})}(e,t);var n=[],r=0;t.columns.forEach(function(e){var i=e.getMaxCustomCellWidth(t);i?e.width=i:(e.width=e.wrappedWidth,n.push(e)),r+=e.width});var i=t.getWidth(e.pageSize().width)-r;i&&(i=of(n,i,function(e){return Math.max(e.minReadableWidth,e.minWidth)})),i&&(i=of(n,i,function(e){return e.minWidth})),i=Math.abs(i),!t.settings.horizontalPageBreak&&i>.1/e.scaleFactor()&&(i=i<1?i:Math.round(i),console.log("Of the table content, ".concat(i," units width could not fit page"))),function(e){for(var t=e.allRows(),n=0;n<t.length;n++)for(var r=t[n],i=null,o=0,s=0,a=0;a<e.columns.length;a++){var c=e.columns[a];if((s-=1)>1&&e.columns[a+1])o+=c.width,delete r.cells[c.index];else if(i){var l=i;delete r.cells[c.index],i=null,l.width=c.width+o}else{if(!(l=r.cells[c.index]))continue;if(s=l.colSpan,o=0,l.colSpan>1){i=l,o+=c.width;continue}l.width=c.width+o}}}(t),function(e,t){for(var n={count:0,height:0},r=0,i=e.allRows();r<i.length;r++){for(var o=i[r],s=0,a=e.columns;s<a.length;s++){var c=a[s],l=o.cells[c.index];if(l){t.applyStyles(l.styles,!0);var u=l.width-l.padding("horizontal");if("linebreak"===l.styles.overflow)l.text=t.splitTextToSize(l.text,u+1/t.scaleFactor(),{fontSize:l.styles.fontSize});else if("ellipsize"===l.styles.overflow)l.text=sf(l.text,u,l.styles,t,"...");else if("hidden"===l.styles.overflow)l.text=sf(l.text,u,l.styles,t,"");else if("function"==typeof l.styles.overflow){var d=l.styles.overflow(l.text,u);l.text="string"==typeof d?[d]:d}l.contentHeight=l.getContentHeight(t.scaleFactor(),t.getLineHeightFactor());var h=l.contentHeight/l.rowSpan;l.rowSpan>1&&n.count*n.height<h*l.rowSpan?n={height:h,count:l.rowSpan}:n&&n.count>0&&n.height>h&&(h=n.height),h>o.height&&(o.height=h)}}n.count--}}(t,e),function(e){for(var t={},n=1,r=e.allRows(),i=0;i<r.length;i++)for(var o=r[i],s=0,a=e.columns;s<a.length;s++){var c=a[s],l=t[c.index];if(n>1)n--,delete o.cells[c.index];else if(l)l.cell.height+=o.height,n=l.cell.colSpan,delete o.cells[c.index],l.left--,l.left<=1&&delete t[c.index];else{var u=o.cells[c.index];if(!u)continue;if(u.height=o.height,u.rowSpan>1){var d=r.length-i,h=u.rowSpan>d?d:u.rowSpan;t[c.index]={cell:u,left:h,row:o}}}}}(t)}(n,i),n.applyStyles(n.userStyles),i}function cf(e,t,n,r,i,o){var s={};return t.map(function(t,a){for(var c=0,l={},u=0,d=0,h=0,f=n;h<f.length;h++){var p=f[h];if(null==s[p.index]||0===s[p.index].left)if(0===d){var m,g={};"object"!=typeof(m=Array.isArray(t)?t[p.index-u-c]:t[p.dataKey])||Array.isArray(m)||(g=(null==m?void 0:m.styles)||{});var b=uf(e,p,a,i,r,o,g),v=new nf(m,b,e);l[p.dataKey]=v,l[p.index]=v,d=v.colSpan-1,s[p.index]={left:v.rowSpan-1,times:d}}else d--,u++;else s[p.index].left--,d=s[p.index].times,c++}return new tf(t,a,e,l)})}function lf(e,t){var n={};return e.forEach(function(e){if(null!=e.raw){var r=function(e,t){if("head"===e){if("object"==typeof t)return t.header||null;if("string"==typeof t||"number"==typeof t)return t}else if("foot"===e&&"object"==typeof t)return t.footer;return null}(t,e.raw);null!=r&&(n[e.dataKey]=r)}}),Object.keys(n).length>0?n:null}function uf(e,t,n,r,i,o,s){var a,c={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}}[r];"head"===e?a=i.headStyles:"body"===e?a=i.bodyStyles:"foot"===e&&(a=i.footStyles);var l=Kh({},c.table,c[e],i.styles,a),u=i.columnStyles[t.dataKey]||i.columnStyles[t.index]||{},d="body"===e?u:{},h="body"===e&&n%2==0?Kh({},c.alternateRow,i.alternateRowStyles):{},f=function(e){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/e,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}}(o),p=Kh({},f,l,h,d);return Kh(p,s)}function df(e,t,n){var r;void 0===n&&(n={});var i=$h(e,t),o=new Map,s=[],a=[],c=[];Array.isArray(t.settings.horizontalPageBreakRepeat)?c=t.settings.horizontalPageBreakRepeat:"string"!=typeof t.settings.horizontalPageBreakRepeat&&"number"!=typeof t.settings.horizontalPageBreakRepeat||(c=[t.settings.horizontalPageBreakRepeat]),c.forEach(function(e){var n=t.columns.find(function(t){return t.dataKey===e||t.index===e});n&&!o.has(n.index)&&(o.set(n.index,!0),s.push(n.index),a.push(t.columns[n.index]),i-=n.wrappedWidth)});for(var l=!0,u=null!==(r=null==n?void 0:n.start)&&void 0!==r?r:0;u<t.columns.length;)if(o.has(u))u++;else{var d=t.columns[u].wrappedWidth;if(!(l||i>=d))break;l=!1,s.push(u),a.push(t.columns[u]),i-=d,u++}return{colIndexes:s,columns:a,lastIndex:u-1}}function hf(e,t,n,r){var i=t.settings;e.applyStyles(e.userStyles),"firstPage"!==i.showHead&&"everyPage"!==i.showHead||t.head.forEach(function(i){return bf(e,t,i,n,r)})}function ff(e,t,n,r,i,o){e.applyStyles(e.userStyles),o=null!=o?o:t.body.length;var s=Math.min(n+o,t.body.length),a=-1;return t.body.slice(n,s).forEach(function(o,s){var c=n+s===t.body.length-1,l=yf(e,t,c,r);o.canEntireRowFit(l,i)&&(bf(e,t,o,r,i),a=n+s)}),a}function pf(e,t,n,r){var i=t.settings;e.applyStyles(e.userStyles),"lastPage"!==i.showFoot&&"everyPage"!==i.showFoot||t.foot.forEach(function(i){return bf(e,t,i,n,r)})}function mf(e,t,n){var r=n.getLineHeight(e.styles.fontSize),i=e.padding("vertical"),o=Math.floor((t-i)/r);return Math.max(0,o)}function gf(e,t,n,r,i,o,s){var a=yf(e,t,r,o);if(n.canEntireRowFit(a,s))bf(e,t,n,o,s);else if(function(e,t,n,r){var i=e.pageSize().height,o=r.settings.margin,s=i-(o.top+o.bottom);"body"===t.section&&(s-=r.getHeadHeight(r.columns)+r.getFootHeight(r.columns));var a=t.getMinimumRowHeight(r.columns,e),c=a<n;if(a>s)return console.log("Will not be able to print row ".concat(t.index," correctly since it's minimum height is larger than page height")),!0;if(!c)return!1;var l=t.hasRowSpan(r.columns);return t.getMaxCellHeight(r.columns)>s?(l&&console.log("The content of row ".concat(t.index," will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.")),!0):!l&&"avoid"!==r.settings.rowPageBreak}(e,n,a,t)){var c=function(e,t,n,r){var i={};e.spansMultiplePages=!0,e.height=0;for(var o=0,s=0,a=n.columns;s<a.length;s++){var c=a[s];if(g=e.cells[c.index]){Array.isArray(g.text)||(g.text=[g.text]),(m=Kh(m=new nf(g.raw,g.styles,g.section),g)).text=[];var l=mf(g,t,r);g.text.length>l&&(m.text=g.text.splice(l,g.text.length));var u=r.scaleFactor(),d=r.getLineHeightFactor();g.contentHeight=g.getContentHeight(u,d),g.contentHeight>=t&&(g.contentHeight=t,m.styles.minCellHeight-=t),g.contentHeight>e.height&&(e.height=g.contentHeight),m.contentHeight=m.getContentHeight(u,d),m.contentHeight>o&&(o=m.contentHeight),i[c.index]=m}}var h=new tf(e.raw,-1,e.section,i,!0);h.height=o;for(var f=0,p=n.columns;f<p.length;f++){var m,g;c=p[f],(m=h.cells[c.index])&&(m.height=h.height),(g=e.cells[c.index])&&(g.height=e.height)}return h}(n,a,t,e);bf(e,t,n,o,s),wf(e,t,i,o,s),gf(e,t,c,r,i,o,s)}else wf(e,t,i,o,s),gf(e,t,n,r,i,o,s)}function bf(e,t,n,r,i){r.x=t.settings.margin.left;for(var o=0,s=i;o<s.length;o++){var a=s[o],c=n.cells[a.index];if(c)if(e.applyStyles(c.styles),c.x=r.x,c.y=r.y,!1!==t.callCellHooks(e,t.hooks.willDrawCell,c,n,a,r)){vf(e,c,r);var l=c.getTextPos();jh(c.text,l.x,l.y,{halign:c.styles.halign,valign:c.styles.valign,maxWidth:Math.ceil(c.width-c.padding("left")-c.padding("right"))},e.getDocument()),t.callCellHooks(e,t.hooks.didDrawCell,c,n,a,r),r.x+=a.width}else r.x+=a.width;else r.x+=a.width}r.y+=n.height}function vf(e,t,n){var r=t.styles;if(e.getDocument().setFillColor(e.getDocument().getFillColor()),"number"==typeof r.lineWidth){var i=qh(r.lineWidth,r.fillColor);i&&e.rect(t.x,n.y,t.width,t.height,i)}else"object"==typeof r.lineWidth&&(r.fillColor&&e.rect(t.x,n.y,t.width,t.height,"F"),function(e,t,n,r){var i,o,s,a;function c(t,n,r,i,o){e.getDocument().setLineWidth(t),e.getDocument().line(n,r,i,o,"S")}r.top&&(i=n.x,o=n.y,s=n.x+t.width,a=n.y,r.right&&(s+=.5*r.right),r.left&&(i-=.5*r.left),c(r.top,i,o,s,a)),r.bottom&&(i=n.x,o=n.y+t.height,s=n.x+t.width,a=n.y+t.height,r.right&&(s+=.5*r.right),r.left&&(i-=.5*r.left),c(r.bottom,i,o,s,a)),r.left&&(i=n.x,o=n.y,s=n.x,a=n.y+t.height,r.top&&(o-=.5*r.top),r.bottom&&(a+=.5*r.bottom),c(r.left,i,o,s,a)),r.right&&(i=n.x+t.width,o=n.y,s=n.x+t.width,a=n.y+t.height,r.top&&(o-=.5*r.top),r.bottom&&(a+=.5*r.bottom),c(r.right,i,o,s,a))}(e,t,n,r.lineWidth))}function yf(e,t,n,r){var i=t.settings.margin.bottom,o=t.settings.showFoot;return("everyPage"===o||"lastPage"===o&&n)&&(i+=t.getFootHeight(t.columns)),e.pageSize().height-r.y-i}function wf(e,t,n,r,i,o){void 0===i&&(i=[]),void 0===o&&(o=!1),e.applyStyles(e.userStyles),"everyPage"!==t.settings.showFoot||o||t.foot.forEach(function(n){return bf(e,t,n,r,i)}),t.callEndPageHooks(e,r);var s=t.settings.margin;Bh(e,t,n,r),_f(e),t.pageNumber++,r.x=s.left,r.y=s.top,n.y=s.top,t.callWillDrawPageHooks(e,r),"everyPage"===t.settings.showHead&&(t.head.forEach(function(n){return bf(e,t,n,r,i)}),e.applyStyles(e.userStyles))}function _f(e){var t=e.pageNumber();return e.setPage(t+1),e.pageNumber()===t&&(e.addPage(),!0)}try{if("undefined"!=typeof window&&window){var xf=window,kf=xf.jsPDF||(null===(Yh=xf.jspdf)||void 0===Yh?void 0:Yh.jsPDF);kf&&function(e){e.API.autoTable=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(e,t){var n=t.settings,r=n.startY,i=n.margin,o={x:i.left,y:r},s=t.getHeadHeight(t.columns)+t.getFootHeight(t.columns),a=r+i.bottom+s;"avoid"===n.pageBreak&&(a+=t.body.reduce(function(e,t){return e+t.height},0));var c=new Fh(e);("always"===n.pageBreak||null!=n.startY&&a>c.pageSize().height)&&(_f(c),o.y=i.top),t.callWillDrawPageHooks(c,o);var l=Kh({},o);t.startPageNumber=c.pageNumber(),n.horizontalPageBreak?function(e,t,n,r){var i=function(e,t){for(var n=[],r=0;r<t.columns.length;r++){var i=df(e,t,{start:r});i.columns.length&&(n.push(i),r=i.lastIndex)}return n}(e,t);if("afterAllRows"===t.settings.horizontalPageBreakBehaviour)i.forEach(function(i,o){e.applyStyles(e.userStyles),o>0?wf(e,t,n,r,i.columns,!0):hf(e,t,r,i.columns),function(e,t,n,r,i){e.applyStyles(e.userStyles),t.body.forEach(function(o,s){var a=s===t.body.length-1;gf(e,t,o,a,n,r,i)})}(e,t,n,r,i.columns),pf(e,t,r,i.columns)});else for(var o=-1,s=i[0],a=function(){var a=o;if(s){e.applyStyles(e.userStyles);var c=s.columns;o>=0?wf(e,t,n,r,c,!0):hf(e,t,r,c),a=ff(e,t,o+1,r,c),pf(e,t,r,c)}var l=a-o;i.slice(1).forEach(function(i){e.applyStyles(e.userStyles),wf(e,t,n,r,i.columns,!0),ff(e,t,o+1,r,i.columns,l),pf(e,t,r,i.columns)}),o=a};o<t.body.length-1;)a()}(c,t,l,o):(c.applyStyles(c.userStyles),"firstPage"!==n.showHead&&"everyPage"!==n.showHead||t.head.forEach(function(e){return bf(c,t,e,o,t.columns)}),c.applyStyles(c.userStyles),t.body.forEach(function(e,n){var r=n===t.body.length-1;gf(c,t,e,r,l,o,t.columns)}),c.applyStyles(c.userStyles),"lastPage"!==n.showFoot&&"everyPage"!==n.showFoot||t.foot.forEach(function(e){return bf(c,t,e,o,t.columns)})),Bh(c,t,l,o),t.callEndPageHooks(c,o),t.finalY=o.y,e.lastAutoTable=t,c.applyStyles(c.userStyles)}(this,af(this,function(e,t){var n=new Fh(e),r=n.getDocumentOptions(),i=n.getGlobalOptions();!function(e,t,n){for(var r=0,i=[e,t,n];r<i.length;r++){var o=i[r];o&&"object"!=typeof o&&console.error("The options parameter should be of type object, is: "+typeof o),o.startY&&"number"!=typeof o.startY&&(console.error("Invalid value for startY option",o.startY),delete o.startY)}}(i,r,t);var o,s=Kh({},i,r,t);"undefined"!=typeof window&&(o=window);var a=function(e,t,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},i=function(i){if("columnStyles"===i){var o=e[i],s=t[i],a=n[i];r.columnStyles=Kh({},o,s,a)}else{var c=[e,t,n].map(function(e){return e[i]||{}});r[i]=Kh({},c[0],c[1],c[2])}},o=0,s=Object.keys(r);o<s.length;o++)i(s[o]);return r}(i,r,t),c=function(e,t,n){for(var r={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},i=0,o=[e,t,n];i<o.length;i++){var s=o[i];s.didParseCell&&r.didParseCell.push(s.didParseCell),s.willDrawCell&&r.willDrawCell.push(s.willDrawCell),s.didDrawCell&&r.didDrawCell.push(s.didDrawCell),s.willDrawPage&&r.willDrawPage.push(s.willDrawPage),s.didDrawPage&&r.didDrawPage.push(s.didDrawPage)}return r}(i,r,t),l=function(e,t){var n,r,i,o,s,a,c,l,u,d,h,f,p,m,g=Uh(t.margin,40/e.scaleFactor()),b=null!==(n=function(e,t){var n=e.getLastAutoTable(),r=e.scaleFactor(),i=e.pageNumber(),o=!1;return n&&n.startPageNumber&&(o=n.startPageNumber+n.pageNumber-1===i),"number"==typeof t?t:null!=t&&!1!==t||!o||null==(null==n?void 0:n.finalY)?null:n.finalY+20/r}(e,t.startY))&&void 0!==n?n:g.top;p=!0===t.showFoot?"everyPage":!1===t.showFoot?"never":null!==(r=t.showFoot)&&void 0!==r?r:"everyPage",m=!0===t.showHead?"everyPage":!1===t.showHead?"never":null!==(i=t.showHead)&&void 0!==i?i:"everyPage";var v=null!==(o=t.useCss)&&void 0!==o&&o,y=t.theme||(v?"plain":"striped"),w=!!t.horizontalPageBreak,_=null!==(s=t.horizontalPageBreakRepeat)&&void 0!==s?s:null;return{includeHiddenHtml:null!==(a=t.includeHiddenHtml)&&void 0!==a&&a,useCss:v,theme:y,startY:b,margin:g,pageBreak:null!==(c=t.pageBreak)&&void 0!==c?c:"auto",rowPageBreak:null!==(l=t.rowPageBreak)&&void 0!==l?l:"auto",tableWidth:null!==(u=t.tableWidth)&&void 0!==u?u:"auto",showHead:m,showFoot:p,tableLineWidth:null!==(d=t.tableLineWidth)&&void 0!==d?d:0,tableLineColor:null!==(h=t.tableLineColor)&&void 0!==h?h:200,horizontalPageBreak:w,horizontalPageBreakRepeat:_,horizontalPageBreakBehaviour:null!==(f=t.horizontalPageBreakBehaviour)&&void 0!==f?f:"afterAllRows"}}(n,s),u=function(e,t,n){var r=t.head||[],i=t.body||[],o=t.foot||[];if(t.html){var s=t.includeHiddenHtml;if(n){var a=Vh(e,t.html,n,s,t.useCss)||{};r=a.head||r,i=a.body||r,o=a.foot||r}else console.error("Cannot parse html in non browser environment")}var c=t.columns||function(e,t,n){var r=e[0]||t[0]||n[0]||[],i=[];return Object.keys(r).filter(function(e){return"_element"!==e}).forEach(function(e){var t,n=1;"object"!=typeof(t=Array.isArray(r)?r[parseInt(e)]:r[e])||Array.isArray(t)||(n=(null==t?void 0:t.colSpan)||1);for(var o=0;o<n;o++){var s={dataKey:Array.isArray(r)?i.length:e+(o>0?"_".concat(o):"")};i.push(s)}}),i}(r,i,o);return{columns:c,head:r,body:i,foot:o}}(n,s,o);return{id:t.tableId,content:u,hooks:c,styles:a,settings:l}}(this,e[0]))),this},e.API.lastAutoTable=!1,e.API.autoTableText=function(e,t,n,r){jh(e,t,n,r,this)},e.API.autoTableSetDefaults=function(e){return Fh.setDefaults(e,this),this},e.autoTableSetDefaults=function(e,t){Fh.setDefaults(e,t)},e.API.autoTableHtmlToJson=function(e,t){var n;if(void 0===t&&(t=!1),"undefined"==typeof window)return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;var r=Vh(new Fh(this),e,window,t,!1),i=r.head,o=r.body;return{columns:(null===(n=i[0])||void 0===n?void 0:n.map(function(e){return e.content}))||[],rows:o,data:o}}}(kf)}}catch(ar){console.error("Could not apply autoTable plugin",ar)}function Sf(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const i=s.prototype,o=Object.keys(i);for(let e=0;e<o.length;e++){const t=o[e];t in n||(n[t]=i[t].bind(n))}}const i=n?.Parent??Object;class o extends i{}function s(e){var t;const i=n?.Parent?new o:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(const e of i._zod.deferred)e();return i}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}s.p,(0,m.__)("Accepted","surecookie"),(0,m.__)("Declined","surecookie"),(0,m.__)("Partially Accepted","surecookie"),E("pricing_consent_log_export_upsell","pricing/"),Object.freeze({status:"aborted"}),Symbol("zod_brand");class Af extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Nf extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Lf={};function Pf(e){return e&&Object.assign(Lf,e),Lf}function Cf(e){const t=Object.values(e).filter(e=>"number"==typeof e),n=Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t);return n}function Ef(e,t="|"){return e.map(e=>Kf(e)).join(t)}function If(e,t){return"bigint"==typeof t?t.toString():t}function Of(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function jf(e){return null==e}function zf(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ff=Symbol("evaluating");function Tf(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ff)return void 0===r&&(r=Ff,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Rf(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Mf(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Df(e){return JSON.stringify(e)}const Bf="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function qf(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Uf=Of(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function $f(e){if(!1===qf(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==qf(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Wf(e){return $f(e)?{...e}:Array.isArray(e)?[...e]:e}const Zf=new Set(["string","number","symbol"]),Hf=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Vf(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gf(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Jf(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function Kf(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}const Yf={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Xf={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Qf(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function ep(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function tp(e){return"string"==typeof e?e:e?.message}function np(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=tp(e.inst?._zod.def?.error?.(e))??tp(t?.error?.(e))??tp(n.customError?.(e))??tp(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function rp(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ip(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function op(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const sp=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,If,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ap=Sf("$ZodError",sp),cp=Sf("$ZodError",sp,{Parent:Error}),lp=e=>(t,n,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Af;if(s.issues.length){const t=new(i?.Err??e)(s.issues.map(e=>np(e,o,Pf())));throw Bf(t,i?.callee),t}return s.value},up=lp(cp),dp=e=>async(t,n,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(i?.Err??e)(s.issues.map(e=>np(e,o,Pf())));throw Bf(t,i?.callee),t}return s.value},hp=dp(cp),fp=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Af;return o.issues.length?{success:!1,error:new(e??ap)(o.issues.map(e=>np(e,i,Pf())))}:{success:!0,data:o.value}},pp=fp(cp),mp=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>np(e,i,Pf())))}:{success:!0,data:o.value}},gp=mp(cp),bp=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lp(e)(t,n,i)},vp=e=>(t,n,r)=>lp(e)(t,n,r),yp=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return dp(e)(t,n,i)},_p=e=>async(t,n,r)=>dp(e)(t,n,r),xp=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return fp(e)(t,n,i)},kp=e=>(t,n,r)=>fp(e)(t,n,r),Sp=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return mp(e)(t,n,i)},Ap=e=>async(t,n,r)=>mp(e)(t,n,r),Np=/^[cC][^\s-]{8,}$/,Lp=/^[0-9a-z]+$/,Pp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Cp=/^[0-9a-vA-V]{20}$/,Ep=/^[A-Za-z0-9]{27}$/,Ip=/^[a-zA-Z0-9_-]{21}$/,Op=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jp=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,zp=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Fp=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Tp=Fp(4),Rp=Fp(6),Mp=Fp(7),Dp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Bp=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,qp=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Up=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$p=Up,Wp=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Zp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Hp(){return new RegExp(Zp,"u")}const Vp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Gp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Jp=e=>{const t=Vf(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Kp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qp=/^[A-Za-z0-9_-]*$/,em=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,tm=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,nm=/^\+[1-9]\d{6,14}$/,rm="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",im=new RegExp(`^${rm}$`);function om(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sm(e){return new RegExp(`^${om(e)}$`)}function am(e){const t=om({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${rm}T(?:${r})$`)}const cm=e=>new RegExp(`^${e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*"}$`),lm=/^-?\d+n?$/,um=/^-?\d+$/,dm=/^-?\d+(?:\.\d+)?$/,hm=/^(?:true|false)$/i,fm=/^null$/i,pm=/^undefined$/i,mm=/^[^A-Z]*$/,gm=/^[^a-z]*$/,bm=/^[0-9a-fA-F]*$/;function vm(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ym(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const wm=/^[0-9a-fA-F]{32}$/,_m=vm(22,"=="),xm=ym(22),km=/^[0-9a-fA-F]{40}$/,Sm=vm(27,"="),Am=ym(27),Nm=/^[0-9a-fA-F]{64}$/,Lm=vm(43,"="),Pm=ym(43),Cm=/^[0-9a-fA-F]{96}$/,Em=vm(64,""),Im=ym(64),Om=/^[0-9a-fA-F]{128}$/,jm=vm(86,"=="),zm=ym(86),Fm=Sf("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Tm={number:"number",bigint:"bigint",object:"date"},Rm=Sf("$ZodCheckLessThan",(e,t)=>{Fm.init(e,t);const n=Tm[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Mm=Sf("$ZodCheckGreaterThan",(e,t)=>{Fm.init(e,t);const n=Tm[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dm=Sf("$ZodCheckMultipleOf",(e,t)=>{Fm.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(0===i&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}const o=n>i?n:i;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Bm=Sf("$ZodCheckNumberFormat",(e,t)=>{Fm.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,o]=Yf[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=o,n&&(r.pattern=um)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),qm=Sf("$ZodCheckBigIntFormat",(e,t)=>{Fm.init(e,t);const[n,r]=Xf[t.format];e._zod.onattach.push(e=>{const i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{const o=i.value;o<n&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>r&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Um=Sf("$ZodCheckMaxSize",(e,t)=>{var n;Fm.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!jf(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;r.size<=t.maximum||n.issues.push({origin:rp(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$m=Sf("$ZodCheckMinSize",(e,t)=>{var n;Fm.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!jf(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;r.size>=t.minimum||n.issues.push({origin:rp(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wm=Sf("$ZodCheckSizeEquals",(e,t)=>{var n;Fm.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!jf(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{const r=n.value,i=r.size;if(i===t.size)return;const o=i>t.size;n.issues.push({origin:rp(r),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Zm=Sf("$ZodCheckMaxLength",(e,t)=>{var n;Fm.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!jf(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const i=ip(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Hm=Sf("$ZodCheckMinLength",(e,t)=>{var n;Fm.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!jf(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const i=ip(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Vm=Sf("$ZodCheckLengthEquals",(e,t)=>{var n;Fm.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!jf(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,i=r.length;if(i===t.length)return;const o=ip(r),s=i>t.length;n.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Gm=Sf("$ZodCheckStringFormat",(e,t)=>{var n,r;Fm.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Jm=Sf("$ZodCheckRegex",(e,t)=>{Gm.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Km=Sf("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=mm),Gm.init(e,t)}),Ym=Sf("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=gm),Gm.init(e,t)}),Xm=Sf("$ZodCheckIncludes",(e,t)=>{Fm.init(e,t);const n=Vf(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Qm=Sf("$ZodCheckStartsWith",(e,t)=>{Fm.init(e,t);const n=new RegExp(`^${Vf(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),eg=Sf("$ZodCheckEndsWith",(e,t)=>{Fm.init(e,t);const n=new RegExp(`.*${Vf(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function tg(e,t,n){e.issues.length&&t.issues.push(...ep(n,e.issues))}const ng=Sf("$ZodCheckProperty",(e,t)=>{Fm.init(e,t),e._zod.check=e=>{const n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>tg(n,e,t.property));tg(n,e,t.property)}}),rg=Sf("$ZodCheckMimeType",(e,t)=>{Fm.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),ig=Sf("$ZodCheckOverwrite",(e,t)=>{Fm.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class og{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>`  ${e}`)].join("\n"))}}const sg={major:4,minor:3,patch:6},ag=Sf("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sg;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,i=Qf(e);for(const o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(i)continue;const t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new Af;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(i||(i=Qf(e,t)))});else{if(e.issues.length===t)continue;i||(i=Qf(e,t))}}return r?r.then(()=>e):e},n=(n,i,o)=>{if(Qf(n))return n.aborted=!0,n;const s=t(i,r,o);if(s instanceof Promise){if(!1===o.async)throw new Af;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(i,o)=>{if(o.skipChecks)return e._zod.parse(i,o);if("backward"===o.direction){const t=e._zod.parse({value:i.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,o)):n(t,i,o)}const s=e._zod.parse(i,o);if(s instanceof Promise){if(!1===o.async)throw new Af;return s.then(e=>t(e,r,o))}return t(s,r,o)}}Tf(e,"~standard",()=>({validate:t=>{try{const n=pp(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return gp(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),cg=Sf("$ZodString",(e,t)=>{ag.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??cm(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),lg=Sf("$ZodStringFormat",(e,t)=>{Gm.init(e,t),cg.init(e,t)}),ug=Sf("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zp),lg.init(e,t)}),dg=Sf("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Fp(e))}else t.pattern??(t.pattern=Fp());lg.init(e,t)}),hg=Sf("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Dp),lg.init(e,t)}),fg=Sf("$ZodURL",(e,t)=>{lg.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=i.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),pg=Sf("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Hp()),lg.init(e,t)}),mg=Sf("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ip),lg.init(e,t)}),gg=Sf("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Np),lg.init(e,t)}),bg=Sf("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Lp),lg.init(e,t)}),vg=Sf("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Pp),lg.init(e,t)}),yg=Sf("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Cp),lg.init(e,t)}),wg=Sf("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ep),lg.init(e,t)}),_g=Sf("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=am(t)),lg.init(e,t)}),xg=Sf("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=im),lg.init(e,t)}),kg=Sf("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=sm(t)),lg.init(e,t)}),Sg=Sf("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Op),lg.init(e,t)}),Ag=Sf("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Vp),lg.init(e,t),e._zod.bag.format="ipv4"}),Ng=Sf("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Gp),lg.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Lg=Sf("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Jp(t.delimiter)),lg.init(e,t),e._zod.bag.format="mac"}),Pg=Sf("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Kp),lg.init(e,t)}),Cg=Sf("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yp),lg.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Eg(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Ig=Sf("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Xp),lg.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Eg(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Og=Sf("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Qp),lg.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!Qp.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Eg(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),jg=Sf("$ZodE164",(e,t)=>{t.pattern??(t.pattern=nm),lg.init(e,t)}),zg=Sf("$ZodJWT",(e,t)=>{lg.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&"JWT"!==i?.typ||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Fg=Sf("$ZodCustomStringFormat",(e,t)=>{lg.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Tg=Sf("$ZodNumber",(e,t)=>{ag.init(e,t),e._zod.pattern=e._zod.bag.pattern??dm,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;const o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),Rg=Sf("$ZodNumberFormat",(e,t)=>{Bm.init(e,t),Tg.init(e,t)}),Mg=Sf("$ZodBoolean",(e,t)=>{ag.init(e,t),e._zod.pattern=hm,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Dg=Sf("$ZodBigInt",(e,t)=>{ag.init(e,t),e._zod.pattern=lm,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Bg=Sf("$ZodBigIntFormat",(e,t)=>{qm.init(e,t),Dg.init(e,t)}),qg=Sf("$ZodSymbol",(e,t)=>{ag.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return"symbol"==typeof r||t.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),t}}),Ug=Sf("$ZodUndefined",(e,t)=>{ag.init(e,t),e._zod.pattern=pm,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}}),$g=Sf("$ZodNull",(e,t)=>{ag.init(e,t),e._zod.pattern=fm,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),Wg=Sf("$ZodAny",(e,t)=>{ag.init(e,t),e._zod.parse=e=>e}),Zg=Sf("$ZodUnknown",(e,t)=>{ag.init(e,t),e._zod.parse=e=>e}),Hg=Sf("$ZodNever",(e,t)=>{ag.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),Vg=Sf("$ZodVoid",(e,t)=>{ag.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}}),Gg=Sf("$ZodDate",(e,t)=>{ag.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const i=n.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),n}});function Jg(e,t,n){e.issues.length&&t.issues.push(...ep(n,e.issues)),t.value[n]=e.value}const Kg=Sf("$ZodArray",(e,t)=>{ag.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const o=[];for(let e=0;e<i.length;e++){const s=i[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?o.push(a.then(t=>Jg(t,n,e))):Jg(a,n,e)}return o.length?Promise.all(o).then(()=>n):n}});function Yg(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...ep(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Xg(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Qg(e,t,n,r,i,o){const s=[],a=i.keySet,c=i.catchall._zod,l=c.def.type,u="optional"===c.optout;for(const i in t){if(a.has(i))continue;if("never"===l){s.push(i);continue}const o=c.run({value:t[i],issues:[]},r);o instanceof Promise?e.push(o.then(e=>Yg(e,n,i,t,u))):Yg(o,n,i,t,u)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const eb=Sf("$ZodObject",(e,t)=>{ag.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=Of(()=>Xg(t));Tf(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const i=qf,o=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=r.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],l=s.shape;for(const e of s.keys){const r=l[e],i="optional"===r._zod.optout,o=r._zod.run({value:a[e],issues:[]},n);o instanceof Promise?c.push(o.then(n=>Yg(n,t,e,a,i))):Yg(o,t,e,a,i)}return o?Qg(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),tb=Sf("$ZodObjectJIT",(e,t)=>{eb.init(e,t);const n=e._zod.parse,r=Of(()=>Xg(t));let i;const o=qf,s=!Lf.jitless,a=s&&Uf.value,c=t.catchall;let l;e._zod.parse=(u,d)=>{l??(l=r.value);const h=u.value;return o(h)?s&&a&&!1===d?.async&&!0!==d.jitless?(i||(i=(e=>{const t=new og(["shape","payload","ctx"]),n=r.value,i=e=>{const t=Df(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input=payload.value;");const o=Object.create(null);let s=0;for(const e of n.keys)o[e]="key_"+s++;t.write("const newResult={};");for(const r of n.keys){const n=o[r],s=Df(r),a=e[r],c="optional"===a?._zod?.optout;t.write(`const ${n}=${i(r)};`),c?t.write(`\n        if(${n}.issues.length){\n          if(${s} in input){\n            payload.issues=payload.issues.concat(${n}.issues.map(iss=> ({\n              ...iss,\n              path: iss.path ? [${s}, ...iss.path]:[${s}]\n            })));\n          }\n        }\n        \n        if(${n}.value===undefined){\n          if(${s} in input){\n            newResult[${s}]=undefined;\n          }\n        }else{\n          newResult[${s}]=${n}.value;\n        }\n        \n      `):t.write(`\n        if(${n}.issues.length){\n          payload.issues=payload.issues.concat(${n}.issues.map(iss=> ({\n            ...iss,\n            path: iss.path ? [${s}, ...iss.path]:[${s}]\n          })));\n        }\n        \n        if(${n}.value===undefined){\n          if(${s} in input){\n            newResult[${s}]=undefined;\n          }\n        }else{\n          newResult[${s}]=${n}.value;\n        }\n        \n      `)}t.write("payload.value=newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),u=i(u,d),c?Qg([],h,u,d,l,e):u):n(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),u)}});function nb(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const i=e.filter(e=>!Qf(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>np(e,r,Pf())))}),t)}const rb=Sf("$ZodUnion",(e,t)=>{ag.init(e,t),Tf(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Tf(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Tf(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Tf(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>zf(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return r(i,o);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:i.value,issues:[]},o);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>nb(t,i,e,o)):nb(a,i,e,o)}});function ib(e,t,n,r){const i=e.filter(e=>0===e.issues.length);return 1===i.length?(t.value=i[0].value,t):(0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>np(e,r,Pf())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}const ob=Sf("$ZodXor",(e,t)=>{rb.init(e,t),t.inclusive=!1;const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return r(i,o);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:i.value,issues:[]},o);t instanceof Promise?(a.push(t),s=!0):a.push(t)}return s?Promise.all(a).then(t=>ib(t,i,e,o)):ib(a,i,e,o)}}),sb=Sf("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,rb.init(e,t);const n=e._zod.parse;Tf(e._zod,"propValues",()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(const r of n)e[t].add(r)}}return e});const r=Of(()=>{const e=t.options,n=new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,o)=>{const s=i.value;if(!qf(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;const a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(i,o):t.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),i)}}),ab=Sf("$ZodIntersection",(e,t)=>{ag.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,i=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,n])=>lb(e,t,n)):lb(e,i,o)}});function cb(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if($f(e)&&$f(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),i={...e,...t};for(const n of r){const r=cb(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=cb(e[r],t[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function lb(e,t,n){const r=new Map;let i;for(const n of t.issues)if("unrecognized_keys"===n.code){i??(i=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const o=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&i&&e.issues.push({...i,keys:o}),Qf(e))return e;const s=cb(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const ub=Sf("$ZodTuple",(e,t)=>{ag.init(e,t);const n=t.items;e._zod.parse=(r,i)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const s=[],a=[...n].reverse().findIndex(e=>"optional"!==e._zod.optin),c=-1===a?0:n.length-a;if(!t.rest){const t=o.length>n.length,i=o.length<c-1;if(t||i)return r.issues.push({...t?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:o,inst:e,origin:"array"}),r}let l=-1;for(const e of n){if(l++,l>=o.length&&l>=c)continue;const t=e._zod.run({value:o[l],issues:[]},i);t instanceof Promise?s.push(t.then(e=>db(e,r,l))):db(t,r,l)}if(t.rest){const e=o.slice(n.length);for(const n of e){l++;const e=t.rest._zod.run({value:n,issues:[]},i);e instanceof Promise?s.push(e.then(e=>db(e,r,l))):db(e,r,l)}}return s.length?Promise.all(s).then(()=>r):r}});function db(e,t,n){e.issues.length&&t.issues.push(...ep(n,e.issues)),t.value[n]=e.value}const hb=Sf("$ZodRecord",(e,t)=>{ag.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!$f(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const o=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const e of s)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){a.add("number"==typeof e?e.toString():e);const s=t.valueType._zod.run({value:i[e],issues:[]},r);s instanceof Promise?o.push(s.then(t=>{t.issues.length&&n.issues.push(...ep(e,t.issues)),n.value[e]=t.value})):(s.issues.length&&n.issues.push(...ep(e,s.issues)),n.value[e]=s.value)}let c;for(const e in i)a.has(e)||(c=c??[],c.push(e));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c})}else{n.value={};for(const s of Reflect.ownKeys(i)){if("__proto__"===s)continue;let a=t.keyType._zod.run({value:s,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof s&&dm.test(s)&&a.issues.length){const e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(a=e)}if(a.issues.length){"loose"===t.mode?n.value[s]=i[s]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>np(e,r,Pf())),input:s,path:[s],inst:e});continue}const c=t.valueType._zod.run({value:i[s],issues:[]},r);c instanceof Promise?o.push(c.then(e=>{e.issues.length&&n.issues.push(...ep(s,e.issues)),n.value[a.value]=e.value})):(c.issues.length&&n.issues.push(...ep(s,c.issues)),n.value[a.value]=c.value)}}return o.length?Promise.all(o).then(()=>n):n}}),fb=Sf("$ZodMap",(e,t)=>{ag.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;const o=[];n.value=new Map;for(const[s,a]of i){const c=t.keyType._zod.run({value:s,issues:[]},r),l=t.valueType._zod.run({value:a,issues:[]},r);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([t,o])=>{pb(t,o,n,s,i,e,r)})):pb(c,l,n,s,i,e,r)}return o.length?Promise.all(o).then(()=>n):n}});function pb(e,t,n,r,i,o,s){e.issues.length&&(Zf.has(typeof r)?n.issues.push(...ep(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(e=>np(e,s,Pf()))})),t.issues.length&&(Zf.has(typeof r)?n.issues.push(...ep(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:r,issues:t.issues.map(e=>np(e,s,Pf()))})),n.value.set(e.value,t.value)}const mb=Sf("$ZodSet",(e,t)=>{ag.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;const o=[];n.value=new Set;for(const e of i){const i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?o.push(i.then(e=>gb(e,n))):gb(i,n)}return o.length?Promise.all(o).then(()=>n):n}});function gb(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const bb=Sf("$ZodEnum",(e,t)=>{ag.init(e,t);const n=Cf(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Zf.has(typeof e)).map(e=>"string"==typeof e?Vf(e):e.toString()).join("|")})$`),e._zod.parse=(t,i)=>{const o=t.value;return r.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),vb=Sf("$ZodLiteral",(e,t)=>{if(ag.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?Vf(e):e?Vf(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,i)=>{const o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),yb=Sf("$ZodFile",(e,t)=>{ag.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}}),wb=Sf("$ZodTransform",(e,t)=>{ag.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Nf(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Af;return n.value=i,n}});function _b(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const xb=Sf("$ZodOptional",(e,t)=>{ag.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Tf(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Tf(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${zf(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>_b(t,e.value)):_b(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),kb=Sf("$ZodExactOptional",(e,t)=>{xb.init(e,t),Tf(e._zod,"values",()=>t.innerType._zod.values),Tf(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Sb=Sf("$ZodNullable",(e,t)=>{ag.init(e,t),Tf(e._zod,"optin",()=>t.innerType._zod.optin),Tf(e._zod,"optout",()=>t.innerType._zod.optout),Tf(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${zf(e.source)}|null)$`):void 0}),Tf(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),Ab=Sf("$ZodDefault",(e,t)=>{ag.init(e,t),e._zod.optin="optional",Tf(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Nb(e,t)):Nb(r,t)}});function Nb(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Lb=Sf("$ZodPrefault",(e,t)=>{ag.init(e,t),e._zod.optin="optional",Tf(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Pb=Sf("$ZodNonOptional",(e,t)=>{ag.init(e,t),Tf(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Cb(t,e)):Cb(i,e)}});function Cb(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Eb=Sf("$ZodSuccess",(e,t)=>{ag.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new Nf("ZodSuccess");const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}}),Ib=Sf("$ZodCatch",(e,t)=>{ag.init(e,t),Tf(e._zod,"optin",()=>t.innerType._zod.optin),Tf(e._zod,"optout",()=>t.innerType._zod.optout),Tf(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>np(e,n,Pf()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>np(e,n,Pf()))},input:e.value}),e.issues=[]),e)}}),Ob=Sf("$ZodNaN",(e,t)=>{ag.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),jb=Sf("$ZodPipe",(e,t)=>{ag.init(e,t),Tf(e._zod,"values",()=>t.in._zod.values),Tf(e._zod,"optin",()=>t.in._zod.optin),Tf(e._zod,"optout",()=>t.out._zod.optout),Tf(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>zb(e,t.in,n)):zb(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>zb(e,t.out,n)):zb(r,t.out,n)}});function zb(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Fb=Sf("$ZodCodec",(e,t)=>{ag.init(e,t),Tf(e._zod,"values",()=>t.in._zod.values),Tf(e._zod,"optin",()=>t.in._zod.optin),Tf(e._zod,"optout",()=>t.out._zod.optout),Tf(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Tb(e,t,n)):Tb(r,t,n)}{const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Tb(e,t,n)):Tb(r,t,n)}}});function Tb(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){const r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Rb(e,r,t.out,n)):Rb(e,r,t.out,n)}{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Rb(e,r,t.in,n)):Rb(e,r,t.in,n)}}function Rb(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const Mb=Sf("$ZodReadonly",(e,t)=>{ag.init(e,t),Tf(e._zod,"propValues",()=>t.innerType._zod.propValues),Tf(e._zod,"values",()=>t.innerType._zod.values),Tf(e._zod,"optin",()=>t.innerType?._zod?.optin),Tf(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Db):Db(r)}});function Db(e){return e.value=Object.freeze(e.value),e}const Bb=Sf("$ZodTemplateLiteral",(e,t)=>{ag.init(e,t);const n=[];for(const e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);const t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${e._zod.traits}`);const r=t.startsWith("^")?1:0,i=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(r,i))}else{if(null!==e&&!Hf.has(typeof e))throw new Error(`Invalid template literal part: ${e}`);n.push(Vf(`${e}`))}e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>"string"!=typeof n.value?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),qb=Sf("$ZodFunction",(e,t)=>(ag.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw new Error("implement() must be called with a function");return function(...n){const r=e._def.input?up(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?up(e._def.output,i):i}},e.implementAsync=t=>{if("function"!=typeof t)throw new Error("implementAsync() must be called with a function");return async function(...n){const r=e._def.input?await hp(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await hp(e._def.output,i):i}},e._zod.parse=(t,n)=>{if("function"!=typeof t.value)return t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}),t;const r=e._def.output&&"promise"===e._def.output._zod.def.type;return t.value=r?e.implementAsync(t.value):e.implement(t.value),t},e.input=(...t)=>{const n=e.constructor;return Array.isArray(t[0])?new n({type:"function",input:new ub({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}):new n({type:"function",input:t[0],output:e._def.output})},e.output=t=>new(0,e.constructor)({type:"function",input:e._def.input,output:t}),e)),Ub=Sf("$ZodPromise",(e,t)=>{ag.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),$b=Sf("$ZodLazy",(e,t)=>{ag.init(e,t),Tf(e._zod,"innerType",()=>t.getter()),Tf(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Tf(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Tf(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Tf(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Wb=Sf("$ZodCustom",(e,t)=>{Fm.init(e,t),ag.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Zb(t,n,r,e));Zb(i,n,r,e)}});function Zb(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(op(e))}}var Hb;Symbol("ZodOutput"),Symbol("ZodInput");(Hb=globalThis).__zod_globalRegistry??(Hb.__zod_globalRegistry=new class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const Vb=globalThis.__zod_globalRegistry;function Gb(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Jf(t)})}function Jb(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Jf(t)})}function Kb(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Jf(t)})}function Yb(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Jf(t)})}function Xb(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Jf(t)})}function Qb(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Jf(t)})}function ev(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Jf(t)})}function tv(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Jf(t)})}function nv(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Jf(t)})}function rv(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Jf(t)})}function iv(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Jf(t)})}function ov(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Jf(t)})}function sv(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Jf(t)})}function av(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Jf(t)})}function cv(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Jf(t)})}function lv(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Jf(t)})}function uv(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Jf(t)})}function dv(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Jf(t)})}function hv(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Jf(t)})}function fv(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Jf(t)})}function pv(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Jf(t)})}function mv(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Jf(t)})}function gv(e,t){return new Rm({check:"less_than",...Jf(t),value:e,inclusive:!1})}function bv(e,t){return new Rm({check:"less_than",...Jf(t),value:e,inclusive:!0})}function vv(e,t){return new Mm({check:"greater_than",...Jf(t),value:e,inclusive:!1})}function yv(e,t){return new Mm({check:"greater_than",...Jf(t),value:e,inclusive:!0})}function wv(e){return vv(0,e)}function _v(e){return gv(0,e)}function xv(e){return bv(0,e)}function kv(e){return yv(0,e)}function Sv(e,t){return new Dm({check:"multiple_of",...Jf(t),value:e})}function Av(e,t){return new Um({check:"max_size",...Jf(t),maximum:e})}function Nv(e,t){return new $m({check:"min_size",...Jf(t),minimum:e})}function Lv(e,t){return new Wm({check:"size_equals",...Jf(t),size:e})}function Pv(e,t){return new Zm({check:"max_length",...Jf(t),maximum:e})}function Cv(e,t){return new Hm({check:"min_length",...Jf(t),minimum:e})}function Ev(e,t){return new Vm({check:"length_equals",...Jf(t),length:e})}function Iv(e,t){return new Jm({check:"string_format",format:"regex",...Jf(t),pattern:e})}function Ov(e){return new Km({check:"string_format",format:"lowercase",...Jf(e)})}function jv(e){return new Ym({check:"string_format",format:"uppercase",...Jf(e)})}function zv(e,t){return new Xm({check:"string_format",format:"includes",...Jf(t),includes:e})}function Fv(e,t){return new Qm({check:"string_format",format:"starts_with",...Jf(t),prefix:e})}function Tv(e,t){return new eg({check:"string_format",format:"ends_with",...Jf(t),suffix:e})}function Rv(e,t,n){return new ng({check:"property",property:e,schema:t,...Jf(n)})}function Mv(e,t){return new rg({check:"mime_type",mime:e,...Jf(t)})}function Dv(e){return new ig({check:"overwrite",tx:e})}function Bv(e){return Dv(t=>t.normalize(e))}function qv(){return Dv(e=>e.trim())}function Uv(){return Dv(e=>e.toLowerCase())}function $v(){return Dv(e=>e.toUpperCase())}function Wv(){return Dv(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))}function Zv(e,t,n,r={}){const i=Jf(r),o={...Jf(r),check:"string_format",type:"string",format:t,fn:"function"==typeof n?n:e=>n.test(e),...i};return n instanceof RegExp&&(o.pattern=n),new e(o)}function Hv(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Vb,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Vv(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,r);else{const n=s.schema,o=t.processors[i.type];if(!o)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,n,r)}const o=e._zod.parent;o&&(s.ref||(s.ref=o),Vv(o,t,r),t.seen.get(o).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),"input"===t.io&&Kv(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Gv(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}const i=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:i,defId:o}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};const o=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${r}/${o}`}}if(t[1]===n)return{ref:"#"};const i=`#/${r}/`,o=t[1].schema.id??"__schema"+e.counter++;return{defId:o,ref:i+o}})(t);r.def={...r.schema},o&&(r.defId=o);const s=r.schema;for(const e in s)delete s[e];s.$ref=i};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){i(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}const o=e.metadataRegistry.get(n[0])?.id;(o||r.cycle||r.count>1&&"ref"===e.reused)&&i(n)}}function Jv(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const i=n.def??n.schema,o={...i},s=n.ref;if(n.ref=null,s){r(s);const n=e.seen.get(s),a=n.schema;if(!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(i,a):(i.allOf=i.allOf??[],i.allOf.push(a)),Object.assign(i,o),t._zod.parent===s)for(const e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(a.$ref&&n.def)for(const e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}const a=t._zod.parent;if(a&&a!==s){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(const e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);const o=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&("draft-2020-12"===e.target?i.$defs=o:i.definitions=o);try{const n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Yv(t,"input",e.processors),output:Yv(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function Kv(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return Kv(r.element,n);if("set"===r.type)return Kv(r.valueType,n);if("lazy"===r.type)return Kv(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return Kv(r.innerType,n);if("intersection"===r.type)return Kv(r.left,n)||Kv(r.right,n);if("record"===r.type||"map"===r.type)return Kv(r.keyType,n)||Kv(r.valueType,n);if("pipe"===r.type)return Kv(r.in,n)||Kv(r.out,n);if("object"===r.type){for(const e in r.shape)if(Kv(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(Kv(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(Kv(e,n))return!0;return!(!r.rest||!Kv(r.rest,n))}return!1}const Yv=(e,t,n={})=>r=>{const{libraryOptions:i,target:o}=r??{},s=Hv({...i??{},target:o,io:t,processors:n});return Vv(e,s),Gv(s,e),Jv(s,e)},Xv={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Qv=(e,t,n,r)=>{const i=e._zod.def,o=!1===i.inclusive,s=i.options.map((e,n)=>Vv(e,t,{...r,path:[...r.path,o?"oneOf":"anyOf",n]}));o?n.oneOf=s:n.anyOf=s},ey=(e,t,n,r)=>{const i=e._zod.def;Vv(i.innerType,t,r),t.seen.get(e).ref=i.innerType},ty=Sf("ZodISODateTime",(e,t)=>{_g.init(e,t),Ly.init(e,t)});function ny(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Jf(t)})}(ty,e)}const ry=Sf("ZodISODate",(e,t)=>{xg.init(e,t),Ly.init(e,t)});function iy(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Jf(t)})}(ry,e)}const oy=Sf("ZodISOTime",(e,t)=>{kg.init(e,t),Ly.init(e,t)});function sy(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Jf(t)})}(oy,e)}const ay=Sf("ZodISODuration",(e,t)=>{Sg.init(e,t),Ly.init(e,t)});function cy(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Jf(t)})}(ay,e)}const ly=(e,t)=>{ap.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>r({issues:e}));else if("invalid_key"===i.code)r({issues:i.issues});else if("invalid_element"===i.code)r({issues:i.issues});else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,If,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,If,2)}},isEmpty:{get:()=>0===e.issues.length}})},uy=(Sf("ZodError",ly),Sf("ZodError",ly,{Parent:Error})),dy=lp(uy),hy=dp(uy),fy=fp(uy),py=mp(uy),my=bp(uy),gy=vp(uy),by=yp(uy),vy=_p(uy),yy=xp(uy),wy=kp(uy),_y=Sp(uy),xy=Ap(uy),ky=Sf("ZodType",(e,t)=>(ag.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Yv(e,"input"),output:Yv(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=Hv({...n,processors:t});return Vv(e,r),Gv(r,e),Jv(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Mf(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Gf(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>dy(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>fy(e,t,n),e.parseAsync=async(t,n)=>hy(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>py(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>my(e,t,n),e.decode=(t,n)=>gy(e,t,n),e.encodeAsync=async(t,n)=>by(e,t,n),e.decodeAsync=async(t,n)=>vy(e,t,n),e.safeEncode=(t,n)=>yy(e,t,n),e.safeDecode=(t,n)=>wy(e,t,n),e.safeEncodeAsync=async(t,n)=>_y(e,t,n),e.safeDecodeAsync=async(t,n)=>xy(e,t,n),e.refine=(t,n)=>e.check(bx(t,n)),e.superRefine=t=>e.check(vx(t)),e.overwrite=t=>e.check(Dv(t)),e.optional=()=>T_(e),e.exactOptional=()=>M_(e),e.nullable=()=>B_(e),e.nullish=()=>T_(B_(e)),e.nonoptional=t=>V_(e,t),e.array=()=>t_(e),e.or=t=>c_([e,t]),e.and=t=>p_(e,t),e.transform=t=>tx(e,z_(t)),e.default=t=>$_(e,t),e.prefault=t=>Z_(e,t),e.catch=t=>Y_(e,t),e.pipe=t=>tx(e,t),e.readonly=()=>ox(e),e.describe=t=>{const n=e.clone();return Vb.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Vb.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Vb.get(e);const n=e.clone();return Vb.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Sy=Sf("_ZodString",(e,t)=>{cg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:i,maximum:o,format:s,patterns:a,contentEncoding:c}=e._zod.bag;if("number"==typeof i&&(r.minLength=i),"number"==typeof o&&(r.maxLength=o),s&&(r.format=Xv[s]??s,""===r.format&&delete r.format,"time"===s&&delete r.format),c&&(r.contentEncoding=c),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Iv(...t)),e.includes=(...t)=>e.check(zv(...t)),e.startsWith=(...t)=>e.check(Fv(...t)),e.endsWith=(...t)=>e.check(Tv(...t)),e.min=(...t)=>e.check(Cv(...t)),e.max=(...t)=>e.check(Pv(...t)),e.length=(...t)=>e.check(Ev(...t)),e.nonempty=(...t)=>e.check(Cv(1,...t)),e.lowercase=t=>e.check(Ov(t)),e.uppercase=t=>e.check(jv(t)),e.trim=()=>e.check(qv()),e.normalize=(...t)=>e.check(Bv(...t)),e.toLowerCase=()=>e.check(Uv()),e.toUpperCase=()=>e.check($v()),e.slugify=()=>e.check(Wv())}),Ay=Sf("ZodString",(e,t)=>{cg.init(e,t),Sy.init(e,t),e.email=t=>e.check(Gb(Py,t)),e.url=t=>e.check(ev(Ry,t)),e.jwt=t=>e.check(mv(gw,t)),e.emoji=t=>e.check(tv(By,t)),e.guid=t=>e.check(Jb(Ey,t)),e.uuid=t=>e.check(Kb(Oy,t)),e.uuidv4=t=>e.check(Yb(Oy,t)),e.uuidv6=t=>e.check(Xb(Oy,t)),e.uuidv7=t=>e.check(Qb(Oy,t)),e.nanoid=t=>e.check(nv(Uy,t)),e.guid=t=>e.check(Jb(Ey,t)),e.cuid=t=>e.check(rv(Wy,t)),e.cuid2=t=>e.check(iv(Hy,t)),e.ulid=t=>e.check(ov(Gy,t)),e.base64=t=>e.check(hv(uw,t)),e.base64url=t=>e.check(fv(hw,t)),e.xid=t=>e.check(sv(Ky,t)),e.ksuid=t=>e.check(av(Xy,t)),e.ipv4=t=>e.check(cv(ew,t)),e.ipv6=t=>e.check(lv(iw,t)),e.cidrv4=t=>e.check(uv(sw,t)),e.cidrv6=t=>e.check(dv(cw,t)),e.e164=t=>e.check(pv(pw,t)),e.datetime=t=>e.check(ny(t)),e.date=t=>e.check(iy(t)),e.time=t=>e.check(sy(t)),e.duration=t=>e.check(cy(t))});function Ny(e){return function(e,t){return new e({type:"string",...Jf(t)})}(Ay,e)}const Ly=Sf("ZodStringFormat",(e,t)=>{lg.init(e,t),Sy.init(e,t)}),Py=Sf("ZodEmail",(e,t)=>{hg.init(e,t),Ly.init(e,t)});function Cy(e){return Gb(Py,e)}const Ey=Sf("ZodGUID",(e,t)=>{ug.init(e,t),Ly.init(e,t)});function Iy(e){return Jb(Ey,e)}const Oy=Sf("ZodUUID",(e,t)=>{dg.init(e,t),Ly.init(e,t)});function jy(e){return Kb(Oy,e)}function zy(e){return Yb(Oy,e)}function Fy(e){return Xb(Oy,e)}function Ty(e){return Qb(Oy,e)}const Ry=Sf("ZodURL",(e,t)=>{fg.init(e,t),Ly.init(e,t)});function My(e){return ev(Ry,e)}function Dy(e){return ev(Ry,{protocol:/^https?$/,hostname:tm,...Jf(e)})}const By=Sf("ZodEmoji",(e,t)=>{pg.init(e,t),Ly.init(e,t)});function qy(e){return tv(By,e)}const Uy=Sf("ZodNanoID",(e,t)=>{mg.init(e,t),Ly.init(e,t)});function $y(e){return nv(Uy,e)}const Wy=Sf("ZodCUID",(e,t)=>{gg.init(e,t),Ly.init(e,t)});function Zy(e){return rv(Wy,e)}const Hy=Sf("ZodCUID2",(e,t)=>{bg.init(e,t),Ly.init(e,t)});function Vy(e){return iv(Hy,e)}const Gy=Sf("ZodULID",(e,t)=>{vg.init(e,t),Ly.init(e,t)});function Jy(e){return ov(Gy,e)}const Ky=Sf("ZodXID",(e,t)=>{yg.init(e,t),Ly.init(e,t)});function Yy(e){return sv(Ky,e)}const Xy=Sf("ZodKSUID",(e,t)=>{wg.init(e,t),Ly.init(e,t)});function Qy(e){return av(Xy,e)}const ew=Sf("ZodIPv4",(e,t)=>{Ag.init(e,t),Ly.init(e,t)});function tw(e){return cv(ew,e)}const nw=Sf("ZodMAC",(e,t)=>{Lg.init(e,t),Ly.init(e,t)});function rw(e){return function(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Jf(t)})}(nw,e)}const iw=Sf("ZodIPv6",(e,t)=>{Ng.init(e,t),Ly.init(e,t)});function ow(e){return lv(iw,e)}const sw=Sf("ZodCIDRv4",(e,t)=>{Pg.init(e,t),Ly.init(e,t)});function aw(e){return uv(sw,e)}const cw=Sf("ZodCIDRv6",(e,t)=>{Cg.init(e,t),Ly.init(e,t)});function lw(e){return dv(cw,e)}const uw=Sf("ZodBase64",(e,t)=>{Ig.init(e,t),Ly.init(e,t)});function dw(e){return hv(uw,e)}const hw=Sf("ZodBase64URL",(e,t)=>{Og.init(e,t),Ly.init(e,t)});function fw(e){return fv(hw,e)}const pw=Sf("ZodE164",(e,t)=>{jg.init(e,t),Ly.init(e,t)});function mw(e){return pv(pw,e)}const gw=Sf("ZodJWT",(e,t)=>{zg.init(e,t),Ly.init(e,t)});function bw(e){return mv(gw,e)}const vw=Sf("ZodCustomStringFormat",(e,t)=>{Fg.init(e,t),Ly.init(e,t)});function yw(e,t,n={}){return Zv(vw,e,t,n)}function ww(e){return Zv(vw,"hostname",em,e)}function _w(e){return Zv(vw,"hex",bm,e)}function xw(e,t){const n=`${e}_${t?.enc??"hex"}`,r=a[n];if(!r)throw new Error(`Unrecognized hash format: ${n}`);return Zv(vw,n,r,t)}const kw=Sf("ZodNumber",(e,t)=>{Tg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:i,maximum:o,format:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;"string"==typeof s&&s.includes("int")?r.type="integer":r.type="number","number"==typeof l&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l),"number"==typeof i&&(r.minimum=i,"number"==typeof l&&"draft-04"!==t.target&&(l>=i?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c),"number"==typeof o&&(r.maximum=o,"number"==typeof c&&"draft-04"!==t.target&&(c<=o?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(vv(t,n)),e.gte=(t,n)=>e.check(yv(t,n)),e.min=(t,n)=>e.check(yv(t,n)),e.lt=(t,n)=>e.check(gv(t,n)),e.lte=(t,n)=>e.check(bv(t,n)),e.max=(t,n)=>e.check(bv(t,n)),e.int=t=>e.check(Nw(t)),e.safe=t=>e.check(Nw(t)),e.positive=t=>e.check(vv(0,t)),e.nonnegative=t=>e.check(yv(0,t)),e.negative=t=>e.check(gv(0,t)),e.nonpositive=t=>e.check(bv(0,t)),e.multipleOf=(t,n)=>e.check(Sv(t,n)),e.step=(t,n)=>e.check(Sv(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Sw(e){return function(e,t){return new e({type:"number",checks:[],...Jf(t)})}(kw,e)}const Aw=Sf("ZodNumberFormat",(e,t)=>{Rg.init(e,t),kw.init(e,t)});function Nw(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Jf(t)})}(Aw,e)}function Lw(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Jf(t)})}(Aw,e)}function Pw(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Jf(t)})}(Aw,e)}function Cw(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Jf(t)})}(Aw,e)}function Ew(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Jf(t)})}(Aw,e)}const Iw=Sf("ZodBoolean",(e,t)=>{Mg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function Ow(e){return function(e,t){return new e({type:"boolean",...Jf(t)})}(Iw,e)}const jw=Sf("ZodBigInt",(e,t)=>{Dg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema")})(0,e),e.gte=(t,n)=>e.check(yv(t,n)),e.min=(t,n)=>e.check(yv(t,n)),e.gt=(t,n)=>e.check(vv(t,n)),e.gte=(t,n)=>e.check(yv(t,n)),e.min=(t,n)=>e.check(yv(t,n)),e.lt=(t,n)=>e.check(gv(t,n)),e.lte=(t,n)=>e.check(bv(t,n)),e.max=(t,n)=>e.check(bv(t,n)),e.positive=t=>e.check(vv(BigInt(0),t)),e.negative=t=>e.check(gv(BigInt(0),t)),e.nonpositive=t=>e.check(bv(BigInt(0),t)),e.nonnegative=t=>e.check(yv(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Sv(t,n));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function zw(e){return function(e,t){return new e({type:"bigint",...Jf(t)})}(jw,e)}const Fw=Sf("ZodBigIntFormat",(e,t)=>{Bg.init(e,t),jw.init(e,t)});function Tw(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Jf(t)})}(Fw,e)}function Rw(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Jf(t)})}(Fw,e)}const Mw=Sf("ZodSymbol",(e,t)=>{qg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema")})(0,e)});function Dw(e){return function(e,t){return new e({type:"symbol",...Jf(t)})}(Mw,e)}const Bw=Sf("ZodUndefined",(e,t)=>{Ug.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema")})(0,e)});function qw(e){return function(e,t){return new e({type:"undefined",...Jf(t)})}(Bw,e)}const Uw=Sf("ZodNull",(e,t)=>{$g.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{"openapi-3.0"===t.target?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"})(0,e,t)});function $w(e){return function(e,t){return new e({type:"null",...Jf(t)})}(Uw,e)}const Ww=Sf("ZodAny",(e,t)=>{Wg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Zw(){return new Ww({type:"any"})}const Hw=Sf("ZodUnknown",(e,t)=>{Zg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Vw(){return new Hw({type:"unknown"})}const Gw=Sf("ZodNever",(e,t)=>{Hg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function Jw(e){return function(e,t){return new e({type:"never",...Jf(t)})}(Gw,e)}const Kw=Sf("ZodVoid",(e,t)=>{Vg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Void cannot be represented in JSON Schema")})(0,e)});function Yw(e){return function(e,t){return new e({type:"void",...Jf(t)})}(Kw,e)}const Xw=Sf("ZodDate",(e,t)=>{Gg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Date cannot be represented in JSON Schema")})(0,e),e.min=(t,n)=>e.check(yv(t,n)),e.max=(t,n)=>e.check(bv(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Qw(e){return function(e,t){return new e({type:"date",...Jf(t)})}(Xw,e)}const e_=Sf("ZodArray",(e,t)=>{Kg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=n,o=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(i.minItems=s),"number"==typeof a&&(i.maxItems=a),i.type="array",i.items=Vv(o.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Cv(t,n)),e.nonempty=t=>e.check(Cv(1,t)),e.max=(t,n)=>e.check(Pv(t,n)),e.length=(t,n)=>e.check(Ev(t,n)),e.unwrap=()=>e.element});function t_(e,t){return function(e,t,n){return new e({type:"array",element:t,...Jf(n)})}(e_,e,t)}function n_(e){const t=e._zod.def.shape;return L_(Object.keys(t))}const r_=Sf("ZodObject",(e,t)=>{tb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=n,o=e._zod.def;i.type="object",i.properties={};const s=o.shape;for(const e in s)i.properties[e]=Vv(s[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(s)),c=new Set([...a].filter(e=>{const n=o.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));c.size>0&&(i.required=Array.from(c)),"never"===o.catchall?._zod.def.type?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Vv(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(i.additionalProperties=!1)})(e,t,n,r),Tf(e,"shape",()=>t.shape),e.keyof=()=>L_(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Vw()}),e.loose=()=>e.clone({...e._zod.def,catchall:Vw()}),e.strict=()=>e.clone({...e._zod.def,catchall:Jw()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!$f(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Mf(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Rf(this,"shape",n),n}});return Gf(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!$f(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Mf(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Rf(this,"shape",n),n}});return Gf(e,n)}(e,t),e.merge=t=>function(e,t){const n=Mf(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Rf(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Gf(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Gf(e,Mf(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Rf(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=Mf(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Rf(this,"shape",r),r},checks:[]});return Gf(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Mf(t._zod.def,{get shape(){const r=t._zod.def.shape,i={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)i[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Rf(this,"shape",i),i},checks:[]});return Gf(t,i)}(F_,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Mf(t._zod.def,{get shape(){const r=t._zod.def.shape,i={...r};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)i[t]=new e({type:"nonoptional",innerType:r[t]});return Rf(this,"shape",i),i}});return Gf(t,r)}(H_,e,t[0])});function i_(e,t){const n={type:"object",shape:e??{},...Jf(t)};return new r_(n)}function o_(e,t){return new r_({type:"object",shape:e,catchall:Jw(),...Jf(t)})}function s_(e,t){return new r_({type:"object",shape:e,catchall:Vw(),...Jf(t)})}const a_=Sf("ZodUnion",(e,t)=>{rb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qv(e,t,n,r),e.options=t.options});function c_(e,t){return new a_({type:"union",options:e,...Jf(t)})}const l_=Sf("ZodXor",(e,t)=>{a_.init(e,t),ob.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qv(e,t,n,r),e.options=t.options});function u_(e,t){return new l_({type:"union",options:e,inclusive:!1,...Jf(t)})}const d_=Sf("ZodDiscriminatedUnion",(e,t)=>{a_.init(e,t),sb.init(e,t)});function h_(e,t,n){return new d_({type:"union",options:t,discriminator:e,...Jf(n)})}const f_=Sf("ZodIntersection",(e,t)=>{ab.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def,o=Vv(i.left,t,{...r,path:[...r.path,"allOf",0]}),s=Vv(i.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=c})(e,t,n,r)});function p_(e,t){return new f_({type:"intersection",left:e,right:t})}const m_=Sf("ZodTuple",(e,t)=>{ub.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=n,o=e._zod.def;i.type="array";const s="draft-2020-12"===t.target?"prefixItems":"items",a="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",c=o.items.map((e,n)=>Vv(e,t,{...r,path:[...r.path,s,n]})),l=o.rest?Vv(o.rest,t,{...r,path:[...r.path,a,..."openapi-3.0"===t.target?[o.items.length]:[]]}):null;"draft-2020-12"===t.target?(i.prefixItems=c,l&&(i.items=l)):"openapi-3.0"===t.target?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));const{minimum:u,maximum:d}=e._zod.bag;"number"==typeof u&&(i.minItems=u),"number"==typeof d&&(i.maxItems=d)})(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function g_(e,t,n){const r=t instanceof ag;return new m_({type:"tuple",items:e,rest:r?t:null,...Jf(r?n:t)})}const b_=Sf("ZodRecord",(e,t)=>{hb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=n,o=e._zod.def;i.type="object";const s=o.keyType,a=s._zod.bag,c=a?.patterns;if("loose"===o.mode&&c&&c.size>0){const e=Vv(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const t of c)i.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(i.propertyNames=Vv(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Vv(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const l=s._zod.values;if(l){const e=[...l].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(i.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function v_(e,t,n){return new b_({type:"record",keyType:e,valueType:t,...Jf(n)})}function y_(e,t,n){const r=Gf(e);return r._zod.values=void 0,new b_({type:"record",keyType:r,valueType:t,...Jf(n)})}function w_(e,t,n){return new b_({type:"record",keyType:e,valueType:t,mode:"loose",...Jf(n)})}const x_=Sf("ZodMap",(e,t)=>{fb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Map cannot be represented in JSON Schema")})(0,e),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(Nv(...t)),e.nonempty=t=>e.check(Nv(1,t)),e.max=(...t)=>e.check(Av(...t)),e.size=(...t)=>e.check(Lv(...t))});function k_(e,t,n){return new x_({type:"map",keyType:e,valueType:t,...Jf(n)})}const S_=Sf("ZodSet",(e,t)=>{mb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Set cannot be represented in JSON Schema")})(0,e),e.min=(...t)=>e.check(Nv(...t)),e.nonempty=t=>e.check(Nv(1,t)),e.max=(...t)=>e.check(Av(...t)),e.size=(...t)=>e.check(Lv(...t))});function A_(e,t){return new S_({type:"set",valueType:e,...Jf(t)})}const N_=Sf("ZodEnum",(e,t)=>{bb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=Cf(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const i={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);i[r]=t.entries[r]}return new N_({...t,checks:[],...Jf(r),entries:i})},e.exclude=(e,r)=>{const i={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete i[t]}return new N_({...t,checks:[],...Jf(r),entries:i})}});function L_(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new N_({type:"enum",entries:n,...Jf(t)})}function P_(e,t){return new N_({type:"enum",entries:e,...Jf(t)})}const C_=Sf("ZodLiteral",(e,t)=>{vb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,i=[];for(const e of r.values)if(void 0===e){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(e))}else i.push(e);if(0===i.length);else if(1===i.length){const e=i[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else i.every(e=>"number"==typeof e)&&(n.type="number"),i.every(e=>"string"==typeof e)&&(n.type="string"),i.every(e=>"boolean"==typeof e)&&(n.type="boolean"),i.every(e=>null===e)&&(n.type="null"),n.enum=i})(e,t,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function E_(e,t){return new C_({type:"literal",values:Array.isArray(e)?e:[e],...Jf(t)})}const I_=Sf("ZodFile",(e,t)=>{yb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:s,mime:a}=e._zod.bag;void 0!==o&&(i.minLength=o),void 0!==s&&(i.maxLength=s),a?1===a.length?(i.contentMediaType=a[0],Object.assign(r,i)):(Object.assign(r,i),r.anyOf=a.map(e=>({contentMediaType:e}))):Object.assign(r,i)})(e,0,n),e.min=(t,n)=>e.check(Nv(t,n)),e.max=(t,n)=>e.check(Av(t,n)),e.mime=(t,n)=>e.check(Mv(Array.isArray(t)?t:[t],n))});function O_(e){return function(e,t){return new e({type:"file",...Jf(t)})}(I_,e)}const j_=Sf("ZodTransform",(e,t)=>{wb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Nf(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(op(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(op(t))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function z_(e){return new j_({type:"transform",transform:e})}const F_=Sf("ZodOptional",(e,t)=>{xb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ey(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function T_(e){return new F_({type:"optional",innerType:e})}const R_=Sf("ZodExactOptional",(e,t)=>{kb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ey(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function M_(e){return new R_({type:"optional",innerType:e})}const D_=Sf("ZodNullable",(e,t)=>{Sb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def,o=Vv(i.innerType,t,r),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function B_(e){return new D_({type:"nullable",innerType:e})}function q_(e){return T_(B_(e))}const U_=Sf("ZodDefault",(e,t)=>{Ab.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;Vv(i.innerType,t,r),t.seen.get(e).ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function $_(e,t){return new U_({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():Wf(t)}})}const W_=Sf("ZodPrefault",(e,t)=>{Lb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;Vv(i.innerType,t,r),t.seen.get(e).ref=i.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Z_(e,t){return new W_({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():Wf(t)}})}const H_=Sf("ZodNonOptional",(e,t)=>{Pb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;Vv(i.innerType,t,r),t.seen.get(e).ref=i.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function V_(e,t){return new H_({type:"nonoptional",innerType:e,...Jf(t)})}const G_=Sf("ZodSuccess",(e,t)=>{Eb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t),e.unwrap=()=>e._zod.def.innerType});function J_(e){return new G_({type:"success",innerType:e})}const K_=Sf("ZodCatch",(e,t)=>{Ib.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;let o;Vv(i.innerType,t,r),t.seen.get(e).ref=i.innerType;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Y_(e,t){return new K_({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}const X_=Sf("ZodNaN",(e,t)=>{Ob.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema")})(0,e)});function Q_(e){return function(e,t){return new e({type:"nan",...Jf(t)})}(X_,e)}const ex=Sf("ZodPipe",(e,t)=>{jb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def,o="input"===t.io?"transform"===i.in._zod.def.type?i.out:i.in:i.out;Vv(o,t,r),t.seen.get(e).ref=o})(e,t,0,r),e.in=t.in,e.out=t.out});function tx(e,t){return new ex({type:"pipe",in:e,out:t})}const nx=Sf("ZodCodec",(e,t)=>{ex.init(e,t),Fb.init(e,t)});function rx(e,t,n){return new nx({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const ix=Sf("ZodReadonly",(e,t)=>{Mb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;Vv(i.innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ox(e){return new ix({type:"readonly",innerType:e})}const sx=Sf("ZodTemplateLiteral",(e,t)=>{Bb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=i.source})(e,0,n)});function ax(e,t){return new sx({type:"template_literal",parts:e,...Jf(t)})}const cx=Sf("ZodLazy",(e,t)=>{$b.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.innerType;Vv(i,t,r),t.seen.get(e).ref=i})(e,t,0,r),e.unwrap=()=>e._zod.def.getter()});function lx(e){return new cx({type:"lazy",getter:e})}const ux=Sf("ZodPromise",(e,t)=>{Ub.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const i=e._zod.def;Vv(i.innerType,t,r),t.seen.get(e).ref=i.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function dx(e){return new ux({type:"promise",innerType:e})}const hx=Sf("ZodFunction",(e,t)=>{qb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Function types cannot be represented in JSON Schema")})(0,e)});function fx(e){return new hx({type:"function",input:Array.isArray(e?.input)?g_(e?.input):e?.input??t_(Vw()),output:e?.output??Vw()})}const px=Sf("ZodCustom",(e,t)=>{Wb.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});function mx(e){const t=new Fm({check:"custom"});return t._zod.check=e,t}function gx(e,t){return function(e,t,n){const r=Jf(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}(px,e??(()=>!0),t)}function bx(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Jf(n)})}(px,e,t)}function vx(e){return function(e){const t=function(e){const t=new Fm({check:"custom",...Jf(void 0)});return t._zod.check=e,t}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(op(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(op(r))}},e(n.value,n)));return t}(e)}const yx=function(e){const t=new Fm({check:"describe"});return t._zod.onattach=[t=>{const n=Vb.get(t)??{};Vb.add(t,{...n,description:e})}],t._zod.check=()=>{},t},wx=function(e){const t=new Fm({check:"meta"});return t._zod.onattach=[t=>{const n=Vb.get(t)??{};Vb.add(t,{...n,...e})}],t._zod.check=()=>{},t};function xx(e,t={}){const n=new px({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...Jf(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}const kx=(...e)=>function(e,t){const n=Jf(t);let r=n.truthy??["true","1","yes","on","y","enabled"],i=n.falsy??["false","0","no","off","n","disabled"];"sensitive"!==n.case&&(r=r.map(e=>"string"==typeof e?e.toLowerCase():e),i=i.map(e=>"string"==typeof e?e.toLowerCase():e));const o=new Set(r),s=new Set(i),a=e.Codec??Fb,c=e.Boolean??Mg,l=new a({type:"pipe",in:new(e.String??cg)({type:"string",error:n.error}),out:new c({type:"boolean",error:n.error}),transform:(e,t)=>{let r=e;return"sensitive"!==n.case&&(r=r.toLowerCase()),!!o.has(r)||!s.has(r)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:t.value,inst:l,continue:!1}),{})},reverseTransform:(e,t)=>!0===e?r[0]||"true":i[0]||"false",error:n.error});return l}({Codec:nx,Boolean:Iw,String:Ay},...e);function Sx(e){const t=lx(()=>c_([Ny(e),Sw(),Ow(),$w(),t_(t),v_(Ny(),t)]));return t}function Ax(e,t){return tx(z_(e),t)}var Nx;Nx||(Nx={}),new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]),Pf({localeError:(()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(t){return e[t]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return e=>{switch(e.code){case"invalid_type":{const t=r[e.expected]??e.expected,n=function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(null===e)return"null";if(Array.isArray(e))return"array";const t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return t}(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case"invalid_value":return 1===e.values.length?`Invalid input: expected ${Kf(e.values[0])}`:`Invalid option: expected one of ${Ef(e.values,"|")}`;case"too_big":{const n=e.inclusive?"<=":"<",r=t(e.origin);return r?`Too big: expected ${e.origin??"value"} to have ${n}${e.maximum.toString()} ${r.unit??"elements"}`:`Too big: expected ${e.origin??"value"} to be ${n}${e.maximum.toString()}`}case"too_small":{const n=e.inclusive?">=":">",r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case"invalid_format":{const t=e;return"starts_with"===t.format?`Invalid string: must start with "${t.prefix}"`:"ends_with"===t.format?`Invalid string: must end with "${t.suffix}"`:"includes"===t.format?`Invalid string: must include "${t.includes}"`:"regex"===t.format?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${Ef(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`}}})()}),i_({name:Ny().min(1,{message:(0,m.__)("Please enter a category name","surecookie")}).trim(),description:Ny().default("")}),i_({name:Ny().min(1,{message:(0,m.__)("Please enter a cookie name","surecookie")}).trim(),category:Ny().min(1,{message:(0,m.__)("Please select a category","surecookie")}),duration:Ny().optional().default(""),provider:Ny().optional().default(""),domain:Ny().optional().default(""),description:Ny().optional().default(""),purpose:Ny().optional().default("")}),(0,m.__)("Launch Setup Wizard","surecookie"),window,E("scan_cookies_learn_more","docs/"),window?.surecookieAdminData||window;const Lx=({variant:e="rectangular",className:t,...n})=>{const r={circular:"rounded-full bg-gray-200 ",rectangular:"rounded-md bg-gray-200"}[e],i={circular:"size-10",rectangular:"w-96 h-3"}[e];return(0,f.jsx)("div",{className:Pe(r,"animate-pulse",i,t),...n})},Px=Fe("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),Cx=Fe("ImageOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),Ex=Fe("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]),Ix={sm:{image:"w-8 h-8",name:"text-xs",fileIcon:"h-8",uploadText:"text-xs"},md:{image:"w-10 h-10",name:"text-sm",fileIcon:"h-10",uploadText:"text-xs"},lg:{image:"w-10 h-10",name:"text-sm",fileIcon:"h-10",uploadText:"text-xs"}},Ox=({file:e,onRemove:t,error:n,disabled:r,size:i="sm"})=>(0,f.jsx)("div",{className:Pe("w-full flex items-start justify-between rounded mt-2 bg-field-primary-background p-2 gap-3",n&&"border-alert-border-danger bg-alert-background-danger"),children:(0,f.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[e.type.startsWith("image")?(0,f.jsx)("div",{className:Pe("rounded-sm flex items-center justify-center shrink-0",n&&"bg-gray-200"),children:n?(0,f.jsx)(Cx,{className:"size-6 text-field-helper"}):(0,f.jsx)("img",{src:"url"in e?e.url:URL.createObjectURL(e),alt:"Preview",className:Pe("w-full object-contain rounded-sm",Ix[i].image)})}):(0,f.jsx)("span",{className:Pe("inline-flex self-start p-0.5",Ix[i].fileIcon),children:(0,f.jsx)(Px,{className:"size-5 text-icon-primary"})}),(0,f.jsxs)("div",{className:"text-left flex flex-col gap-0 w-[calc(100%_-_5.5rem)]",children:[(0,f.jsx)("span",{className:Pe(Ix[i].name,"font-medium text-field-label truncate"),children:e.name}),e.size&&e.size>0&&(0,f.jsx)("span",{className:Pe(Ix[i].uploadText,"text-xs text-field-helper",n&&"text-support-error"),children:Ee(e.size)})]}),!r&&(0,f.jsx)("button",{onClick:()=>t(e),className:"inline-flex cursor-pointer bg-transparent border-0 p-1 my-0 ml-auto mr-0 ring-0 focus:outline-none self-start","aria-label":"Remove file",children:(0,f.jsx)(Ex,{className:"size-4 text-support-error"})})]})}),jx=new Map,zx=()=>(0,f.jsx)(Lx,{className:"h-14 w-full"}),Fx=({imageId:e,imageUrl:t,onRemove:n})=>{let r=(({imageId:e="",imageUrl:t=""})=>{if(jx.has(e||t))return jx.get(e||t);const n=(e=>{let t,n="pending";const r=e.then(e=>{n="success",t=e},e=>{n="error",t=e});return{read(){if("pending"===n)throw r;if("error"===n)throw t;if("success"===n)return t}}})(new Promise(n=>{if(!e&&!t)return void n({});const r=e=>{if(!e)return void n({});const t=(e=>wp.media.attachment(e).fetch())(e);t&&"function"==typeof t.then?t.then(()=>{n(t)}).catch(()=>{n({})}):n(t)};t?(async e=>{if(!e)return null;const t=new URL(e).pathname.split("/").pop().split("?")[0],n=t.replace(/-\d+x\d+\.(jpg|jpeg|png|gif|webp)$/i,"").replace(/-scaled\.(jpg|jpeg|png|gif|webp)$/i,"").replace(/\.(webp)$/i,"").replace(/(-optimized|-compressed)/i,""),r=[{search:t},{search:n},{search:t.replace(/\.[^/.]+$/,"")},{search:n.replace(/\.[^/.]+$/,"")}];for(const e of r)try{const r=await O()({path:(0,j.addQueryArgs)("/wp/v2/media",{search:e.search,media_type:"image",slug:e.search,per_page:20}),method:"GET"});if(r&&r.length>0)return r.find(e=>{const r=e.source_url||e.url,i=r.split("/").pop().split("?")[0];return i===t||r.includes(n)||i.includes(n)})||r[0]}catch(e){continue}try{const e=n.split("-")[0],t=await O()({path:(0,j.addQueryArgs)("/wp/v2/media",{search:e,media_type:"image",per_page:50}),method:"GET"});if(t&&t.length>0)return t[0]}catch(e){}return null})(t).then(e=>{e?r(e.id):n({})}).catch(()=>{n({})}):e?r(e):n({})}));return jx.set(e||t,n),n})({imageId:e,imageUrl:t}).read()||{};"attributes"in r&&(r=r.attributes);const i=r.filename||"",o=r.filesizeInBytes||"",s=r.url||"",a=r.type||"";return(0,f.jsx)("div",{className:"[&>div]:m-0",children:(0,f.jsx)(Ox,{file:{name:i,url:s,type:a,size:o},onRemove:n,size:"md"})})};(0,d.memo)(({imageId:e,imageUrl:t,onRemove:n})=>((0,d.useEffect)(()=>{const n=()=>{(e||t)&&jx.delete(e||t)};return window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}},[e,t]),e||t?(0,f.jsx)(Ci,{children:(0,f.jsx)(d.Suspense,{fallback:(0,f.jsx)(zx,{}),children:(0,f.jsx)(Fx,{imageId:e,imageUrl:t,onRemove:n})})}):null));const Tx=({modalDescription:e,cookiePolicyUrl:t,cookiePolicyTitle:n})=>{if(!e.includes("{cookie_policy_link}"))return e;if(!t)return e.replace(/\s*\{cookie_policy_link\}\s*/g," ").replace(/\s+/g," ").trim();const r=(0,f.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"surecookie-modal-policy-link",children:n||(0,m.__)("Cookie Policy","surecookie")});return(0,d.createInterpolateElement)(e.replace("{cookie_policy_link}","<link />"),{link:r})},Rx=({isOpen:e,onClose:t,onSave:n,settings:r={},isPreview:i=!1})=>{const[o,s]=(0,d.useState)({}),[a,c]=(0,d.useState)([]),[l,u]=(0,d.useState)([]),[h,g]=(0,d.useState)([]),[b,v]=(0,d.useState)([]),[y,w]=(0,d.useState)(!0),[_,x]=(0,d.useState)(""),[k,S]=(0,d.useState)(window.innerWidth<=768),L=(0,d.useRef)(null),P=(0,d.useRef)(null),C=(0,d.useRef)(null);(0,d.useEffect)(()=>{e&&C.current&&(P.current=C.current.ownerDocument.activeElement)},[e]),(0,d.useEffect)(()=>{!e&&P.current&&(P.current.focus(),P.current=null)},[e]),(0,d.useEffect)(()=>{const e=window.matchMedia("(max-width: 768px)"),t=e=>S(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,d.useEffect)(()=>{const e=window.surecookiePublicSettings?.cookie_categories||{},t=r.cookie_categories&&Object.keys(r.cookie_categories).length?Object.values(r.cookie_categories):Object.values(e);c(t);const n=Object.values(r?.custom_cookies)||[];u(n);const i={};t.forEach(e=>{i[e.id]="essential"===e.id});const o=localStorage.getItem("surecookie_preferences");if(o)try{const e=JSON.parse(o);t.forEach(t=>{"essential"===t.id?i[t.id]=!0:void 0!==e[t.id]&&(i[t.id]=e[t.id])}),s(i)}catch(e){s(i)}else s(i);w(!1)},[r.cookie_categories,r.custom_cookies,e]),(0,d.useEffect)(()=>{e||g([])},[e]),(0,d.useEffect)(()=>{if(e&&L.current){const e=setTimeout(()=>{L.current.focus()},100);return()=>clearTimeout(e)}},[e]);const I=(0,d.useCallback)(e=>e?Array.from(e.querySelectorAll('button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')):[],[]),O=(0,d.useCallback)(n=>{if(!e)return;if("Escape"===n.key)return n.preventDefault(),void t();if("Tab"!==n.key)return;const r=I(L.current);if(0===r.length)return;const i=r[0],o=r[r.length-1];n.shiftKey?L.current.ownerDocument.activeElement===i&&(n.preventDefault(),o.focus()):L.current.ownerDocument.activeElement===o&&(n.preventDefault(),i.focus())},[e,t,I]);(0,d.useEffect)(()=>(document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)),[O]);const j=()=>{const e={};a.forEach(t=>{e[t.id]=!0}),s(e),localStorage.setItem("surecookie_preferences",JSON.stringify(e)),window.surecookieManager&&window.surecookieManager.saveConsent(e,"accepted"),x((0,m.__)("All cookies accepted.","surecookie")),n(e)},z=()=>{const e={};a.forEach(t=>{"essential"===t.id?e[t.id]=!0:e[t.id]=!1}),s(e),localStorage.setItem("surecookie_preferences",JSON.stringify(e)),window.surecookieManager&&window.surecookieManager.saveConsent(e,"declined"),x((0,m.__)("Non-essential cookies rejected.","surecookie")),n(e)},F=()=>{localStorage.setItem("surecookie_preferences",JSON.stringify(o)),window.surecookieManager&&window.surecookieManager.saveConsent(o,"partially_accepted"),x((0,m.__)("Preferences saved successfully.","surecookie")),n(o)},T=r.cookie_policy_page_url||window?.surecookiePublicSettings?.cookie_policy_page_url||"",R=r.cookie_policy_page_title||window?.surecookiePublicSettings?.cookie_policy_page_title||"",M=r.preferences_modal_heading||window?.surecookiePublicSettings?.preferences_modal_heading||"",D=r.preferences_modal_description||window?.surecookiePublicSettings?.preferences_modal_description||"",B=r.text_color||"var(--surecookie-banner-text-color, #374151)",q=r.text_color||"var(--surecookie-banner-text-color, #ffffff)",U=r.banner_bg_color||"var(--surecookie-banner-background-color, #111827)",$="#37415126",W=(0,f.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"surecookie-sr-only",children:_});return e?(0,f.jsxs)("div",{ref:C,children:[W,(0,f.jsx)("div",{className:"surecookie-modal-backdrop",onClick:t,children:(0,f.jsx)("div",{className:"surecookie-modal-wrapper",children:(0,f.jsxs)("div",{ref:L,role:"dialog","aria-modal":"true","aria-labelledby":"surecookie-modal-title","aria-describedby":"surecookie-modal-description",className:"surecookie-preferences-modal",style:{backgroundColor:U,color:B,...r.banner_bg_color&&{"--surecookie-banner-background-color":r.banner_bg_color},...r.text_color&&{"--surecookie-banner-text-color":r.text_color},...r.accept_btn_color&&{"--surecookie-banner-primary-color":r.accept_btn_color},...r.decline_btn_color&&{"--surecookie-banner-secondary-color":r.decline_btn_color}},onClick:e=>e.stopPropagation(),tabIndex:"-1",children:[(0,f.jsxs)("div",{className:"surecookie-modal-header",children:[(0,f.jsxs)("div",{className:"surecookie-modal-header-text",children:[(0,f.jsx)("h2",{id:"surecookie-modal-title",className:"surecookie-modal-title",children:M}),(0,f.jsx)("p",{id:"surecookie-modal-description",className:"surecookie-modal-description",children:Tx({modalDescription:D,cookiePolicyUrl:T,cookiePolicyTitle:R})})]}),(0,f.jsx)("button",{type:"button",className:"surecookie-modal-close-btn",onClick:t,"aria-label":(0,m.__)("Close privacy preferences dialog","surecookie"),children:(0,f.jsx)(A,{size:20,"aria-hidden":"true"})})]}),(0,f.jsx)("div",{className:"surecookie-categories-wrapper",children:(0,f.jsx)("div",{className:"surecookie-categories-scroll",children:(0,f.jsxs)("div",{className:"surecookie-categories-list",role:"status","aria-live":"polite","aria-busy":y,children:[y&&[1,2,3,4].map(e=>(0,f.jsx)("div",{className:"surecookie-category-item",style:{borderBottomColor:$},children:(0,f.jsxs)("div",{className:"surecookie-category-header",children:[(0,f.jsxs)("div",{className:"surecookie-category-trigger",children:[(0,f.jsx)("span",{className:"surecookie-skeleton surecookie-skeleton-icon"}),(0,f.jsx)("span",{className:"surecookie-skeleton surecookie-skeleton-title"})]}),1===e?(0,f.jsx)("span",{className:"surecookie-skeleton surecookie-skeleton-badge"}):(0,f.jsx)("span",{className:"surecookie-skeleton surecookie-skeleton-toggle"})]})},e)),!y&&a.map(e=>{const t=o[e.id],n=(r=e.id,l.filter(e=>e.category===r));var r;const i=h.includes(e.id),c=`surecookie-category-details-${e.id}`,u=`surecookie-cookie-table-${e.id}`;return(0,f.jsxs)("div",{className:"surecookie-category-item",style:{borderBottomColor:$},children:[(0,f.jsxs)("div",{className:"surecookie-category-header",children:[(0,f.jsxs)("button",{type:"button",className:"surecookie-category-trigger",onClick:()=>(e=>{g(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])})(e.id),"aria-expanded":i,"aria-controls":c,children:[(0,f.jsx)("span",{className:"surecookie-expand-icon "+(i?"expanded":""),style:{color:B},"aria-hidden":"true",children:(0,f.jsx)(N,{size:18,strokeWidth:2.5,focusable:"false"})}),(0,f.jsx)("span",{className:"surecookie-category-name",style:{color:q},children:e.name})]}),(0,f.jsxs)("div",{className:"surecookie-category-controls",children:["essential"===e.id&&(0,f.jsx)("span",{className:"surecookie-always-active","aria-hidden":"true",children:(0,m.__)("Always Active","surecookie")}),(0,f.jsx)("button",{type:"button",className:"surecookie-toggle-btn",role:"switch","aria-checked":t?"true":"false","aria-label":"essential"===e.id?(0,m.sprintf)( 
(0,m.__)("%s: always active, cannot be disabled","surecookie"),e.name):e.name,onClick:()=>(e=>{const t=a.find(t=>t.id===e);t&&"essential"===t.id||s(t=>({...t,[e]:!t[e]}))})(e.id),"aria-disabled":"essential"===e.id,style:{backgroundColor:t?"var(--surecookie-banner-primary-color, #2563eb)":"#D1D5DB"},children:(0,f.jsx)("span",{className:"surecookie-toggle-knob "+(t?"checked":""),"aria-hidden":"true"})})]})]}),(0,f.jsx)("div",{id:c,className:"surecookie-category-details",hidden:!i,children:i&&(0,f.jsxs)(f.Fragment,{children:[e.description&&(0,f.jsx)("p",{className:"surecookie-category-desc",children:e.description}),n.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("button",{type:"button",className:"surecookie-cookie-table-toggle",onClick:t=>{t.stopPropagation(),(e=>{v(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])})(e.id)},"aria-expanded":b.includes(e.id),"aria-controls":u,children:[(0,f.jsx)("span",{className:"surecookie-cookie-table-label",children:(0,m.__)("View Cookies","surecookie")}),(0,f.jsx)("span",{className:"surecookie-table-chevron "+(b.includes(e.id)?"expanded":""),"aria-hidden":"true",children:(0,f.jsx)(N,{size:16,strokeWidth:2.5,focusable:"false"})})]}),(0,f.jsx)("div",{id:u,className:"surecookie-cookie-table-wrapper",hidden:!b.includes(e.id),children:b.includes(e.id)&&(0,f.jsxs)("table",{className:"surecookie-cookie-table","aria-label":(0,m.sprintf)( 
(0,m.__)("%s cookies details","surecookie"),e.name),children:[(0,f.jsx)("thead",{children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{scope:"col",children:(0,m.__)("Name","surecookie")}),(0,f.jsx)("th",{scope:"col",children:(0,m.__)("Provider","surecookie")}),(0,f.jsx)("th",{scope:"col",children:(0,m.__)("Duration","surecookie")}),(0,f.jsx)("th",{scope:"col",children:(0,m.__)("Expiry","surecookie")})]})}),(0,f.jsx)("tbody",{children:n.map(e=>(0,f.jsxs)("tr",{children:[(0,f.jsx)("td",{children:e.name}),(0,f.jsx)("td",{children:e.provider||"-"}),(0,f.jsx)("td",{children:e.duration||"-"}),(0,f.jsx)("td",{children:e.expires||"-"})]},e.id||`${e.category}-${e.name}`))})]})})]})]})})]},e.id)})]})})}),(0,f.jsx)("div",{className:"surecookie-modal-footer",children:k?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{display:"flex",gap:"8px"},children:[(0,f.jsx)("button",{type:"button",className:"surecookie-btn-outline surecookie-btn-sm",onClick:i?void 0:j,"aria-disabled":i?"true":void 0,children:(0,m.__)("Accept All","surecookie")}),(0,f.jsx)("button",{type:"button",className:"surecookie-btn-outline-secondary surecookie-btn-sm",onClick:i?void 0:z,"aria-disabled":i?"true":void 0,children:(0,m.__)("Reject All","surecookie")})]}),(0,f.jsx)("button",{type:"button",className:"surecookie-btn-primary surecookie-btn-sm",onClick:i?void 0:F,"aria-disabled":i?"true":void 0,children:(0,m.__)("Confirm My Choices","surecookie")})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"surecookie-footer-actions",children:[(0,f.jsx)("button",{type:"button",className:"surecookie-btn-outline",onClick:i?void 0:j,"aria-disabled":i?"true":void 0,children:(0,m.__)("Accept All","surecookie")}),(0,f.jsx)("button",{type:"button",className:"surecookie-btn-outline-secondary",onClick:i?void 0:z,"aria-disabled":i?"true":void 0,children:(0,m.__)("Reject All","surecookie")})]}),(0,f.jsx)("button",{type:"button",className:"surecookie-btn-primary",onClick:i?void 0:F,"aria-disabled":i?"true":void 0,children:(0,m.__)("Confirm My Choices","surecookie")})]})}),!r.remove_branding&&(0,f.jsx)("div",{className:"surecookie-modal-footer-branding",style:{borderTopColor:"#37415126",justifyContent:"flex-end"},children:(0,f.jsxs)("a",{href:E("preferences_modal_branding"),target:"_blank",rel:"noopener noreferrer",className:"surecookie-modal-branding-content","aria-label":(0,m.__)("Powered by SureCookie (opens in new tab)","surecookie"),children:[(0,f.jsx)("span",{"aria-hidden":"true",children:(0,m.__)("Powered by","surecookie")}),(0,f.jsx)(p,{width:"10",height:"12","aria-hidden":!0,focusable:"false"}),(0,f.jsx)("span",{"aria-hidden":"true",children:"SureCookie"})]})})]})})})]}):W},Mx=()=>{const e=(0,d.useMemo)(()=>window.surecookiePublicSettings||{},[]),t=(0,d.useMemo)(()=>{const e=(0,h.applyFilters)("surecookie.publicSettingsResolvers",[]);return Array.isArray(e)?e.filter(e=>"function"==typeof e):[]},[]),[n,r]=(0,d.useState)(e),[i,o]=(0,d.useState)(!1),[s,a]=(0,d.useState)(!1),c=(0,d.useRef)(null),l=(0,d.useRef)(null),u=(0,d.useRef)(null),[g,b]=(0,d.useState)(0===t.length),v=(0,d.useMemo)(()=>void 0===n.show_settings_btn_enabled||Boolean(n.show_settings_btn_enabled),[n.show_settings_btn_enabled]),y=Boolean(e?.is_banner_visibility_hidden),[w,_]=(0,d.useState)(!y&&(n.banner_enabled||n.enable_banner||!1)),x=n.message_heading||"",k=n.message_description??(0,m.__)("This website uses cookies to enhance your browsing experience, personalize content, provide social media features, and analyze our traffic. You can review and manage your cookie settings at any time, or accept all cookies to proceed.","surecookie"),S=n.notice_type||"banner",A=n.notice_position||"bottom",N=n.banner_width||"650",P=(0,d.useMemo)(()=>n.locale?n.locale.replace("_","-"):document.documentElement.lang||void 0,[n.locale]),C="var(--surecookie-banner-text-color, #374151)",I=n.banner_logo||"",O=(e=>{const t=e?.accept_all_enabled;return!0===t||1===t||"1"===t})(n),j=n.banner_animation||"fade",z=n.active_law_id,F="opt-out"===(n.consent_model||"opt-in"),T=(0,d.useMemo)(()=>({accept:(0,m.__)("Only Essential","surecookie"),accept_all:(0,m.__)("Accept All","surecookie"),decline:(0,m.__)("Decline","surecookie"),preferences:(0,m.__)("Preferences","surecookie")}),[]),R=(e,t)=>{if(n.button_labels?.[e])return n.button_labels[e];const r=n.law_default_labels?.[e];return z&&r?r:t||T[e]||""},M=R("accept",n.accept_btn_text),D=R("accept_all",n.accept_all_btn_text),B=R("decline",n.decline_btn_text),q=R("preferences",n.preferences_btn_text),U=(0,d.useMemo)(()=>{let e;return e=n.button_config&&Array.isArray(n.button_config)?n.button_config:F&&!n.button_config?["accept","decline"]:n.button_order||"accept_all,accept,preferences,decline",((e,{acceptAllEnabled:t})=>{const n=Array.isArray(e)?e.slice():String(e||"").split(",").map(e=>e.trim()).filter(Boolean);return t?n:n.filter(e=>"accept_all"!==e)})(e,{acceptAllEnabled:O})},[n.button_order,n.button_config,F,O]),$=(0,d.useMemo)(()=>Object.values(n.cookie_categories||{}),[n.cookie_categories]),W=(0,d.useMemo)(()=>Object.values(n.custom_cookies||{}),[n.custom_cookies]),Z=(0,d.useMemo)(()=>n.scanned_cookies||[],[n.scanned_cookies]),H=(0,d.useMemo)(()=>{const e=new Set(W.map(e=>e.name)),t=Z.filter(t=>!e.has(t.name));return[...W,...t]},[W,Z]);(0,d.useEffect)(()=>{if(g||0===t.length)return;let n=!1;const i=(e={})=>{n||(Object.keys(e).length>0&&(r(t=>({...t,...e})),y?_(!1):void 0!==e.banner_enabled?_(Boolean(e.banner_enabled)):void 0!==e.enable_banner&&_(Boolean(e.enable_banner))),b(!0))};(async()=>{let n={};for(const r of t)try{const t=await r({...e,...n});t&&"object"==typeof t&&(n={...n,...t})}catch(e){}i(n)})();const o=setTimeout(()=>{n||i()},4e3);return()=>{n=!0,clearTimeout(o)}},[e,g,t]),(0,d.useEffect)(()=>{if(!g)return;if(!w)return void o(!1);(()=>{if(window.surecookieManager&&window.surecookieManager.hasConsent()){if(V())return void o(!0);o(!1)}else o(!0)})();const e=()=>{!document.hidden&&w&&window.surecookieManager&&window.surecookieManager.hasConsent()&&V()&&o(!0)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[w,W,v,g]),(0,d.useEffect)(()=>{const e=e=>{e.detail?o(!1):w&&o(!0)};return window.addEventListener("surecookie_changed",e),()=>{window.removeEventListener("surecookie_changed",e)}},[w]),(0,d.useEffect)(()=>{const e=e=>{e.detail&&"object"==typeof e.detail&&(r(t=>({...t,...e.detail})),void 0!==e.detail.banner_enabled&&_(!y&&Boolean(e.detail.banner_enabled)))};return window.addEventListener("surecookie_settings_changed",e),()=>{window.removeEventListener("surecookie_settings_changed",e)}},[]),(0,d.useEffect)(()=>{const e=()=>{w&&(c.current=l.current?.ownerDocument?.activeElement??null,F?(a(!1),o(!0)):(o(!1),a(!0)))},t=t=>{document.querySelector("[data-surecookie-reconsent]")&&t.target.closest("[data-surecookie-reconsent]")&&(t.preventDefault(),e())},n=t=>{" "===t.key&&document.querySelector("[data-surecookie-reconsent]")&&t.target.closest("[data-surecookie-reconsent]")&&(t.preventDefault(),e())};return document.addEventListener("surecookie_open_preferences",e),document.addEventListener("click",t),document.addEventListener("keydown",n),()=>{document.removeEventListener("surecookie_open_preferences",e),document.removeEventListener("click",t),document.removeEventListener("keydown",n)}},[F,w]),(0,d.useEffect)(()=>{if(!i)return;const e=e=>{if("Escape"===e.key)return e.preventDefault(),void o(!1);if("Tab"!==e.key)return;const t=Array.from(u.current?.querySelectorAll('button:not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')??[]);if(0===t.length)return;const n=t[0],r=t[t.length-1],i=u.current?.ownerDocument?.activeElement;e.shiftKey?i!==n&&u.current?.contains(i)||(e.preventDefault(),r.focus()):i!==r&&u.current?.contains(i)||(e.preventDefault(),n.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),(0,d.useEffect)(()=>{if(!i||!u.current)return;const e=setTimeout(()=>{const e=u.current?.querySelector("button:not([disabled])");e?e.focus():u.current?.focus()},100);return()=>clearTimeout(e)},[i]),(0,d.useEffect)(()=>{const e=l.current;if(!e)return;const t=e.ownerDocument||document,n=Array.from(t.body.children),r=e.closest("#surecookie-public-root");return n.forEach(e=>{e===r||e.contains(r)||(s?(e.setAttribute("inert",""),e.removeAttribute("aria-hidden")):i?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","true")):(e.removeAttribute("inert"),e.removeAttribute("aria-hidden")))}),()=>{n.forEach(e=>{e.removeAttribute("inert"),e.removeAttribute("aria-hidden")})}},[i,s]);const V=()=>{if(!W||0===W.length)return!1;const e=window.surecookieManager.getConsent();if(!e||!e.preferences)return!1;const t=e.timestamp?new Date(e.timestamp):null,n=new Date;for(const r of W)if(r.expires){const i=new Date(r.expires);if(i<n&&(!t||i>t)&&e.preferences[r.category])return!0}return!1},G=(0,d.useCallback)(()=>{const e={};F?($&&$.length>0?$.forEach(t=>{e[t.id]=!0}):(e.essential=!0,e.functional=!0,e.analytics=!0,e.marketing=!0,e.uncategorized=!0),localStorage.setItem("surecookie_preferences",JSON.stringify(e)),window.surecookieManager&&window.surecookieManager.saveConsent(e,"accepted")):($&&$.length>0?$.forEach(t=>{e[t.id]="essential"===t.id}):(e.essential=!0,e.functional=!1,e.analytics=!1,e.marketing=!1,e.uncategorized=!1),localStorage.setItem("surecookie_preferences",JSON.stringify(e)),window.surecookieManager&&window.surecookieManager.saveConsent(e,"partially_accepted")),o(!1)},[$,v,F]),J=(0,d.useCallback)(()=>{if(!O)return;const e={};$&&$.length>0?$.forEach(t=>{e[t.id]=!0}):(e.essential=!0,e.functional=!0,e.analytics=!0,e.marketing=!0,e.uncategorized=!0),localStorage.setItem("surecookie_preferences",JSON.stringify(e)),window.surecookieManager&&window.surecookieManager.saveConsent(e,"accepted"),o(!1)},[O,$,v]),K=(0,d.useCallback)(()=>{const e={};$&&$.length>0?$.forEach(t=>{"essential"===t.id?e[t.id]=!0:e[t.id]=!1}):(e.essential=!0,e.functional=!1,e.analytics=!1,e.marketing=!1,e.uncategorized=!1),localStorage.setItem("surecookie_preferences",JSON.stringify(e)),window.surecookieManager&&window.surecookieManager.saveConsent(e,"declined"),o(!1)},[$,v]),Y=(0,d.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),c.current=l.current?.ownerDocument?.activeElement??null,o(!1),a(!0)},[]),X=(0,d.useCallback)(()=>{a(!1),c.current&&(c.current.focus(),c.current=null),window.surecookieManager&&window.surecookieManager.hasConsent()||o(!0)},[v]),Q=(0,d.useCallback)(()=>{a(!1),o(!1)},[v]),ee=(e,t)=>({color:e,...t&&{borderColor:t}});return(0,f.jsxs)("div",{ref:l,className:"surecookie-public-banner-wrapper surecookie-styles",style:{...n.banner_bg_color&&{"--surecookie-banner-background-color":n.banner_bg_color},...n.text_color&&{"--surecookie-banner-text-color":n.text_color},...n.accept_btn_color&&{"--surecookie-banner-primary-color":n.accept_btn_color},...n.accept_btn_hover_color&&{"--surecookie-banner-primary-hover-color":n.accept_btn_hover_color},...n.decline_btn_color&&{"--surecookie-banner-secondary-color":n.decline_btn_color}},children:[w&&i&&(0,f.jsx)("div",{ref:u,role:"dialog","aria-modal":"true",lang:P,tabIndex:"-1","aria-labelledby":x?"surecookie-banner-heading":void 0,"aria-label":x?void 0:(0,m.__)("Cookie Consent","surecookie"),"aria-describedby":"surecookie-banner-description",style:{backgroundColor:"var(--surecookie-banner-background-color, #111827)",color:C,...("box"===S||"popup"===S)&&{width:`${N}px`}},className:`surecookie-public-banner surecookie-banner surecookie-container-mobile surecookie-banner-container ${"banner"===S?"surecookie-banner-container-banner":I?"surecookie-banner-container-box-with-logo":"surecookie-banner-container-box"} ${(()=>{if("banner"===S)return"top"===A?"surecookie-banner-position-top":"surecookie-banner-position-bottom";if("box"===S){const e="surecookie-banner-position-box-base";switch(A){case"bottom-left":return`${e} surecookie-banner-position-bottom-left`;case"bottom-center":return"surecookie-banner-position-bottom-center";case"bottom-right":default:return`${e} surecookie-banner-position-bottom-right`;case"middle":return"surecookie-banner-position-middle"}}return"popup"===S?"surecookie-banner-position-popup":"surecookie-banner-position-bottom"})()} ${"slide"===j?"surecookie-banner-animation-slide":"surecookie-banner-animation-fade"}`,"data-banner":"true","data-dark-mode":L(n.banner_bg_color)||!n.banner_bg_color?"true":"false",children:(0,f.jsxs)("div",{className:"surecookie-banner-inner "+("box"===S?"surecookie-banner-inner-box":"surecookie-banner-inner-banner"),style:{..."box"===S&&{maxWidth:`${N}px`}},children:[I&&(0,f.jsx)("div",{className:"surecookie-banner-logo-wrapper",children:(0,f.jsx)("img",{src:I,alt:(0,m.__)("Banner logo","surecookie"),className:"surecookie-banner-logo"})}),(0,f.jsxs)("div",{className:"surecookie-content-mobile surecookie-banner-content "+("box"===S?"surecookie-banner-content-box":"surecookie-banner-content-banner"),children:[(0,f.jsxs)("div",{className:"surecookie-banner-text-wrapper",children:[x&&(0,f.jsx)("h3",{id:"surecookie-banner-heading",className:"surecookie-banner-heading",style:{color:C},children:x}),(0,f.jsx)("p",{id:"surecookie-banner-description",className:"surecookie-banner-description",style:{color:C},children:k}),"banner"===S&&!n.remove_branding&&(0,f.jsxs)("a",{href:E("banner_branding"),target:"_blank",rel:"noopener noreferrer",className:"surecookie-branding-mobile surecookie-branding",tabIndex:"-1","aria-label":(0,m.__)("Powered by SureCookie (opens in new tab)","surecookie"),children:[(0,f.jsx)("span",{"aria-hidden":"true",children:"Powered by"}),(0,f.jsx)(p,{width:"10",height:"12","aria-hidden":!0,focusable:"false"}),(0,f.jsx)("span",{"aria-hidden":"true",children:"SureCookie"})]})]}),(0,f.jsx)("div",{className:"surecookie-buttons-mobile surecookie-banner-buttons "+("box"===S?"surecookie-banner-buttons-box":"surecookie-banner-buttons-banner"),children:(()=>{const e={decline:(0,f.jsx)("button",{type:"button",className:"surecookie-decline-btn surecookie-button-mobile surecookie-btn-base",onClick:K,"aria-label":(0,m.__)("Decline all non-essential cookies","surecookie"),style:ee("#ffffff"),children:B},"decline"),preferences:(0,f.jsx)("button",{type:"button",className:"surecookie-preferences-btn surecookie-button-mobile surecookie-btn-base surecookie-btn-transparent surecookie-btn-font-semibold",onClick:Y,"aria-label":(0,m.__)("Manage cookie preferences","surecookie"),style:ee("var(--surecookie-banner-text-color, "+C+")"),children:q},"preferences"),accept:(0,f.jsx)("button",{type:"button",className:"surecookie-accept-btn surecookie-button-mobile surecookie-btn-base",onClick:G,"aria-label":(0,m.__)("Accept only essential cookies","surecookie"),style:ee("#ffffff"),children:M},"accept"),accept_all:O?(0,f.jsx)("button",{type:"button",className:"surecookie-accept-all-btn surecookie-button-mobile surecookie-btn-base",onClick:J,"aria-label":(0,m.__)("Accept all cookies","surecookie"),style:ee("#ffffff"),children:D},"accept_all"):null},t=U.map(t=>e[t]).filter(Boolean);return"banner"===S||n.remove_branding?t:[...t,(0,f.jsxs)("a",{href:E("preferences_modal_branding"),target:"_blank",rel:"noopener noreferrer",className:"surecookie-branding-mobile surecookie-branding","aria-label":(0,m.__)("Powered by SureCookie (opens in new tab)","surecookie"),children:[(0,f.jsx)("span",{"aria-hidden":"true",children:(0,m.__)("Powered by","surecookie")}),(0,f.jsx)(p,{width:"10",height:"12","aria-hidden":!0,focusable:"false"}),(0,f.jsx)("span",{"aria-hidden":"true",children:"SureCookie"})]},"branding")]})()})]})]})}),g&&w&&(0,h.applyFilters)("surecookie.floatingWidget",null,{publicSettings:n,showBanner:i,bannerEnabled:w}),(0,f.jsx)(Rx,{isOpen:s,onClose:X,onSave:Q,settings:{banner_bg_color:n.banner_bg_color,text_color:n.text_color,accept_btn_color:n.accept_btn_color,accept_btn_text_color:"#ffffff",decline_btn_color:n.decline_btn_color,decline_btn_text_color:"#ffffff",preferences_btn_text_color:n.text_color,decline_btn_border_color:n.decline_btn_border_color,cookie_categories:$,custom_cookies:H,remove_branding:n.remove_branding}})]})},Dx=new Set(["text/javascript","module","application/javascript","application/ecmascript","text/ecmascript","importmap","speculationrules"]);function Bx(e,t){const n=e.getAttribute(t);if(!n||"none"===n)return null;const r=n.toLowerCase().trim();return Dx.has(r)?r:null}"undefined"!=typeof window&&(window.surecookieManager=new class{constructor(){this.CONSENT_COOKIE_NAME="surecookie_user_consent",this.SESSION_COOKIE_NAME="surecookie_session_id",this.CONSENT_COOKIE_EXPIRY=365,this.SESSION_COOKIE_EXPIRY=365,this.consentData=null,this.sessionId=null,this.dynamicObserver=null,this.loadConsent(),this.loadOrCreateSessionId()}loadOrCreateSessionId(){const e=this.getCookie(this.SESSION_COOKIE_NAME);return e?this.sessionId=e:(this.sessionId=this.generateUUID(),this.setCookie(this.SESSION_COOKIE_NAME,this.sessionId,this.SESSION_COOKIE_EXPIRY)),this.sessionId}generateUUID(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.floor(16*Math.random());return("x"===e?t:t%4+8).toString(16)})}getSessionId(){return this.sessionId}loadConsent(){const e=this.getCookie(this.CONSENT_COOKIE_NAME);if(e)try{this.consentData=JSON.parse(decodeURIComponent(e))}catch(e){this.consentData=null}}saveConsent(e,t="custom"){const n=this.determineAction(e,t),r=this.consentData?JSON.stringify(this.consentData.preferences):null,i=this.consentData?this.consentData.action:null,o=null!==r&&r===JSON.stringify(e)&&i===n,s={preferences:e,action:n,timestamp:(new Date).toISOString()};this.consentData=s;const a=this.getConsentDuration(),c=encodeURIComponent(JSON.stringify(s));return this.setCookie(this.CONSENT_COOKIE_NAME,c,a),o||this.saveToDatabase(e,n),this.deleteDeclinedCookies(e),this.applyConsent(),this.updateGoogleConsent(e),this.updateWpConsentApi(e),setTimeout(()=>{this.triggerConsentChange(s)},0),s}updateGoogleConsent(e){if(!window.surecookiePublicSettings?.gcm_enabled||"function"!=typeof window.gtag)return;const t={ad_storage:e.marketing?"granted":"denied",ad_user_data:e.marketing?"granted":"denied",ad_personalization:e.marketing?"granted":"denied",personalization_storage:e.marketing?"granted":"denied",analytics_storage:e.analytics?"granted":"denied",functionality_storage:e.functional?"granted":"denied",security_storage:"granted"};window.gtag("consent","update",t),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"surecookie_consent_updated",consentState:t,surecookiePreferences:e}),window.dispatchEvent(new CustomEvent("surecookie_gcm_updated",{detail:{consentState:t,preferences:e,timestamp:Date.now()}}))}updateWpConsentApi(e){if("function"==typeof window.wp_set_consent)try{const t=window.surecookiePublicSettings?.wpConsentCategoryMap||{essential:"functional",functional:"preferences",analytics:"statistics",marketing:"marketing"},n=new Set;Object.entries(t).forEach(([t,r])=>{if(!(t in e))return;const i="essential"===t||e[t]?"allow":"deny";n.has(r)||(window.wp_set_consent(r,i),n.add(r))}),Object.keys(e).forEach(r=>{if(t[r])return;const i="marketing",o=e[r]?"allow":"deny";n.has(i)||(window.wp_set_consent(i,o),n.add(i))})}catch(e){console.error("SureCookie: WP Consent API sync failed",e)}}hasGlobalPrivacyControl(){return!0===navigator.globalPrivacyControl}getConsentDuration(){if(window.surecookiePublicSettings&&void 0!==window.surecookiePublicSettings.consent_duration_days){const e=parseInt(window.surecookiePublicSettings.consent_duration_days,10);if(!isNaN(e)&&e>=1&&e<=3650)return e}return 365}saveToDatabase(e,t){window.surecookiePublicSettings&&window.surecookiePublicSettings.consent_logging_enabled&&((e,t,n)=>O()({method:"POST",path:"/surecookie/v1/consent-logs/create-log",credentials:"same-origin",data:{preferences:JSON.stringify(e),action_type:t,session_id:n,consent_log_token:window.surecookiePublicSettings?.consent_log_token??""}}))(e,t,this.sessionId).then(e=>{if(!e.success)throw e}).catch(e=>{})}getConsent(){return this.consentData}hasConsent(){return null!==this.consentData}isAllowed(e){const t=window.surecookiePublicSettings?.consent_model||"opt-in";return this.consentData?!0===this.consentData.preferences[e]:"opt-out"===t||"essential"===e}acceptAll(e){const t={};return e.forEach(e=>{t[e.id]=!0}),this.saveConsent(t,"accepted")}declineAll(e){const t={};return e.forEach(e=>{"essential"===e.id?t[e.id]=!0:t[e.id]=!1}),this.saveConsent(t,"declined")}saveCustomPreferences(e){return this.saveConsent(e,"partially_accepted")}clearConsent(){this.deleteCookie(this.CONSENT_COOKIE_NAME),this.consentData=null,this.triggerConsentChange(null)}applyConsent(){const e=window.surecookiePublicSettings?.consent_model||"opt-in";this.reflowCollapsedPlaceholders(),this.consentData||"opt-out"===e?(document.querySelectorAll("script[data-consent]").forEach(e=>{const t=e.getAttribute("data-consent");this.isAllowed(t)&&this.executeScript(e)}),document.querySelectorAll('script[type="text/plain"][data-surecookie-category]').forEach(e=>{const t=e.getAttribute("data-surecookie-category");this.isAllowed(t)&&this.executeBlockedScript(e)}),document.querySelectorAll("iframe[data-surecookie-src], embed[data-surecookie-src]").forEach(e=>{const t=e.getAttribute("data-surecookie-category");this.isAllowed(t)&&this.loadBlockedSrcElement(e)}),document.querySelectorAll("object[data-surecookie-data]").forEach(e=>{const t=e.getAttribute("data-surecookie-category");this.isAllowed(t)&&this.loadBlockedObject(e)}),this.showPendingPlaceholders(),window.dispatchEvent(new CustomEvent("surecookie_applied",{detail:this.consentData}))):this.showPendingPlaceholders()}startDynamicObserver(){if(this.dynamicObserver)return;const e=e=>{1===e.nodeType&&("SCRIPT"===e.tagName&&"text/plain"===e.getAttribute("type")?.toLowerCase()&&e.hasAttribute("data-surecookie-category")?this.isAllowed(e.getAttribute("data-surecookie-category"))&&this.executeBlockedScript(e):"SCRIPT"===e.tagName&&e.hasAttribute("data-consent")?this.isAllowed(e.getAttribute("data-consent"))&&this.executeScript(e):"IFRAME"!==e.tagName&&"EMBED"!==e.tagName||!e.hasAttribute("data-surecookie-src")||!this.isAllowed(e.getAttribute("data-surecookie-category"))?"OBJECT"===e.tagName&&e.hasAttribute("data-surecookie-data")&&this.isAllowed(e.getAttribute("data-surecookie-category"))&&this.loadBlockedObject(e):this.loadBlockedSrcElement(e))};this.dynamicObserver=new MutationObserver(t=>{for(const n of t)for(const t of n.addedNodes)1===t.nodeType&&(t.classList?.contains("surecookie-placeholder")?this.reflowCollapsedPlaceholders(t.parentNode||document):this.reflowCollapsedPlaceholders(t),e(t),t.querySelectorAll?.("script[data-surecookie-category], script[data-consent], iframe[data-surecookie-src], embed[data-surecookie-src], object[data-surecookie-data]")?.forEach(e));this.hasConsent()&&this.areAllCategoriesAllowed()&&this.stopDynamicObserver()}),this.dynamicObserver.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("pagehide",()=>this.stopDynamicObserver(),{once:!0})}stopDynamicObserver(){this.dynamicObserver&&(this.dynamicObserver.disconnect(),this.dynamicObserver=null)}areAllCategoriesAllowed(){const e=window.surecookiePublicSettings?.cookie_categories||{},t=Object.values(e).map(e=>e.id);return 0!==t.length&&t.every(e=>this.isAllowed(e))}loadBlockedSrcElement(e){const t=e.getAttribute("data-surecookie-src");if(!t)return;e.setAttribute("src",t),e.style.display="",e.removeAttribute("data-surecookie-src"),e.removeAttribute("data-surecookie-name"),e.removeAttribute("data-surecookie-category");const n=e.closest(".surecookie-placeholder");n&&n.classList.add("surecookie-loaded")}loadBlockedObject(e){const t=e.getAttribute("data-surecookie-data");if(!t)return;e.querySelectorAll("param[data-surecookie-param-name]").forEach(e=>{const t=e.getAttribute("data-surecookie-param-name");t&&(e.setAttribute("name",t),e.removeAttribute("data-surecookie-param-name"))}),e.setAttribute("data",t),e.removeAttribute("data-surecookie-data"),e.removeAttribute("data-surecookie-name"),e.removeAttribute("data-surecookie-category"),e.style.display="";const n=e.cloneNode(!0);e.parentNode?.replaceChild(n,e);const r=n.closest(".surecookie-placeholder");r&&r.classList.add("surecookie-loaded")}showPendingPlaceholders(){document.querySelectorAll(".surecookie-placeholder:not(.surecookie-loaded)").forEach(e=>{e.classList.add("surecookie-pending")})}reflowCollapsedPlaceholders(e=document){const t=e.querySelectorAll?.(".surecookie-placeholder:not(.surecookie-reflowed)");if(!t||0===t.length)return;const n=[];t.forEach(e=>{const t=e.parentElement;if(!t||null===t.offsetParent)return;if(t.getBoundingClientRect().height>0)return;const r=parseInt(e.getAttribute("data-surecookie-width")||"0",10),i=parseInt(e.getAttribute("data-surecookie-height")||"0",10);!Number.isFinite(r)||!Number.isFinite(i)||r<=0||i<=0||n.push({ph:e,w:r,h:i})}),n.forEach(({ph:e,w:t,h:n})=>{e.style.position="relative",e.style.width="100%",e.style.maxWidth=t+"px",e.style.height="auto",e.style.aspectRatio=t+" / "+n,e.classList.add("surecookie-reflowed")})}acceptCategoryFromPlaceholder(e){if(!e)return;const t=window.surecookiePublicSettings?.cookie_categories||{},n=this.consentData?.preferences||{},r=window.surecookiePublicSettings?.consent_model||"opt-in",i={};let o="partially_accepted";"opt-out"===r?(Object.values(t).forEach(e=>{i[e.id]=!0}),o="accepted"):Object.values(t).forEach(t=>{"essential"===t.id||t.id===e?i[t.id]=!0:i[t.id]=n[t.id]||!1}),localStorage.setItem("surecookie_preferences",JSON.stringify(i)),this.saveConsent(i,o)}executeScript(e){const t=document.createElement("script");Array.from(e.attributes).forEach(e=>{"data-consent"!==e.name&&"type"!==e.name&&t.setAttribute(e.name,e.value)}),e.textContent&&(t.textContent=e.textContent);const n=Bx(e,"data-original-type");null!==n&&t.setAttribute("type",n),e.parentNode.replaceChild(t,e)}executeBlockedScript(e){const t=document.createElement("script");Array.from(e.attributes).forEach(e=>{"type"===e.name||e.name.startsWith("data-surecookie")||t.setAttribute(e.name,e.value)});const n=Bx(e,"data-surecookie-original-type");null!==n&&t.setAttribute("type",n);const r=e.getAttribute("data-surecookie-src");r?t.src=r:e.textContent&&(t.textContent=e.textContent),e.parentNode.replaceChild(t,e)}triggerConsentChange(e){window.dispatchEvent(new CustomEvent("surecookie_changed",{detail:e}))}setCookie(e,t,n){const r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3);let i=`${e}=${t};expires=${r.toUTCString()};path=/;SameSite=Lax`;"https:"===window.location.protocol&&(i+=";Secure"),document.cookie=i}getCookie(e){const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){let r=n[e];for(;" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return r.substring(t.length,r.length)}return null}deleteCookie(e){document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;`}deleteDeclinedCookies(e){const t=window.surecookiePublicSettings?.custom_cookies;if(!t)return;const n=Array.isArray(t)?t:Object.values(t);Object.keys(e).forEach(t=>{if(!e[t]&&"essential"!==t){n.filter(e=>e.category===t).forEach(e=>{this.deleteCookie(e.name)})}})}getConsentSummary(){if(!this.consentData)return"No consent given";const{action:e,timestamp:t,preferences:n}=this.consentData;return{action:e,timestamp:t,allowed:Object.keys(n).filter(e=>n[e]),preferences:n}}determineAction(e,t){if("accepted"===t||"declined"===t||"partially_accepted"===t||"custom"===t)return t;const n=Object.values(e);if(n.every(e=>!0===e))return"accepted";const r=n.every(e=>!1===e),i=Object.keys(e).every(t=>"essential"===t?!0===e[t]:!1===e[t]);return r||i?"declined":"partially_accepted"}initOnLoad(){this.applyConsent();const e=this.getConsent();if(e&&(this.updateGoogleConsent(e.preferences),this.updateWpConsentApi(e.preferences)),this.hasGlobalPrivacyControl()){const e={essential:!0,functional:!1,analytics:!1,marketing:!1};this.updateGoogleConsent(e),this.updateWpConsentApi(e)}this.startDynamicObserver()}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{window.surecookieManager.initOnLoad()}):window.surecookieManager.initOnLoad(),document.addEventListener("click",e=>{const t=e.target.closest(".surecookie-placeholder-button");if(t){const e=t.getAttribute("data-surecookie-category");e&&window.surecookieManager.acceptCategoryFromPlaceholder(e)}})),document.addEventListener("DOMContentLoaded",function(){const e=document.getElementById("surecookie-public-root");e&&(0,d.createRoot)(e).render((0,f.jsx)(Mx,{}))})})();
(()=>{"use strict";var e,r,_,t,a,n={},i={};function __webpack_require__(e){var r=i[e];if(void 0!==r)return r.exports;var _=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(_.exports,_,_.exports,__webpack_require__),_.loaded=!0,_.exports}__webpack_require__.m=n,e=[],__webpack_require__.O=(r,_,t,a)=>{if(!_){var n=1/0;for(b=0;b<e.length;b++){for(var[_,t,a]=e[b],i=!0,c=0;c<_.length;c++)(!1&a||n>=a)&&Object.keys(__webpack_require__.O).every(e=>__webpack_require__.O[e](_[c]))?_.splice(c--,1):(i=!1,a<n&&(n=a));if(i){e.splice(b--,1);var o=t();void 0!==o&&(r=o)}}return r}a=a||0;for(var b=e.length;b>0&&e[b-1][2]>a;b--)e[b]=e[b-1];e[b]=[_,t,a]},_=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var a=Object.create(null);__webpack_require__.r(a);var n={};r=r||[null,_({}),_([]),_(_)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~r.indexOf(i);i=_(i))Object.getOwnPropertyNames(i).forEach(r=>n[r]=()=>e[r]);return n.default=()=>e,__webpack_require__.d(a,n),a},__webpack_require__.d=(e,r)=>{for(var _ in r)__webpack_require__.o(r,_)&&!__webpack_require__.o(e,_)&&Object.defineProperty(e,_,{enumerable:!0,get:r[_]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce((r,_)=>(__webpack_require__.f[_](e,r),r),[])),__webpack_require__.u=e=>786===e?"397f2d183c19202777d6.bundle.min.js":216===e?"lightbox.570c05c5a283cfb6b223.bundle.min.js":30===e?"text-path.a67c1f3a78d208bc7e1b.bundle.min.js":131===e?"accordion.8b0db5058afeb74622f5.bundle.min.js":707===e?"alert.b4336601ffdb6086d1b5.bundle.min.js":457===e?"counter.12335f45aaa79d244f24.bundle.min.js":234===e?"progress.0ea083b809812c0e3aa1.bundle.min.js":575===e?"tabs.18344b05d8d1ea0702bc.bundle.min.js":775===e?"toggle.2a177a3ef4785d3dfbc5.bundle.min.js":180===e?"video.86d44e46e43d0807e708.bundle.min.js":177===e?"image-carousel.6167d20b95b33386757b.bundle.min.js":212===e?"text-editor.45609661e409413f1cef.bundle.min.js":211===e?"wp-audio.c9624cb6e5dc9de86abd.bundle.min.js":215===e?"nested-tabs.a2401356d329f179475e.bundle.min.js":915===e?"nested-accordion.294d40984397351fd0f5.bundle.min.js":1===e?"contact-buttons.e98d0220ce8c38404e7e.bundle.min.js":336===e?"floating-bars.740d06d17cea5cebdb61.bundle.min.js":557===e?"shared-frontend-handlers.03caa53373b56d3bab67.bundle.min.js":396===e?"shared-editor-handlers.cacdcbed391abf4b48b0.bundle.min.js":768===e?"container-editor-handlers.a2e8e48d28c5544fb183.bundle.min.js":77===e?"section-frontend-handlers.d85ab872da118940910d.bundle.min.js":220===e?"section-editor-handlers.53ffedef32043348b99b.bundle.min.js":304===e?"nested-title-keyboard-handler.2a67d3cc630e11815acc.bundle.min.js":void 0,__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},a="elementorFrontend:",__webpack_require__.l=(e,r,_,n)=>{if(t[e])t[e].push(r);else{var i,c;if(void 0!==_)for(var o=document.getElementsByTagName("script"),b=0;b<o.length;b++){var d=o[b];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==a+_){i=d;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",__webpack_require__.nc&&i.setAttribute("nonce",__webpack_require__.nc),i.setAttribute("data-webpack",a+_),i.src=e),t[e]=[r];var onScriptComplete=(r,_)=>{i.onerror=i.onload=null,clearTimeout(u);var a=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach(e=>e(_)),r)return r(_)},u=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=onScriptComplete.bind(null,i.onerror),i.onload=onScriptComplete.bind(null,i.onload),c&&document.head.appendChild(i)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var r=__webpack_require__.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var _=r.getElementsByTagName("script");if(_.length)for(var t=_.length-1;t>-1&&(!e||!/^http(s?):/.test(e));)e=_[t--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{var e={76:0};__webpack_require__.f.j=(r,_)=>{var t=__webpack_require__.o(e,r)?e[r]:void 0;if(0!==t)if(t)_.push(t[2]);else if(76!=r){var a=new Promise((_,a)=>t=e[r]=[_,a]);_.push(t[2]=a);var n=__webpack_require__.p+__webpack_require__.u(r),i=new Error;__webpack_require__.l(n,_=>{if(__webpack_require__.o(e,r)&&(0!==(t=e[r])&&(e[r]=void 0),t)){var a=_&&("load"===_.type?"missing":_.type),n=_&&_.target&&_.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+n+")",i.name="ChunkLoadError",i.type=a,i.request=n,t[1](i)}},"chunk-"+r,r)}else e[r]=0},__webpack_require__.O.j=r=>0===e[r];var webpackJsonpCallback=(r,_)=>{var t,a,[n,i,c]=_,o=0;if(n.some(r=>0!==e[r])){for(t in i)__webpack_require__.o(i,t)&&(__webpack_require__.m[t]=i[t]);if(c)var b=c(__webpack_require__)}for(r&&r(_);o<n.length;o++)a=n[o],__webpack_require__.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return __webpack_require__.O(b)},r=self.webpackChunkelementorFrontend=self.webpackChunkelementorFrontend||[];r.forEach(webpackJsonpCallback.bind(null,0)),r.push=webpackJsonpCallback.bind(null,r.push.bind(r))})()})();
(self.webpackChunkelementorFrontend=self.webpackChunkelementorFrontend||[]).push([[941],{1:(e,t,r)=>{"use strict";var n=r(5578),i=r(7255),s=r(5755),o=r(1866),a=r(6029),c=r(5022),l=n.Symbol,u=i("wks"),p=c?l.for||l:l&&l.withoutSetter||o;e.exports=function(e){return s(u,e)||(u[e]=a&&s(l,e)?l[e]:p("Symbol."+e)),u[e]}},41:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},169:(e,t,r)=>{"use strict";var n=r(4762),i=r(8473),s=r(1483),o=r(5755),a=r(382),c=r(2048).CONFIGURABLE,l=r(7268),u=r(4483),p=u.enforce,d=u.get,h=String,f=Object.defineProperty,g=n("".slice),m=n("".replace),v=n([].join),y=a&&!i(function(){return 8!==f(function(){},"length",{value:8}).length}),w=String(String).split("String"),b=e.exports=function(e,t,r){"Symbol("===g(h(t),0,7)&&(t="["+m(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!o(e,"name")||c&&e.name!==t)&&(a?f(e,"name",{value:t,configurable:!0}):e.name=t),y&&r&&o(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?a&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=p(e);return o(n,"source")||(n.source=v(w,"string"==typeof t?t:"")),e};Function.prototype.toString=b(function toString(){return s(this)&&d(this).source||l(this)},"toString")},274:(e,t,r)=>{"use strict";var n=r(8473);e.exports=!n(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},348:(e,t,r)=>{"use strict";var n=r(1807),i=r(1483),s=r(1704),o=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&i(r=e.toString)&&!s(a=n(r,e)))return a;if(i(r=e.valueOf)&&!s(a=n(r,e)))return a;if("string"!==t&&i(r=e.toString)&&!s(a=n(r,e)))return a;throw new o("Can't convert object to primitive value")}},382:(e,t,r)=>{"use strict";var n=r(8473);e.exports=!n(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},641:(e,t,r)=>{"use strict";r(5724),r(4846),r(7458),r(9655);const Module=function(){const e=jQuery,t=arguments,r=this,n={};let i;this.getItems=function(e,t){if(t){const r=t.split("."),n=r.splice(0,1);if(!r.length)return e[n];if(!e[n])return;return this.getItems(e[n],r.join("."))}return e},this.getSettings=function(e){return this.getItems(i,e)},this.setSettings=function(t,n,s){if(s||(s=i),"object"==typeof t)return e.extend(s,t),r;const o=t.split("."),a=o.splice(0,1);return o.length?(s[a]||(s[a]={}),r.setSettings(o.join("."),n,s[a])):(s[a]=n,r)},this.getErrorMessage=function(e,t){let r;if("forceMethodImplementation"===e)r=`The method '${t}' must to be implemented in the inheritor child.`;else r="An error occurs";return r},this.forceMethodImplementation=function(e){throw new Error(this.getErrorMessage("forceMethodImplementation",e))},this.on=function(t,i){if("object"==typeof t)return e.each(t,function(e){r.on(e,this)}),r;return t.split(" ").forEach(function(e){n[e]||(n[e]=[]),n[e].push(i)}),r},this.off=function(e,t){if(!n[e])return r;if(!t)return delete n[e],r;const i=n[e].indexOf(t);return-1!==i&&(delete n[e][i],n[e]=n[e].filter(e=>e)),r},this.trigger=function(t){const i="on"+t[0].toUpperCase()+t.slice(1),s=Array.prototype.slice.call(arguments,1);r[i]&&r[i].apply(r,s);const o=n[t];return o?(e.each(o,function(e,t){t.apply(r,s)}),r):r},r.__construct.apply(r,t),e.each(r,function(e){const t=r[e];"function"==typeof t&&(r[e]=function(){return t.apply(r,arguments)})}),function(){i=r.getDefaultSettings();const n=t[0];n&&e.extend(!0,i,n)}(),r.trigger("init")};Module.prototype.__construct=function(){},Module.prototype.getDefaultSettings=function(){return{}},Module.prototype.getConstructorID=function(){return this.constructor.name},Module.extend=function(e){const t=jQuery,r=this,child=function(){return r.apply(this,arguments)};return t.extend(child,r),(child.prototype=Object.create(t.extend({},r.prototype,e))).constructor=child,child.__super__=r.prototype,child},e.exports=Module},670:(e,t,r)=>{"use strict";var n=r(382),i=r(5835),s=r(7738);e.exports=function(e,t,r){n?i.f(e,t,s(0,r)):e[t]=r}},751:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(5724),r(4846),r(9655);class InstanceType{static[Symbol.hasInstance](e){let t=super[Symbol.hasInstance](e);if(e&&!e.constructor.getInstanceType)return t;if(e&&(e.instanceTypes||(e.instanceTypes=[]),t||this.getInstanceType()===e.constructor.getInstanceType()&&(t=!0),t)){const t=this.getInstanceType===InstanceType.getInstanceType?"BaseInstanceType":this.getInstanceType();-1===e.instanceTypes.indexOf(t)&&e.instanceTypes.push(t)}return!t&&e&&(t=e.instanceTypes&&Array.isArray(e.instanceTypes)&&-1!==e.instanceTypes.indexOf(this.getInstanceType())),t}static getInstanceType(){elementorModules.ForceMethodImplementation()}constructor(){let e=new.target;const t=[];for(;e.__proto__&&e.__proto__.name;)t.push(e.__proto__),e=e.__proto__;t.reverse().forEach(e=>this instanceof e)}}t.default=InstanceType},1091:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},1265:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(641)),s=n(r(2425)),o=n(r(2946)),a=n(r(3980)),c=n(r(2970)),l=n(r(8685)),u=r(9031),p=r(1462);const d={Module:i.default,ViewModule:s.default,ArgsObject:o.default,ForceMethodImplementation:l.default,utils:{Masonry:a.default,Scroll:c.default},importExport:{createGetInitialState:u.createGetInitialState,customizationDialogsRegistry:p.customizationDialogsRegistry}};window.elementorModules?Object.assign(window.elementorModules,d):window.elementorModules=d;t.default=window.elementorModules},1278:(e,t,r)=>{"use strict";var n=r(4762),i=n({}.toString),s=n("".slice);e.exports=function(e){return s(i(e),8,-1)}},1409:(e,t,r)=>{"use strict";var n=r(5578),i=r(1483);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},1423:(e,t,r)=>{"use strict";var n=r(1409),i=r(1483),s=r(4815),o=r(5022),a=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&s(t.prototype,a(e))}},1462:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.customizationDialogsRegistry=void 0;var n=r(7958);t.customizationDialogsRegistry=new n.BaseRegistry},1483:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},1506:(e,t,r)=>{"use strict";var n=r(2914),i=r(1807),s=r(2293),o=r(8761),a=r(5299),c=r(6960),l=r(4815),u=r(4887),p=r(6665),d=r(6721),h=TypeError,Result=function(e,t){this.stopped=e,this.result=t},f=Result.prototype;e.exports=function(e,t,r){var g,m,v,y,w,b,S,x=r&&r.that,E=!(!r||!r.AS_ENTRIES),I=!(!r||!r.IS_RECORD),_=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),O=n(t,x),stop=function(e){return g&&d(g,"normal"),new Result(!0,e)},callFn=function(e){return E?(s(e),C?O(e[0],e[1],stop):O(e[0],e[1])):C?O(e,stop):O(e)};if(I)g=e.iterator;else if(_)g=e;else{if(!(m=p(e)))throw new h(o(e)+" is not iterable");if(a(m)){for(v=0,y=c(e);y>v;v++)if((w=callFn(e[v]))&&l(f,w))return w;return new Result(!1)}g=u(e,m)}for(b=I?e.next:g.next;!(S=i(b,g)).done;){try{w=callFn(S.value)}catch(e){d(g,"throw",e)}if("object"==typeof w&&w&&l(f,w))return w}return new Result(!1)}},1507:e=>{"use strict";e.exports={}},1703:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function trunc(e){var n=+e;return(n>0?r:t)(n)}},1704:(e,t,r)=>{"use strict";var n=r(1483);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},1799:(e,t,r)=>{"use strict";var n=r(382),i=r(8473),s=r(3145);e.exports=!n&&!i(function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},1807:(e,t,r)=>{"use strict";var n=r(274),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},1831:(e,t,r)=>{"use strict";var n=r(9557),i=r(5578),s=r(2095),o="__core-js_shared__",a=e.exports=i[o]||s(o,{});(a.versions||(a.versions=[])).push({version:"3.46.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"})},1851:(e,t,r)=>{"use strict";var n,i,s,o=r(8473),a=r(1483),c=r(1704),l=r(5290),u=r(3181),p=r(7914),d=r(1),h=r(9557),f=d("iterator"),g=!1;[].keys&&("next"in(s=[].keys())?(i=u(u(s)))!==Object.prototype&&(n=i):g=!0),!c(n)||o(function(){var e={};return n[f].call(e)!==e})?n={}:h&&(n=l(n)),a(n[f])||p(n,f,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},1866:(e,t,r)=>{"use strict";var n=r(4762),i=0,s=Math.random(),o=n(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+s,36)}},1975:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(8120),o=r(2293),a=r(41),c=r(8660),l=r(8901),u=r(9557),p=r(6721),d=r(7486),h=r(5267),f=!u&&!d("filter",function(){}),g=!u&&!f&&h("filter",TypeError),m=u||f||g,v=c(function(){for(var e,t,r=this.iterator,n=this.predicate,s=this.next;;){if(e=o(i(s,r)),this.done=!!e.done)return;if(t=e.value,l(r,n,[t,this.counter++],!0))return t}});n({target:"Iterator",proto:!0,real:!0,forced:m},{filter:function filter(e){o(this);try{s(e)}catch(e){p(this,"throw",e)}return g?i(g,this,e):new v(a(this),{predicate:e})}})},1983:(e,t,r)=>{"use strict";var n=r(6721);e.exports=function(e,t,r){for(var i=e.length-1;i>=0;i--)if(void 0!==e[i])try{r=n(e[i].iterator,t,r)}catch(e){t="throw",r=e}if("throw"===t)throw r;return r}},2048:(e,t,r)=>{"use strict";var n=r(382),i=r(5755),s=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,a=i(s,"name"),c=a&&"something"===function something(){}.name,l=a&&(!n||n&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:l}},2095:(e,t,r)=>{"use strict";var n=r(5578),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},2121:(e,t,r)=>{"use strict";var n=r(4762),i=r(8473),s=r(1278),o=Object,a=n("".split);e.exports=i(function(){return!o("z").propertyIsEnumerable(0)})?function(e){return"String"===s(e)?a(e,""):o(e)}:o},2278:(e,t,r)=>{"use strict";var n=r(6742),i=r(4741).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return n(e,i)}},2293:(e,t,r)=>{"use strict";var n=r(1704),i=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not an object")}},2313:(e,t,r)=>{"use strict";var n=r(7914);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},2347:(e,t,r)=>{"use strict";var n=r(3312),i=Object;e.exports=function(e){return i(n(e))}},2355:(e,t,r)=>{"use strict";var n=r(1807),i=r(1704),s=r(1423),o=r(2564),a=r(348),c=r(1),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!i(e)||s(e))return e;var r,c=o(e,u);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!i(r)||s(r))return r;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},2425:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(641));t.default=i.default.extend({elements:null,getDefaultElements:()=>({}),bindEvents(){},onInit(){this.initElements(),this.bindEvents()},initElements(){this.elements=this.getDefaultElements()}})},2564:(e,t,r)=>{"use strict";var n=r(8120),i=r(5983);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},2811:(e,t,r)=>{"use strict";var n=r(1409);e.exports=n("document","documentElement")},2890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(4846),r(6211);class _default extends elementorModules.ViewModule{getDefaultSettings(){return{selectors:{elements:".elementor-element",nestedDocumentElements:".elementor .elementor-element"},classes:{editMode:"elementor-edit-mode"}}}getDefaultElements(){const e=this.getSettings("selectors");return{$elements:this.$element.find(e.elements).not(this.$element.find(e.nestedDocumentElements))}}getDocumentSettings(e){let t;if(this.isEdit){t={};const e=elementor.settings.page.model;jQuery.each(e.getActiveControls(),r=>{t[r]=e.attributes[r]})}else t=this.$element.data("elementor-settings")||{};return this.getItems(t,e)}runElementsHandlers(){this.elements.$elements.each((e,t)=>setTimeout(()=>elementorFrontend.elementsHandler.runReadyTrigger(t)))}onInit(){this.$element=this.getSettings("$element"),super.onInit(),this.isEdit=this.$element.hasClass(this.getSettings("classes.editMode")),this.isEdit?elementor.on("document:loaded",()=>{elementor.settings.page.model.on("change",this.onSettingsChange.bind(this))}):this.runElementsHandlers()}onSettingsChange(){}}t.default=_default},2914:(e,t,r)=>{"use strict";var n=r(3786),i=r(8120),s=r(274),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:s?o(e,t):function(){return e.apply(t,arguments)}}},2946:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(751)),s=n(r(5213));class ArgsObject extends i.default{static getInstanceType(){return"ArgsObject"}constructor(e){super(),this.args=e}requireArgument(e,t=this.args){if(!Object.prototype.hasOwnProperty.call(t,e))throw Error(`${e} is required.`)}requireArgumentType(e,t,r=this.args){if(this.requireArgument(e,r),typeof r[e]!==t)throw Error(`${e} invalid type: ${t}.`)}requireArgumentInstance(e,t,r=this.args){if(this.requireArgument(e,r),!(r[e]instanceof t||(0,s.default)(r[e],t)))throw Error(`${e} invalid instance.`)}requireArgumentConstructor(e,t,r=this.args){if(this.requireArgument(e,r),r[e].constructor.toString()!==t.prototype.constructor.toString())throw Error(`${e} invalid constructor type.`)}}t.default=ArgsObject},2970:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(5724);t.default=class Scroll{static scrollObserver(e){let t=0;const r={root:e.root||null,rootMargin:e.offset||"0px",threshold:((e=0)=>{const t=[];if(e>0&&e<=100){const r=100/e;for(let e=0;e<=100;e+=r)t.push(e/100)}else t.push(0);return t})(e.sensitivity)};return new IntersectionObserver(function handleIntersect(r){const n=r[0].boundingClientRect.y,i=r[0].isIntersecting,s=n<t?"down":"up",o=Math.abs(parseFloat((100*r[0].intersectionRatio).toFixed(2)));e.callback({sensitivity:e.sensitivity,isInViewport:i,scrollPercentage:o,intersectionScrollDirection:s}),t=n},r)}static getElementViewportPercentage(e,t={}){const r=e[0].getBoundingClientRect(),n=t.start||0,i=t.end||0,s=window.innerHeight*n/100,o=window.innerHeight*i/100,a=r.top-window.innerHeight,c=0-a+s,l=r.top+s+e.height()-a+o,u=Math.max(0,Math.min(c/l,1));return parseFloat((100*u).toFixed(2))}static getPageScrollPercentage(e={},t){const r=e.start||0,n=e.end||0,i=t||document.documentElement.scrollHeight-document.documentElement.clientHeight,s=i*r/100,o=i+s+i*n/100;return(document.documentElement.scrollTop+document.body.scrollTop+s)/o*100}}},3005:(e,t,r)=>{"use strict";var n=r(1703);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},3145:(e,t,r)=>{"use strict";var n=r(5578),i=r(1704),s=n.document,o=i(s)&&i(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},3181:(e,t,r)=>{"use strict";var n=r(5755),i=r(1483),s=r(2347),o=r(5409),a=r(9441),c=o("IE_PROTO"),l=Object,u=l.prototype;e.exports=a?l.getPrototypeOf:function(e){var t=s(e);if(n(t,c))return t[c];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof l?u:null}},3242:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(1506),o=r(8120),a=r(2293),c=r(41),l=r(6721),u=r(5267)("find",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:u},{find:function find(e){a(this);try{o(e)}catch(e){l(this,"throw",e)}if(u)return i(u,this,e);var t=c(this),r=0;return s(t,function(t,n){if(e(t,r++))return n(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},3312:(e,t,r)=>{"use strict";var n=r(5983),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},3392:(e,t,r)=>{"use strict";var n=r(3005),i=Math.max,s=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):s(r,t)}},3617:(e,t,r)=>{"use strict";var n=r(8612),i=r(5578),s=r(6021),o=r(2293),a=r(1483),c=r(3181),l=r(3864),u=r(670),p=r(8473),d=r(5755),h=r(1),f=r(1851).IteratorPrototype,g=r(382),m=r(9557),v="constructor",y="Iterator",w=h("toStringTag"),b=TypeError,S=i[y],x=m||!a(S)||S.prototype!==f||!p(function(){S({})}),E=function Iterator(){if(s(this,f),c(this)===f)throw new b("Abstract class Iterator not directly constructable")},defineIteratorPrototypeAccessor=function(e,t){g?l(f,e,{configurable:!0,get:function(){return t},set:function(t){if(o(this),this===f)throw new b("You can't redefine this property");d(this,e)?this[e]=t:u(this,e,t)}}):f[e]=t};d(f,w)||defineIteratorPrototypeAccessor(w,y),!x&&d(f,v)&&f[v]!==Object||defineIteratorPrototypeAccessor(v,E),E.prototype=f,n({global:!0,constructor:!0,forced:x},{Iterator:E})},3658:(e,t,r)=>{"use strict";var n=r(6742),i=r(4741);e.exports=Object.keys||function keys(e){return n(e,i)}},3786:(e,t,r)=>{"use strict";var n=r(1278),i=r(4762);e.exports=function(e){if("Function"===n(e))return i(e)}},3815:(e,t,r)=>{"use strict";var n=r(2355),i=r(1423);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},3864:(e,t,r)=>{"use strict";var n=r(169),i=r(5835);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},3896:(e,t,r)=>{"use strict";var n=r(382),i=r(8473);e.exports=n&&i(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},3980:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(5724);var i=n(r(2425));t.default=i.default.extend({getDefaultSettings:()=>({container:null,items:null,columnsCount:3,verticalSpaceBetween:30}),getDefaultElements(){return{$container:jQuery(this.getSettings("container")),$items:jQuery(this.getSettings("items"))}},run(){var e=[],t=this.elements.$container.position().top,r=this.getSettings(),n=r.columnsCount;t+=parseInt(this.elements.$container.css("margin-top"),10),this.elements.$items.each(function(i){var s=Math.floor(i/n),o=jQuery(this),a=o[0].getBoundingClientRect().height+r.verticalSpaceBetween;if(s){var c=o.position(),l=i%n,u=c.top-t-e[l];u-=parseInt(o.css("margin-top"),10),u*=-1,o.css("margin-top",u+"px"),e[l]+=a}else e.push(a)})}})},3991:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(8120),o=r(2293),a=r(41),c=r(8660),l=r(8901),u=r(6721),p=r(7486),d=r(5267),h=r(9557),f=!h&&!p("map",function(){}),g=!h&&!f&&d("map",TypeError),m=h||f||g,v=c(function(){var e=this.iterator,t=o(i(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)});n({target:"Iterator",proto:!0,real:!0,forced:m},{map:function map(e){o(this);try{s(e)}catch(e){u(this,"throw",e)}return g?i(g,this,e):new v(a(this),{mapper:e})}})},4338:(e,t,r)=>{"use strict";var n={};n[r(1)("toStringTag")]="z",e.exports="[object z]"===String(n)},4347:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},4364:(e,t,r)=>{"use strict";r(3991)},4483:(e,t,r)=>{"use strict";var n,i,s,o=r(4644),a=r(5578),c=r(1704),l=r(9037),u=r(5755),p=r(1831),d=r(5409),h=r(1507),f="Object already initialized",g=a.TypeError,m=a.WeakMap;if(o||p.state){var v=p.state||(p.state=new m);v.get=v.get,v.has=v.has,v.set=v.set,n=function(e,t){if(v.has(e))throw new g(f);return t.facade=e,v.set(e,t),t},i=function(e){return v.get(e)||{}},s=function(e){return v.has(e)}}else{var y=d("state");h[y]=!0,n=function(e,t){if(u(e,y))throw new g(f);return t.facade=e,l(e,y,t),t},i=function(e){return u(e,y)?e[y]:{}},s=function(e){return u(e,y)}}e.exports={set:n,get:i,has:s,enforce:function(e){return s(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=i(t)).type!==e)throw new g("Incompatible receiver, "+e+" required");return r}}}},4644:(e,t,r)=>{"use strict";var n=r(5578),i=r(1483),s=n.WeakMap;e.exports=i(s)&&/native code/.test(String(s))},4741:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},4762:(e,t,r)=>{"use strict";var n=r(274),i=Function.prototype,s=i.call,o=n&&i.bind.bind(s,s);e.exports=n?o:function(e){return function(){return s.apply(e,arguments)}}},4815:(e,t,r)=>{"use strict";var n=r(4762);e.exports=n({}.isPrototypeOf)},4846:(e,t,r)=>{"use strict";r(3617)},4887:(e,t,r)=>{"use strict";var n=r(1807),i=r(8120),s=r(2293),o=r(8761),a=r(6665),c=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(i(r))return s(n(r,e));throw new c(o(e)+" is not iterable")}},4914:(e,t,r)=>{"use strict";var n=r(1278);e.exports=Array.isArray||function isArray(e){return"Array"===n(e)}},4946:(e,t,r)=>{"use strict";var n=r(6784),i=n(r(1265)),s=n(r(2890)),o=n(r(7955)),a=n(r(8140)),c=n(r(7224)),l=n(r(5633)),u=n(r(9603));i.default.frontend={Document:s.default,tools:{StretchElement:o.default},handlers:{Base:c.default,StretchedElement:a.default,SwiperBase:l.default,CarouselBase:u.default}}},4961:(e,t,r)=>{"use strict";var n=r(382),i=r(1807),s=r(7611),o=r(7738),a=r(5599),c=r(3815),l=r(5755),u=r(1799),p=Object.getOwnPropertyDescriptor;t.f=n?p:function getOwnPropertyDescriptor(e,t){if(e=a(e),t=c(t),u)try{return p(e,t)}catch(e){}if(l(e,t))return o(!i(s.f,e,t),e[t])}},5022:(e,t,r)=>{"use strict";var n=r(6029);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5213:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=(e,t)=>{t=Array.isArray(t)?t:[t];for(const r of t)if(e.constructor.name===r.prototype[Symbol.toStringTag])return!0;return!1}},5247:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},5267:(e,t,r)=>{"use strict";var n=r(5578);e.exports=function(e,t){var r=n.Iterator,i=r&&r.prototype,s=i&&i[e],o=!1;if(s)try{s.call({next:function(){return{done:!0}},return:function(){o=!0}},-1)}catch(e){e instanceof t||(o=!1)}if(!o)return s}},5290:(e,t,r)=>{"use strict";var n,i=r(2293),s=r(5799),o=r(4741),a=r(1507),c=r(2811),l=r(3145),u=r(5409),p="prototype",d="script",h=u("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"<"+d+">"+e+"</"+d+">"},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObject=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;NullProtoObject="undefined"!=typeof document?document.domain&&n?NullProtoObjectViaActiveX(n):(t=l("iframe"),r="java"+d+":",t.style.display="none",c.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F):NullProtoObjectViaActiveX(n);for(var i=o.length;i--;)delete NullProtoObject[p][o[i]];return NullProtoObject()};a[h]=!0,e.exports=Object.create||function create(e,t){var r;return null!==e?(EmptyConstructor[p]=i(e),r=new EmptyConstructor,EmptyConstructor[p]=null,r[h]=e):r=NullProtoObject(),void 0===t?r:s.f(r,t)}},5299:(e,t,r)=>{"use strict";var n=r(1),i=r(6775),s=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[s]===e)}},5409:(e,t,r)=>{"use strict";var n=r(7255),i=r(1866),s=n("keys");e.exports=function(e){return s[e]||(s[e]=i(e))}},5578:function(e,t,r){"use strict";var check=function(e){return e&&e.Math===Math&&e};e.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof r.g&&r.g)||check("object"==typeof this&&this)||function(){return this}()||Function("return this")()},5599:(e,t,r)=>{"use strict";var n=r(2121),i=r(3312);e.exports=function(e){return n(i(e))}},5633:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(r(7224));class SwiperHandlerBase extends i.default{getInitialSlide(){const e=this.getEditSettings();return e.activeItemIndex?e.activeItemIndex-1:0}getSlidesCount(){return this.elements.$slides.length}togglePauseOnHover(e){e?this.elements.$swiperContainer.on({mouseenter:()=>{this.swiper.autoplay.stop()},mouseleave:()=>{this.swiper.autoplay.start()}}):this.elements.$swiperContainer.off("mouseenter mouseleave")}handleKenBurns(){const e=this.getSettings();this.$activeImageBg&&this.$activeImageBg.removeClass(e.classes.kenBurnsActive),this.activeItemIndex=this.swiper?this.swiper.activeIndex:this.getInitialSlide(),this.swiper?this.$activeImageBg=jQuery(this.swiper.slides[this.activeItemIndex]).children("."+e.classes.slideBackground):this.$activeImageBg=jQuery(this.elements.$slides[0]).children("."+e.classes.slideBackground),this.$activeImageBg.addClass(e.classes.kenBurnsActive)}}t.default=SwiperHandlerBase},5724:(e,t,r)=>{"use strict";var n=r(8612),i=r(2347),s=r(6960),o=r(9273),a=r(1091);n({target:"Array",proto:!0,arity:1,forced:r(8473)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function push(e){var t=i(this),r=s(t),n=arguments.length;a(r+n);for(var c=0;c<n;c++)t[r]=arguments[c],r++;return o(t,r),r}})},5755:(e,t,r)=>{"use strict";var n=r(4762),i=r(2347),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return s(i(e),t)}},5799:(e,t,r)=>{"use strict";var n=r(382),i=r(3896),s=r(5835),o=r(2293),a=r(5599),c=r(3658);t.f=n&&!i?Object.defineProperties:function defineProperties(e,t){o(e);for(var r,n=a(t),i=c(t),l=i.length,u=0;l>u;)s.f(e,r=i[u++],n[r]);return e}},5835:(e,t,r)=>{"use strict";var n=r(382),i=r(1799),s=r(3896),o=r(2293),a=r(3815),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p="enumerable",d="configurable",h="writable";t.f=n?s?function defineProperty(e,t,r){if(o(e),t=a(t),o(r),"function"==typeof e&&"prototype"===t&&"value"in r&&h in r&&!r[h]){var n=u(e,t);n&&n[h]&&(e[t]=r.value,r={configurable:d in r?r[d]:n[d],enumerable:p in r?r[p]:n[p],writable:!1})}return l(e,t,r)}:l:function defineProperty(e,t,r){if(o(e),t=a(t),o(r),i)try{return l(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},5983:e=>{"use strict";e.exports=function(e){return null==e}},6021:(e,t,r)=>{"use strict";var n=r(4815),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},6029:(e,t,r)=>{"use strict";var n=r(6477),i=r(8473),s=r(5578).String;e.exports=!!Object.getOwnPropertySymbols&&!i(function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},6145:(e,t,r)=>{"use strict";var n=r(4338),i=r(1483),s=r(1278),o=r(1)("toStringTag"),a=Object,c="Arguments"===s(function(){return arguments}());e.exports=n?s:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=a(e),o))?r:c?s(t):"Object"===(n=s(t))&&i(t.callee)?"Arguments":n}},6211:(e,t,r)=>{"use strict";r(3242)},6477:(e,t,r)=>{"use strict";var n,i,s=r(5578),o=r(9461),a=s.process,c=s.Deno,l=a&&a.versions||c&&c.version,u=l&&l.v8;u&&(i=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},6651:(e,t,r)=>{"use strict";var n=r(5599),i=r(3392),s=r(6960),createMethod=function(e){return function(t,r,o){var a=n(t),c=s(a);if(0===c)return!e&&-1;var l,u=i(o,c);if(e&&r!=r){for(;c>u;)if((l=a[u++])!=l)return!0}else for(;c>u;u++)if((e||u in a)&&a[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},6665:(e,t,r)=>{"use strict";var n=r(6145),i=r(2564),s=r(5983),o=r(6775),a=r(1)("iterator");e.exports=function(e){if(!s(e))return i(e,a)||i(e,"@@iterator")||o[n(e)]}},6721:(e,t,r)=>{"use strict";var n=r(1807),i=r(2293),s=r(2564);e.exports=function(e,t,r){var o,a;i(e);try{if(!(o=s(e,"return"))){if("throw"===t)throw r;return r}o=n(o,e)}catch(e){a=!0,o=e}if("throw"===t)throw r;if(a)throw o;return i(o),r}},6726:(e,t,r)=>{"use strict";var n=r(5755),i=r(9497),s=r(4961),o=r(5835);e.exports=function(e,t,r){for(var a=i(t),c=o.f,l=s.f,u=0;u<a.length;u++){var p=a[u];n(e,p)||r&&n(r,p)||c(e,p,l(t,p))}}},6742:(e,t,r)=>{"use strict";var n=r(4762),i=r(5755),s=r(5599),o=r(6651).indexOf,a=r(1507),c=n([].push);e.exports=function(e,t){var r,n=s(e),l=0,u=[];for(r in n)!i(a,r)&&i(n,r)&&c(u,r);for(;t.length>l;)i(n,r=t[l++])&&(~o(u,r)||c(u,r));return u}},6775:e=>{"use strict";e.exports={}},6784:e=>{e.exports=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},6960:(e,t,r)=>{"use strict";var n=r(8324);e.exports=function(e){return n(e.length)}},7224:(e,t,r)=>{"use strict";r(5724),r(4846),r(7458),r(6211),r(9655),e.exports=elementorModules.ViewModule.extend({$element:null,editorListeners:null,onElementChange:null,onEditSettingsChange:null,onPageSettingsChange:null,isEdit:null,__construct(e){this.isActive(e)&&(this.$element=e.$element,this.isEdit=this.$element.hasClass("elementor-element-edit-mode"),this.isEdit&&this.addEditorListeners())},isActive:()=>!0,isElementInTheCurrentDocument(){return!!elementorFrontend.isEditMode()&&elementor.documents.currentDocument.id.toString()===this.$element[0].closest(".elementor").dataset.elementorId},findElement(e){var t=this.$element;return t.find(e).filter(function(){return jQuery(this).parent().closest(".elementor-element").is(t)})},getUniqueHandlerID(e,t){return e||(e=this.getModelCID()),t||(t=this.$element),e+t.attr("data-element_type")+this.getConstructorID()},initEditorListeners(){var e=this;if(e.editorListeners=[{event:"element:destroy",to:elementor.channels.data,callback(t){t.cid===e.getModelCID()&&e.onDestroy()}}],e.onElementChange){const t=e.getWidgetType()||e.getElementType();let r="change";"global"!==t&&(r+=":"+t),e.editorListeners.push({event:r,to:elementor.channels.editor,callback(t,r){e.getUniqueHandlerID(r.model.cid,r.$el)===e.getUniqueHandlerID()&&e.onElementChange(t.model.get("name"),t,r)}})}e.onEditSettingsChange&&e.editorListeners.push({event:"change:editSettings",to:elementor.channels.editor,callback(t,r){if(r.model.cid!==e.getModelCID())return;const n=Object.keys(t.changed)[0];e.onEditSettingsChange(n,t.changed[n])}}),["page"].forEach(function(t){var r="on"+t[0].toUpperCase()+t.slice(1)+"SettingsChange";e[r]&&e.editorListeners.push({event:"change",to:elementor.settings[t].model,callback(t){e[r](t.changed)}})})},getEditorListeners(){return this.editorListeners||this.initEditorListeners(),this.editorListeners},addEditorListeners(){var e=this.getUniqueHandlerID();this.getEditorListeners().forEach(function(t){elementorFrontend.addListenerOnce(e,t.event,t.callback,t.to)})},removeEditorListeners(){var e=this.getUniqueHandlerID();this.getEditorListeners().forEach(function(t){elementorFrontend.removeListeners(e,t.event,null,t.to)})},getElementType(){return this.$element.data("element_type")},getWidgetType(){const e=this.$element.data("widget_type");if(e)return e.split(".")[0]},getID(){return this.$element.data("id")},getModelCID(){return this.$element.data("model-cid")},getElementSettings(e){let t={};const r=this.getModelCID();if(this.isEdit&&r){const e=elementorFrontend.config.elements.data[r],n=e.attributes;let i=n.widgetType||n.elType;n.isInner&&(i="inner-"+i);let s=elementorFrontend.config.elements.keys[i];s||(s=elementorFrontend.config.elements.keys[i]=[],jQuery.each(e.controls,(e,t)=>{(t.frontend_available||t.editor_available)&&s.push(e)})),jQuery.each(e.getActiveControls(),function(e){if(-1!==s.indexOf(e)){let r=n[e];r.toJSON&&(r=r.toJSON()),t[e]=r}})}else t=this.$element.data("settings")||{};return this.getItems(t,e)},getEditSettings(e){var t={};return this.isEdit&&(t=elementorFrontend.config.elements.editSettings[this.getModelCID()].attributes),this.getItems(t,e)},getCurrentDeviceSetting(e){return elementorFrontend.getCurrentDeviceSetting(this.getElementSettings(),e)},onInit(){this.isActive(this.getSettings())&&elementorModules.ViewModule.prototype.onInit.apply(this,arguments)},onDestroy(){this.isEdit&&this.removeEditorListeners(),this.unbindEvents&&this.unbindEvents()}})},7255:(e,t,r)=>{"use strict";var n=r(1831);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},7268:(e,t,r)=>{"use strict";var n=r(4762),i=r(1483),s=r(1831),o=n(Function.toString);i(s.inspectSource)||(s.inspectSource=function(e){return o(e)}),e.exports=s.inspectSource},7458:(e,t,r)=>{"use strict";r(1975)},7486:e=>{"use strict";e.exports=function(e,t){var r="function"==typeof Iterator&&Iterator.prototype[e];if(r)try{r.call({next:null},t).next()}catch(e){return!0}}},7611:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function propertyIsEnumerable(e){var t=n(this,e);return!!t&&t.enumerable}:r},7738:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7914:(e,t,r)=>{"use strict";var n=r(1483),i=r(5835),s=r(169),o=r(2095);e.exports=function(e,t,r,a){a||(a={});var c=a.enumerable,l=void 0!==a.name?a.name:t;if(n(r)&&s(r,l,a),a.global)c?e[t]=r:o(t,r);else{try{a.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},7955:e=>{"use strict";e.exports=elementorModules.ViewModule.extend({getDefaultSettings:()=>({element:null,direction:elementorFrontend.config.is_rtl?"right":"left",selectors:{container:window},considerScrollbar:!1,cssOutput:"inline"}),getDefaultElements(){return{$element:jQuery(this.getSettings("element"))}},stretch(){const e=this.getSettings();let t;try{t=jQuery(e.selectors.container)}catch(e){}t&&t.length||(t=jQuery(this.getDefaultSettings().selectors.container)),this.reset();var r=this.elements.$element,n=t.innerWidth(),i=r.offset().left,s="fixed"===r.css("position"),o=s?0:i,a=window===t[0];if(!a){var c=t.offset().left;s&&(o=c),i>c&&(o=i-c)}if(e.considerScrollbar&&a){o-=window.innerWidth-n}s||(elementorFrontend.config.is_rtl&&(o=n-(r.outerWidth()+o)),o=-o),e.margin&&(o+=e.margin);var l={};let u=n;e.margin&&(u-=2*e.margin),l.width=u+"px",l[e.direction]=o+"px","variables"!==e.cssOutput?r.css(l):this.applyCssVariables(r,l)},reset(){const e={},t=this.getSettings(),r=this.elements.$element;"variables"!==t.cssOutput?(e.width="",e[t.direction]="",r.css(e)):this.resetCssVariables(r)},applyCssVariables(e,t){e.css("--stretch-width",t.width),t.left?e.css("--stretch-left",t.left):e.css("--stretch-right",t.right)},resetCssVariables(e){e.css({"--stretch-width":"","--stretch-left":"","--stretch-right":""})}})},7958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRegistry=void 0,r(4846),r(7458),r(9655),r(4364);t.BaseRegistry=class BaseRegistry{constructor(){this.sections=new Map}register(e){if(!e.key||!e.title)throw new Error("Template type must have key and title");const t=this.get(e.key)||this.formatSection(e);if(e.children)if(t.children){const r=new Map(t.children.map(e=>[e.key,e]));e.children.forEach(e=>{const t=this.formatSection(e);r.set(e.key,t)}),t.children=Array.from(r.values())}else t.children=e.children.map(e=>this.formatSection(e));this.sections.set(e.key,t)}formatSection({children:e,...t}){return{key:t.key,title:t.title,description:t.description||"",useParentDefault:!1!==t.useParentDefault,getInitialState:t.getInitialState||null,component:t.component||null,order:t.order||10,isAvailable:t.isAvailable||(()=>!0),...t}}getAll(){return Array.from(this.sections.values()).filter(e=>e.isAvailable()).map(e=>e.children?{...e,children:[...e.children].sort((e,t)=>e.order-t.order)}:e).sort((e,t)=>e.order-t.order)}get(e){return this.sections.get(e)}}},8120:(e,t,r)=>{"use strict";var n=r(1483),i=r(8761),s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(i(e)+" is not a function")}},8140:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(4846),r(6211);var i=n(r(7224));class StretchedElement extends i.default{getStretchedClass(){return"e-stretched"}getStretchSettingName(){return"stretch_element"}getStretchActiveValue(){return"yes"}bindEvents(){const e=this.getUniqueHandlerID();elementorFrontend.addListenerOnce(e,"resize",this.stretch),elementorFrontend.addListenerOnce(e,"sticky:stick",this.stretch,this.$element),elementorFrontend.addListenerOnce(e,"sticky:unstick",this.stretch,this.$element),elementorFrontend.isEditMode()&&(this.onKitChangeStretchContainerChange=this.onKitChangeStretchContainerChange.bind(this),elementor.channels.editor.on("kit:change:stretchContainer",this.onKitChangeStretchContainerChange))}unbindEvents(){elementorFrontend.removeListeners(this.getUniqueHandlerID(),"resize",this.stretch),elementorFrontend.isEditMode()&&elementor.channels.editor.off("kit:change:stretchContainer",this.onKitChangeStretchContainerChange)}isActive(e){return elementorFrontend.isEditMode()||e.$element.hasClass(this.getStretchedClass())}getStretchElementForConfig(e=null){return e?this.$element.find(e):this.$element}getStretchElementConfig(){return{element:this.getStretchElementForConfig(),selectors:{container:this.getStretchContainer()},considerScrollbar:elementorFrontend.isEditMode()&&elementorFrontend.config.is_rtl}}initStretch(){this.stretch=this.stretch.bind(this),this.stretchElement=new elementorModules.frontend.tools.StretchElement(this.getStretchElementConfig())}getStretchContainer(){return elementorFrontend.getKitSettings("stretched_section_container")||window}isStretchSettingEnabled(){return this.getElementSettings(this.getStretchSettingName())===this.getStretchActiveValue()}stretch(){this.isStretchSettingEnabled()&&this.stretchElement.stretch()}onInit(...e){this.isActive(this.getSettings())&&(this.initStretch(),super.onInit(...e),this.stretch())}onElementChange(e){this.getStretchSettingName()===e&&(this.isStretchSettingEnabled()?this.stretch():this.stretchElement.reset())}onKitChangeStretchContainerChange(){this.stretchElement.setSettings("selectors.container",this.getStretchContainer()),this.stretch()}}t.default=StretchedElement},8324:(e,t,r)=>{"use strict";var n=r(3005),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},8473:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},8612:(e,t,r)=>{"use strict";var n=r(5578),i=r(4961).f,s=r(9037),o=r(7914),a=r(2095),c=r(6726),l=r(8730);e.exports=function(e,t){var r,u,p,d,h,f=e.target,g=e.global,m=e.stat;if(r=g?n:m?n[f]||a(f,{}):n[f]&&n[f].prototype)for(u in t){if(d=t[u],p=e.dontCallGetSet?(h=i(r,u))&&h.value:r[u],!l(g?u:f+(m?".":"#")+u,e.forced)&&void 0!==p){if(typeof d==typeof p)continue;c(d,p)}(e.sham||p&&p.sham)&&s(d,"sham",!0),o(r,u,d,e)}}},8660:(e,t,r)=>{"use strict";var n=r(1807),i=r(5290),s=r(9037),o=r(2313),a=r(1),c=r(4483),l=r(2564),u=r(1851).IteratorPrototype,p=r(5247),d=r(6721),h=r(1983),f=a("toStringTag"),g="IteratorHelper",m="WrapForValidIterator",v="normal",y="throw",w=c.set,createIteratorProxyPrototype=function(e){var t=c.getterFor(e?m:g);return o(i(u),{next:function next(){var r=t(this);if(e)return r.nextHandler();if(r.done)return p(void 0,!0);try{var n=r.nextHandler();return r.returnHandlerResult?n:p(n,r.done)}catch(e){throw r.done=!0,e}},return:function(){var r=t(this),i=r.iterator;if(r.done=!0,e){var s=l(i,"return");return s?n(s,i):p(void 0,!0)}if(r.inner)try{d(r.inner.iterator,v)}catch(e){return d(i,y,e)}if(r.openIters)try{h(r.openIters,v)}catch(e){return d(i,y,e)}return i&&d(i,v),p(void 0,!0)}})},b=createIteratorProxyPrototype(!0),S=createIteratorProxyPrototype(!1);s(S,f,"Iterator Helper"),e.exports=function(e,t,r){var n=function Iterator(n,i){i?(i.iterator=n.iterator,i.next=n.next):i=n,i.type=t?m:g,i.returnHandlerResult=!!r,i.nextHandler=e,i.counter=0,i.done=!1,w(this,i)};return n.prototype=t?b:S,n}},8685:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ForceMethodImplementation=void 0;class ForceMethodImplementation extends Error{constructor(e={},t={}){super(`${e.isStatic?"static ":""}${e.fullName}() should be implemented, please provide '${e.functionName||e.fullName}' functionality.`,t),Object.keys(t).length&&console.error(t),Error.captureStackTrace(this,ForceMethodImplementation)}}t.ForceMethodImplementation=ForceMethodImplementation;t.default=e=>{const t=Error().stack.split("\n")[2].trim(),r=t.startsWith("at new")?"constructor":t.split(" ")[1],n={};if(n.functionName=r,n.fullName=r,n.functionName.includes(".")){const e=n.functionName.split(".");n.className=e[0],n.functionName=e[1]}else n.isStatic=!0;throw new ForceMethodImplementation(n,e)}},8730:(e,t,r)=>{"use strict";var n=r(8473),i=r(1483),s=/#|\.prototype\./,isForced=function(e,t){var r=a[o(e)];return r===l||r!==c&&(i(t)?n(t):!!t)},o=isForced.normalize=function(e){return String(e).replace(s,".").toLowerCase()},a=isForced.data={},c=isForced.NATIVE="N",l=isForced.POLYFILL="P";e.exports=isForced},8761:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},8901:(e,t,r)=>{"use strict";var n=r(2293),i=r(6721);e.exports=function(e,t,r,s){try{return s?t(n(r)[0],r[1]):t(r)}catch(t){i(e,"throw",t)}}},9031:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGetInitialState=function createGetInitialState(e,t={}){return(r,n)=>{let i=n;if(r.hasOwnProperty("uploadedData")){i=!1;const t=r.uploadedData.manifest.templates,n=elementorAppConfig?.["import-export-customization"]?.exportGroups||{};for(const r in t){if(n[t[r].doc_type]===e){i=!0;break}}}return{enabled:i,...t}}}},9037:(e,t,r)=>{"use strict";var n=r(382),i=r(5835),s=r(7738);e.exports=n?function(e,t,r){return i.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},9273:(e,t,r)=>{"use strict";var n=r(382),i=r(4914),s=TypeError,o=Object.getOwnPropertyDescriptor,a=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(i(e)&&!o(e,"length").writable)throw new s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},9441:(e,t,r)=>{"use strict";var n=r(8473);e.exports=!n(function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})},9461:(e,t,r)=>{"use strict";var n=r(5578).navigator,i=n&&n.userAgent;e.exports=i?String(i):""},9497:(e,t,r)=>{"use strict";var n=r(1409),i=r(4762),s=r(2278),o=r(4347),a=r(2293),c=i([].concat);e.exports=n("Reflect","ownKeys")||function ownKeys(e){var t=s.f(a(e)),r=o.f;return r?c(t,r(e)):t}},9557:e=>{"use strict";e.exports=!1},9603:(e,t,r)=>{"use strict";var n=r(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,r(4846),r(6211),r(9655);var i=n(r(5633));class CarouselHandlerBase extends i.default{getDefaultSettings(){return{selectors:{carousel:".swiper",swiperWrapper:".swiper-wrapper",slideContent:".swiper-slide",swiperArrow:".elementor-swiper-button",paginationWrapper:".swiper-pagination",paginationBullet:".swiper-pagination-bullet",paginationBulletWrapper:".swiper-pagination-bullets"}}}getDefaultElements(){const e=this.getSettings("selectors"),t={$swiperContainer:this.$element.find(e.carousel),$swiperWrapper:this.$element.find(e.swiperWrapper),$swiperArrows:this.$element.find(e.swiperArrow),$paginationWrapper:this.$element.find(e.paginationWrapper),$paginationBullets:this.$element.find(e.paginationBullet),$paginationBulletWrapper:this.$element.find(e.paginationBulletWrapper)};return t.$slides=t.$swiperContainer.find(e.slideContent),t}getSwiperSettings(){const e=this.getElementSettings(),t=+e.slides_to_show||3,r=1===t,n=elementorFrontend.config.responsive.activeBreakpoints,i={mobile:1,tablet:r?1:2},s={slidesPerView:t,loop:"yes"===e.infinite,speed:e.speed,handleElementorBreakpoints:!0,breakpoints:{}};let o=t;Object.keys(n).reverse().forEach(t=>{const r=i[t]?i[t]:o;s.breakpoints[n[t].value]={slidesPerView:+e["slides_to_show_"+t]||r,slidesPerGroup:+e["slides_to_scroll_"+t]||1},e.image_spacing_custom&&(s.breakpoints[n[t].value].spaceBetween=this.getSpaceBetween(t)),o=+e["slides_to_show_"+t]||r}),"yes"===e.autoplay&&(s.autoplay={delay:e.autoplay_speed,disableOnInteraction:"yes"===e.pause_on_interaction}),r?(s.effect=e.effect,"fade"===e.effect&&(s.fadeEffect={crossFade:!0})):s.slidesPerGroup=+e.slides_to_scroll||1,e.image_spacing_custom&&(s.spaceBetween=this.getSpaceBetween());const a="arrows"===e.navigation||"both"===e.navigation,c="dots"===e.navigation||"both"===e.navigation||e.pagination;return a&&(s.navigation={prevEl:".elementor-swiper-button-prev",nextEl:".elementor-swiper-button-next"}),c&&(s.pagination={el:`.elementor-element-${this.getID()} .swiper-pagination`,type:e.pagination?e.pagination:"bullets",clickable:!0,renderBullet:(e,t)=>`<span class="${t}" role="button" tabindex="0" data-bullet-index="${e}" aria-label="${elementorFrontend.config.i18n.a11yCarouselPaginationBulletMessage} ${e+1}"></span>`}),"yes"===e.lazyload&&(s.lazy={loadPrevNext:!0,loadPrevNextAmount:1}),s.a11y={enabled:!0,prevSlideMessage:elementorFrontend.config.i18n.a11yCarouselPrevSlideMessage,nextSlideMessage:elementorFrontend.config.i18n.a11yCarouselNextSlideMessage,firstSlideMessage:elementorFrontend.config.i18n.a11yCarouselFirstSlideMessage,lastSlideMessage:elementorFrontend.config.i18n.a11yCarouselLastSlideMessage},s.on={slideChange:()=>{this.a11ySetPaginationTabindex(),this.handleElementHandlers(),this.a11ySetSlideAriaHidden()},init:()=>{this.a11ySetPaginationTabindex(),this.a11ySetSlideAriaHidden("initialisation")}},this.applyOffsetSettings(e,s,t),s}getOffsetWidth(){const e=elementorFrontend.getCurrentDeviceMode();return elementorFrontend.utils.controls.getResponsiveControlValue(this.getElementSettings(),"offset_width","size",e)||0}applyOffsetSettings(e,t,r){const n=e.offset_sides;if(!(elementorFrontend.isEditMode()&&"NestedCarousel"===this.constructor.name)&&n&&"none"!==n)switch(n){case"right":this.forceSliderToShowNextSlideWhenOnLast(t,r),this.addClassToSwiperContainer("offset-right");break;case"left":this.addClassToSwiperContainer("offset-left");break;case"both":this.forceSliderToShowNextSlideWhenOnLast(t,r),this.addClassToSwiperContainer("offset-both")}}forceSliderToShowNextSlideWhenOnLast(e,t){e.slidesPerView=t+.001}addClassToSwiperContainer(e){this.getDefaultElements().$swiperContainer[0].classList.add(e)}async onInit(...e){if(super.onInit(...e),!this.elements.$swiperContainer.length||2>this.elements.$slides.length)return;await this.initSwiper();"yes"===this.getElementSettings().pause_on_hover&&this.togglePauseOnHover(!0)}async initSwiper(){const e=elementorFrontend.utils.swiper;this.swiper=await new e(this.elements.$swiperContainer,this.getSwiperSettings()),this.elements.$swiperContainer.data("swiper",this.swiper)}bindEvents(){this.elements.$swiperArrows.on("keydown",this.onDirectionArrowKeydown.bind(this)),this.elements.$paginationWrapper.on("keydown",".swiper-pagination-bullet",this.onDirectionArrowKeydown.bind(this)),this.elements.$swiperContainer.on("keydown",".swiper-slide",this.onDirectionArrowKeydown.bind(this)),this.$element.find(":focusable").on("focus",this.onFocusDisableAutoplay.bind(this)),elementorFrontend.elements.$window.on("resize",this.getSwiperSettings.bind(this))}unbindEvents(){this.elements.$swiperArrows.off(),this.elements.$paginationWrapper.off(),this.elements.$swiperContainer.off(),this.$element.find(":focusable").off(),elementorFrontend.elements.$window.off("resize")}onDirectionArrowKeydown(e){const t=elementorFrontend.config.is_rtl,r=e.originalEvent.code,n=t?"ArrowLeft":"ArrowRight";if(!(-1!==["ArrowLeft","ArrowRight"].indexOf(r)))return!0;(t?"ArrowRight":"ArrowLeft")===r?this.swiper.slidePrev():n===r&&this.swiper.slideNext()}onFocusDisableAutoplay(){this.swiper.autoplay.stop()}updateSwiperOption(e){const t=this.getElementSettings()[e],r=this.swiper.params;switch(e){case"autoplay_speed":r.autoplay.delay=t;break;case"speed":r.speed=t}this.swiper.update()}getChangeableProperties(){return{pause_on_hover:"pauseOnHover",autoplay_speed:"delay",speed:"speed",arrows_position:"arrows_position"}}onElementChange(e){if(0===e.indexOf("image_spacing_custom"))return void this.updateSpaceBetween(e);if(this.getChangeableProperties()[e])if("pause_on_hover"===e){const e=this.getElementSettings("pause_on_hover");this.togglePauseOnHover("yes"===e)}else this.updateSwiperOption(e)}onEditSettingsChange(e){"activeItemIndex"===e&&this.swiper.slideToLoop(this.getEditSettings("activeItemIndex")-1)}getSpaceBetween(e=null){const t=elementorFrontend.utils.controls.getResponsiveControlValue(this.getElementSettings(),"image_spacing_custom","size",e);return Number(t)||0}updateSpaceBetween(e){const t=e.match("image_spacing_custom_(.*)"),r=t?t[1]:"desktop",n=this.getSpaceBetween(r);"desktop"!==r&&(this.swiper.params.breakpoints[elementorFrontend.config.responsive.activeBreakpoints[r].value].spaceBetween=n),this.swiper.params.spaceBetween=n,this.swiper.update()}getPaginationBullets(e="array"){const t=this.$element.find(this.getSettings("selectors").paginationBullet);return"array"===e?Array.from(t):t}a11ySetPaginationTabindex(){const e=this.swiper?.params?.pagination.bulletClass,t=this.swiper?.params?.pagination.bulletActiveClass;this.getPaginationBullets().forEach(e=>{e.classList?.contains(t)||e.removeAttribute("tabindex")});const r="ArrowLeft"===event?.code||"ArrowRight"===event?.code;event?.target?.classList?.contains(e)&&r&&this.$element.find(`.${t}`).trigger("focus")}getSwiperWrapperTranformXValue(){let e=this.elements.$swiperWrapper[0]?.style.transform;return e=e.replace("translate3d(",""),e=e.split(","),e=parseInt(e[0].replace("px","")),e||0}a11ySetSlideAriaHidden(e=""){if("number"!=typeof("initialisation"===e?0:this.swiper?.activeIndex))return;const t=this.getSwiperWrapperTranformXValue(),r=this.elements.$swiperWrapper[0].clientWidth;this.elements.$swiperContainer.find(this.getSettings("selectors").slideContent).each((e,n)=>{0<=n.offsetLeft+t&&r>n.offsetLeft+t?(n.removeAttribute("aria-hidden"),n.removeAttribute("inert")):(n.setAttribute("aria-hidden",!0),n.setAttribute("inert",""))})}handleElementHandlers(){}}t.default=CarouselHandlerBase},9655:(e,t,r)=>{"use strict";r(9930)},9930:(e,t,r)=>{"use strict";var n=r(8612),i=r(1807),s=r(1506),o=r(8120),a=r(2293),c=r(41),l=r(6721),u=r(5267)("forEach",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:u},{forEach:function forEach(e){a(this);try{o(e)}catch(e){l(this,"throw",e)}if(u)return i(u,this,e);var t=c(this),r=0;s(t,function(t){e(t,r++)},{IS_RECORD:!0})}})}},e=>{var t;t=4946,e(e.s=t)}]);
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(x){"use strict";var t,e,i,n,W,C,o,s,r,l,a,h,u;function E(t,e,i){return[parseFloat(t[0])*(a.test(t[0])?e/100:1),parseFloat(t[1])*(a.test(t[1])?i/100:1)]}function L(t,e){return parseInt(x.css(t,e),10)||0}function N(t){return null!=t&&t===t.window}x.ui=x.ui||{},x.ui.version="1.13.3",
x.extend(x.expr.pseudos,{data:x.expr.createPseudo?x.expr.createPseudo(function(e){return function(t){return!!x.data(t,e)}}):function(t,e,i){return!!x.data(t,i[3])}}),
x.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}}),
x.ui.focusable=function(t,e){var i,n,o,s=t.nodeName.toLowerCase();return"area"===s?(o=(i=t.parentNode).name,!(!t.href||!o||"map"!==i.nodeName.toLowerCase())&&0<(i=x("img[usemap='#"+o+"']")).length&&i.is(":visible")):(/^(input|select|textarea|button|object)$/.test(s)?(n=!t.disabled)&&(o=x(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===s&&t.href||e,n&&x(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(x(t)))},x.extend(x.expr.pseudos,{focusable:function(t){return x.ui.focusable(t,null!=x.attr(t,"tabindex"))}}),x.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):x(this[0].form)},
x.ui.formResetMixin={_formResetHandler:function(){var e=x(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");x.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(x.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}},x.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),
x.expr.pseudos||(x.expr.pseudos=x.expr[":"]),x.uniqueSort||(x.uniqueSort=x.unique),x.escapeSelector||(e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,i=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},x.escapeSelector=function(t){return(t+"").replace(e,i)}),x.fn.even&&x.fn.odd||x.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}}),
x.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},
x.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+x.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},x.ui.plugin={add:function(t,e,i){var n,o=x.ui[t].prototype;for(n in i)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([e,i[n]])},call:function(t,e,i,n){var o,s=t.plugins[e];if(s&&(n||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o<s.length;o++)t.options[s[o][0]]&&s[o][1].apply(t.element,i)}},
W=Math.max,C=Math.abs,o=/left|center|right/,s=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,a=/%$/,h=x.fn.position,x.position={scrollbarWidth:function(){var t,e,i;return void 0!==n?n:(i=(e=x("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>")).children()[0],x("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),n=t-i)},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?x.position.scrollbarWidth():0,height:e?x.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=x(t||window),i=N(e[0]),n=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:n,offset:!i&&!n?x(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},x.fn.position=function(f){var c,d,p,g,m,v,y,w,b,_,t,e;return f&&f.of?(v="string"==typeof(f=x.extend({},f)).of?x(document).find(f.of):x(f.of),y=x.position.getWithinInfo(f.within),w=x.position.getScrollInfo(y),b=(f.collision||"flip").split(" "),_={},e=9===(e=(t=v)[0]).nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:N(e)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:e.preventDefault?{width:0,height:0,offset:{top:e.pageY,left:e.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()},v[0].preventDefault&&(f.at="left top"),d=e.width,p=e.height,m=x.extend({},g=e.offset),x.each(["my","at"],function(){var t,e,i=(f[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):s.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=s.test(i[1])?i[1]:"center",t=r.exec(i[0]),e=r.exec(i[1]),_[this]=[t?t[0]:0,e?e[0]:0],f[this]=[l.exec(i[0])[0],l.exec(i[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===f.at[0]?m.left+=d:"center"===f.at[0]&&(m.left+=d/2),"bottom"===f.at[1]?m.top+=p:"center"===f.at[1]&&(m.top+=p/2),c=E(_.at,d,p),m.left+=c[0],m.top+=c[1],this.each(function(){var i,t,r=x(this),l=r.outerWidth(),a=r.outerHeight(),e=L(this,"marginLeft"),n=L(this,"marginTop"),o=l+e+L(this,"marginRight")+w.width,s=a+n+L(this,"marginBottom")+w.height,h=x.extend({},m),u=E(_.my,r.outerWidth(),r.outerHeight());"right"===f.my[0]?h.left-=l:"center"===f.my[0]&&(h.left-=l/2),"bottom"===f.my[1]?h.top-=a:"center"===f.my[1]&&(h.top-=a/2),h.left+=u[0],h.top+=u[1],i={marginLeft:e,marginTop:n},x.each(["left","top"],function(t,e){x.ui.position[b[t]]&&x.ui.position[b[t]][e](h,{targetWidth:d,targetHeight:p,elemWidth:l,elemHeight:a,collisionPosition:i,collisionWidth:o,collisionHeight:s,offset:[c[0]+u[0],c[1]+u[1]],my:f.my,at:f.at,within:y,elem:r})}),f.using&&(t=function(t){var e=g.left-h.left,i=e+d-l,n=g.top-h.top,o=n+p-a,s={target:{element:v,left:g.left,top:g.top,width:d,height:p},element:{element:r,left:h.left,top:h.top,width:l,height:a},horizontal:i<0?"left":0<e?"right":"center",vertical:o<0?"top":0<n?"bottom":"middle"};d<l&&C(e+i)<d&&(s.horizontal="center"),p<a&&C(n+o)<p&&(s.vertical="middle"),W(C(e),C(i))>W(C(n),C(o))?s.important="horizontal":s.important="vertical",f.using.call(this,t,s)}),r.offset(x.extend(h,{using:t}))})):h.apply(this,arguments)},x.ui.position={fit:{left:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollLeft:n.offset.left,n=n.width,s=t.left-e.collisionPosition.marginLeft,r=o-s,l=s+e.collisionWidth-n-o;n<e.collisionWidth?0<r&&l<=0?(i=t.left+r+e.collisionWidth-n-o,t.left+=r-i):t.left=!(0<l&&r<=0)&&l<r?o+n-e.collisionWidth:o:0<r?t.left+=r:0<l?t.left-=l:t.left=W(t.left-s,t.left)},top:function(t,e){var i,n=e.within,n=n.isWindow?n.scrollTop:n.offset.top,o=e.within.height,s=t.top-e.collisionPosition.marginTop,r=n-s,l=s+e.collisionHeight-o-n;o<e.collisionHeight?0<r&&l<=0?(i=t.top+r+e.collisionHeight-o-n,t.top+=r-i):t.top=!(0<l&&r<=0)&&l<r?n+o-e.collisionHeight:n:0<r?t.top+=r:0<l?t.top-=l:t.top=W(t.top-s,t.top)}},flip:{left:function(t,e){var i=e.within,n=i.offset.left+i.scrollLeft,o=i.width,i=i.isWindow?i.scrollLeft:i.offset.left,s=t.left-e.collisionPosition.marginLeft,r=s-i,s=s+e.collisionWidth-o-i,l="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,a="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,h=-2*e.offset[0];r<0?((o=t.left+l+a+h+e.collisionWidth-o-n)<0||o<C(r))&&(t.left+=l+a+h):0<s&&(0<(n=t.left-e.collisionPosition.marginLeft+l+a+h-i)||C(n)<s)&&(t.left+=l+a+h)},top:function(t,e){var i=e.within,n=i.offset.top+i.scrollTop,o=i.height,i=i.isWindow?i.scrollTop:i.offset.top,s=t.top-e.collisionPosition.marginTop,r=s-i,s=s+e.collisionHeight-o-i,l="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,a="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,h=-2*e.offset[1];r<0?((o=t.top+l+a+h+e.collisionHeight-o-n)<0||o<C(r))&&(t.top+=l+a+h):0<s&&(0<(n=t.top-e.collisionPosition.marginTop+l+a+h-i)||C(n)<s)&&(t.top+=l+a+h)}},flipfit:{left:function(){x.ui.position.flip.left.apply(this,arguments),x.ui.position.fit.left.apply(this,arguments)},top:function(){x.ui.position.flip.top.apply(this,arguments),x.ui.position.fit.top.apply(this,arguments)}}},x.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=(i=i||e.body).nodeName?i:e.body},x.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&x(t).trigger("blur")},
x.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=x(this);return(!i||"static"!==t.css("position"))&&n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:x(this[0].ownerDocument||document)},
x.extend(x.expr.pseudos,{tabbable:function(t){var e=x.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&x.ui.focusable(t,i)}}),
x.fn.extend({uniqueId:(u=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++u)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&x(this).removeAttr("id")})}});
var f,c=0,d=Array.prototype.hasOwnProperty,p=Array.prototype.slice;x.cleanData=(f=x.cleanData,function(t){for(var e,i,n=0;null!=(i=t[n]);n++)(e=x._data(i,"events"))&&e.remove&&x(i).triggerHandler("remove");f(t)}),x.widget=function(t,i,e){var n,o,s,r={},l=t.split(".")[0],a=l+"-"+(t=t.split(".")[1]);return e||(e=i,i=x.Widget),Array.isArray(e)&&(e=x.extend.apply(null,[{}].concat(e))),x.expr.pseudos[a.toLowerCase()]=function(t){return!!x.data(t,a)},x[l]=x[l]||{},n=x[l][t],o=x[l][t]=function(t,e){if(!this||!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},x.extend(o,n,{version:e.version,_proto:x.extend({},e),_childConstructors:[]}),(s=new i).options=x.widget.extend({},s.options),x.each(e,function(e,n){function o(){return i.prototype[e].apply(this,arguments)}function s(t){return i.prototype[e].apply(this,t)}r[e]="function"!=typeof n?n:function(){var t,e=this._super,i=this._superApply;return this._super=o,this._superApply=s,t=n.apply(this,arguments),this._super=e,this._superApply=i,t}}),o.prototype=x.widget.extend(s,{widgetEventPrefix:n&&s.widgetEventPrefix||t},r,{constructor:o,namespace:l,widgetName:t,widgetFullName:a}),n?(x.each(n._childConstructors,function(t,e){var i=e.prototype;x.widget(i.namespace+"."+i.widgetName,o,e._proto)}),delete n._childConstructors):i._childConstructors.push(o),x.widget.bridge(t,o),o},x.widget.extend=function(t){for(var e,i,n=p.call(arguments,1),o=0,s=n.length;o<s;o++)for(e in n[o])i=n[o][e],d.call(n[o],e)&&void 0!==i&&(x.isPlainObject(i)?t[e]=x.isPlainObject(t[e])?x.widget.extend({},t[e],i):x.widget.extend({},i):t[e]=i);return t},x.widget.bridge=function(s,e){var r=e.prototype.widgetFullName||s;x.fn[s]=function(i){var t="string"==typeof i,n=p.call(arguments,1),o=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=x.data(this,r);return"instance"===i?(o=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?x.error("no such method '"+i+"' for "+s+" widget instance"):(t=e[i].apply(e,n))!==e&&void 0!==t?(o=t&&t.jquery?o.pushStack(t.get()):t,!1):void 0:x.error("cannot call methods on "+s+" prior to initialization; attempted to call method '"+i+"'")}):o=void 0:(n.length&&(i=x.widget.extend.apply(null,[i].concat(n))),this.each(function(){var t=x.data(this,r);t?(t.option(i||{}),t._init&&t._init()):x.data(this,r,new e(i,this))})),o}},x.Widget=function(){},x.Widget._childConstructors=[],x.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=x(e||this.defaultElement||this)[0],this.element=x(e),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=x(),this.hoverable=x(),this.focusable=x(),this.classesElementLookup={},e!==this&&(x.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=x(e.style?e.ownerDocument:e.document||e),this.window=x(this.document[0].defaultView||this.document[0].parentWindow)),this.options=x.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:x.noop,_create:x.noop,_init:x.noop,destroy:function(){var i=this;this._destroy(),x.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:x.noop,widget:function(){return this.element},option:function(t,e){var i,n,o,s=t;if(0===arguments.length)return x.widget.extend({},this.options);if("string"==typeof t)if(s={},t=(i=t.split(".")).shift(),i.length){for(n=s[t]=x.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)n[i[o]]=n[i[o]]||{},n=n[i[o]];if(t=i.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=e}return this._setOptions(s),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,n;for(e in t)n=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&n&&n.length&&(i=x(n.get()),this._removeClass(n,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(o){var s=[],r=this;function t(t,e){for(var i,n=0;n<t.length;n++)i=r.classesElementLookup[t[n]]||x(),i=o.add?(function(){var i=[];o.element.each(function(t,e){x.map(r.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),r._on(x(i),{remove:"_untrackClassesElement"})}(),x(x.uniqueSort(i.get().concat(o.element.get())))):x(i.not(o.element).get()),r.classesElementLookup[t[n]]=i,s.push(t[n]),e&&o.classes[t[n]]&&s.push(o.classes[t[n]])}return(o=x.extend({element:this.element,classes:this.options.classes||{}},o)).keys&&t(o.keys.match(/\S+/g)||[],!0),o.extra&&t(o.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(i){var n=this;x.each(n.classesElementLookup,function(t,e){-1!==x.inArray(i.target,e)&&(n.classesElementLookup[t]=x(e.not(i.target).get()))}),this._off(x(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,n){var o="string"==typeof t||null===t,e={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:n="boolean"==typeof n?n:i};return e.element.toggleClass(this._classes(e),n),this},_on:function(o,s,t){var r,l=this;"boolean"!=typeof o&&(t=s,s=o,o=!1),t?(s=r=x(s),this.bindings=this.bindings.add(s)):(t=s,s=this.element,r=this.widget()),x.each(t,function(t,e){function i(){if(o||!0!==l.options.disabled&&!x(this).hasClass("ui-state-disabled"))return("string"==typeof e?l[e]:e).apply(l,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||x.guid++);var t=t.match(/^([\w:-]*)\s*(.*)$/),n=t[1]+l.eventNamespace,t=t[2];t?r.on(n,t,i):s.on(n,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=x(this.bindings.not(t).get()),this.focusable=x(this.focusable.not(t).get()),this.hoverable=x(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(x(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(x(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var n,o,s=this.options[t];if(i=i||{},(e=x.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],o=e.originalEvent)for(n in o)n in e||(e[n]=o[n]);return this.element.trigger(e,i),!("function"==typeof s&&!1===s.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},x.each({show:"fadeIn",hide:"fadeOut"},function(s,r){x.Widget.prototype["_"+s]=function(e,t,i){var n,o=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||r:s;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),n=!x.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),n&&x.effects&&x.effects.effect[o]?e[s](t):o!==s&&e[o]?e[o](t.duration,t.easing,i):e.queue(function(t){x(this)[s](),i&&i.call(e[0]),t()})}})});